bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/4834] New: Incorrect bytemode in x86 disassembler


From: ht at inter7 dot jp
Subject: [Bug binutils/4834] New: Incorrect bytemode in x86 disassembler
Date: 24 Jul 2007 01:03:37 -0000

Disassembler prints incorrect bytemode for SSE insns in Intel syntax.

% objdump -v
GNU objdump (GNU Binutils) 2.17.50.20070723
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.

% cat sse.s
.byte  0xF2, 0x0F, 0x5E, 0x00
.byte  0xF3, 0x0F, 0x5E, 0x00
.byte  0xF2, 0x0F, 0x5F, 0x00
.byte  0xF3, 0x0F, 0x5F, 0x00
.byte  0xF2, 0x0F, 0x5D, 0x00
.byte  0xF3, 0x0F, 0x5D, 0x00
.byte  0xF3, 0x0F, 0x10, 0x00
.byte  0xF3, 0x0F, 0x11, 0x00
.byte  0xF2, 0x0F, 0x10, 0x00
.byte  0xF2, 0x0F, 0x11, 0x00
.byte  0xF2, 0x0F, 0x59, 0x00
.byte  0xF3, 0x0F, 0x59, 0x00
.byte  0xF3, 0x0F, 0x53, 0x00
.byte  0xF3, 0x0F, 0x52, 0x00
.byte  0xF2, 0x0F, 0x51, 0x00
.byte  0xF3, 0x0F, 0x51, 0x00
.byte  0xF2, 0x0F, 0x5C, 0x00
.byte  0xF3, 0x0F, 0x5C, 0x00
.byte  0xF3, 0x0F, 0x5A, 0x00
.byte  0xF2, 0x0F, 0x5A, 0x00

% as sse.s -o sse.o
% objdump -dw -Mintel --section="LC_SEGMENT.__TEXT.__text" sse.o

sse.o:     file format mach-o-le

Disassembly of section LC_SEGMENT.__TEXT.__text:

0000000000000000 <LC_SEGMENT.__TEXT.__text>:
   0:   f2 0f 5e 00             divsd  xmm0,XMMWORD PTR [eax]
   4:   f3 0f 5e 00             divss  xmm0,XMMWORD PTR [eax]
   8:   f2 0f 5f 00             maxsd  xmm0,XMMWORD PTR [eax]
   c:   f3 0f 5f 00             maxss  xmm0,XMMWORD PTR [eax]
  10:   f2 0f 5d 00             minsd  xmm0,XMMWORD PTR [eax]
  14:   f3 0f 5d 00             minss  xmm0,XMMWORD PTR [eax]
  18:   f3 0f 10 00             movss  xmm0,XMMWORD PTR [eax]
  1c:   f3 0f 11 00             movss  XMMWORD PTR [eax],xmm0
  20:   f2 0f 10 00             movsd  xmm0,XMMWORD PTR [eax]
  24:   f2 0f 11 00             movsd  XMMWORD PTR [eax],xmm0
  28:   f2 0f 59 00             mulsd  xmm0,XMMWORD PTR [eax]
  2c:   f3 0f 59 00             mulss  xmm0,XMMWORD PTR [eax]
  30:   f3 0f 53 00             rcpss  xmm0,XMMWORD PTR [eax]
  34:   f3 0f 52 00             rsqrtss xmm0,XMMWORD PTR [eax]
  38:   f2 0f 51 00             sqrtsd xmm0,XMMWORD PTR [eax]
  3c:   f3 0f 51 00             sqrtss xmm0,XMMWORD PTR [eax]
  40:   f2 0f 5c 00             subsd  xmm0,XMMWORD PTR [eax]
  44:   f3 0f 5c 00             subss  xmm0,XMMWORD PTR [eax]
  48:   f3 0f 5a 00             cvtss2sd xmm0,XMMWORD PTR [eax]
  4c:   f2 0f 5a 00             cvtsd2ss xmm0,XMMWORD PTR [eax]

All above modes are XMMWORD, but that's wrong.
Intel(R) 64 and IA-32 Architectures Software Developer's Manual Volume 2A & 2B
In the manuals, it's written as follows.

Opcode                  Instruction
F2 0F 5E /r             DIVSD  xmm1, xmm2/m64
F3 0F 5E /r             DIVSS  xmm1, xmm2/m32
F2 0F 5F /r             MAXSD  xmm1, xmm2/m64
F3 0F 5F /r             MAXSS  xmm1, xmm2/m32
F2 0F 5D /r             MINSD  xmm1, xmm2/m64
F3 0F 5D /r             MINSS  xmm1, xmm2/m32
F3 0F 10 /r             MOVSS  xmm1, xmm2/m32
F3 0F 11 /r             MOVSS  xmm2/m32, xmm
F2 0F 10 /r             MOVSD  xmm1, xmm2/m64
F2 0F 11 /r             MOVSD  xmm2/m64, xmm1
F2 0F 59 /r             MULSD  xmm1, xmm2/m64
F3 0F 59 /r             MULSS  xmm1, xmm2/m32
F3 0F 53 /r             RCPSS  xmm1, xmm2/m32
F3 0F 52 /r             RSQRTSS xmm1, xmm2/m32
F2 0F 51 /r             SQRTSD xmm1, xmm2/m64
F3 0F 51 /r             SQRTSS xmm1, xmm2/m32
F2 0F 5C /r             SUBSD  xmm1, xmm2/m64
F3 0F 5C /r             SUBSS  xmm1, xmm2/m32
F3 0F 5A /r             CVTSS2SD xmm1, xmm2/m32
F2 0F 5A /r             CVTSD2SS xmm1, xmm2/m64

-- 
           Summary: Incorrect bytemode in x86 disassembler
           Product: binutils
           Version: 2.18 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: ht at inter7 dot jp
                CC: bug-binutils at gnu dot org
  GCC host triplet: i686-apple-darwin


http://sourceware.org/bugzilla/show_bug.cgi?id=4834

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]