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

Bill Schmidt wschmidt at linux.vnet.ibm.com
Mon Nov 5 08:44:26 PST 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.

After checking with others, the consensus is that this approach appears
to be your best option.  The patch itself LGTM.

Bill

-- 
Bill Schmidt, Ph.D.
IBM Advance Toolchain for PowerLinux
IBM Linux Technology Center
wschmidt at us.ibm.com
wschmidt at linux.vnet.ibm.com
> 
> Thanks again,
> Hal
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list