real.c: Avoid parse error if FLOAT_WORDS_BIG_ENDIAN is not a compile-time constant...
authorJason Thorpe <thorpej@wasabisystems.com>
Thu, 5 Sep 2002 16:54:57 +0000 (16:54 +0000)
committerJason Thorpe <thorpej@gcc.gnu.org>
Thu, 5 Sep 2002 16:54:57 +0000 (16:54 +0000)
* real.c: Avoid parse error if FLOAT_WORDS_BIG_ENDIAN is
not a compile-time constant for the non-IBM case.
* config/arm/arm-protos.h (arm_float_words_big_endian): New
prototype.
* config/arm/arm.c (arm_float_words_big_endian): New function.
* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __VFP_FP__
if TARGET_VFP  and not TARGET_HARD_FLOAT.
(ARM_FLAG_VFP, TARGET_VFP): Define.
(FLOAT_WORDS_BIG_ENDIAN): Use arm_float_words_big_endian.

[ Missed arm.h in previous checkin, and pasto'd ChangeLog entry, which
  is now corrected. ]

From-SVN: r56857

gcc/ChangeLog
gcc/config/arm/arm.h

index 3fafcb6..a3ec8a0 100644 (file)
@@ -10,8 +10,8 @@
        * config/arm/arm-protos.h (arm_float_words_big_endian): New
        prototype. 
        * config/arm/arm.c (arm_float_words_big_endian): New function.
-       (TARGET_CPU_CPP_BUILTINS): Define __VFP_FP__ if TARGET_VFP  
-       and not TARGET_HARD_FLOAT. 
+       * config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define __VFP_FP__
+       if TARGET_VFP  and not TARGET_HARD_FLOAT. 
        (ARM_FLAG_VFP, TARGET_VFP): Define. 
        (FLOAT_WORDS_BIG_ENDIAN): Use arm_float_words_big_endian.
 
index 8ab8267..5865472 100644 (file)
@@ -58,6 +58,11 @@ Boston, MA 02111-1307, USA.  */
        if (TARGET_SOFT_FLOAT)                          \
          builtin_define ("__SOFTFP__");                \
                                                        \
+       /* FIXME: TARGET_HARD_FLOAT currently implies   \
+          FPA.  */                                     \
+       if (TARGET_VFP && !TARGET_HARD_FLOAT)           \
+         builtin_define ("__VFP_FP__");                \
+                                                       \
        /* Add a define for interworking.               \
           Needed when building libgcc.a.  */           \
        if (TARGET_INTERWORK)                           \
@@ -365,6 +370,9 @@ Unrecognized value in TARGET_CPU_DEFAULT.
    destination is non-Thumb aware.  */
 #define THUMB_FLAG_CALLER_SUPER_INTERWORKING   (1 << 20)
 
+/* Nonzero means target uses VFP FP.  */
+#define ARM_FLAG_VFP           (1 << 21)
+
 #define TARGET_APCS_FRAME              (target_flags & ARM_FLAG_APCS_FRAME)
 #define TARGET_POKE_FUNCTION_NAME      (target_flags & ARM_FLAG_POKE)
 #define TARGET_FPE                     (target_flags & ARM_FLAG_FPE)
@@ -375,6 +383,7 @@ Unrecognized value in TARGET_CPU_DEFAULT.
 #define TARGET_MMU_TRAPS               (target_flags & ARM_FLAG_MMU_TRAPS)
 #define TARGET_SOFT_FLOAT              (target_flags & ARM_FLAG_SOFT_FLOAT)
 #define TARGET_HARD_FLOAT              (! TARGET_SOFT_FLOAT)
+#define TARGET_VFP                     (target_flags & ARM_FLAG_VFP)
 #define TARGET_BIG_END                 (target_flags & ARM_FLAG_BIG_END)
 #define TARGET_INTERWORK               (target_flags & ARM_FLAG_INTERWORK)
 #define TARGET_LITTLE_WORDS            (target_flags & ARM_FLAG_LITTLE_WORDS)
@@ -666,8 +675,9 @@ extern int arm_is_6_or_7;
 #endif
 
 /* Define this if most significant word of doubles is the lowest numbered.
-   This is always true, even when in little-endian mode.  */
-#define FLOAT_WORDS_BIG_ENDIAN 1
+   The rules are different based on whether or not we use FPA-format or
+   VFP-format doubles.  */
+#define FLOAT_WORDS_BIG_ENDIAN (arm_float_words_big_endian ())
 
 #define UNITS_PER_WORD 4