This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
asm clobber arg for AIX
- From: Perry Smith <pedz at easesoftware dot com>
- To: MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Thu, 30 Nov 2006 16:30:38 -0600
- Subject: asm clobber arg for AIX
The AIX assembler uses "1" for register 1 -- which surprised me. I
thought it accepted
both 1 and r1.
Anyhow, in one of my asm statements, I want to specify that register
1 (the stack pointer)
is being changed. So I did this (so far)
asm("lwz 1, %0" : : "rm" (newbase));
I put "rm" as the constraint because it can be either a register or a
memory location.
Should I just put "m"? GCC (4.0.2) seems to produce the same code
either way.
Also, should I put "1" as being clobbered? Like:
asm("lwz 1, %0" : : "m" (newbase) : "1" );
Thanks,
Perry Smith ( pedz@easesoftware.com )
Ease Software, Inc. ( http://www.easesoftware.com )
Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems