<div dir="ltr">Hi Tim.<div><br></div><div>Please see attached the revised patch. I have made the template function and the</div><div>new operand classes clearly refer to PC-relative addresses and changed the shifting </div>
<div>policy.</div><div><br></div><div>Regards,</div><div>Mihai</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 1, 2013 at 1:38 PM, Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Mihail,<br>
<div class="im"><br>
> I think that my template method will actually work for all offsets. Let's<br>
> take a case study: ldr r0, [r1, #-4]<br>
<br>
</div>I mean the one in the AsmParser, not in the decoder, the decoder one<br>
is versatile but unnecessary if we stick to pre-encoded MCOperands<br>
(where sane).<br>
<br>
The problem is more "ldr r0, [r1, #-4096]" for the LDRi12 instruction.<br>
This should not be allowed, but it looks like your "Min" would get set<br>
to -4096 because a 13-bit 2s complement integer can accept that<br>
immediate.<br>
<div class="im"><br>
> Regarding the shifting of the immediate for ADR's PC-relative operand, I can<br>
> of course have it shifted in the MCOperand if you insist.<br>
<br>
</div>I think that would be better.<br>
<br>
Cheers.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br></div>