[llvm-commits] [PATCH] Support for PowerPC inline asm Z and y

Hal Finkel hfinkel at anl.gov
Sat Nov 3 20:39:20 PDT 2012


In order to use the PPC64 lwbrx instruction, I've generally followed the instructions here:
http://hardwarebug.org/2008/10/25/gcc-inline-asm-annoyance/
which requires supporting the following inline asm syntax:
asm ("lwbrx %0, %y1" : "=r"(v) : "Z"(*p));

Currently, neither the 'Z' constraint type nor the special 'y' modifier are supported in the PowerPC backend. This patch adds some rudimentary support. It treats 'Z' like any other memory operand, and with 'y', adds r0 and then the register operand with the memory reference. This will work with lwbrx, and a number of other instructions, but I'm not sure if it is sufficiently general.

Even if this is functionally correct, I assume it would be more efficient for the backend to understand that 'Z' can directly take a base and offset register, but I'm not sure how to do that.

Please review.

Thanks again,
Hal

-- 
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppc-asm-Zy.patch
Type: text/x-patch
Size: 2444 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121103/a18f8540/attachment.bin>


More information about the llvm-commits mailing list