<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - 16-bit and 32-bit immediates print as 64-bits in annotated assembly (x86-64)"
   href="http://llvm.org/bugs/show_bug.cgi?id=20347">20347</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>16-bit and 32-bit immediates print as 64-bits in annotated assembly (x86-64)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>llc
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>spatel+llvm@rotateright.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Using llc built from r213097:

$ cat imm.ll
define i8 @int8() #0 {
  ret i8 -128
}
define i16 @int16() #0 {
  ret i16 -32768
}
define i32 @int32() #0 {
  ret i32 -2147483648
}
define i64 @int64() #0 {
  ret i64 -9223372036854775808
}

---------------------------------------------------------------

$ ./llc imm.ll -o -  
(irrelevant output removed)
    movb    $-128, %al
    movw    $-32768, %ax            ## imm = 0xFFFFFFFFFFFF8000
    movl    $-2147483648, %eax      ## imm = 0xFFFFFFFF80000000
    movabsq    $-9223372036854775808, %rax ## imm = 0x8000000000000000

---------------------------------------------------------------

It's good to show decimal immediates as hex values when reading asm, but it's
confusing to see known 16-bit and 32-bit values displayed as sign extended
64-bit hex. 

Can we display immediates with the correct size? For completeness, shouldn't
the 8-bit value also be displayed in hex?

I think this is x86-specific because I don't see any attempt to print
immediates in hex when displaying ARM or PPC64 asm.</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>