[LLVMbugs] [Bug 7691] New: wrong encoding of movq %rax, 0

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 22 09:13:58 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7691

           Summary: wrong encoding of movq %rax, 0
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rdivacky at freebsd.org
                CC: llvmbugs at cs.uiuc.edu


pes ~/clangbsd$ echo 'movq    %rax, 0' | llvm-mc --show-encoding --show-inst
        .section        __TEXT,__text,regular,pure_instructions
        movq    %rax, 0                 # encoding: [0x48,0xa3,A,A,A,A]
                                        #   fixup A - offset: 2, value: 0,
kind: FK_Data_4
                                        # <MCInst #1363 MOV64ao64
                                        #  <MCOperand Expr:(0)>>

note that the actual encoding is 

         0x48,0xa3,A,A,A,A

pes ~/clangbsd$ cat bah.s 
mov    %rax,0x0
pes ~/clangbsd$ as bah.s -o bah.o && objdump -d bah.o

bah.o:     file format elf64-x86-64

Disassembly of section .text:

0000000000000000 <.text>:
   0:   48 89 04 25 00 00 00    mov    %rax,0x0
   7:   00 

ie. the encoding for gnu as is

        48 89 04 25 00 00 00 00

thats one 00 more than with llvm

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list