MS/CW-style inline assembly for GCC

Stan Shebs shebs@apple.com
Fri May 7 02:11:00 GMT 2004


Ian Lance Taylor wrote:

>Richard Henderson <rth@redhat.com> writes:
>
>
>>Well, with this description it would seem that you could directly
>>convert CW asms into GCC asms, and thus you would have no impact
>>on anything outside the parser.  With that as a premise, I have no
>>objection (as a backend guy) to CW support being added to the FSF
>>compiler.
>>
>
>If it is really true that only the parser would have to change, then
>it seems to me that CW asm could be converted into gcc asm using a
>separate tool which simply rewrote the file.  It would have to do
>simple C/C++ parsing, but I think not full parsing.  Such a tool would
>be useful as a conversion aid, and with some specs hackery could also
>be invoked directly by the Darwin compiler.
>
You're not the first person to suggest the separate tool idea! It
would have to know types and decls well enough to come up with the
right constraint letters. Take a look at MacMAME sources to see
some hairy usage of CW inline asm; much of it is assembled from
combinations of macros.

Stan



More information about the Gcc mailing list