<div dir="ltr">I'm looking for a more agreeable solution to this, but I'm hitting issues.<div>Two ways I can see this done:</div><div><br></div><div>1. instructions keep a single immediate operand so_imm which is parsed with </div>
<div>a custom parser method. Basically the asm pattern remains "asm $reg1, $reg2, $imm"</div><div>and it's supposed to match strings like "asm r0, r1, #4, #6". I don't think this is possible</div>
<div>due to the operation of the parser. It will recognize a 3 operand pattern and will not attempt</div><div>to match it against a 4 operand assembly string.</div><div><br></div><div>2. instructions will have two immediate operands, with an alias to support the single immediate</div>
<div>operand plus one conversion function to even out the representation (i.e. to transform the </div><div>single operand into <value, rot> pair. There are issues with this one as well. For one thing,</div><div>not all 16-bit immediates can be represented and tablegen lacks the ability to use additional </div>
<div>predicates when matching instruction aliases (i.e. I can't have a special predicate to decide</div><div>whether an alias can apply). Secondly, even if this is fixed, there remains the problem of </div><div>the codegen pattern. The selection IR contains a single immediate. If the instruction has two </div>
<div>immediate operands, the pattern becomes illegal or can't be matched.</div><div><br></div><div>For solution 1, the blocking issue is the parser recognizing comma as a operand separator</div><div>and not matching patterns and assembly strings of different arity.</div>
<div><br></div><div>For solution 2, the blocking issue is the selection patterns. Basically I'd have to have a separate</div><div>set on instructions for selection only, which makes the whole effort futile.</div><div>
<br></div><div>It looks to me that there really isn't much alternative to having separate instructions.</div><div>What do you think? Is there anything I'm overlooking?</div><div><br></div><div>Regards,</div><div>Mihai</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 1, 2013 at 7:52 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"><div class="im">> There are two different issues that were brought up:<br>
><br>
> 1. whether this support should be implemented in the first place<br>
<br>
</div>I don't think anyone's argued that the syntax shouldn't be supported.<br>
It's definitely a good idea, and a necessity if we claim to be a full<br>
ARM assembler.<br>
<div class="im"><br>
> 2. the exact manner of implementation<br>
<br>
</div>That's where the disagreements are, I think.<br>
<br>
Cheers.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br></div>