asm constraints

Zvilius, Mark Mark.Zvilius@fluke.com
Fri Aug 27 06:58:00 GMT 2004


For a PowerPC architecture I'm using the following asm statement in C source
to read a time base register:

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

The code this generates is:
	mftb   r0
	mr     r9,r0
	stw    r9,0x18(r31)

I'm wondering why it's wasting a register. Am I specifying the constraint
incorrectly?

Mark Z.



More information about the Gcc-help mailing list