<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 --- - Support relaxation of more x86 instructions"
   href="http://llvm.org/bugs/show_bug.cgi?id=22662">22662</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Support relaxation of more x86 instructions
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>Backend: X86
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dwmw2@infradead.org
          </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>$ cat foo.S
.code16
    movl (foo), %ebx
foo:
$ llvm-mc -filetype=obj foo.S | llvm-objdump -d -triple=i686-pc-linux-code16 -

<stdin>:    file format ELF64-x86-64

Disassembly of section .text:
.text:
       0:    67 66 8b 1d 00 00 00 00                          movl    0, %ebx

We didn't need the 0x67 addr32 prefix for this. GCC does this:

       0:    66 8b 1e 00 00                                   movl    0, %ebx

Although not strictly incorrect, this causes a problem for size-sensitive code;
the above example was taken from a boot sector implementation.

We should emit the 16-bit version by default. And if we do that, we're going to
need to handle relaxation for the case where it *isn't* sufficient.

We normally handle relaxation by converting to a *different* opcode. That isn't
sufficient here; we'll probably need a flag in the MCInst to indicate that it
should use addr32. Which is nice, since we already *wanted* to support the
explicit 'addr32' prefix...</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>