aboutsummaryrefslogtreecommitdiff
path: root/gdb/defs.h
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1996-04-12 16:53:08 +0000
committerStu Grossman <grossman@cygnus>1996-04-12 16:53:08 +0000
commitc6fbd98bed167d79e49c0d4a38b5432853f11799 (patch)
tree3e8906fb8ca09716451258bd1d0281cd3189e52a /gdb/defs.h
parent9b1271617bf446b2015601820d2f996b3d16fe8a (diff)
downloadgdb-c6fbd98bed167d79e49c0d4a38b5432853f11799.zip
gdb-c6fbd98bed167d79e49c0d4a38b5432853f11799.tar.gz
gdb-c6fbd98bed167d79e49c0d4a38b5432853f11799.tar.bz2
* defs.h: Define TARGET_{FLOAT DOUBLE LONG_DOUBLE}_FORMAT
defaults for bi-endian targets. Replace function pointers for floatformat routines with macros. No need for these to be runtime selectable. * findvar.c: Get rid of floatformat function pointers. Use macros in extract_floating and store_floating. * remote-nindy.c (nindy_fetch_registers nindy_store_registers): Use floatformat macros.
Diffstat (limited to 'gdb/defs.h')
-rw-r--r--gdb/defs.h32
1 files changed, 14 insertions, 18 deletions
diff --git a/gdb/defs.h b/gdb/defs.h
index ce36938..d11c6b1 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -874,21 +874,23 @@ extern const struct floatformat floatformat_unknown;
# define TARGET_DOUBLE_FORMAT &floatformat_ieee_double_little
# endif
# endif
-# ifndef TARGET_LONG_DOUBLE_FORMAT
-# define TARGET_LONG_DOUBLE_FORMAT &floatformat_unknown
-# endif
#else /* TARGET_BYTE_ORDER_SELECTABLE */
# ifndef TARGET_FLOAT_FORMAT
- Need a definition for target float format
+# define TARGET_FLOAT_FORMAT (target_byte_order == BIG_ENDIAN \
+ ? &floatformat_ieee_single_big \
+ : &floatformat_ieee_single_little)
# endif
# ifndef TARGET_DOUBLE_FORMAT
- Need a definition for target double format
-# endif
-# ifndef TARGET_LONG_DOUBLE_FORMAT
- Need a definition for target long double format
+# define TARGET_DOUBLE_FORMAT (target_byte_order == BIG_ENDIAN \
+ ? &floatformat_ieee_double_big \
+ : &floatformat_ieee_double_little)
# endif
#endif
+#ifndef TARGET_LONG_DOUBLE_FORMAT
+# define TARGET_LONG_DOUBLE_FORMAT &floatformat_unknown
+#endif
+
/* Use `long double' if the host compiler supports it. (Note that this is not
necessarily any longer than `double'. On SunOS/gcc, it's the same as
double.) This is necessary because GDB internally converts all floating
@@ -904,20 +906,14 @@ extern void floatformat_to_long_double PARAMS ((const struct floatformat *,
char *, DOUBLEST *));
extern void floatformat_from_long_double PARAMS ((const struct floatformat *,
DOUBLEST *, char *));
+#define FLOATFORMAT_TO_DOUBLEST floatformat_to_long_double
+#define FLOATFORMAT_FROM_DOUBLEST floatformat_from_long_double
#else
typedef double DOUBLEST;
+#define FLOATFORMAT_TO_DOUBLEST floatformat_to_double
+#define FLOATFORMAT_FROM_DOUBLEST floatformat_from_double
#endif
-/* Pointer to appropriate conversion routine to convert between target floating
- point format and DOUBLEST. */
-
-extern void
-(*floatformat_to_doublest) PARAMS ((const struct floatformat *,
- char *, DOUBLEST *));
-extern void
-(*floatformat_from_doublest) PARAMS ((const struct floatformat *,
- DOUBLEST *, char *));
-
extern DOUBLEST extract_floating PARAMS ((void *, int));
extern void store_floating PARAMS ((void *, int, DOUBLEST));