diff options
author | Mark Kettenis <kettenis@gnu.org> | 2000-03-26 21:21:50 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2000-03-26 21:21:50 +0000 |
commit | ac27f131b2fc0c5e0872c5855c599974b7416d07 (patch) | |
tree | 399afc0505a8f76691e4d2f234516cd003e5961e /gdb/i386-tdep.c | |
parent | 9f10757c407c9946029436682ae554f9739fa62d (diff) | |
download | gdb-ac27f131b2fc0c5e0872c5855c599974b7416d07.zip gdb-ac27f131b2fc0c5e0872c5855c599974b7416d07.tar.gz gdb-ac27f131b2fc0c5e0872c5855c599974b7416d07.tar.bz2 |
2000-03-26 Mark Kettenis <kettenis@gnu.org>
Provide `long double' support for most i386 targets.
* config/i386/tm-i386.h (TARGET_LONG_DOUBLE_FORMAT): Define as
&floatformat_i387_ext.
(TARGET_LONG_DOUBLE_BITS): Define as 96.
(REGISTER_VIRTUAL_TYPE): Change type for FPU registers to
`builtin_type_long_double'.
(REGISTER_CONVERT_TO_VIRTUAL): Call
i386_register_convert_to_virtual.
(REGISTER_CONVERT_TO_RAW): Call i386_register_convert_to_raw.
(i387_to_double, double_to_i387): Remove prototypes.
(i386_extract_return_value): Change prototype to match definition
in i386-tdep.c.
* config/i386/tm-i386mk.h (TARGET_LONG_DOUBLE_FORMAT): #undef.
(TARGET_LONG_DOUBLE_BITS): #undef.
* config/i386/tm-linux.h (TARGET_LONG_DOUBLE_BIT): Remove.
[HAVE_LONG_DOUBLE && HOST_I386] (LD_I387): Remove.
(i387_extract_floating, i387_store_floating): Remove prototypes.
(TARGET_EXTRACT_FLOATING, TARGET_STORE_FLOATING): Remove.
(REGISTER_CONVERT_TO_VIRTUAL, REGOISTER_CONVERT_TO_RAW): Remove.
(REGISTER_VIRTUAL_TYPE): Remove.
* i386-tdep.c (i386_register_convert_to_virtual): New function.
(i386_register_convert_to_raw): New function.
* i387-tdep.c [LD_I387] (i387_extract_floating): Remove.
(i387_store_floating): Remove.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r-- | gdb/i386-tdep.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 421a7a0..39990db 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -761,6 +761,32 @@ i386_extract_return_value (struct type *type, char *regbuf, char *valbuf) } } +/* Convert data from raw format for register REGNUM in buffer FROM to + virtual format with type TYPE in buffer TO. In principle both + formats are identical except that the virtual format has two extra + bytes appended that aren't used. We set these to zero. */ + +void +i386_register_convert_to_virtual (int regnum, struct type *type, + char *from, char *to) +{ + /* Copy straight over, but take care of the padding. */ + memcpy (to, from, FPU_REG_RAW_SIZE); + memset (to + FPU_REG_RAW_SIZE, 0, TYPE_LENGTH (type) - FPU_REG_RAW_SIZE); +} + +/* Convert data from virtual format with type TYPE in buffer FROM to + raw format for register REGNUM in buffer TO. Simply omit the two + unused bytes. */ + +void +i386_register_convert_to_raw (struct type *type, int regnum, + char *from, char *to) +{ + memcpy (to, from, FPU_REG_RAW_SIZE); +} + + #ifdef I386V4_SIGTRAMP_SAVED_PC /* Get saved user PC for sigtramp from the pushed ucontext on the stack for all three variants of SVR4 sigtramps. */ |