[LLVMdev] best way to implement complex addressing modes

Ralph Corderoy ralph at inputplus.co.uk
Thu Sep 7 02:22:49 PDT 2006

Hi Chris,

> On Wed, 6 Sep 2006, [UTF-8] Rafael Esp?ndola wrote:
> > The ARM has some very powerful and complex addressing modes. For
> > example, the  data processing instructions (and, orr, add, ..) have
> > an addressing mode that has 11 options (imm, reg, and 9 reg + some
> > shift).
> I'm not sure exactly what the constraints you have are

For those interested, here's the kind of things you could do, at least
on older ARM architectures.

    # Jump-table dispatch.
    cmp r0, #42
    addls pc, pc, r0, lsl #2

    # Load first byte of 8-byte element from array at r1 indexed by r2.
    ldrb r0, [r1, r2, lsl #3]

I'd have thought PowerPC has some similarities?



More information about the llvm-dev mailing list