[llvm-commits] [PATCH] ARM JIT: Add support to MOVimm32 using movt/movw for JIT

Zonr Chang zonr.xchg at gmail.com
Thu May 20 20:34:39 PDT 2010


Thanks for your patch review (and also to Anton.)

How to reuse the movw/movt logic is indeed a problem. PR7048 is an example.
To fix this bug, we need to insert more codes into function
emitDataProcessingInstruction(...) (see attachment.)

It is because, precisely, the previous patch (arm-jit-movt-and-movw.patch)
implemented the pseudo instruction ARM::MOVi32imm (which according to
ARMInstrInfo.td should be materialized to movw/movt pair.) However, there's
a case to use movw or movt as a single instruction to move value and their
materialization will route to emitDataProcessingInstruction() since both
movw (opcode ARM::MOVTi16) and movt (opcode ARM::MOVi16) are data processing
instructions (i.e. ARMII::DPFrm.)

In PR7048, the "1001" to printf(...) will be moved to the register using
single instruction movw. As you can see in this patch, the logic to encode
the immediate is reused the third time (one
in emitDataProcessingInstruction(...) and one in relocation codes.)

Is there a way to reuse the encoding codes?


Zonr



2010/5/21 Rafael Espindola <espindola at google.com>

> On 18 May 2010 15:19, Zonr Chang <zonr.xchg at gmail.com> wrote:
> > The attached patch enables LLVM to materialize of movt/movw instructions
> > in ARM JIT. These allow you loading 32-bit immediate and addresses using
> 2
> > instructions instead of from the constant pool. This patch should resolve
> > the Bug #6265 (http://llvm.org/bugs/show_bug.cgi?id=6265).
>
> I had a quick look at the patch and it looks fine. Some time ago I
> tried to implement this, but wanted to reused the movw and movt logic.
> Unfortunately creating new machine instructions at this stage is not
> very convenient.
>
> I think the patch is fine. It might also fix PR7048. I am trying it
> right now, but it takes some time to build llvm on a beagleboard :-)
>
> > Zonr
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >
> >
>
> Thanks,
> --
> Rafael Ávila de Espíndola
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100521/5e21e0f5/attachment.html>


More information about the llvm-commits mailing list