public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/16089] New: disassembler work incorrectly with some SSE2 instructions.
@ 2013-10-25 18:19 yulyugin at gmail dot com
  2013-10-31 10:43 ` [Bug gdb/16089] " palves at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: yulyugin at gmail dot com @ 2013-10-25 18:19 UTC (permalink / raw)
  To: gdb-prs

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug gdb/16089] disassembler work incorrectly with some SSE2 instructions.
  2013-10-25 18:19 [Bug gdb/16089] New: disassembler work incorrectly with some SSE2 instructions yulyugin at gmail dot com
@ 2013-10-31 10:43 ` palves at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: palves at redhat dot com @ 2013-10-31 10:43 UTC (permalink / raw)
  To: gdb-prs

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

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |palves at redhat dot com
         Resolution|---                         |DUPLICATE

--- Comment #1 from Pedro Alves <palves at redhat dot com> ---
> Similar bug submitted in objdump (16083).

Thanks.  GDB actually shares the disassembler code with objdump, so once that
one is fixed, so will GDB.

*** This bug has been marked as a duplicate of bug 16083 ***

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-31 10:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-25 18:19 [Bug gdb/16089] New: disassembler work incorrectly with some SSE2 instructions yulyugin at gmail dot com
2013-10-31 10:43 ` [Bug gdb/16089] " palves at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).