<html>
    <head>
      <base href="https://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 --- - Incorrect/inefficient pushw encodings for x86-64 targets" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23996&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=VAGe2H-4hhWfxKhNV5mLgjIcXm9qZy4e788K38bJPlo&s=fqCf7jTKXuKXhUeyFGsG5kxze_NMjS_fYqK-P_14uHM&e=">23996</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrect/inefficient pushw encodings for x86-64 targets
          </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>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>Backend: X86
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>david.l.kreitzer@intel.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>Below is an illustration of the problems.  The first pushw is incorrectly
encoded as pushq. The second pushw is encoded correctly but inefficiently as it
uses a 16-bit immediate rather than an 8-bit immediate.

Note also that the gas-generated instruction "66 6a 2a" is incorrectly printed
by llvm-objdump as pushq.

All 3 problems can be fixed by fixing the instruction descriptors for the
16-bit push immediate forms.


------------------------------
bash-4.3$ cat t.s
.section push,"x"
pushw $foo
pushw $42
bash-4.3$ llvm-mc t.s -filetype=obj -o - | llvm-objdump -d -

<stdin>:        file format ELF64-x86-64

Disassembly of section push:
push:
       0:       68 00 00 00 00  pushq   $0
       5:       66 68 2a 00     pushw   $42
bash-4.3$ gcc -c t.s && llvm-objdump -d t.o

t.o:    file format ELF64-x86-64

Disassembly of section push:
push:
       0:       66 68 00 00     pushw   $0
       4:       66 6a 2a        pushq   $42</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>