aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMantas Mikaitis <mantas.mikaitis@arm.com>2015-02-05 16:58:58 +0000
committerAlan Lawrence <alalaw01@gcc.gnu.org>2015-02-05 16:58:58 +0000
commit29e1d31b2cf2720fad010f1079b679c5edfb206f (patch)
tree3af2ded9211f056e18c3f33bceaa37292a578673
parent06fa4f005f4432d90148d37bcce2752dd922e947 (diff)
downloadgcc-29e1d31b2cf2720fad010f1079b679c5edfb206f.zip
gcc-29e1d31b2cf2720fad010f1079b679c5edfb206f.tar.gz
gcc-29e1d31b2cf2720fad010f1079b679c5edfb206f.tar.bz2
[ARM] __ARM_FP & __ARM_NEON_FP defined when -march=armv7-m
gcc/: * config/arm/arm.h (TARGET_NEON_FP): Removed conditional definition, define to zero if !TARGET_NEON. (TARGET_CPU_CPP_BUILTINS): Added second condition before defining __ARM_FP macro. gcc/testsuite/: * 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: r220456
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/arm/arm.h12
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.target/arm/macro_defs0.c12
-rw-r--r--gcc/testsuite/gcc.target/arm/macro_defs1.c8
-rw-r--r--gcc/testsuite/gcc.target/arm/macro_defs2.c14
6 files changed, 53 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c293971..1805759 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2015-02-04 Mantas Mikaitis <mantas.mikaitis@arm.com>
+
+ * config/arm/arm.h (TARGET_NEON_FP): Removed conditional definition,
+ define to zero if !TARGET_NEON.
+ (TARGET_CPU_CPP_BUILTINS): Added second condition before defining
+ __ARM_FP macro.
+
2015-02-04 Jan Hubicka <hubicka@ucw.cz>
Trevor Saunders <tsaunders@mozilla.com>
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 831d6e1..297dfe1 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -2360,17 +2360,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. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b7be54e..d8adce2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2015-02-05 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-02-05 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/64905
diff --git a/gcc/testsuite/gcc.target/arm/macro_defs0.c b/gcc/testsuite/gcc.target/arm/macro_defs0.c
new file mode 100644
index 0000000..945eec3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/macro_defs0.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv7-m" } } */
+/* { dg-skip-if "avoid conflicting multilib options" { target *-*-* } { "-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
index 0000000..d5423c7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/macro_defs1.c
@@ -0,0 +1,8 @@
+/* { 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
index 0000000..9a96042
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/macro_defs2.c
@@ -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
+
+