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]

asm constraints


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.


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