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 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



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