<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><base href="x-msg://669/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Gordon.<div><br></div><div>I was the one that patch to disassemble this branch correctly (r166982 for <a href="rdar://">rdar://</a>12585795).  Your changes to lib/Target/ARM/ARMInstrThumb2.td looks right to me.  But I'm not a code gen guy so I think Jim will need to look at the change to lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp (the right shift) but that sounds correct to me.</div><div><br></div><div>Kev</div><div><br></div><div><div><div>On Mar 27, 2013, at 5:24 PM, Gordon Keiser <<a href="mailto:gkeiser@arxan.com">gkeiser@arxan.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" link="#0563C1" vlink="#954F72" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Hi,<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">A little while back someone checked in a patch to disassemble this branch correctly, but the TableGen definition was still using incorrect information as if a 20 bit immediate was involved, and the encode function neglected to right shift the immediate first (the output becomes left shifted by #1).   The former item was causing the S, J1, and J2 bits of the instruction to be set incorrectly (based on bits 19-17 of the immediate rather than the calculated version from the encode function), and the latter was causing all of the branches to go twice as far as specified.  This was verified both by the output from LLVM’s disassembler which is correct in this case, IDA 6.4, and lots of bit checking vs. ARM’s docs.<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">The patch also updates test cases, which were listing encoding results which didn’t match what they should have been.<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">I don’t have commit access yet, so someone who does can feel free to commit if it looks good. <o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Cheers,<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><b><span style="font-size: 9pt; font-family: Verdana, sans-serif; color: navy; ">Gordon Keiser<br></span></b><span style="font-size: 8pt; font-family: Verdana, sans-serif; color: navy; ">Software Development Engineer<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 8pt; font-family: Verdana, sans-serif; color: navy; ">Arxan Technologies<o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 8pt; font-family: Verdana, sans-serif; color: navy; ">w:+1.765.889.4756   m:+1.765.237.4833 <o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><a href="mailto:gkeiser@arxan.com" style="color: rgb(149, 79, 114); text-decoration: underline; "><span style="font-size: 8pt; font-family: Verdana, sans-serif; color: blue; ">gkeiser@arxan.com</span></a><span style="font-size: 8pt; font-family: Verdana, sans-serif; color: blue; ">       <span class="Apple-converted-space"> </span></span><a href="http://www.arxan.com/" style="color: rgb(149, 79, 114); text-decoration: underline; "><span style="font-size: 8pt; font-family: Verdana, sans-serif; color: rgb(228, 108, 10); ">www.arxan.com</span></a><span style="font-size: 8pt; font-family: Verdana, sans-serif; color: rgb(31, 73, 125); "> <o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 8pt; font-family: Verdana, sans-serif; color: rgb(228, 108, 10); ">Protecting the App Economy™</span><span style="font-size: 8pt; color: rgb(228, 108, 10); "> </span><span style="color: rgb(31, 73, 125); "><o:p></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div></div><span><Thumb2b.wT4Encoding.patch></span>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu" style="color: rgb(149, 79, 114); text-decoration: underline; ">llvm-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" style="color: rgb(149, 79, 114); text-decoration: underline; ">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br></div></blockquote></div><br></div></body></html>