From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19519 invoked by alias); 16 Sep 2009 16:33:58 -0000 Received: (qmail 19510 invoked by uid 22791); 16 Sep 2009 16:33:57 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtagate4.de.ibm.com (HELO mtagate4.de.ibm.com) (195.212.17.164) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Sep 2009 16:33:52 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.13.1/8.13.1) with ESMTP id n8GGXnJm018624 for ; Wed, 16 Sep 2009 16:33:49 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n8GGXnPW2801876 for ; Wed, 16 Sep 2009 18:33:49 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n8GGXneB002038 for ; Wed, 16 Sep 2009 18:33:49 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id n8GGXm39002027; Wed, 16 Sep 2009 18:33:48 +0200 Message-Id: <200909161633.n8GGXm39002027@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 16 Sep 2009 18:33:48 +0200 Subject: [rfc] Show POWER7 VSX register contents in double-precision format To: gdb-patches@sourceware.org Date: Wed, 16 Sep 2009 16:33:00 -0000 From: "Ulrich Weigand" Cc: thiago.bauermann@gmail.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00518.txt.bz2 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