This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfc] Show POWER7 VSX register contents in double-precision format
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Cc: thiago dot bauermann at gmail dot com
- Date: Wed, 16 Sep 2009 18:33:48 +0200 (CEST)
- Subject: [rfc] Show POWER7 VSX register contents in double-precision format
Hello,
GDB currently uses the following data type to print contents of
POWER7 VSX registers:
type = union __ppc_builtin_type_vec128 {
uint128_t uint128;
float v4_float[4];
int32_t v4_int32[4];
int16_t v8_int16[8];
int8_t v16_int8[16];
}
However, it's been pointed out to me that VSX also supports
operations on vectors of two "double" values. Therefore it
would be useful to also show the register contents in that
format ...
The following patch implements this by adding a v2_double
member to the above union type.
Any reason why this wouldn't be a good idea?
Tested on powerpc64-linux with no regressions.
I'm planning on committing this within the next couple
of days.
Bye,
Ulrich
ChangeLog:
* rs6000-tdep.c (rs6000_builtin_type_vec128): Add v2_double
union member.
Index: gdb/rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.336
diff -u -p -r1.336 rs6000-tdep.c
--- gdb/rs6000-tdep.c 31 Jul 2009 15:23:20 -0000 1.336
+++ gdb/rs6000-tdep.c 16 Sep 2009 15:06:53 -0000
@@ -2311,6 +2311,7 @@ rs6000_builtin_type_vec128 (struct gdbar
type = union __ppc_builtin_type_vec128 {
uint128_t uint128;
+ double v2_double[2];
float v4_float[4];
int32_t v4_int32[4];
int16_t v8_int16[8];
@@ -2323,6 +2324,8 @@ rs6000_builtin_type_vec128 (struct gdbar
t = arch_composite_type (gdbarch,
"__ppc_builtin_type_vec128", TYPE_CODE_UNION);
append_composite_type_field (t, "uint128", bt->builtin_uint128);
+ append_composite_type_field (t, "v2_double",
+ init_vector_type (bt->builtin_double, 2));
append_composite_type_field (t, "v4_float",
init_vector_type (bt->builtin_float, 4));
append_composite_type_field (t, "v4_int32",
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com