This is the mail archive of the gcc@gcc.gnu.org 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


Richard Henderson wrote:

On Tue, May 04, 2004 at 11:19:12AM -0700, Stan Shebs wrote:


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?

Well, no - so far the type of the variable has been sufficient to pick
a good register class. But that's specific to PowerPC, the generalized
mechanism would have to have a target hook that would pass in at least
opcode, operand position, and operand tree/decl. A future enhancement
(should this all prove popular) might be to add some kind of syntax to
supply constraint letters, but it seems like it would be quite some
time before there would be a demand for such a thing - if your asm
is so tricky you need to use particular constraint letters, then you'd
really want to use the more general asm statement syntax anyway.

Stan


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