From: Andrew Burgess Date: Thu, 13 Dec 2018 19:06:23 +0000 (+0000) Subject: gdb/riscv: Add float status registers to save and restore reggroups X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ecc82c059059cfa21a8a099779253686f9637f9f;p=binutils-gdb.git gdb/riscv: Add float status registers to save and restore reggroups We should save and restore the floating point status registers. This became an issue when testing 32-bit float on a target with 64-bit with the gdb.base/callfuncs.exp test. gdb/ChangeLog: * riscv-tdep.c (riscv_register_reggroup_p): Save and restore fcsr, fflags, and frm registers. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ea003617f25..513bc7ceb08 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-12-22 Andrew Burgess + + * riscv-tdep.c (riscv_register_reggroup_p): Save and restore fcsr, + fflags, and frm registers. + 2018-12-22 Andrew Burgess * riscv-tdep.c (riscv_dwarf_reg_to_regnum): New function. diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index 3408f5a21df..704e8512b3d 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -896,7 +896,10 @@ riscv_register_reggroup_p (struct gdbarch *gdbarch, int regnum, else if (reggroup == restore_reggroup || reggroup == save_reggroup) { if (riscv_has_fp_regs (gdbarch)) - return regnum <= RISCV_LAST_FP_REGNUM; + return (regnum <= RISCV_LAST_FP_REGNUM + || regnum == RISCV_CSR_FCSR_REGNUM + || regnum == RISCV_CSR_FFLAGS_REGNUM + || regnum == RISCV_CSR_FRM_REGNUM); else return regnum < RISCV_FIRST_FP_REGNUM; }