[PATCH] D41967: [PPC] Return PPC::CARRY for inline asm constraint "{xer}"

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 12 10:18:43 PST 2018


Carrot added a comment.

In https://reviews.llvm.org/D41967#974291, @echristo wrote:

> I think instead you want to add an alias in PPC similar to this:
>
> def XER: SPR<1, "xer">, DwarfRegNum<[76]>;
>
> // Carry bit.  In the architecture this is really bit 0 of the XER register
>  // (which really is SPR register 1);  this is the only bit interesting to a
>  // compiler.
>  def CARRY: SPR<1, "xer">, DwarfRegNum<[76]> {
>
>   let Aliases = [XER];
>
> }
>
> Does this work on your testcase?


Unfortunately it doesn't work. When comparing register name

if (RegName.equals_lower(RI->getRegAsmName(*I)))

Instead of "xer" or "ca", RI->getRegAsmName(*I) returns "CARRY" for unknown reason.


https://reviews.llvm.org/D41967





More information about the llvm-commits mailing list