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
Mark Mitchell wrote:
Matt Austern wrote:
If you can come up with an assembly syntax that's genuinely better
than CW's, and if we can convincingly tell our developers that it's
better, then we really will consider telling our developers they
should convert their code.
Oh, throwing down the guantlet! :-)
I'm in Palm Springs next week, I'll see if anything springs to mind --
but I don't really expect to do better that CW. I do understand why
people like that more than GCC's syntax.
Yep, it's not a take-it-or-leave-it situation - there will almost
certainly be points of CW compatibility that are too fragrant for
FSF GCC under any circumstances, but that Apple needs, and those
would remain local as usual. A good analogy is AltiVec, which has a
generic implementation built on on even more generic vector machinery,
but for which we have Apple-specific changes as well.
To do CW-syntax (in an ideal) world, you'd want the assembler
integrated into the compiler. It would then parse the assembly code,
emitting actual RTL insns into the instruction stream. Right? (That,
presumably, is how CW actually inserts code in and amongst these
assembly instructions; it just puts them into the instruction stream
and then happily schedules them along with everything else.) Whereas
Apple's current implementation produces one big asm string for GCC,
annoated with constraints obtained by parsing the assembly code a
bit. Right?
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).
Stan