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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to