This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: MS/CW-style inline assembly for GCC
Richard Henderson wrote:
On Fri, May 07, 2004 at 02:15:05PM -0700, Stan Shebs wrote:
Right, although I make a separate asm statement for each line of
assembly (if nothing else, a single asm statement would have a
rather large number of inputs, outputs, and clobbers, could cause
reload problems).
If you split apart the lump, you'll break load-locked/store-conditional
sequences, which have strict requirements on what can come in between.
With non-x86, I don't expect that *moderate* uses of inline assembly
should cause problems on 32 register targets.
It's always worried me a bit, although my bug reports have only been
about syntactic corner cases. I suppose you'd want a target-specific
hook that can tell you when it's OK to create a new asm statement -
which would solve another class of user problems, situations where
they don't know whether it's better to use single or multiple asm
statements, only that the wrong choice will be punished. :-)
Of course, that MacMAME garbage that was posted eariler, where the
entire function is inline assembly, is just stupid. That deserves
to fail.
At some point, CW couldn't do assembly files - some of the MacMAME
stuff is for 601s specifically, so it may date back to earliest CW
and PowerMacs. Wrapping in C function syntax does have one handy
property on 9-era systems, TOC turds are autogenerated for you.
Stan