This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/16089] New: disassembler work incorrectly with some SSE2 instructions.


https://sourceware.org/bugzilla/show_bug.cgi?id=16089

            Bug ID: 16089
           Summary: disassembler work incorrectly with some SSE2
                    instructions.
           Product: gdb
           Version: 7.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: yulyugin at gmail dot com

Created attachment 7257
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7257&action=edit
real hardware test

Compile attached file:
> gcc -Wall -g -O0 mulsd.c
Run gdb:
> gdb a.out

Set breakpoint in main:
Breakpoint 1, main () at test.c:4
4           double a[2] = {2, 2}, b[2] = {0, 0};

Make one step
(gdb) n
5           __asm__ __volatile__ (

(gdb) disassembler
<omitted>
=> 0x0000000000400572 <+54>:    movupd -0x10(%rbp),%xmm7
   0x0000000000400577 <+59>:    data16
   0x0000000000400578 <+60>:    mulpd  %xmm7,%xmm7
   0x000000000040057c <+64>:    movupd %xmm7,-0x20(%rbp)
<omitted>

Instruction disassembled incorrectly. It's mulsd %xmm7, %xmm7.

Hardware look at prefixes order but not in all cases.

Examples with mul** instructions:
66 f3 f2 0f 59 ff     is mulsd %%xmm7, %%xmm7 (mandatory prefix is f2)
66 f2 f3 0f 59 ff     is mulss %%xmm7, %%xmm7 (mandatory prefix is f3)
66 0f 59 ff           is mulpd %%xmm7, %%xmm7 (mandatory prefix is 66)
f2 66 0f 59 ff        is mulsd %%xmm7, %%xmm7 (mandatory prefix is f2)

If both f2 and f3 prefixes present last of it is mandatory. But 66 prefix is
mandatory only if f2 and f3 prefixes is not present in this insturction.

Similar bug submitted in objdump (16083).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]