This is the mail archive of the gcc-help@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: asm constraints


	unsigned int tbl;
	__asm__("mftbl %0" : "=r" (tbl));

[side note: mftbl is not a PowerPC insn, nor an assembler extended mnemonic. I have no idea why libopcodes accepts it].

I'm wondering why it's wasting a register.

Did you compile with optimization on? If so, what compiler version did you use? I tried with 3.4.1 and it works just fine. If you still have problems, please show the exact code (full routine, compilable as-is).

Am I specifying the constraint incorrectly?

No, it's fine.



Segher



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