Wouldn't this be a viable use of the third disassembler return value "SoftFail"? The only difference between its use here and how it is used in the ARM backend is that the Intel manuals explicitly define the behaviour in the out of range case, but you could easily reappropriate SoftFail for the x86 architecture to mean "It's defined, but I'm going to warn about it".<br>
<br><div class="gmail_quote">On 17 July 2013 16:09, 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">>> I think I like that one even less. It means that we can't reassemble<br>
>> our own disassembly,<br>
><br>
> I've not been following this closely, but can you explain this? It sounds<br>
> like we're producing instructions with out-of-range immediates in<br>
> disassembly.<br>
<br>
</div>The immediate takes up a full byte in the instruction stream and<br>
values outside the [0,31] (or whatever) range have well-defined<br>
semantics. In my book that makes them valid instructions that the<br>
disassembler ought to have a representation for.<br>
<br>
I suppose that condition could be dropped, though: disassemble the<br>
alternative encodings as if those extra bits weren't there. That would<br>
be better than just changing the AsmParser, but still not my preferred<br>
solution. It's rather misleading for a user of the disassembler.<br>
<div class="HOEnZb"><div class="h5"><br>
Tim.<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>
</div></div></blockquote></div><br>