public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/17464] New: Strange display of vector registers
@ 2014-10-07 15:26 muller at ics dot u-strasbg.fr
  2024-01-02 17:13 ` [Bug gdb/17464] " ssbssa at sourceware dot org
  0 siblings, 1 reply; 2+ messages in thread
From: muller at ics dot u-strasbg.fr @ 2014-10-07 15:26 UTC (permalink / raw)
  To: gdb-prs

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.


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

* [Bug gdb/17464] Strange display of vector registers
  2014-10-07 15:26 [Bug gdb/17464] New: Strange display of vector registers muller at ics dot u-strasbg.fr
@ 2024-01-02 17:13 ` ssbssa at sourceware dot org
  0 siblings, 0 replies; 2+ messages in thread
From: ssbssa at sourceware dot org @ 2024-01-02 17:13 UTC (permalink / raw)
  To: gdb-prs

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

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ssbssa at sourceware dot org

--- Comment #1 from Hannes Domani <ssbssa at sourceware dot org> ---
Note that since [1] the output is slightly different:
```
(gdb) info registers xmm15
xmm15          {v8_bfloat16 = {0x6666, 0x6666, 0x6666, 0x404c, 0x0, 0x0, 0x0,
0x0}, v8_half = {0x6666, 0x6666, 0x6666, 0x404c, 0x0, 0x0, 0x0, 0x0}, v4_float
= {0x66666666, 0x404c6666, 0x0, 0x0}, v2_double = {0x404c666666666666, 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 = 0x404c666666666666}
```

But it's still hexadecimal.

[1]
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=56262a931b7ca8ee3ec9104bc7e9e0b40cf3d64e

-- 
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:[~2024-01-02 17:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-07 15:26 [Bug gdb/17464] New: Strange display of vector registers muller at ics dot u-strasbg.fr
2024-01-02 17:13 ` [Bug gdb/17464] " ssbssa at sourceware dot org

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).