[PATCH] Allow %w, %z operands to be immediates for AArch64

Tim Northover t.p.northover at gmail.com
Wed Oct 30 04:58:33 PDT 2013


Hi Weiming,

> This patch is to fix http://llvm.org/bugs/show_bug.cgi?id=17728
>
> Please help to review it.

I think the patch is too much of a point-fix for this one case. Even
the comment refers solely to this situation when there are far more
combinations that could cause this.

The X86 backend seems to deal with this in a more natural way, though
I don't think its approach is directly applicable. Its logic is
essentially:
1. Does this modifier apply to this operand?
2. If so, print it as such
3. Else, pretend there was no modifier.

In the AArch64 context this is probably best implemented by moving the
generic code to the bottom of the function (so it gets executed when
the switch "break"s) and checking "if (MO.isReg()) ..." before calling
printModifiedGPRAsmOperand. Similar tests could apply to the
floating-point versions (e.g. asm("fcmp %0, %s1" :: "r"(lhs),
"rY"(0.0f))) and probably the addresses too.

Cheers.

Tim.



More information about the llvm-commits mailing list