[PATCH] Add support for ARM modified immediate syntax

Tim Northover tnorthover at apple.com
Fri Aug 9 05:42:28 PDT 2013


Hi Mihai,

> For solution 1, the blocking issue is the parser recognizing comma as a operand separator
> and not matching patterns and assembly strings of different arity.

I think if you give your so_imm a ParserMethod then it short-circuits the normal comma-spotting, and it can eat as much of the string as it likes. This is how the addresses are matched, for example: even though "[r0, #3]" has a comma in it, the generic code doesn't see it.

Incidentally, adding an "MIOperandInfo = (ops i32imm:$value, i32imm:$rot)" would probably make the internal representation neatest here. by giving your MachineInstr two separate operands for the immediate value.

Because the two operands would be hidden behind the single so_imm it should be reasonably easy for a ComplexPattern to match them still.

> For solution 2, the blocking issue is the selection patterns. Basically I'd have to have a separate
> set on instructions for selection only, which makes the whole effort futile.

Yes, I think that goes wrong rather quickly. I can't think of a sensible way to match those instructions.

Cheers.

Tim.



More information about the llvm-commits mailing list