From: Rick Hohensee <humbubba@smarty.smart.net>
To: linux-kernel@vger.kernel.org
Subject: Re: Why Plan 9 C compilers don't have asm("")
Date: Wed, 4 Jul 2001 06:10:55 -0400 (EDT) [thread overview]
Message-ID: <200107041010.GAA01979@smarty.smart.net> (raw)
>>
>Cort Dugan
>> There isn't such a crippling difference between straight-line and code
>>with>
>> unconditional branches in it with modern processors. In fact, there's>
>>very
>> little measurable difference.
>>
>> If you're looking for something to blame hurd performance on I'd
>>suggest
>> the entire design of Mach, not inline asm vs procedure calls. Tossing
>>a
>> few context switches into calls is a lot more expensive.
>
hpa
>That's not where the bulk of the penalty of a function call comes in
>(and it's a call/return, not an unconditional branch.) The penalty
>comes in because of the additional need to obey the calling
>convention, and from the icache discontinuity.
>
call/return is two unconditional branches and a push and a pop (is that
right?), which is I think what CD means, i.e. in terms of branch
prediction. The push/pop is a hit on old CPUs, donno about >386. You're
right though. The big hit is you can't lose the pushes to set up the args
for a separately assembled function, or the frame drop that follows it.
>Not to mention that certain things simply cannot be done that way.
>
Don't tell me that. Then I can't use my subroutine-threaded Forth
variant, in which + is a subroutine call. ;o)
Anyway, yes it's a performance hit to not inline asms. Is it worth the
bletchery? It's worth asking that once in a while. I've looked at set_bit
both ways. Now I'm curious how it does as straight C.
Rick Hohensee
next reply other threads:[~2001-07-04 9:58 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-04 10:10 Rick Hohensee [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-07-23 4:39 Why Plan 9 C compilers don't have asm("") Rick Hohensee
2001-07-09 3:03 Rick Hohensee
[not found] <mailman.994629840.17424.linux-kernel2news@redhat.com>
2001-07-09 0:08 ` Pete Zaitcev
2001-07-09 0:28 ` Victor Yodaiken
2001-07-07 6:16 Rick Hohensee
2001-07-06 17:24 Rick Hohensee
2001-07-06 23:54 ` David S. Miller
2001-07-07 0:16 ` H. Peter Anvin
2001-07-07 0:37 ` David S. Miller
2001-07-05 3:26 Rick Hohensee
2001-07-04 3:37 Rick Hohensee
2001-07-04 3:36 ` Olivier Galibert
2001-07-04 6:24 ` Cort Dougan
2001-07-04 8:03 ` H. Peter Anvin
2001-07-04 17:22 ` Linus Torvalds
2001-07-06 8:38 ` Cort Dougan
2001-07-06 11:43 ` David S. Miller
2001-07-06 18:44 ` Linus Torvalds
2001-07-06 20:02 ` Cort Dougan
2001-07-08 21:55 ` Victor Yodaiken
2001-07-08 22:28 ` Alan Cox
2001-07-08 22:29 ` David S. Miller
2001-07-09 1:22 ` Johan Kullstam
2001-07-21 22:10 ` Richard Henderson
2001-07-22 3:43 ` Linus Torvalds
2001-07-22 3:59 ` Mike Castle
2001-07-22 6:49 ` Richard Henderson
2001-07-22 7:44 ` Linus Torvalds
2001-07-22 15:53 ` Richard Henderson
2001-07-22 19:08 ` Linus Torvalds
2001-07-04 7:15 ` pazke
2001-07-05 1:02 ` Michael Meissner
2001-07-05 1:54 ` Rick Hohensee
2001-07-05 16:54 ` Michael Meissner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200107041010.GAA01979@smarty.smart.net \
--to=humbubba@smarty.smart.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.