mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 01:07:52 +00:00
* defs.h, findvar.c (extract_floating, store_floating): New functions.
* Move SWAP_TARGET_AND_HOST from defs.h to findvar.c because it is now used only by extract_floating and store_floating. * valprint.c (print_floating): Use unsigned arithmetic. Use extract_unsigned_integer instead of SWAP_TARGET_AND_HOST. Change sizeof (float) to 4 and sizeof (double) to 8 (those are always the relevant sizes for this code, which is in #ifdef IEEE_FLOAT). * values.c (unpack_long, unpack_double, value_from_double), valarith.c (value_binop), stabsread.c (define_symbol): Use extract_floating and store_floating instead of SWAP_TARGET_AND_HOST. * config/m68k/tm-m68k.h, config/i960/tm-i960.h (REGISTER_CONVERT_*): Use extract_floating and store_floating. * config/m88k/tm-m88k.h: Add comments (it should be doing the same). * i386-tdep.c (i386_extract_return_value), * remote-nindy.c (nindy_store_registers): Use store_floating.
This commit is contained in:
@@ -472,7 +472,7 @@ nindy_store_registers(regno)
|
||||
int regno;
|
||||
{
|
||||
struct nindy_regs nindy_regs;
|
||||
int regnum, inv;
|
||||
int regnum;
|
||||
double dub;
|
||||
|
||||
memcpy (nindy_regs.local_regs, ®isters[REGISTER_BYTE (R0_REGNUM)], 16*4);
|
||||
@@ -480,18 +480,14 @@ nindy_store_registers(regno)
|
||||
memcpy (nindy_regs.pcw_acw, ®isters[REGISTER_BYTE (PCW_REGNUM)], 2*4);
|
||||
memcpy (nindy_regs.ip, ®isters[REGISTER_BYTE (IP_REGNUM)], 1*4);
|
||||
memcpy (nindy_regs.tcw, ®isters[REGISTER_BYTE (TCW_REGNUM)], 1*4);
|
||||
/* Float regs. Only works on IEEE_FLOAT hosts. FIXME! */
|
||||
for (regnum = FP0_REGNUM; regnum < FP0_REGNUM + 4; regnum++) {
|
||||
ieee_extended_to_double (&ext_format_i960,
|
||||
®isters[REGISTER_BYTE (regnum)], &dub);
|
||||
/* dub now in host byte order */
|
||||
/* FIXME-someday, the arguments to unpack_double are backward.
|
||||
It expects a target double and returns a host; we pass the opposite.
|
||||
This mostly works but not quite. */
|
||||
dub = unpack_double (builtin_type_double, (char *)&dub, &inv);
|
||||
/* dub now in target byte order */
|
||||
memcpy (&nindy_regs.fp_as_double[8 * (regnum - FP0_REGNUM)], &dub, 8);
|
||||
}
|
||||
for (regnum = FP0_REGNUM; regnum < FP0_REGNUM + 4; regnum++)
|
||||
{
|
||||
ieee_extended_to_double (&ext_format_i960,
|
||||
®isters[REGISTER_BYTE (regnum)], &dub);
|
||||
store_floating (&nindy_regs.fp_as_double[8 * (regnum - FP0_REGNUM)],
|
||||
REGISTER_VIRTUAL_SIZE (regnum),
|
||||
dub);
|
||||
}
|
||||
|
||||
immediate_quit++;
|
||||
ninRegsPut( (char *) &nindy_regs );
|
||||
|
||||
Reference in New Issue
Block a user