+Sun Mar 23 16:19:20 1997 Mark Alexander <marka@cygnus.com>
+
+Fixes from Peter Schauer:
+ * config/mips/tm-mips.h (REGISTER_CONVERT_TO_TYPE,
+ REGISTER_CONVERT_FROM_TYPE): Swap words if target, not host,
+ is big-endian and if registers are 32 bits.
+ * mips-tdep.c (mips_print_register, mips_extract_return_value,
+ mips_store_return_value): Fix floating-point word-order problems on
+ little-endian targets introduced by changes of Mar 21.
+
Sun Mar 23 15:43:27 1997 Stan Shebs <shebs@andros.cygnus.com>
* remote.c (target_resume_hook, target_wait_loop_hook): New
? builtin_type_float : builtin_type_int)
#endif
-#if HOST_BYTE_ORDER == BIG_ENDIAN
/* All mips targets store doubles in a register pair with the least
significant register in the lower numbered register.
- If the host is big endian, double register values need conversion between
- memory and register formats. */
+ If the target is big endian, double register values need conversion
+ between memory and register formats. */
#define REGISTER_CONVERT_TO_TYPE(n, type, buffer) \
- do {if ((n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32 && \
- TYPE_CODE(type) == TYPE_CODE_FLT && TYPE_LENGTH(type) == 8) { \
+ do {if (TARGET_BYTE_ORDER == BIG_ENDIAN \
+ && REGISTER_RAW_SIZE (n) == 4 \
+ && (n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32 \
+ && TYPE_CODE(type) == TYPE_CODE_FLT \
+ && TYPE_LENGTH(type) == 8) { \
char __temp[4]; \
memcpy (__temp, ((char *)(buffer))+4, 4); \
memcpy (((char *)(buffer))+4, (buffer), 4); \
memcpy (((char *)(buffer)), __temp, 4); }} while (0)
#define REGISTER_CONVERT_FROM_TYPE(n, type, buffer) \
- do {if ((n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32 && \
- TYPE_CODE(type) == TYPE_CODE_FLT && TYPE_LENGTH(type) == 8) { \
+ do {if (TARGET_BYTE_ORDER == BIG_ENDIAN \
+ && REGISTER_RAW_SIZE (n) == 4 \
+ && (n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32 \
+ && TYPE_CODE(type) == TYPE_CODE_FLT \
+ && TYPE_LENGTH(type) == 8) { \
char __temp[4]; \
memcpy (__temp, ((char *)(buffer))+4, 4); \
memcpy (((char *)(buffer))+4, (buffer), 4); \
memcpy (((char *)(buffer)), __temp, 4); }} while (0)
-#endif
/* Store the address of the place in which to copy the structure the
subroutine will return. Handled by mips_push_arguments. */