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

Eric Christopher echristo at gmail.com
Mon Nov 5 08:59:24 PST 2012


On Mon, Nov 5, 2012 at 8:44 AM, Bill Schmidt <wschmidt at linux.vnet.ibm.com>wrote:

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


LGTM as well. Thanks Hal!

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121105/d8824c9b/attachment.html>


More information about the llvm-commits mailing list