+supply_fpregset (elf_fpregset_t *fpregsetp)
+{
+ int reg;
+
+ /* Supply the floating-point registers. */
+ for (reg = 0; reg < 8; reg++)
+ supply_register (FP0_REGNUM + reg, FPREG_ADDR (fpregsetp, reg));
+
+ supply_register (FCTRL_REGNUM, (char *) &fpregsetp->cwd);
+ supply_register (FSTAT_REGNUM, (char *) &fpregsetp->swd);
+ supply_register (FTAG_REGNUM, (char *) &fpregsetp->twd);
+ supply_register (FCOFF_REGNUM, (char *) &fpregsetp->fip);
+ supply_register (FDS_REGNUM, (char *) &fpregsetp->fos);
+ supply_register (FDOFF_REGNUM, (char *) &fpregsetp->foo);
+
+ /* Extract the code segment and opcode from the "fcs" member. */
+ {
+ long l;
+
+ l = fpregsetp->fcs & 0xffff;
+ supply_register (FCS_REGNUM, (char *) &l);
+
+ l = (fpregsetp->fcs >> 16) & ((1 << 11) - 1);
+ supply_register (FOP_REGNUM, (char *) &l);
+ }
+}
+
+/* Convert the valid floating-point register values in GDB's register
+ array to `struct user' format and store them in *FPREGSETP. The
+ array VALID indicates which register values are valid. If VALID is
+ NULL, all registers are assumed to be valid. */
+
+static void
+convert_to_fpregset (elf_fpregset_t *fpregsetp, signed char *valid)
+{
+ int reg;
+
+ /* Fill in the floating-point registers. */
+ for (reg = 0; reg < 8; reg++)
+ if (!valid || valid[reg])
+ memcpy (FPREG_ADDR (fpregsetp, reg),
+ ®isters[REGISTER_BYTE (FP0_REGNUM + reg)],
+ REGISTER_RAW_SIZE(FP0_REGNUM + reg));
+
+#define fill(MEMBER, REGNO) \
+ if (! valid || valid[(REGNO)]) \
+ memcpy (&fpregsetp->MEMBER, ®isters[REGISTER_BYTE (REGNO)], \
+ sizeof (fpregsetp->MEMBER))
+
+ fill (cwd, FCTRL_REGNUM);
+ fill (swd, FSTAT_REGNUM);
+ fill (twd, FTAG_REGNUM);
+ fill (fip, FCOFF_REGNUM);
+ fill (foo, FDOFF_REGNUM);
+ fill (fos, FDS_REGNUM);
+
+#undef fill
+
+ if (! valid || valid[FCS_REGNUM])
+ fpregsetp->fcs
+ = ((fpregsetp->fcs & ~0xffff)
+ | (* (int *) ®isters[REGISTER_BYTE (FCS_REGNUM)] & 0xffff));
+
+ if (! valid || valid[FOP_REGNUM])
+ fpregsetp->fcs
+ = ((fpregsetp->fcs & 0xffff)
+ | ((*(int *) ®isters[REGISTER_BYTE (FOP_REGNUM)] & ((1 << 11) - 1))
+ << 16));
+}
+
+/* Fill register REGNO (if it is a floating-point register) in
+ *FPREGSETP with the value in GDB's register array. If REGNO is -1,
+ do this for all registers. */
+
+void
+fill_fpregset (elf_fpregset_t *fpregsetp, int regno)