Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: gdb-patches@sourceware.org
Cc: thiago.bauermann@gmail.com
Subject: [rfc] Show POWER7 VSX register contents in double-precision format
Date: Wed, 16 Sep 2009 16:33:00 -0000	[thread overview]
Message-ID: <200909161633.n8GGXm39002027@d12av02.megacenter.de.ibm.com> (raw)

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


             reply	other threads:[~2009-09-16 16:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-16 16:33 Ulrich Weigand [this message]
2009-09-18 15:51 ` Ulrich Weigand

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=200909161633.n8GGXm39002027@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=thiago.bauermann@gmail.com \
    /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