question regarding asm()

Richard Henderson rth@cygnus.com
Thu Oct 16 08:31:00 GMT 1997


On Wed, Oct 15, 1997 at 10:05:34PM -0600, Jeffrey A Law wrote:
>   > >	Clobber just means that GCC cannot make assumptions about the
>   > >register after the call, not before.
>   > 
>   > That's what I expected, but the docs seems to sugest otherwise..
> Why do you think that?

  "The input operands are guaranteed not to use any of the clobbered
   registers, and neither will the output operands' addresses, so you
   can read and write the clobbered registers as many times as you like."

That from 'info gcc "c ext" "extended asm"'.

> However, on some ports, when there aren't enough registers, GCC can't do
> this,

Yeah, well, that's the breaks.

> and in some cases it can't even tell you that it did something
> wrong. This is especially important on machines with weird register
> sets like the x86.

Ouch.

> This is _precisely_ why I've told folks in the past to avoid sucking
> up all the registers for asms -- particularly Linux folk who seem to
> write bigger asms than anyone.

It would be nice, and probably solve some of these problems with the
strange and wonderous asm blocks we write, if you could separately
list regs clobbered at input/output/both.

And while I'm wishing, more than 10 arguments, which is feasable
when all that's needed are memory and immediate constraints. 

And being able to specify immediate inputs to file scope asm blocks
so I can easily write assembly thunks that use offsetof to communicate
with C structs.


r~



More information about the Gcc mailing list