[01/17,PowerPC] Simplify rs6000_pseudo_register_reggroup_p

Message ID 20180713135226.2321-2-pedromfc@linux.ibm.com
State New
Headers show
Series
  • GDB support for more powerpc registers on linux
Related show

Commit Message

Pedro Franco de Carvalho July 13, 2018, 1:52 p.m.
This patch changes rs6000_register_reggroup_p to use
default_register_reggroup_p when possible.

Group membership for SPE, VSX and EFP pseudoregisters can be detected
through their types in default_register_reggroup_p. DFP pseudoregs
still need special handling when checking membership to the float
group, because default_register_reggroup_p doesn't consider registers
with type code TYPE_CODE_DECFLOAT to be part of the float group.

gdb/ChangeLog:
YYYY-MM-DD  Pedro Franco de Carvalho  <pedromfc@linux.ibm.com>

	* rs6000-tdep.c (rs6000_pseudo_register_reggroup_p): Call
	default_register_reggroup_p.
---
 gdb/rs6000-tdep.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

-- 
2.13.6

Patch

diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 4eeb62ac52..55ce22ea85 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -2423,12 +2423,12 @@  rs6000_pseudo_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
 	      || IS_VSX_PSEUDOREG (tdep, regnum)
 	      || IS_EFP_PSEUDOREG (tdep, regnum));
 
-  /* These are the e500 pseudo-registers or the POWER7 VSX registers.  */
-  if (IS_SPE_PSEUDOREG (tdep, regnum) || IS_VSX_PSEUDOREG (tdep, regnum))
-    return group == all_reggroup || group == vector_reggroup;
-  else
-    /* PPC decimal128 or Extended FP pseudo-registers.  */
-    return group == all_reggroup || group == float_reggroup;
+  /* builtin_declong doesn't have TYPE_CODE_FLT, so it won't be
+     detected as a float register by default_register_reggroup_p.  */
+  if (IS_DFP_PSEUDOREG (tdep, regnum) && group == float_reggroup)
+    return 1;
+
+  return default_register_reggroup_p (gdbarch, regnum, group);
 }
 
 /* The register format for RS/6000 floating point registers is always