public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][AArch64] Error out of arm_neon.h if nofp/nosimd
@ 2015-01-14 10:54 Kyrill Tkachov
  2015-01-14 11:27 ` Richard Earnshaw
  0 siblings, 1 reply; 2+ messages in thread
From: Kyrill Tkachov @ 2015-01-14 10:54 UTC (permalink / raw)
  To: GCC Patches; +Cc: Marcus Shawcroft, Richard Earnshaw

[-- Attachment #1: Type: text/plain, Size: 823 bytes --]

Hi all,

In the arm version of arm_neon.h we error out early if the user tries to 
use that header without NEON.
In aarch64 AdvancedSIMD is available by default unless the user 
explicitly disables it.
Still it would be more helpful if we could just error out gracefully 
instead of dumping a long stream of type errors and other black magic in 
case the user disables AdvancedSIMD explicitly.
So, similar to arm_neon.h in the arm port we error out in aarch64 as well.

Checked that all arm_neon.h-related tests work as before.

Ok for trunk?

Thanks,
Kyrill

2015-01-14  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * config/aarch64/arm_neon.h: Error out if NEON is not available.

2015-01-14  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * gcc.target/aarch64/arm_neon-nosimd-error.c: New test.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: aarch64-neon-error.patch --]
[-- Type: text/x-patch; name=aarch64-neon-error.patch, Size: 1195 bytes --]

commit 3c3d56e01ec55f8387bf447e57cdc7f94b0e119b
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date:   Thu Dec 11 15:09:56 2014 +0000

    [AArch64] Error out of arm_neon.h if nofp/nosimd

diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h
index 319cd8c..22dfb0b 100644
--- a/gcc/config/aarch64/arm_neon.h
+++ b/gcc/config/aarch64/arm_neon.h
@@ -27,6 +27,10 @@
 #ifndef _AARCH64_NEON_H_
 #define _AARCH64_NEON_H_
 
+#ifndef __ARM_NEON
+#error You must enable AdvancedSIMD instructions to use arm_neon.h
+#else
+
 #include <stdint.h>
 
 #define __AARCH64_UINT64_C(__C) ((uint64_t) __C)
@@ -25209,3 +25213,5 @@ __INTERLEAVE_LIST (zip)
 #undef __aarch64_vdupq_laneq_u64
 
 #endif
+
+#endif
diff --git a/gcc/testsuite/gcc.target/aarch64/arm_neon-nosimd-error.c b/gcc/testsuite/gcc.target/aarch64/arm_neon-nosimd-error.c
new file mode 100644
index 0000000..6c508ec
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/arm_neon-nosimd-error.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-mgeneral-regs-only" } */
+/* { dg-excess-errors "You must enable" } */
+
+#include "arm_neon.h"
+
+int
+foo ()
+{
+  return 0;
+}

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][AArch64] Error out of arm_neon.h if nofp/nosimd
  2015-01-14 10:54 [PATCH][AArch64] Error out of arm_neon.h if nofp/nosimd Kyrill Tkachov
@ 2015-01-14 11:27 ` Richard Earnshaw
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Earnshaw @ 2015-01-14 11:27 UTC (permalink / raw)
  To: Kyrill Tkachov, GCC Patches; +Cc: Marcus Shawcroft

On 14/01/15 10:42, Kyrill Tkachov wrote:
> Hi all,
> 
> In the arm version of arm_neon.h we error out early if the user tries to 
> use that header without NEON.
> In aarch64 AdvancedSIMD is available by default unless the user 
> explicitly disables it.
> Still it would be more helpful if we could just error out gracefully 
> instead of dumping a long stream of type errors and other black magic in 
> case the user disables AdvancedSIMD explicitly.
> So, similar to arm_neon.h in the arm port we error out in aarch64 as well.
> 
> Checked that all arm_neon.h-related tests work as before.
> 
> Ok for trunk?
> 
> Thanks,
> Kyrill
> 
> 2015-01-14  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
> 
>      * config/aarch64/arm_neon.h: Error out if NEON is not available.
> 
> 2015-01-14  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
> 
>      * gcc.target/aarch64/arm_neon-nosimd-error.c: New test.
> 

OK>

R.

> 
> aarch64-neon-error.patch
> 
> 
> commit 3c3d56e01ec55f8387bf447e57cdc7f94b0e119b
> Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
> Date:   Thu Dec 11 15:09:56 2014 +0000
> 
>     [AArch64] Error out of arm_neon.h if nofp/nosimd
> 
> diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h
> index 319cd8c..22dfb0b 100644
> --- a/gcc/config/aarch64/arm_neon.h
> +++ b/gcc/config/aarch64/arm_neon.h
> @@ -27,6 +27,10 @@
>  #ifndef _AARCH64_NEON_H_
>  #define _AARCH64_NEON_H_
>  
> +#ifndef __ARM_NEON
> +#error You must enable AdvancedSIMD instructions to use arm_neon.h
> +#else
> +
>  #include <stdint.h>
>  
>  #define __AARCH64_UINT64_C(__C) ((uint64_t) __C)
> @@ -25209,3 +25213,5 @@ __INTERLEAVE_LIST (zip)
>  #undef __aarch64_vdupq_laneq_u64
>  
>  #endif
> +
> +#endif
> diff --git a/gcc/testsuite/gcc.target/aarch64/arm_neon-nosimd-error.c b/gcc/testsuite/gcc.target/aarch64/arm_neon-nosimd-error.c
> new file mode 100644
> index 0000000..6c508ec
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/aarch64/arm_neon-nosimd-error.c
> @@ -0,0 +1,11 @@
> +/* { dg-do compile } */
> +/* { dg-options "-mgeneral-regs-only" } */
> +/* { dg-excess-errors "You must enable" } */
> +
> +#include "arm_neon.h"
> +
> +int
> +foo ()
> +{
> +  return 0;
> +}
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-14 11:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-14 10:54 [PATCH][AArch64] Error out of arm_neon.h if nofp/nosimd Kyrill Tkachov
2015-01-14 11:27 ` Richard Earnshaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).