+Fri Apr 12 09:45:29 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * 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.
+
Thu Apr 11 21:28:02 1996 Fred Fish <fnf@cygnus.com>
From: Miles Bader <miles@gnu.ai.mit.edu>
# 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
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));
const struct floatformat floatformat_unknown;
-#ifdef HAVE_LONG_DOUBLE
-void (*floatformat_to_doublest)
- PARAMS ((const struct floatformat *,
- char *, DOUBLEST *)) = floatformat_to_long_double;
-void (*floatformat_from_doublest)
- PARAMS ((const struct floatformat *,
- DOUBLEST *, char *)) = floatformat_from_long_double;
-#else
-void (*floatformat_to_doublest)
- PARAMS ((const struct floatformat *,
- char *, DOUBLEST *)) = floatformat_to_double;
-void (*floatformat_from_doublest)
- PARAMS ((const struct floatformat *,
- DOUBLEST *, char *)) = floatformat_from_double;
-#endif
-
/* Registers we shouldn't try to store. */
#if !defined (CANNOT_STORE_REGISTER)
#define CANNOT_STORE_REGISTER(regno) 0
return retval;
}
else
- floatformat_to_doublest (TARGET_FLOAT_FORMAT, addr, &dretval);
+ FLOATFORMAT_TO_DOUBLEST (TARGET_FLOAT_FORMAT, addr, &dretval);
}
else if (len == sizeof (double))
{
return retval;
}
else
- floatformat_to_doublest (TARGET_DOUBLE_FORMAT, addr, &dretval);
+ FLOATFORMAT_TO_DOUBLEST (TARGET_DOUBLE_FORMAT, addr, &dretval);
}
else if (len == sizeof (DOUBLEST))
{
return retval;
}
else
- floatformat_to_doublest (TARGET_LONG_DOUBLE_FORMAT, addr, &dretval);
+ FLOATFORMAT_TO_DOUBLEST (TARGET_LONG_DOUBLE_FORMAT, addr, &dretval);
}
else
{
memcpy (addr, &floatval, sizeof (floatval));
}
else
- floatformat_from_doublest (TARGET_FLOAT_FORMAT, &val, addr);
+ FLOATFORMAT_FROM_DOUBLEST (TARGET_FLOAT_FORMAT, &val, addr);
}
else if (len == sizeof (double))
{
memcpy (addr, &doubleval, sizeof (doubleval));
}
else
- floatformat_from_doublest (TARGET_DOUBLE_FORMAT, &val, addr);
+ FLOATFORMAT_FROM_DOUBLEST (TARGET_DOUBLE_FORMAT, &val, addr);
}
else if (len == sizeof (DOUBLEST))
{
if (HOST_LONG_DOUBLE_FORMAT == TARGET_LONG_DOUBLE_FORMAT)
memcpy (addr, &val, sizeof (val));
else
- floatformat_from_doublest (TARGET_LONG_DOUBLE_FORMAT, &val, addr);
+ FLOATFORMAT_FROM_DOUBLEST (TARGET_LONG_DOUBLE_FORMAT, &val, addr);
}
else
{
&nindy_regs.fp_as_double[8 * (regnum - FP0_REGNUM)],
&inv);
/* dub now in host byte order */
- floatformat_from_double (&floatformat_i960_ext, &dub,
- ®isters[REGISTER_BYTE (regnum)]);
+ FLOATFORMAT_FROM_DOUBLEST (&floatformat_i960_ext, &dub,
+ ®isters[REGISTER_BYTE (regnum)]);
}
registers_fetched ();
memcpy (nindy_regs.tcw, ®isters[REGISTER_BYTE (TCW_REGNUM)], 1*4);
for (regnum = FP0_REGNUM; regnum < FP0_REGNUM + 4; regnum++)
{
- floatformat_to_double (&floatformat_i960_ext,
- ®isters[REGISTER_BYTE (regnum)], &dub);
+ FLOATFORMAT_TO_DOUBLEST (&floatformat_i960_ext,
+ ®isters[REGISTER_BYTE (regnum)], &dub);
store_floating (&nindy_regs.fp_as_double[8 * (regnum - FP0_REGNUM)],
REGISTER_VIRTUAL_SIZE (regnum),
dub);