[llvm-commits] [llvm] r128635 - in /llvm/trunk: lib/Target/ARM/ARMAddressingModes.h lib/Target/ARM/ARMBaseInfo.h lib/Target/ARM/ARMBaseInstrInfo.h lib/Target/ARM/ARMInstrFormats.td lib/Target/ARM/ARMInstrInfo.td lib/Target/ARM/AsmParser/ARMAsmPar

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Thu Mar 31 12:17:22 PDT 2011


Hi Jim,

> I'm glad to see you're looking at this. Hopefully the bugs won't be too hard to track down.

Also really nice to hear back from you.

> If you're feeling ambitious, addrmode2 is on its way out in favor of addrmode_imm12 and ldst_so_reg. Specifically, addrmode2 conflates the immediate and register addressing and modally indicates which of the two it's defining by the second register operand being zero. This, as I'm sure you've encountered, gives the asm parser all sorts of fun to deal with, as there are operands that aren't part of the assembly syntax and aren't easily inferable without custom handling. Splitting the operand into parts has two major benefits. First, it helps with the above by making the instruction definition only have machine operands which are actually part of the real instructions. Second, the different addressing modes typically have a different scheduling itinerary, and that's not expressive with a combined addressing mode construct. The AI_ldr1 multiclass, used by the base LDR instructions, has an example of how this works.

Interesting. It's indeed a good idea.

> When you get to doing parsing for the _PRE/_POST instructions that do have associated patterns, there's some complications due to the writeback tied register constraint. The best way we have to represent that right now, albeit kinda ugly, is to use a pseudo-instruction for the code-gen that has the writeback output operand tied to the source base reg, and an assembler-only real instruction (which has the encoding information) that doesn't have an explicit output writeback operand, just the source base operand. The ARMAsmPrinter MC lowering pseudo-expansion would lower the former to the latter.

Ok. I see it now. I'll try to leave the LDR instructions for a next
patch if that is possible, so I can address them better. Thanks for
the explanation.

-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc




More information about the llvm-commits mailing list