This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
asm constraints
- From: "Zvilius, Mark" <Mark dot Zvilius at fluke dot com>
- To: "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 26 Aug 2004 15:17:21 -0700
- Subject: 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.