[LLVMbugs] [Bug 23996] New: Incorrect/inefficient pushw encodings for x86-64 targets

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jun 30 14:33:33 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23996

            Bug ID: 23996
           Summary: Incorrect/inefficient pushw encodings for x86-64
                    targets
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: david.l.kreitzer at intel.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150630/c0939e61/attachment.html>


More information about the llvm-bugs mailing list