This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MS/CW-style inline assembly for GCC

On Tue, May 04, 2004 at 11:19:12AM -0700, Stan Shebs wrote:
> CW allows jumps within the asm block, for which one synthesizes local
> labels, but not outside, which I agree would be heinous.

Not too bad...

> I think CW only lets you use variables that are in registers. The
> same problem must exist for GCC asm statements right? Presumably
> the compiler kicks out your asm statement as invalid, because the
> constraint can't be satisfied.

That's what happens with gcc asms, yes.  It was much less clear
what to do about msvc asms, mostly due to lack of registers, the
pressure added by x86 elf -fpic code, and (perhaps unreasonable)
customer expectation that it "just work".

I presume you're also parsing the asm opcode to know what register
class is needed at a particular point?

> Is the killing of all registers required behavior? Seems not that
> hard to detect the ones being clobbered and add them to the asm
> statement's clobber list.

I think so, yes.  I don't recall the details; probably some
customer test case that accidentally worked with msvc.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]