diff mbox

[ARM] Error out of arm_neon.h if compiling for soft-float ABI

Message ID 56D4847C.1000305@foss.arm.com
State New
Headers show

Commit Message

Kyrill Tkachov Feb. 29, 2016, 5:48 p.m. UTC
Hi all,

Now that we've moved to pragmas guarding the various intrinsics in arm_neon.h I think we should still
throw a #error if someone tries to include the header while compiling for -mfloat-abi=soft.

This gives a more helpful error message when someone has a compiler configured --with-float=soft
and forgets to add an appropriate -mfloat-abi option on the command line.
Currently we'll just give tons of error messages whereas with this patch we just
show a simple clean message.

Tested on arm. This could be argued to be a user experience regression fix.
Ok for trunk?

Thanks,
Kyrill

2016-02-29  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * config/arm/arm_neon.h: Show error if using with soft-float ABI.

Comments

Christophe Lyon March 2, 2016, 3:10 p.m. UTC | #1
On 29 February 2016 at 18:48, Kyrill Tkachov
<kyrylo.tkachov@foss.arm.com> wrote:
> Hi all,
>
> Now that we've moved to pragmas guarding the various intrinsics in
> arm_neon.h I think we should still
> throw a #error if someone tries to include the header while compiling for
> -mfloat-abi=soft.
>
> This gives a more helpful error message when someone has a compiler
> configured --with-float=soft
> and forgets to add an appropriate -mfloat-abi option on the command line.
> Currently we'll just give tons of error messages whereas with this patch we
> just
> show a simple clean message.
>
> Tested on arm. This could be argued to be a user experience regression fix.
Agreed :)

> Ok for trunk?
>
> Thanks,
> Kyrill
>
> 2016-02-29  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>     * config/arm/arm_neon.h: Show error if using with soft-float ABI.
Ramana Radhakrishnan March 7, 2016, 4:50 a.m. UTC | #2
On Mon, Feb 29, 2016 at 5:48 PM, Kyrill Tkachov
<kyrylo.tkachov@foss.arm.com> wrote:
> Hi all,
>
> Now that we've moved to pragmas guarding the various intrinsics in
> arm_neon.h I think we should still
> throw a #error if someone tries to include the header while compiling for
> -mfloat-abi=soft.
>
> This gives a more helpful error message when someone has a compiler
> configured --with-float=soft
> and forgets to add an appropriate -mfloat-abi option on the command line.
> Currently we'll just give tons of error messages whereas with this patch we
> just
> show a simple clean message.
>
> Tested on arm. This could be argued to be a user experience regression fix.
> Ok for trunk?


OK.

thanks,
Ramana
>
> Thanks,
> Kyrill
>
> 2016-02-29  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>     * config/arm/arm_neon.h: Show error if using with soft-float ABI.
diff mbox

Patch

diff --git a/gcc/config/arm/arm_neon.h b/gcc/config/arm/arm_neon.h
index 47816d52187b979b92d7592991d29e4cbe8f9357..6a880235d24759e9938fb08365eaddff77d60f0e 100644
--- a/gcc/config/arm/arm_neon.h
+++ b/gcc/config/arm/arm_neon.h
@@ -27,6 +27,10 @@ 
 #ifndef _GCC_ARM_NEON_H
 #define _GCC_ARM_NEON_H 1
 
+#ifndef __ARM_FP
+#error "NEON intrinsics not available with the soft-float ABI.  Please use -mfloat-abi=softp or -mfloat-abi=hard"
+#else
+
 #pragma GCC push_options
 #pragma GCC target ("fpu=neon")
 
@@ -14833,3 +14837,4 @@  vmull_high_p64 (poly64x2_t __a, poly64x2_t __b)
 #pragma GCC pop_options
 
 #endif
+#endif