<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><base href="x-msg://343/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Looks good.  I'll commit tomorrow when I get back to work unless someone beats me to it.<div><br></div><div>Kev</div><div><br><div><div>On Mar 27, 2013, at 4:53 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; ">According to ARM DDI0406C, A8.8.29, the CBNZ / CBZ instructions can only branch forwards, and the immediate is zero extended.   The decode function (DecodeThumbCmpBROperand) was sign extending instead, producing incorrect results when the high bit of the immediate was set. <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 attached patch fixes the issue and adds a test case which will trigger it in current code.<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 if it looks good and you do have, feel free to commit.<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><DecodeCBZCorrectImm.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>