<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jul 16, 2013, at 1:26 AM, Ramkumar Ramachandra <<a href="mailto:artagnon@gmail.com">artagnon@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Ramkumar Ramachandra wrote:<br><blockquote type="cite">Stephen Checkoway wrote:<br><blockquote type="cite">bt $n, mem becomes btl $(n % 32), mem + 4*(n / 32)<br></blockquote><br>Yeah, and the same logic should be applied to all bit-test<br>instructions.  Pointers for a patch, please?<br></blockquote><br>It looks like doing this using instruction aliases will result in a<br>huge amount of duplication, but that does seem to be the existing<br>convention.  The larger problem seems to be that<br>MatchInstructionImpl() is too primitive: See d5b2f1a (move the<br>"sh[lr]d op,op" -> "shld $1, op,op" aliases to the .td file.,<br>2010-11-06), where Lattner comments out a slew of instructions saying<br>that the matcher is incapable of matching a fixed immediate.  So, I'd<br>like to look into improving MatchInstructionImpl(), which is generated<br>at utils/TableGen/AsmMatcherEmitter.cpp:2853.  Or is that a lost<br>cause, and should be we open-coding it<br>lib/Target/X86/AsmParser/X86AsmParser.cpp?  I suppose we could inject<br>something into ParseInstruction(), following the examples of outb, inb<br>etc.  Yeah, I think that's what we should do: I'll try to whip up a<br>patch shortly.</div></blockquote></div><br><div>No. The above rule is absolutely the wrong thing to do, as has been previously noted.</div><div><br></div><div>-Jim</div></body></html>