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
Matt Austern writes:
> On May 3, 2004, at 9:19 PM, Richard Henderson wrote:
>
> > On Mon, May 03, 2004 at 05:35:40PM -0700, Stan Shebs wrote:
> >> Can you be more specific about the difficulties?
> >
> > (1) Control flow. MSVC allows branches to leave the asm block,
> > something that doesn't map onto existing gcc asm blocks.
> > The hack we had for this was truely odious.
>
> <other horrible things snipped>
>
> Thanks for the list. As you say, awful stuff.
>
> I don't think we want to emulate all of these things, which means
> that not all code will be directly portable from MSVC to gcc. Maybe
> this means that "MS/CW-style" is a bad name for what we're trying
> to do. Perhaps a better name would just be: more natural syntax
> for inline assembly.
I don't really undersatnd how one syntax for inline assembly may be
said to be more "natural" than another. I don't think this makes any
sense: it's just a matter of what you are used to, or perhaps a matter
of preference.
> We're not just trying to follow someone else slavishly, we're
> trying to adopt a new syntax because we think the new syntax is
> better.
Well, that's the problem. As I understand it you're proposing a whole
new syntax that is less powerful but is to be preferred because it's
"less ugly".
Maintaining two totally different assembler syntaxes doesn't seem to
me like a sensible plan. Perhaps, with a little thought, we could
improve what we have at the moment. "less ugly" might, for example,
involve replacing operands like "%1" with real names in a slightly
less evil way than we do at the moment.
Andrew.