[llvm-commits] Patch for Bug 13556: ARM AsmPrinter doesn't support %H modifier in inline ASM
Weiming Zhao
weimingz at codeaurora.org
Fri Aug 10 17:07:37 PDT 2012
Hi Eric,
Thanks for your reviewing!
I'm attaching a updated patch.
Feel free to let me know if there is anything wrong.
Thanks,
Weiming
-----Original Message-----
From: Eric Christopher [mailto:echristo at apple.com]
Sent: Friday, August 10, 2012 2:08 PM
To: Weiming Zhao
Cc: 'Jim Grosbach'; llvm-commits at cs.uiuc.edu
Subject: Re: [llvm-commits] Patch for Bug 13556: ARM AsmPrinter doesn't
support %H modifier in inline ASM
Actually take a look at the patch I put in yesterday that removes that code
:)
You can then do something, I think, that looks like this:
(RC is your regclass, RI is the register info)
unsigned Reg = RC->getRegister(RI->getEncodingValue(MO.getReg()));
unsigned RegToPrint = // check for even/odd here O <<
ARMInstPrinter::getRegisterName(RegToPrint);
Also from first glance it looks like the indenting was a little off starting
where you were checking the regclass and there's no need for the \09s in the
testcase.
-eric
On Aug 9, 2012, at 5:07 PM, Weiming Zhao <weimingz at codeaurora.org> wrote:
> Hi Jim,
>
> Thanks for your reviewing.
> I agree with your concern.
> A new patch is attached, where I use ARMGPR register class to map the
register number. I assume that, in the td file, the order of registers in
GPR class is consistent with the encoding order.
>
> Thanks,
> Weiming
>
> From: Jim Grosbach [mailto:grosbach at apple.com]
> Sent: Wednesday, August 08, 2012 4:23 PM
> To: Weiming Zhao
> Cc: llvm-commits at cs.uiuc.edu
> Subject: Re: [llvm-commits] Patch for Bug 13556: ARM AsmPrinter
> doesn't support %H modifier in inline ASM
>
> Hi Weiming,
>
> The ordering of the register enum values does not map directly to the
encoding values.
>
> Specifically, the following is fragile and even it it works OK now, it's
making unsafe assumptions about the underlying enum value that may break in
the future:
> + Reg = (Reg - ARM::R0) & 1 ? Reg : Reg + 1;
> + O << ARMInstPrinter::getRegisterName(Reg);
>
> -Jim
>
> On Aug 8, 2012, at 4:07 PM, Weiming Zhao <weimingz at codeaurora.org> wrote:
>
>
> Hi,
>
> I'm attaching a patch to fix bug 13556:
> http://llvm.org/bugs/show_bug.cgi?id=13556
>
> In ARM inline AMM, %H represents the highest-numbered register of a pair.
> Routines like atomic read of 64-bit values needs this modifier.
> Currently, ARMAsmPrinter doesn't support this modifier.
>
> The patch fixes this issue.
> Please feel free to review it.
>
> Thanks,
> Weiming
> <0001-Support-H-modifier-for-ARM-inline-ASM.patch>____________________
> ___________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> <0001-Support-H-modifier-for-ARM-inline-ASM.patch>____________________
> ___________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Support-H-modifier-for-ARM-inline-ASM.patch
Type: application/octet-stream
Size: 2225 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120810/aa72fb4d/attachment.obj>
More information about the llvm-commits
mailing list