<div dir="ltr">Hi Tim,<div><br></div><div>I agree with your point, that the AsmParser in ARM64 is already too complexity. But for this bug, it can't avoid adding more codes in AsmParser unless factoring whole address operand of load/store instructions. The reason why I give up providing a <span style="color:rgb(0,0,0);white-space:pre-wrap">suitably vague warning is that, there's too many instructions sharing two diagnostics!</span></div>
<div><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><font color="#000000"><span style="white-space:pre-wrap">feeding diag.s in patch to llvm-mc built by trunk today, you will see</span></font></div>
<div><font color="#000000"><span style="white-space:pre-wrap"><br></span></font></div><div><span style="white-space:pre-wrap;color:rgb(0,0,0)">>llvm-mc -triple=arm64 -mattr=+neon -assemble -show-encoding <diag.s</span><br>
</div><div><br></div><div><font color="#000000"><div style="white-space:pre-wrap"><span class="" style="white-space:pre">       </span>.text</div><div style="white-space:pre-wrap"><stdin>:1:13: error: index must be a multiple of 4 in range [0, 16380].</div>
<div style="white-space:pre-wrap">ldrb w1   , [x3, w3, sxtw #4]</div><div style="white-space:pre-wrap">            ^</div><div style="white-space:pre-wrap"><stdin>:2:13: error: index must be a multiple of 4 in range [0, 16380].</div>
<div style="white-space:pre-wrap">ldrh w1   , [x3, w3, sxtw #4]</div><div style="white-space:pre-wrap">            ^</div><div style="white-space:pre-wrap"><stdin>:3:13: error: index must be a multiple of 4 in range [0, 16380].</div>
<div style="white-space:pre-wrap">ldr  w1   , [x3, w3, sxtw #4]</div><div style="white-space:pre-wrap">            ^</div><div style="white-space:pre-wrap"><stdin>:4:13: error: index must be a multiple of 8 in range [0, 32760].</div>
<div style="white-space:pre-wrap">ldr  x1   , [x3, w3, sxtw #4]</div><div style="white-space:pre-wrap">            ^</div><div style="white-space:pre-wrap"><stdin>:5:13: error: index must be a multiple of 8 in range [0, 32760].</div>
<div style="white-space:pre-wrap">ldr  b1   , [x3, w3, sxtw #4]</div><div style="white-space:pre-wrap">            ^</div><div style="white-space:pre-wrap"><stdin>:6:13: error: index must be a multiple of 8 in range [0, 32760].</div>
<div style="white-space:pre-wrap">ldr  h1   , [x3, w3, sxtw #4]</div><div style="white-space:pre-wrap">            ^</div><div style="white-space:pre-wrap"><stdin>:7:13: error: index must be a multiple of 8 in range [0, 32760].</div>
<div style="white-space:pre-wrap">ldr  s1   , [x3, w3, sxtw #4]</div><div style="white-space:pre-wrap">            ^</div><div style="white-space:pre-wrap"><stdin>:8:13: error: index must be a multiple of 8 in range [0, 32760].</div>
<div style="white-space:pre-wrap">ldr  d1   , [x3, w3, sxtw #4]</div><div style="white-space:pre-wrap">            ^</div><div style="white-space:pre-wrap"><stdin>:9:13: error: index must be a multiple of 8 in range [0, 32760].</div>
<div style="white-space:pre-wrap">ldr  q1   , [x3, w3, sxtw #1]</div><div style="white-space:pre-wrap">            ^</div><div style="white-space:pre-wrap"><br></div><div style="white-space:pre-wrap">Each diagnostic will hold too many information and get end-users more confused. Also, previous misleading diagnostic is for addressing mode [reg, offset], the suggested offset ranges are incorrect</div>
</font></div><div><font color="#000000"><span style="white-space:pre-wrap">for 8/16/128 bit loading. </span></font></div><div><font color="#000000"><span style="white-space:pre-wrap">For example, when parsing "</span></font><span style="color:rgb(0,0,0);white-space:pre-wrap">ldrb w1, [x3, #4096]</span><span style="white-space:pre-wrap;color:rgb(0,0,0)">", current diagnostic is "</span><span style="color:rgb(0,0,0);white-space:pre-wrap">error: index must be a multiple of 4 in range [0, 16380].</span><span style="white-space:pre-wrap;color:rgb(0,0,0)">"  But correct index should be any integer in [0, 4095].</span></div>
<div>This<span style="white-space:pre-wrap;color:rgb(0,0,0)"> </span>patch<span style="white-space:pre-wrap;color:rgb(0,0,0)"> </span>can<span style="white-space:pre-wrap;color:rgb(0,0,0)"> </span>fix<span style="white-space:pre-wrap;color:rgb(0,0,0)"> </span>this<span style="white-space:pre-wrap;color:rgb(0,0,0)"> </span>problem<span style="white-space:pre-wrap;color:rgb(0,0,0)"> </span>as<span style="white-space:pre-wrap;color:rgb(0,0,0)"> </span>well<span style="white-space:pre-wrap;color:rgb(0,0,0)">.</span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-08 19:29 GMT+08:00 Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Kevin,<br>
<br>
I don't think that degree of hackery is justified for a slightly better diagnostic. ARM64 already suffers from too much C++ code in the AsmParser, We want to work towards decreasing that rather than making it worse.<br>

<br>
Cheers.<br>
<br>
Tim.<br>
<br>
<a href="http://reviews.llvm.org/D3662" target="_blank">http://reviews.llvm.org/D3662</a><br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Best Regards,<div><br></div><div>Kevin Qin</div></div>
</div>