<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:t.scheller@samsung.com" title="Tilmann Scheller <t.scheller@samsung.com>"> <span class="fn">Tilmann Scheller</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WORKSFORME - select in thumb2 sign extends constants when it shouldn't"
   href="http://llvm.org/bugs/show_bug.cgi?id=19107">bug 19107</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>t.scheller@samsung.com
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>WORKSFORME
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WORKSFORME - select in thumb2 sign extends constants when it shouldn't"
   href="http://llvm.org/bugs/show_bug.cgi?id=19107#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED WORKSFORME - select in thumb2 sign extends constants when it shouldn't"
   href="http://llvm.org/bugs/show_bug.cgi?id=19107">bug 19107</a>
              from <span class="vcard"><a class="email" href="mailto:t.scheller@samsung.com" title="Tilmann Scheller <t.scheller@samsung.com>"> <span class="fn">Tilmann Scheller</span></a>
</span></b>
        <pre>Just tried this with trunk, getting the following machine code for the bad2
function:

bad2:
        .fnstart
.Leh_func_begin1:
@ BB#0:
        uxtb    r1, r1
        uxtb    r2, r0
        cmp     r2, r1
        it      hi
        mvnhi   r0, #127
        bx      lr

So indeed the 128 constant is sign extended, however this still matches the
semantics of the LLVM IR, so I don't think we have an actual bug here.

Since there are no 8-bit registers, i8 values effectively get promoted to i32.
In other words, the upper 24-bits of a promoted i8 value are undefined. That's
also why we need the two uxtb instructions in the beginning, since we need to
assume that the upper 24-bits of the incoming values are garbage.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>