Converting MSVC to intel-style gcc inline assembly

Jamie Lokier jamie@shareable.org
Mon Mar 8 22:32:00 GMT 2004


tm_gccmail@kloo.net wrote:
> You can store your operands in an auto struct, then pass in a pointer
> to the struct.
> 
> This accomplishes most of what you want, sans referencing stuff
> with the frame pointer.

Yes it _works_, but

> > it's silly to force arguments into registers when it would
> > be faster for the stack slot to be used directly.

it would be nice to generate tight code without redundant
instructions, and without overly constraining GCC.

It's not important; it would only be useful very rarely, and it's not
obvious which is the cleanest design for the feature, if any.  It
could be done with an operand constraint instead of a formatting
letter - let the asm pattern specify a stack-slot and non-stack-slot
alternative (using the new constraint - there doesn't exist one which
distinguishes stack-slotness AFAIK), and use the multi-alternative
output syntax to select code which has offsets added in the code
template as text, unknown to GCC.

-- Jamie



More information about the Gcc mailing list