aboutsummaryrefslogtreecommitdiff
path: root/gdb/config/i960
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-10-29 18:16:33 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-10-29 18:16:33 +0000
commitbf5c0d644899aa224fcac5eb0b5dff2002d6448c (patch)
treec10acbcabf8139066784b8d7f465617b458dee71 /gdb/config/i960
parente1ec9f078ff7293455d25741056f3fa633deaebf (diff)
downloadgdb-bf5c0d644899aa224fcac5eb0b5dff2002d6448c.zip
gdb-bf5c0d644899aa224fcac5eb0b5dff2002d6448c.tar.gz
gdb-bf5c0d644899aa224fcac5eb0b5dff2002d6448c.tar.bz2
* 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.
Diffstat (limited to 'gdb/config/i960')
-rw-r--r--gdb/config/i960/tm-i960.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/gdb/config/i960/tm-i960.h b/gdb/config/i960/tm-i960.h
index 1337362..9523800 100644
--- a/gdb/config/i960/tm-i960.h
+++ b/gdb/config/i960/tm-i960.h
@@ -169,26 +169,32 @@ extern CORE_ADDR saved_pc_after_call ();
extern struct ext_format ext_format_i960;
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
+#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
{ \
- if ((REGNUM) >= FP0_REGNUM) \
- ieee_extended_to_double (&ext_format_i960, (FROM), (double *)(TO)); \
- else \
+ double val; \
+ if ((REGNUM) >= FP0_REGNUM && (REGNUM) < FPC_REGNUM) \
+ { \
+ ieee_extended_to_double (&ext_format_i960, (FROM), &val); \
+ store_floating ((TO), REGISTER_VIRTUAL_SIZE (REGNUM), val); \
+ } \
+ else \
memcpy ((TO), (FROM), 4); \
}
/* Convert data from virtual format for register REGNUM
to raw format for register REGNUM. */
-#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
+#define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
{ \
- if ((REGNUM) >= FP0_REGNUM) \
- double_to_ieee_extended (&ext_format_i960, (double *)(FROM), (TO)); \
- else \
- memcpy ((TO), (FROM), 4); \
+ if ((REGNUM) >= FP0_REGNUM && (REGNUM) < FPC_REGNUM) \
+ { \
+ double val = extract_floating ((FROM), REGISTER_VIRTUAL_SIZE (REGNUM)); \
+ double_to_ieee_extended (&ext_format_i960, &val, (TO)); \
+ } \
+ else \
+ memcpy ((TO), (FROM), 4); \
}
-
/* Return the GDB type object for the "standard" data type
of data in register N. */