]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[ARM] Backport the patch which fixes __ARM_FP & __ARM_NEON_FP predefines
authorMantas Mikaitis <mantas.mikaitis@arm.com>
Fri, 10 Jul 2015 12:08:47 +0000 (12:08 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Fri, 10 Jul 2015 12:08:47 +0000 (12:08 +0000)
On behalf of Mantas Mikaitis  <Mantas.Mikaitis@arm.com>

* config/arm/arm.h (TARGET_NEON_FP): Remove conditional definition,
define to zero if !TARGET_NEON.
(TARGET_ARM_FP): Add !TARGET_SOFT_FLOAT into the conditional
definition.

* gcc.target/arm/macro_defs0.c: New test.
* gcc.target/arm/macro_defs1.c: New test.
* gcc.target/arm/macro_defs2.c: New test.

From-SVN: r225667

gcc/ChangeLog
gcc/config/arm/arm.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/macro_defs0.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/macro_defs1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/macro_defs2.c [new file with mode: 0644]

index 359014bf600c237ddd48bdb9413e582df8b4a4c4..8dc08bda5184939041c3b63de66e698190f8f609 100644 (file)
@@ -1,3 +1,10 @@
+2015-07-10  Mantas Mikaitis  <Mantas.Mikaitis@arm.com>
+
+       * config/arm/arm.h (TARGET_NEON_FP): Remove conditional definition,
+       define to zero if !TARGET_NEON.
+       (TARGET_ARM_FP): Add !TARGET_SOFT_FLOAT into the conditional
+       definition.
+
 2015-07-09  Iain Sandoe  <iain@codesourcery.com>
 
        PR target/66523
index 23333eb6df57d9db3fcb347776469dd1656e7345..7c9b1b91f0926b1530bd61bb187772962b2a227d 100644 (file)
@@ -2349,17 +2349,17 @@ extern int making_const_table;
    point types.  Where bit 1 indicates 16-bit support, bit 2 indicates
    32-bit support, bit 3 indicates 64-bit support.  */
 #define TARGET_ARM_FP                  \
-  (TARGET_VFP_SINGLE ? 4               \
-                    : (TARGET_VFP_DOUBLE ? (TARGET_FP16 ? 14 : 12) : 0))
+  (!TARGET_SOFT_FLOAT ? (TARGET_VFP_SINGLE ? 4         \
+                       : (TARGET_VFP_DOUBLE ? (TARGET_FP16 ? 14 : 12) : 0)) \
+                     : 0)
 
 
 /* Set as a bit mask indicating the available widths of floating point
    types for hardware NEON floating point.  This is the same as
    TARGET_ARM_FP without the 64-bit bit set.  */
-#ifdef TARGET_NEON
-#define TARGET_NEON_FP         \
-  (TARGET_ARM_FP & (0xff ^ 0x08))
-#endif
+#define TARGET_NEON_FP                          \
+  (TARGET_NEON ? (TARGET_ARM_FP & (0xff ^ 0x08)) \
+              : 0)
 
 /* The maximum number of parallel loads or stores we support in an ldm/stm
    instruction.  */
index 2b37667dbcd6eca156c161bcd2973df4068867f8..adf39131ba5ff4f27965eb1a8aac51745d623a47 100644 (file)
@@ -1,3 +1,9 @@
+2015-07-10  Mantas Mikaitis  <Mantas.Mikaitis@arm.com>
+
+       * gcc.target/arm/macro_defs0.c: New test.
+       * gcc.target/arm/macro_defs1.c: New test.
+       * gcc.target/arm/macro_defs2.c: New test.
+
 2015-07-08  Martin Jambor  <mjambor@suse.cz>
 
        PR ipa/61820
diff --git a/gcc/testsuite/gcc.target/arm/macro_defs0.c b/gcc/testsuite/gcc.target/arm/macro_defs0.c
new file mode 100644 (file)
index 0000000..198243e
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-skip-if "avoid conflicting multilib options"
+   { *-*-* } { "-march=*" } {"-march=armv7-m"} } */
+/* { dg-skip-if "avoid conflicting multilib options"
+   { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */
+/* { dg-options "-march=armv7-m -mcpu=cortex-m3 -mfloat-abi=soft -mthumb" } */
+
+#ifdef __ARM_FP
+#error __ARM_FP should not be defined
+#endif
+
+#ifdef __ARM_NEON_FP
+#error __ARM_NEON_FP should not be defined
+#endif
diff --git a/gcc/testsuite/gcc.target/arm/macro_defs1.c b/gcc/testsuite/gcc.target/arm/macro_defs1.c
new file mode 100644 (file)
index 0000000..075b71b
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-skip-if "avoid conflicting multilib options"
+   { *-*-* } { "-march=*" } { "-march=armv6-m" } } */
+/* { dg-options "-march=armv6-m -mthumb" } */
+
+#ifdef __ARM_NEON_FP
+#error __ARM_NEON_FP should not be defined
+#endif
+
diff --git a/gcc/testsuite/gcc.target/arm/macro_defs2.c b/gcc/testsuite/gcc.target/arm/macro_defs2.c
new file mode 100644 (file)
index 0000000..9a96042
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-march=armv7ve -mcpu=cortex-a15 -mfpu=neon-vfpv4" } */
+/* { dg-add-options arm_neon } */
+/* { dg-require-effective-target arm_neon_ok } */
+
+#ifndef __ARM_NEON_FP
+#error  __ARM_NEON_FP is not defined but should be
+#endif
+
+#ifndef __ARM_FP
+#error  __ARM_FP is not defined but should be
+#endif
+
+