From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8630 invoked by alias); 14 Feb 2011 13:47:57 -0000 Received: (qmail 8618 invoked by uid 22791); 14 Feb 2011 13:47:56 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,TW_CP,TW_EG,TW_XV,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate4.uk.ibm.com (HELO mtagate4.uk.ibm.com) (194.196.100.164) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Feb 2011 13:47:48 +0000 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate4.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p1EDljJL029795 for ; Mon, 14 Feb 2011 13:47:45 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p1EDlo7e1814632 for ; Mon, 14 Feb 2011 13:47:50 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p1EDljM8008516 for ; Mon, 14 Feb 2011 06:47:45 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p1EDlh9T008428; Mon, 14 Feb 2011 06:47:43 -0700 Message-Id: <201102141347.p1EDlh9T008428@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 14 Feb 2011 14:47:43 +0100 Subject: Re: [RFA] Fix Power7 extended floating point pseudo-registers To: bauerman@br.ibm.com (Thiago Jung Bauermann) Date: Mon, 14 Feb 2011 14:16:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org (gdb-patches ml) In-Reply-To: <1297280713.12781.84.camel@hactar> from "Thiago Jung Bauermann" at Feb 09, 2011 05:45:13 PM 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: 2011-02/txt/msg00276.txt.bz2 Thiago Jung Bauermann wrote: > 2011-02-09 Thiago Jung Bauermann > > gdb/ > * rs6000-tdep.c (IS_EFP_PSEUDOREG): Use correct constant for > the EFP register set size. > (efpr_pseudo_register_read): Use intermediary buffer to read > data from the VMX register. > (efpr_pseudo_register_write): Use intermediary buffer to read > and write data from/to the VMX register. > > gdb/testsuite/ > * gdb.arch/vsx-regs.exp: Add "vector_register1_vr" and > "vector_register2_vr" test strings. Test the extended floating > point registers (F32~F63). > * lib/gdb.exp (skip_vsx_tests): Update compile flags for the > IBM XL C compiler. Make the test program use a register provided > by the compiler for the lxvd2x instruction. This looks good to me, except: > @@ -2720,10 +2720,12 @@ efpr_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, > { > struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); > int reg_index = reg_nr - tdep->ppc_efpr0_regnum; > + int vr_reg_nr = tdep->ppc_vr0_regnum + reg_index; > + gdb_byte vr_reg_buf[MAX_REGISTER_SIZE]; > > - /* Read the portion that overlaps the VMX registers. */ > - regcache_raw_read (regcache, tdep->ppc_vr0_regnum + > - reg_index, buffer); > + /* Read the portion that overlaps the VMX register. */ > + regcache_raw_read (regcache, vr_reg_nr, vr_reg_buf); > + memcpy (buffer, vr_reg_buf, register_size (gdbarch, reg_nr)); > } This just re-implements regcache_raw_read_part, doesn't it? You should be just using that routine instead (and likewise for _write). Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com