<meta charset="utf-8"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Thanks for your patch review (and also to Anton.) <div><br></div><div>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.)</div>
<div><br></div><div>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.) </div>
<div><br></div><div>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.)</div>
<div><br></div><div>Is there a way to reuse the encoding codes?</div><div><br></div><div><br></div><div>Zonr</div><div><br></div><div><br></div></span><br><div class="gmail_quote">2010/5/21 Rafael Espindola <span dir="ltr"><<a href="mailto:espindola@google.com">espindola@google.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On 18 May 2010 15:19, Zonr Chang <<a href="mailto:zonr.xchg@gmail.com">zonr.xchg@gmail.com</a>> wrote:<br>

> The attached patch enables LLVM to materialize of movt/movw instructions<br>
> in ARM JIT. These allow you loading 32-bit immediate and addresses using 2<br>
> instructions instead of from the constant pool. This patch should resolve<br>
> the Bug #6265 (<a href="http://llvm.org/bugs/show_bug.cgi?id=6265" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=6265</a>).<br>
<br>
</div></div>I had a quick look at the patch and it looks fine. Some time ago I<br>
tried to implement this, but wanted to reused the movw and movt logic.<br>
Unfortunately creating new machine instructions at this stage is not<br>
very convenient.<br>
<br>
I think the patch is fine. It might also fix PR7048. I am trying it<br>
right now, but it takes some time to build llvm on a beagleboard :-)<br>
<br>
> Zonr<br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
><br>
><br>
<br>
Thanks,<br>
<font color="#888888">--<br>
Rafael Ávila de Espíndola<br>
</font></blockquote></div><br>