From: Andrew Cagney Date: Tue, 13 Nov 2001 03:10:35 +0000 (+0000) Subject: Eliminate REGISTER_CONVERTIBLE(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0cb2e7c50f6723f6ad9a492425a4826a963b36ba;p=binutils-gdb.git Eliminate REGISTER_CONVERTIBLE(). --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d29e0471485..1126b23ca96 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2001-11-10 Andrew Cagney + + * config/i960/tm-nindy960.h (REGISTER_CONVERTIBLE) + (REGISTER_CONVERT_TO_RAW, REGISTER_CONVERT_TO_VIRTUAL): Delete + undef. + * i960-tdep.c (i960_register_type): New function. + * config/i960/tm-i960.h (REGISTER_CONVERTIBLE): Delete. + (REGISTER_CONVERT_TO_VIRTUAL): Delete. + (REGISTER_CONVERT_TO_RAW): Delete. + (REGISTER_VIRTUAL_TYPE): Update. Call i960_register_type. + 2001-11-10 Andrew Cagney * m88k-tdep.c (m88k_register_type): New function. diff --git a/gdb/config/i960/tm-i960.h b/gdb/config/i960/tm-i960.h index ab4262035be..f47b880e8a5 100644 --- a/gdb/config/i960/tm-i960.h +++ b/gdb/config/i960/tm-i960.h @@ -156,39 +156,15 @@ extern CORE_ADDR saved_pc_after_call (); #define MAX_REGISTER_VIRTUAL_SIZE 8 -/* Nonzero if register N requires conversion from raw format to virtual - format. */ - -#define REGISTER_CONVERTIBLE(N) ((N) >= FP0_REGNUM) - #include "floatformat.h" #define TARGET_LONG_DOUBLE_FORMAT &floatformat_i960_ext -/* Convert data from raw format for register REGNUM in buffer FROM - to virtual format with type TYPE in buffer TO. */ - -#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \ -{ \ - DOUBLEST val; \ - floatformat_to_doublest (&floatformat_i960_ext, (FROM), &val); \ - store_floating ((TO), TYPE_LENGTH (TYPE), val); \ -} - -/* Convert data from virtual format with type TYPE in buffer FROM - to raw format for register REGNUM in buffer TO. */ - -#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \ -{ \ - DOUBLEST val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \ - floatformat_from_doublest (&floatformat_i960_ext, &val, (TO)); \ -} - /* Return the GDB type object for the "standard" data type of data in register N. */ -#define REGISTER_VIRTUAL_TYPE(N) ((N) < FP0_REGNUM ? \ - builtin_type_int : builtin_type_double) +struct type *i960_register_type (int regnum); +#define REGISTER_VIRTUAL_TYPE(N) i960_register_type (N) /* Macros for understanding function return values... */ diff --git a/gdb/config/i960/tm-nindy960.h b/gdb/config/i960/tm-nindy960.h index 1a958734a2e..e9cb99c9f4b 100644 --- a/gdb/config/i960/tm-nindy960.h +++ b/gdb/config/i960/tm-nindy960.h @@ -104,7 +104,3 @@ extern int */ #define DECR_PC_AFTER_BREAK 0 - -#undef REGISTER_CONVERT_TO_VIRTUAL -#undef REGISTER_CONVERT_TO_RAW -#undef REGISTER_CONVERTIBLE diff --git a/gdb/i960-tdep.c b/gdb/i960-tdep.c index 197ac103eaf..053c7fa4c87 100644 --- a/gdb/i960-tdep.c +++ b/gdb/i960-tdep.c @@ -34,6 +34,16 @@ static CORE_ADDR next_insn (CORE_ADDR memaddr, unsigned int *pword1, unsigned int *pword2); +struct type * +i960_register_type (int regnum) +{ + if (regnum < FP0_REGNUM) + return builtin_type_int32; + else + return builtin_type_i960_ext; +} + + /* Does the specified function use the "struct returning" convention or the "value returning" convention? The "value returning" convention almost invariably returns the entire value in registers. The