]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[PowerPC] Fix inclusion of dfp pseudoregs in tdep
authorPedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
Tue, 22 May 2018 14:09:05 +0000 (11:09 -0300)
committerPedro Franco de Carvalho <pedromfc@linux.vnet.ibm.com>
Tue, 22 May 2018 14:52:03 +0000 (11:52 -0300)
Previously, decimal floating point pseudoregisters were always included
in the target if it had a floating point unit.

This patch changes this to only include them if the target description
indicates that they are present, i.e. if the FPSCR register has more
than 32 bits.

gdb/ChangeLog:
2018-05-22  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>

* rs6000-tdep.c (rs6000_gdbarch_init): Assign 1 to have_dfp only
if the size of fpscr is larger than 32 bits.

gdb/ChangeLog
gdb/rs6000-tdep.c

index 9e74395b46f38b89902e837ca3b928c97f58c699..db8a6a7f630f4319d020d489bbfbfdf5b96314c3 100644 (file)
@@ -1,3 +1,8 @@
+2018-05-22  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
+
+       * rs6000-tdep.c (rs6000_gdbarch_init): Assign 1 to have_dfp only
+       if the size of fpscr is larger than 32 bits.
+
 2018-05-22  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
 
        * ppc-linux-tdep.c (ppc_linux_vsxregset): New function.
index 0a56c7890ad175515a069df9d0dab0254fdbe51c..ff4699c1918dec4db55bcc802c67b112677d629a 100644 (file)
@@ -5981,14 +5981,16 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
              return NULL;
            }
          have_fpu = 1;
+
+         /* The fpscr register was expanded in isa 2.05 to 64 bits
+            along with the addition of the decimal floating point
+            facility.  */
+         if (tdesc_register_size (feature, "fpscr") > 32)
+           have_dfp = 1;
        }
       else
        have_fpu = 0;
 
-      /* The DFP pseudo-registers will be available when there are floating
-         point registers.  */
-      have_dfp = have_fpu;
-
       feature = tdesc_find_feature (tdesc,
                                    "org.gnu.gdb.power.altivec");
       if (feature != NULL)