Fixes from Peter Schauer:
authorMark Alexander <marka@cygnus>
Mon, 24 Mar 1997 00:29:12 +0000 (00:29 +0000)
committerMark Alexander <marka@cygnus>
Mon, 24 Mar 1997 00:29:12 +0000 (00:29 +0000)
* 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.

gdb/ChangeLog
gdb/config/mips/tm-mips.h

index d9c3c2d263df9d7142a932e00cd9b3c557d930b0..e25c25d652068e753531d07f8c9c0c521eb8a205 100644 (file)
@@ -1,3 +1,13 @@
+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
index aa595f55e9fc24f88de4fddbd5c056a2a099d5e6..64a26b55846462e5084d955f1ecb3ae110b0befb 100644 (file)
@@ -265,28 +265,32 @@ extern void mips_do_registers_info PARAMS ((int, int));
         ? 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.  */
This page took 0.027671 seconds and 4 git commands to generate.