diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index ff4ddac..7d4cc39 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -2343,17 +2343,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/gcc.target/arm/macro_defs0.c b/gcc/testsuite/gcc.target/arm/macro_defs0.c new file mode 100644 index 0000000..198243e --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs0.c @@ -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 index 0000000..075b71b --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs1.c @@ -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 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 + +