public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "muller at ics dot u-strasbg.fr" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/17464] New: Strange display of vector registers
Date: Tue, 07 Oct 2014 15:26:00 -0000	[thread overview]
Message-ID: <bug-17464-4717@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 17464
           Summary: Strange display of vector registers
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: muller at ics dot u-strasbg.fr

the command
info vectors
for x86_64 processor
uses hexadecimal formatting.
  This leads to the use of unpack_long function,
and displays only the integer part of
a given float.

Same source as bug report 

$ cat xmm15-problem.c
>>>>>>>>>>>>>>>>>>>>>>>>>>>>Start of source file
#include <math.h>

double
test_xmm14 (double t)
{
  register double x asm ("xmm11");
  register double y asm ("xmm12");
  register double z asm ("xmm14");

  x = 6.7 * t;
  y = 45.234 + t;
  z = y * t + 5.6 * x;
  return z;
}

double
test_xmm15 (double t)
{
  register double x asm ("xmm11");
  register double y asm ("xmm12");
  register double z asm ("xmm15");

  x = 6.7 * t;
  y = 45.234 + t;
  z = y * t + 5.6 * x;
  return z;
}

int
main ()
{
  register double z asm ("xmm15");

  z = 56.8;
  z = test_xmm14 (z);
  z = test_xmm15 (z);
  return 0;
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>End of source file

$ gdb-mingw64 ./xmm15-problem-mingw64.exe
GNU gdb (GDB) 7.8.50.20141003-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./xmm15-problem-mingw64.exe...done.
(gdb) start
Temporary breakpoint 1 at 0x40163c: file xmm15-problem.c, line 34.
Starting program: E:\cygwin-32\home\Pierre\test\xmm15-problem-mingw64.exe
[New Thread 8040.0x1f38]

Temporary breakpoint 1, main () at xmm15-problem.c:34
34        z = 56.8;
(gdb) n
35        z = test_xmm14 (z);
(gdb) p z
$1 = 56.799999999999997
(gdb) p &z
Address requested for identifier "z" which is in register $xmm15
(gdb) p $xmm15
$2 = {v4_float = {2.72008302e+023, 3.1937499, 0, 0}, v2_double = {
    56.799999999999997, 0}, v16_int8 = {102, 102, 102, 102, 102, 102, 76, 64,
    0, 0, 0, 0, 0, 0, 0, 0}, v8_int16 = {26214, 26214, 26214, 16460, 0, 0, 0,
    0}, v4_int32 = {1717986918, 1078748774, 0, 0}, v2_int64 = {
    4633190706648082022, 0}, uint128 = 4633190706648082022}
(gdb) inf vec
xmm0           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
  v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
  uint128 = 0x00000000000000000000000000000000}

.........Other xmm registers removed.
xmm15          {v4_float = {0x0, 0x3, 0x0, 0x0}, v2_double = {0x38, 0x0},
  v16_int8 = {0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x4c, 0x40, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {0x6666, 0x6666, 0x6666, 0x404c,
    0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x66666666, 0x404c6666, 0x0, 0x0},
  v2_int64 = {0x404c666666666666, 0x0},
  uint128 = 0x0000000000000000404c666666666666}

As you can see, the v2_double field,
is written out as {0x38, 0x0}, which corresponds to the
integer part 56 of 56.8.

  It is a pity that the default command to
display vector registers does not give the full information
on the value for floating point fields.

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


             reply	other threads:[~2014-10-07 15:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-07 15:26 muller at ics dot u-strasbg.fr [this message]
2024-01-02 17:13 ` [Bug gdb/17464] " ssbssa at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-17464-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).