aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-01-20 18:05:54 +0000
committerAndrew Cagney <cagney@redhat.com>2002-01-20 18:05:54 +0000
commitc2f05ac92e7fe9e3161ae09ea3f9e0937af42abc (patch)
tree766a0ffadb76b1de1e4fe885959760c3e720b962 /gdb
parent56248298dc57e763e4e8afbd90926bc19e25b3ac (diff)
downloadgdb-c2f05ac92e7fe9e3161ae09ea3f9e0937af42abc.zip
gdb-c2f05ac92e7fe9e3161ae09ea3f9e0937af42abc.tar.gz
gdb-c2f05ac92e7fe9e3161ae09ea3f9e0937af42abc.tar.bz2
Eliminate IEEE_FLOAT.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog33
-rw-r--r--gdb/config/alpha/tm-alpha.h3
-rw-r--r--gdb/config/arc/tm-arc.h3
-rw-r--r--gdb/config/arm/tm-arm.h1
-rw-r--r--gdb/config/fr30/tm-fr30.h3
-rw-r--r--gdb/config/h8300/tm-h8300.h1
-rw-r--r--gdb/config/h8500/tm-h8500.h2
-rw-r--r--gdb/config/i386/tm-i386.h5
-rw-r--r--gdb/config/i960/tm-i960.h4
-rw-r--r--gdb/config/m68k/tm-m68k.h2
-rw-r--r--gdb/config/m88k/tm-m88k.h2
-rw-r--r--gdb/config/pa/tm-hppa.h4
-rw-r--r--gdb/config/sparc/tm-sparc.h3
-rw-r--r--gdb/config/z8k/tm-z8k.h2
-rw-r--r--gdb/cris-tdep.c3
-rw-r--r--gdb/doc/ChangeLog5
-rw-r--r--gdb/doc/gdbint.texinfo4
-rw-r--r--gdb/doublest.c23
-rw-r--r--gdb/doublest.h6
-rw-r--r--gdb/gdbarch.c27
-rw-r--r--gdb/gdbarch.h16
-rwxr-xr-xgdb/gdbarch.sh2
-rw-r--r--gdb/m68hc11-tdep.c1
-rw-r--r--gdb/mips-tdep.c1
-rw-r--r--gdb/s390-tdep.c1
-rw-r--r--gdb/sh-tdep.c1
-rw-r--r--gdb/sparc-tdep.c1
-rw-r--r--gdb/valprint.c25
-rw-r--r--gdb/x86-64-tdep.c2
29 files changed, 69 insertions, 117 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e247174..11ec997 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,36 @@
+2002-01-20 Andrew Cagney <ac131313@redhat.com>
+
+ * doublest.h (floatformat_from_type): Declare.
+ * doublest.c (floatformat_from_type): New function.
+ (convert_typed_floating): Use.
+
+ * valprint.c (print_floating): Replace checks for IEEE_FLOAT with
+ call to function floatformat_from_type.
+
+ * gdbarch.sh (IEEE_FLOAT): Delete.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * config/i960/tm-i960.h (IEEE_FLOAT): Delete macro.
+ * config/i386/tm-i386.h (IEEE_FLOAT): Ditto.
+ * config/z8k/tm-z8k.h (IEEE_FLOAT): Ditto.
+ * config/sparc/tm-sparc.h (IEEE_FLOAT): Ditto.
+ * config/pa/tm-hppa.h (IEEE_FLOAT): Ditto.
+ * config/m88k/tm-m88k.h (IEEE_FLOAT): Ditto.
+ * config/m68k/tm-m68k.h (IEEE_FLOAT): Ditto.
+ * config/h8500/tm-h8500.h (IEEE_FLOAT): Ditto.
+ * config/h8300/tm-h8300.h (IEEE_FLOAT): Ditto.
+ * config/fr30/tm-fr30.h (IEEE_FLOAT): Ditto.
+ * config/arm/tm-arm.h (IEEE_FLOAT): Ditto.
+ * config/arc/tm-arc.h (IEEE_FLOAT): Ditto.
+ * config/alpha/tm-alpha.h (IEEE_FLOAT): Ditto.
+
+ * s390-tdep.c (s390_gdbarch_init): Do not set ieee_float.
+ * x86-64-tdep.c (i386_gdbarch_init): Ditto.
+ * sparc-tdep.c (sparc_gdbarch_init): Ditto.
+ * sh-tdep.c (sh_gdbarch_init): Ditto.
+ * mips-tdep.c (mips_gdbarch_init): Ditto.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto.
+ * cris-tdep.c (cris_gdbarch_init): Ditto.
+
2002-01-20 Jiri Smid <smid@suse.cz>
* configure.host, configure.tgt: Support x86-64.
diff --git a/gdb/config/alpha/tm-alpha.h b/gdb/config/alpha/tm-alpha.h
index cc29e77..a508354 100644
--- a/gdb/config/alpha/tm-alpha.h
+++ b/gdb/config/alpha/tm-alpha.h
@@ -43,9 +43,6 @@ struct symbol;
#define TARGET_LONG_LONG_BIT 64
#define TARGET_PTR_BIT 64
-/* Floating point is IEEE compliant */
-#define IEEE_FLOAT (1)
-
/* Number of traps that happen between exec'ing the shell
* to run an inferior, and when we finally get to
* the inferior code. This is 2 on most implementations.
diff --git a/gdb/config/arc/tm-arc.h b/gdb/config/arc/tm-arc.h
index 7521296..a015843 100644
--- a/gdb/config/arc/tm-arc.h
+++ b/gdb/config/arc/tm-arc.h
@@ -27,9 +27,6 @@
/* Byte order is selectable. */
#define TARGET_BYTE_ORDER_SELECTABLE
-/* We have IEEE floating point, if we have any float at all. */
-#define IEEE_FLOAT (1)
-
/* Offset from address of function to start of its code.
Zero on most machines. */
#define FUNCTION_START_OFFSET 0
diff --git a/gdb/config/arm/tm-arm.h b/gdb/config/arm/tm-arm.h
index 377b2d8..80fc1f6 100644
--- a/gdb/config/arm/tm-arm.h
+++ b/gdb/config/arm/tm-arm.h
@@ -35,7 +35,6 @@ struct value;
#define TARGET_BYTE_ORDER_DEFAULT BFD_ENDIAN_LITTLE
/* IEEE format floating point. */
-#define IEEE_FLOAT (1)
#define TARGET_DOUBLE_FORMAT (target_byte_order == BFD_ENDIAN_BIG \
? &floatformat_ieee_double_big \
: &floatformat_ieee_double_littlebyte_bigword)
diff --git a/gdb/config/fr30/tm-fr30.h b/gdb/config/fr30/tm-fr30.h
index 5a415c9..4d55092 100644
--- a/gdb/config/fr30/tm-fr30.h
+++ b/gdb/config/fr30/tm-fr30.h
@@ -187,9 +187,6 @@ extern void fr30_store_return_value (struct type *type, char *valbuf);
/* Define this for Wingdb */
#define TARGET_FR30
-/* IEEE format floating point */
-#define IEEE_FLOAT (1)
-
/* Define other aspects of the stack frame. */
/* An expression that tells us whether the function invocation represented
diff --git a/gdb/config/h8300/tm-h8300.h b/gdb/config/h8300/tm-h8300.h
index ad6e7a4..79f52dc 100644
--- a/gdb/config/h8300/tm-h8300.h
+++ b/gdb/config/h8300/tm-h8300.h
@@ -58,7 +58,6 @@ extern int h8300smode;
extern void h8300_init_extra_frame_info ();
-#define IEEE_FLOAT (1)
/* Define the bit, byte, and word ordering of the machine. */
#define TARGET_BYTE_ORDER BFD_ENDIAN_BIG
#undef TARGET_INT_BIT
diff --git a/gdb/config/h8500/tm-h8500.h b/gdb/config/h8500/tm-h8500.h
index 5d00148..2beec07 100644
--- a/gdb/config/h8500/tm-h8500.h
+++ b/gdb/config/h8500/tm-h8500.h
@@ -25,8 +25,6 @@
#define GDB_TARGET_IS_H8500
-#define IEEE_FLOAT (1)
-
/* Define the bit, byte, and word ordering of the machine. */
#define TARGET_BYTE_ORDER BFD_ENDIAN_BIG
diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/i386/tm-i386.h
index 0e3f9b0..9888ca4 100644
--- a/gdb/config/i386/tm-i386.h
+++ b/gdb/config/i386/tm-i386.h
@@ -47,11 +47,6 @@ struct type;
#define TARGET_LONG_DOUBLE_BIT 96
-/* Used for example in valprint.c:print_floating() to enable checking
- for NaN's */
-
-#define IEEE_FLOAT (1)
-
/* Number of traps that happen between exec'ing the shell to run an
inferior, and when we finally get to the inferior code. This is 2
on most implementations. */
diff --git a/gdb/config/i960/tm-i960.h b/gdb/config/i960/tm-i960.h
index b6ed313..da0766d 100644
--- a/gdb/config/i960/tm-i960.h
+++ b/gdb/config/i960/tm-i960.h
@@ -41,10 +41,6 @@
/* Byte order is configurable, but this machine runs little-endian. */
#define TARGET_BYTE_ORDER BFD_ENDIAN_LITTLE
-/* We have IEEE floating point, if we have any float at all. */
-
-#define IEEE_FLOAT (1)
-
/* Offset from address of function to start of its code.
Zero on most machines. */
diff --git a/gdb/config/m68k/tm-m68k.h b/gdb/config/m68k/tm-m68k.h
index d993da5..888089b 100644
--- a/gdb/config/m68k/tm-m68k.h
+++ b/gdb/config/m68k/tm-m68k.h
@@ -23,8 +23,6 @@
/* Generic 68000 stuff, to be included by other tm-*.h files. */
-#define IEEE_FLOAT (1)
-
/* Define the bit, byte, and word ordering of the machine. */
#define TARGET_BYTE_ORDER BFD_ENDIAN_BIG
diff --git a/gdb/config/m88k/tm-m88k.h b/gdb/config/m88k/tm-m88k.h
index 0f509ff..34762b9 100644
--- a/gdb/config/m88k/tm-m88k.h
+++ b/gdb/config/m88k/tm-m88k.h
@@ -47,8 +47,6 @@
init_extra_frame_info (fromleaf, fi)
extern void init_extra_frame_info ();
-#define IEEE_FLOAT (1)
-
/* Offset from address of function to start of its code.
Zero on most machines. */
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index ed74844..14dc304 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -54,10 +54,6 @@ struct inferior_status;
((X) >> (31 - (TO)) & ((1 << ((TO) - (FROM) + 1)) - 1))
#endif
-/* Watch out for NaNs */
-
-#define IEEE_FLOAT (1)
-
/* On the PA, any pass-by-value structure > 8 bytes is actually
passed via a pointer regardless of its type or the compiler
used. */
diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h
index cf98201..4885cd0 100644
--- a/gdb/config/sparc/tm-sparc.h
+++ b/gdb/config/sparc/tm-sparc.h
@@ -298,9 +298,6 @@ extern CORE_ADDR sparc_extract_struct_value_address (char *);
#define STACK_ALIGN(ADDR) sparc32_stack_align (ADDR)
extern CORE_ADDR sparc32_stack_align (CORE_ADDR addr);
-/* Floating point is IEEE compatible. */
-#define IEEE_FLOAT (1)
-
/* The Sparc returns long doubles on the stack. */
#define RETURN_VALUE_ON_STACK(TYPE) \
diff --git a/gdb/config/z8k/tm-z8k.h b/gdb/config/z8k/tm-z8k.h
index 339eb8f..c0dbcd4 100644
--- a/gdb/config/z8k/tm-z8k.h
+++ b/gdb/config/z8k/tm-z8k.h
@@ -19,8 +19,6 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define IEEE_FLOAT (1)
-
#undef TARGET_INT_BIT
#undef TARGET_LONG_BIT
#undef TARGET_SHORT_BIT
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index a134430..8f22ed6 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -4154,9 +4154,6 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
which means we have to set this explicitly. */
set_gdbarch_long_double_bit (gdbarch, 64);
- /* Floating point is IEEE compatible. */
- set_gdbarch_ieee_float (gdbarch, 1);
-
/* There are 32 registers (some of which may not be implemented). */
set_gdbarch_num_regs (gdbarch, 32);
set_gdbarch_sp_regnum (gdbarch, 14);
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index c6dee70..fe7cf21 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
+2002-01-20 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Remove
+ definition of IEEE_FLOAT.
+
2002-01-20 Eli Zaretskii <eliz@is.elta.co.il>
* gdb.texinfo: Beautify copyright years; fix a typo.
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index 51e21db..515b30b 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -3071,10 +3071,6 @@ On HP-UX, certain system routines (millicode) have names beginning with
@samp{$} or @samp{$$}. For example, @code{$$dyncall} is a millicode
routine that handles inter-space procedure calls on PA-RISC.
-@item IEEE_FLOAT
-@findex IEEE_FLOAT
-Define this if the target system uses IEEE-format floating point numbers.
-
@item INIT_EXTRA_FRAME_INFO (@var{fromleaf}, @var{frame})
@findex INIT_EXTRA_FRAME_INFO
If additional information about the frame is required this should be
diff --git a/gdb/doublest.c b/gdb/doublest.c
index 083a50a..2b60657 100644
--- a/gdb/doublest.c
+++ b/gdb/doublest.c
@@ -619,7 +619,7 @@ floatformat_from_doublest (const struct floatformat *fmt,
target-dependent code, the format of floating-point types is known,
but not passed on by GDB. This should be fixed. */
-static const struct floatformat *
+const struct floatformat *
floatformat_from_length (int len)
{
if (len * TARGET_CHAR_BIT == TARGET_FLOAT_BIT)
@@ -632,6 +632,16 @@ floatformat_from_length (int len)
return NULL;
}
+const struct floatformat *
+floatformat_from_type (const struct type *type)
+{
+ gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
+ if (TYPE_FLOATFORMAT (type) != NULL)
+ return TYPE_FLOATFORMAT (type);
+ else
+ return floatformat_from_length (TYPE_LENGTH (type));
+}
+
/* If the host doesn't define NAN, use zero instead. */
#ifndef NAN
#define NAN 0.0
@@ -732,19 +742,12 @@ void
convert_typed_floating (const void *from, const struct type *from_type,
void *to, const struct type *to_type)
{
- const struct floatformat *from_fmt = TYPE_FLOATFORMAT (from_type);
- const struct floatformat *to_fmt = TYPE_FLOATFORMAT (to_type);
+ const struct floatformat *from_fmt = floatformat_from_type (from_type);
+ const struct floatformat *to_fmt = floatformat_from_type (to_type);
gdb_assert (TYPE_CODE (from_type) == TYPE_CODE_FLT);
gdb_assert (TYPE_CODE (to_type) == TYPE_CODE_FLT);
- /* If the floating-point format of FROM_TYPE or TO_TYPE isn't known,
- try to guess it from the type's length. */
- if (from_fmt == NULL)
- from_fmt = floatformat_from_length (TYPE_LENGTH (from_type));
- if (to_fmt == NULL)
- to_fmt = floatformat_from_length (TYPE_LENGTH (to_type));
-
if (from_fmt == NULL || to_fmt == NULL)
{
/* If we don't know the floating-point format of FROM_TYPE or
diff --git a/gdb/doublest.h b/gdb/doublest.h
index ccd9233..0beeb9b 100644
--- a/gdb/doublest.h
+++ b/gdb/doublest.h
@@ -68,6 +68,12 @@ extern char *floatformat_mantissa (const struct floatformat *, char *);
extern DOUBLEST extract_floating (const void *addr, int len);
extern void store_floating (void *addr, int len, DOUBLEST val);
+/* Given TYPE, return its floatformat. TYPE_FLOATFORMAT() may return
+ NULL. type_floatformat() detects that and returns a floatformat
+ based on the type size when FLOATFORMAT is NULL. */
+
+const struct floatformat *floatformat_from_type (const struct type *type);
+
extern DOUBLEST extract_typed_floating (const void *addr,
const struct type *type);
extern void store_typed_floating (void *addr, const struct type *type,
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index e53c521..0cc5a36 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -145,7 +145,6 @@ struct gdbarch
int addr_bit;
int bfd_vma_bit;
int char_signed;
- int ieee_float;
gdbarch_read_pc_ftype *read_pc;
gdbarch_write_pc_ftype *write_pc;
gdbarch_read_fp_ftype *read_fp;
@@ -313,7 +312,6 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
- 0,
generic_register_raw_size,
0,
generic_register_virtual_size,
@@ -566,7 +564,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of bfd_vma_bit, invalid_p == 0 */
if (gdbarch->char_signed == -1)
gdbarch->char_signed = 1;
- /* Skip verify of ieee_float, invalid_p == 0 */
/* Skip verify of read_pc, invalid_p == 0 */
/* Skip verify of write_pc, invalid_p == 0 */
/* Skip verify of read_fp, invalid_p == 0 */
@@ -1256,14 +1253,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->get_saved_register
/*GET_SAVED_REGISTER ()*/);
#endif
-#ifdef IEEE_FLOAT
- fprintf_unfiltered (file,
- "gdbarch_dump: IEEE_FLOAT # %s\n",
- XSTRING (IEEE_FLOAT));
- fprintf_unfiltered (file,
- "gdbarch_dump: IEEE_FLOAT = %d\n",
- IEEE_FLOAT);
-#endif
#ifdef INIT_EXTRA_FRAME_INFO
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -2296,22 +2285,6 @@ set_gdbarch_char_signed (struct gdbarch *gdbarch,
gdbarch->char_signed = char_signed;
}
-int
-gdbarch_ieee_float (struct gdbarch *gdbarch)
-{
- /* Skip verify of ieee_float, invalid_p == 0 */
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_ieee_float called\n");
- return gdbarch->ieee_float;
-}
-
-void
-set_gdbarch_ieee_float (struct gdbarch *gdbarch,
- int ieee_float)
-{
- gdbarch->ieee_float = ieee_float;
-}
-
CORE_ADDR
gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid)
{
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 8cac8cb..1c09fac 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -305,22 +305,6 @@ extern void set_gdbarch_char_signed (struct gdbarch *gdbarch, int char_signed);
#endif
#endif
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (IEEE_FLOAT)
-#define IEEE_FLOAT (0)
-#endif
-
-extern int gdbarch_ieee_float (struct gdbarch *gdbarch);
-extern void set_gdbarch_ieee_float (struct gdbarch *gdbarch, int ieee_float);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IEEE_FLOAT)
-#error "Non multi-arch definition of IEEE_FLOAT"
-#endif
-#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IEEE_FLOAT)
-#define IEEE_FLOAT (gdbarch_ieee_float (current_gdbarch))
-#endif
-#endif
-
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_PC)
#define TARGET_READ_PC(ptid) (generic_target_read_pc (ptid))
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 9bd0e51..d6046ec 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -403,8 +403,6 @@ v::TARGET_BFD_VMA_BIT:int:bfd_vma_bit::::8 * sizeof (void*):TARGET_ARCHITECTURE-
# One if \`char' acts like \`signed char', zero if \`unsigned char'.
v::TARGET_CHAR_SIGNED:int:char_signed::::1:-1:1::::
#
-v::IEEE_FLOAT:int:ieee_float::::0:0::0:::
-#
f::TARGET_READ_PC:CORE_ADDR:read_pc:ptid_t ptid:ptid::0:generic_target_read_pc::0
f::TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, ptid_t ptid:val, ptid::0:generic_target_write_pc::0
f::TARGET_READ_FP:CORE_ADDR:read_fp:void:::0:generic_target_read_fp::0
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 14ae8b1..77d7ebf 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -1157,7 +1157,6 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
set_gdbarch_stack_align (gdbarch, m68hc11_stack_align);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
- set_gdbarch_ieee_float (gdbarch, 1);
return gdbarch;
}
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 9b5a535..30079b5 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -4283,7 +4283,6 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_breakpoint_from_pc (gdbarch, mips_breakpoint_from_pc);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
- set_gdbarch_ieee_float (gdbarch, 1);
set_gdbarch_skip_prologue (gdbarch, mips_skip_prologue);
set_gdbarch_saved_pc_after_call (gdbarch, mips_saved_pc_after_call);
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 7b4972b..239b17a 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -1785,7 +1785,6 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
but not always. */
set_gdbarch_decr_pc_after_break (gdbarch, 2);
set_gdbarch_pop_frame (gdbarch, s390_pop_frame);
- set_gdbarch_ieee_float (gdbarch, 1);
/* Stack grows downward. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
/* Offset from address of function to start of its code.
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index ccb060b..04720fe 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -2123,7 +2123,6 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_saved_pc_after_call (gdbarch, sh_saved_pc_after_call);
set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
- set_gdbarch_ieee_float (gdbarch, 1);
return gdbarch;
}
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 02ebaa4..a32841c 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -2963,7 +2963,6 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frameless_function_invocation (gdbarch,
frameless_look_for_prologue);
set_gdbarch_get_saved_register (gdbarch, sparc_get_saved_register);
- set_gdbarch_ieee_float (gdbarch, 1);
set_gdbarch_init_extra_frame_info (gdbarch, sparc_init_extra_frame_info);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 45acdc7..84cd272 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -548,21 +548,9 @@ print_floating (char *valaddr, struct type *type, struct ui_file *stream)
{
DOUBLEST doub;
int inv;
- const struct floatformat *fmt = &floatformat_unknown;
+ const struct floatformat *fmt = floatformat_from_type (type);
unsigned len = TYPE_LENGTH (type);
- /* FIXME: kettenis/2001-01-20: The check for IEEE_FLOAT is probably
- still necessary since GDB by default assumes that the target uses
- the IEEE 754 representation for its floats and doubles. Of
- course this is all crock and should be cleaned up. */
-
- if (len == TARGET_FLOAT_BIT / TARGET_CHAR_BIT && IEEE_FLOAT)
- fmt = TARGET_FLOAT_FORMAT;
- else if (len == TARGET_DOUBLE_BIT / TARGET_CHAR_BIT && IEEE_FLOAT)
- fmt = TARGET_DOUBLE_FORMAT;
- else if (len == TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT)
- fmt = TARGET_LONG_DOUBLE_FORMAT;
-
if (floatformat_is_nan (fmt, valaddr))
{
if (floatformat_is_negative (fmt, valaddr))
@@ -575,6 +563,13 @@ print_floating (char *valaddr, struct type *type, struct ui_file *stream)
return;
}
+ /* FIXME: cagney/2002-01-15: The simpler extract_typed_floating()
+ routine could be used here only that routine has no way of
+ indicating that the floating point it extracted was invalid (As
+ indicated by INVALID_FLOAT). Instead, this code here could call
+ something like floating_invalid() to check for an invalid
+ floating point. */
+
doub = unpack_double (type, valaddr, &inv);
if (inv)
{
@@ -585,6 +580,10 @@ print_floating (char *valaddr, struct type *type, struct ui_file *stream)
/* FIXME: kettenis/2001-01-20: The following code makes too much
assumptions about the host and target floating point format. */
+ /* FIXME: cagney/2002-01-15: The floatformat pointed to by FMT
+ should contain all the information needed to print the
+ floating-point value without host dependencies. */
+
if (len < sizeof (double))
fprintf_filtered (stream, "%.9g", (double) doub);
else if (len == sizeof (double))
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c
index ce689dd..f02f2b6 100644
--- a/gdb/x86-64-tdep.c
+++ b/gdb/x86-64-tdep.c
@@ -834,8 +834,6 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_ptr_bit (gdbarch, 64);
set_gdbarch_long_double_format (gdbarch, &floatformat_i387_ext);
- set_gdbarch_ieee_float (gdbarch, 1);
-
set_gdbarch_num_regs (gdbarch, X86_64_NUM_REGS);
set_gdbarch_register_name (gdbarch, x86_64_register_name);