From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112448 invoked by alias); 11 Jan 2019 06:59:42 -0000 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 Received: (qmail 112437 invoked by uid 89); 11 Jan 2019 06:59:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 11 Jan 2019 06:59:39 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghqn3-0004yS-O3; Fri, 11 Jan 2019 01:59:37 -0500 Received: from [176.228.60.248] (port=2595 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ghqn3-0001NR-AF; Fri, 11 Jan 2019 01:59:37 -0500 Date: Fri, 11 Jan 2019 06:59:00 -0000 Message-Id: <83tvifhe7d.fsf@gnu.org> From: Eli Zaretskii To: Pedro Franco de Carvalho CC: gdb-patches@sourceware.org, uweigand@de.ibm.com In-reply-to: <20190110194434.842-1-pedromfc@linux.ibm.com> (message from Pedro Franco de Carvalho on Thu, 10 Jan 2019 17:44:33 -0200) Subject: Re: [PATCH] [PowerPC] Aliases for vector registers References: <20190110194434.842-1-pedromfc@linux.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00237.txt.bz2 > From: Pedro Franco de Carvalho > Cc: uweigand@de.ibm.com > Date: Thu, 10 Jan 2019 17:44:33 -0200 > > This patch defines pseudo-registers "v0" through "v31" as aliases that > map to the corresponding raw "vr0" through "vr31" vector registers for > Power. > > The motivation behind this is that although GDB defines these > registers as "vrX", the disassembler prints them as "vX", e.g. as the > operands in instructions such as "vaddubm v2,v1,v1". This can be > confusing to users trying to print out the values of the operands > while inspecting the disassembled code. > > The new aliases are made not to belong to any register group, to avoid > duplicated values in "info register vector" and "info register all". > The arch-specific rs6000_pseudo_register_reggroup_p function had > previously been removed since the other pseudo-registers could have > their groups inferred by their type. It restored with this patch to > handle the aliases. Membership for the other pseudo-registers is > still determined using the default function. > > A new tests checks that GDB prints the expected values of vector > registers after they are filled by the inferior, by using both the raw > names and the aliases. Two other existing tests are modified to also > test the aliases. > > gdb/ChangeLog: > 2019-01-10 Pedro Franco de Carvalho > > * ppc-tdep.h (struct gdbarch_tdep) : New > field. > * rs6000-tdep.c: Include reggroups.h. > (IS_V_ALIAS_PSEUDOREG): Define. > (rs6000_register_name): Return names for the "vX" aliases. > (rs6000_pseudo_register_type): Return type for the "vX" aliases. > (rs6000_pseudo_register_reggroup_p): Restore. Handle "vX" > aliases. Call default_register_reggroup_p for all other > pseudo-registers. > (v_alias_pseudo_register_read, v_alias_pseudo_register_write): > New functions. > (rs6000_pseudo_register_read, rs6000_pseudo_register_write): > Handle "vX" aliases. > (v_alias_pseudo_register_collect): New function. > (rs6000_ax_pseudo_register_collect): Handle "vX" aliases. > (rs6000_gdbarch_init): Initialize "vX" aliases as > pseudo-registers. Restore registration of > rs6000_pseudo_register_reggroup_p with > set_tdesc_pseudo_register_reggroup_p. > > gdb/testsuite/ChangeLog: > 2019-01-10 Pedro Franco de Carvalho > > * gdb.arch/vsx-regs.exp: Add tests that use the vector register > aliases. > * gdb.arch/altivec-regs.exp: Likewise. Fix indentation of two > tests. > * gdb.arch/powerpc-vector-regs.c: New file. > * gdb.arch/powerpc-vector-regs.exp: New file. > > gdb/doc/ChangeLog: > 2019-01-10 Pedro Franco de Carvalho > > * gdb.texinfo (PowerPC Features): Document the alias > pseudo-registers for the org.gnu.gdb.power.altivec feature. The gdb.texinfo part is approved. Thanks.