]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[ARM target attributes] Fix effective_target tests
authorclyon <clyon@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Jan 2016 14:19:41 +0000 (14:19 +0000)
committerclyon <clyon@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Jan 2016 14:19:41 +0000 (14:19 +0000)
2016-01-20  Christophe Lyon  <christophe.lyon@linaro.org>

gcc/
* doc/sourcebuild.texi (arm_crypto_pragma_ok): Document new entry.
(arm_fp_ok): Likewise.
(arm_fp): Likewise.
(arm_crypto): Likewise.

gcc/testsuite/
* lib/target-supports.exp
(check_effective_target_arm_fp_ok_nocache): New.
(check_effective_target_arm_fp_ok): New.
(add_options_for_arm_fp): New.
(check_effective_target_arm_crypto_ok_nocache): Require
target_arm_v8_neon_ok instead of arm32.
(check_effective_target_arm_crypto_pragma_ok_nocache): New.
(check_effective_target_arm_crypto_pragma_ok): New.
(add_options_for_arm_vfp): New.
* gcc.target/arm/attr-crypto.c: Use arm_crypto_pragma_ok effective
target. Do not force -mfloat-abi=softfp, use arm_fp_ok effective
target instead. Force initial fpu to vfp.
* gcc.target/arm/attr-neon-builtin-fail.c: Do not force
-mfloat-abi=softfp, use arm_fp_ok effective target instead.
* gcc.target/arm/attr-neon-fp16.c: Likewise. Remove arm_neon_ok
dependency.
* gcc.target/arm/attr-neon2.c: Do not force -mfloat-abi=softfp,
use arm_vfp effective target instead. Force initial fpu to vfp.
* gcc.target/arm/attr-neon3.c: Likewise.
* gcc.target/arm/cmp-2.c: Use arm_fp_ok effective target instead of
arm_vfp_ok.
* gcc.target/arm/unsigned-float.c: Likewise.
* gcc.target/arm/vfp-1.c: Likewise.
* gcc.target/arm/vfp-ldmdbd.c: Likewise.
* gcc.target/arm/vfp-ldmdbs.c: Likewise.
* gcc.target/arm/vfp-ldmiad.c: Likewise.
* gcc.target/arm/vfp-ldmias.c: Likewise.
* gcc.target/arm/vfp-stmdbd.c: Likewise.
* gcc.target/arm/vfp-stmdbs.c: Likewise.
* gcc.target/arm/vfp-stmiad.c: Likewise.
* gcc.target/arm/vfp-stmias.c: Likewise.
* gcc.target/arm/vnmul-1.c: Likewise.
* gcc.target/arm/vnmul-2.c: Likewise.
* gcc.target/arm/vnmul-3.c: Likewise.
* gcc.target/arm/vnmul-4.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232616 138bc75d-0d04-0410-961f-82ee72b054a4

24 files changed:
gcc/ChangeLog
gcc/doc/sourcebuild.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/attr-crypto.c
gcc/testsuite/gcc.target/arm/attr-neon-builtin-fail.c
gcc/testsuite/gcc.target/arm/attr-neon-fp16.c
gcc/testsuite/gcc.target/arm/attr-neon2.c
gcc/testsuite/gcc.target/arm/attr-neon3.c
gcc/testsuite/gcc.target/arm/cmp-2.c
gcc/testsuite/gcc.target/arm/unsigned-float.c
gcc/testsuite/gcc.target/arm/vfp-1.c
gcc/testsuite/gcc.target/arm/vfp-ldmdbd.c
gcc/testsuite/gcc.target/arm/vfp-ldmdbs.c
gcc/testsuite/gcc.target/arm/vfp-ldmiad.c
gcc/testsuite/gcc.target/arm/vfp-ldmias.c
gcc/testsuite/gcc.target/arm/vfp-stmdbd.c
gcc/testsuite/gcc.target/arm/vfp-stmdbs.c
gcc/testsuite/gcc.target/arm/vfp-stmiad.c
gcc/testsuite/gcc.target/arm/vfp-stmias.c
gcc/testsuite/gcc.target/arm/vnmul-1.c
gcc/testsuite/gcc.target/arm/vnmul-2.c
gcc/testsuite/gcc.target/arm/vnmul-3.c
gcc/testsuite/gcc.target/arm/vnmul-4.c
gcc/testsuite/lib/target-supports.exp

index 1fb002a9fb2696dde9e1ad4d90caacac6b640acc..308c90631b957111f72f58174bb2e40a0cf9fa8a 100644 (file)
@@ -1,3 +1,10 @@
+2016-01-20  Christophe Lyon  <christophe.lyon@linaro.org>
+
+       * doc/sourcebuild.texi (arm_crypto_pragma_ok): Document new entry.
+       (arm_fp_ok): Likewise.
+       (arm_fp): Likewise.
+       (arm_crypto): Likewise.
+
 2016-01-20  Ilya Enkovich  <enkovich.gnu@gmail.com>
            Richard Biener  <rguenther@suse.de>
 
index 62212d4b06ed60890afc329ddd1eaab274d5a1da..036dcd62da49a62257fec57dd99946c9134ee1d6 100644 (file)
@@ -1511,9 +1511,21 @@ Target generates decimal floating point instructions with current options.
 @item arm32
 ARM target generates 32-bit code.
 
+@item arm_crypto_pragma_ok
+@anchor{arm_crypto_pragma_ok}
+ARM target supports pragma target @code{fpu=crypto-neon-fp-armv8}.
+This may need @code{-mfpu=crypto-neon-fp-armv8} or equivalent options.
+Some multilibs may be incompatible with these options.
+
 @item arm_eabi
 ARM target adheres to the ABI for the ARM Architecture.
 
+@item arm_fp_ok
+@anchor{arm_fp_ok}
+ARM target defines @code{__ARM_FP} using @code{-mfloat-abi=softfp} or
+equivalent options.  Some multilibs may be incompatible with these
+options.
+
 @item arm_hf_eabi
 ARM target adheres to the VFP and Advanced SIMD Register Arguments
 variant of the ABI for the ARM Architecture (as selected with
@@ -2047,6 +2059,17 @@ The supported values of @var{feature} for directive @code{dg-add-options}
 are:
 
 @table @code
+@item arm_crypto_pragma
+Crypto extension pragma support.  Only ARM targets support this
+feature, and only then in certain modes; see the
+@ref{arm_crypto_pragma_ok,,arm_crypto_pragma_ok effective target
+keyword}.
+
+@item arm_fp
+@code{__ARM_FP} definition.  Only ARM targets support this feature, and only then
+in certain modes; see the @ref{arm_fp_ok,,arm_fp_ok effective target
+keyword}.
+
 @item arm_neon
 NEON support.  Only ARM targets support this feature, and only then
 in certain modes; see the @ref{arm_neon_ok,,arm_neon_ok effective target
index ce8c63e008e20bd68ba394ce0732c3a2c3895731..9f4bcdd02d734e82434b4dd5b9a48eeef0d264f8 100644 (file)
@@ -1,3 +1,41 @@
+2016-01-20  Christophe Lyon  <christophe.lyon@linaro.org>
+
+       * lib/target-supports.exp
+       (check_effective_target_arm_fp_ok_nocache): New.
+       (check_effective_target_arm_fp_ok): New.
+       (add_options_for_arm_fp): New.
+       (check_effective_target_arm_crypto_ok_nocache): Require
+       target_arm_v8_neon_ok instead of arm32.
+       (check_effective_target_arm_crypto_pragma_ok_nocache): New.
+       (check_effective_target_arm_crypto_pragma_ok): New.
+       (add_options_for_arm_vfp): New.
+       * gcc.target/arm/attr-crypto.c: Use arm_crypto_pragma_ok effective
+       target. Do not force -mfloat-abi=softfp, use arm_fp_ok effective
+       target instead. Force initial fpu to vfp.
+       * gcc.target/arm/attr-neon-builtin-fail.c: Do not force
+       -mfloat-abi=softfp, use arm_fp_ok effective target instead.
+       * gcc.target/arm/attr-neon-fp16.c: Likewise. Remove arm_neon_ok
+       dependency.
+       * gcc.target/arm/attr-neon2.c: Do not force -mfloat-abi=softfp,
+       use arm_vfp effective target instead. Force initial fpu to vfp.
+       * gcc.target/arm/attr-neon3.c: Likewise.
+       * gcc.target/arm/cmp-2.c: Use arm_fp_ok effective target instead of
+       arm_vfp_ok.
+       * gcc.target/arm/unsigned-float.c: Likewise.
+       * gcc.target/arm/vfp-1.c: Likewise.
+       * gcc.target/arm/vfp-ldmdbd.c: Likewise.
+       * gcc.target/arm/vfp-ldmdbs.c: Likewise.
+       * gcc.target/arm/vfp-ldmiad.c: Likewise.
+       * gcc.target/arm/vfp-ldmias.c: Likewise.
+       * gcc.target/arm/vfp-stmdbd.c: Likewise.
+       * gcc.target/arm/vfp-stmdbs.c: Likewise.
+       * gcc.target/arm/vfp-stmiad.c: Likewise.
+       * gcc.target/arm/vfp-stmias.c: Likewise.
+       * gcc.target/arm/vnmul-1.c: Likewise.
+       * gcc.target/arm/vnmul-2.c: Likewise.
+       * gcc.target/arm/vnmul-3.c: Likewise.
+       * gcc.target/arm/vnmul-4.c: Likewise.
+
 2016-01-20  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR testsuite/69366
index 1db598447cd724e5c18c645029d1a5e9cbb80fbe..3b4b7c5eda6229187bd26cd38a816827c2baa5cc 100644 (file)
@@ -1,6 +1,14 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_crypto_ok } */
-/* { dg-options "-O2 -mfloat-abi=softfp" } */
+/* Make sure we can force fpu=vfp before switching using the
+   pragma.  */
+/* { dg-require-effective-target arm_fp_ok } */
+/* { dg-require-effective-target arm_crypto_pragma_ok } */
+/* { dg-options "-O2 -march=armv8-a" } */
+/* { dg-add-options arm_fp } */
+
+/* Reset fpu to a value compatible with the next pragmas.  */
+#pragma GCC target ("fpu=vfp")
+#pragma GCC push_options
 
 #pragma GCC target ("fpu=crypto-neon-fp-armv8")
 
@@ -28,7 +36,7 @@ foo (void)
   return res[0];
 }
 
-#pragma GCC reset_options
+#pragma GCC pop_options
 
 /* Check that the FP version is correctly reset.  */
 
index 6ac32fca166711bb0a7bc86c57e5c88b677b6dca..05dc579f25d0169b918ee775d8df36fae4f9de47 100644 (file)
@@ -1,7 +1,9 @@
 /* Check that calling a neon builtin from a function compiled with vfp fails.  */
 /* { dg-do compile } */
+/* { dg-require-effective-target arm_fp_ok } */
 /* { dg-require-effective-target arm_neon_ok } */
-/* { dg-options "-O2 -mfloat-abi=softfp" } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_fp } */
 
 #include <arm_neon.h>
 
@@ -12,6 +14,5 @@ foo (uint8x16_t *p)
   *p = vmovq_n_u8 (3); /* { dg-message "called from here" } */
 }
 
-/* { dg-error "inlining failed in call to always_inline" "" { target *-*-* } 0 }
- */
+/* { dg-error "inlining failed in call to always_inline" "" { target *-*-* } 0 } */
 
index 3cf8918d724afd40cc34e6b1bc203cfb7c8c7faf..984992f2ab06969969f5e7699d7af7fed356705a 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_neon_ok } */
-/* { dg-options "-mfp16-format=ieee -mfloat-abi=softfp" } */
+/* { dg-require-effective-target arm_fp_ok } */
+/* { dg-options "-mfp16-format=ieee" } */
+/* { dg-add-options arm_fp } */
 
 #include "arm_neon.h"
 
index 819fad4ce621965a9595f8f32e4058ea0b70c861..29668256cf5bd64a7fbc36e24de6e44661fce14d 100644 (file)
@@ -1,6 +1,12 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target arm_neon_ok } */
-/* { dg-options "-O2 -mfloat-abi=softfp -mfpu=vfp" } */
+/* { dg-require-effective-target arm_fp_ok } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_fp } */
+
+/* Reset fpu to a value compatible with the next pragmas.  */
+#pragma GCC target ("fpu=vfp")
+#pragma GCC push_options
 
 #pragma GCC target ("fpu=neon")
 #include <arm_neon.h>
@@ -12,7 +18,7 @@ my (int8x8_t __a, int8x8_t __b)
   return __a + __b;
 }
 
-#pragma GCC reset_options
+#pragma GCC pop_options
 
 /* Check that command line option is restored.  */
 int8x8_t 
index 30a14790d08894c90cc4b95316de5a069b765684..17e429ad73934c2b829d3cefd6a89ebd52052978 100644 (file)
@@ -1,6 +1,12 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target arm_crypto_ok } */
-/* { dg-options "-O2 -mfloat-abi=softfp -mfpu=vfp" } */
+/* { dg-require-effective-target arm_fp_ok } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_fp } */
+
+/* Reset fpu to a value compatible with the next pragmas.  */
+#pragma GCC target ("fpu=vfp")
+#pragma GCC push_options
 
 #include <arm_neon.h>
 
index ed6b609ca86191779f1feb318c99e8fc5318e76e..70e45091c0c5530760bb0d1e4b91f58249afca57 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-require-effective-target arm_fp_ok } */
 /* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
-/* { dg-options "-O -mfpu=vfp -mfloat-abi=softfp" } */
+/* { dg-options "-O" } */
+/* { dg-add-options arm_fp } */
 /* { dg-final { scan-assembler-not "\tbl\t" } } */
 /* { dg-final { scan-assembler-not "__aeabi" } } */
 int x, y;
index b9ed6811bfb97ef7c3ee6eb131b5d4fa36d258b0..e1cda0ce9e29c529d7591e2b008c9528a593e65e 100644 (file)
@@ -1,8 +1,9 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-require-effective-target arm_fp_ok } */
 /* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
 /* { dg-options "-march=armv7-a -O1" } */
-/* { dg-additional-options "-mfloat-abi=softfp" { target { ! { arm_hf_eabi } } } } */
+/* { dg-add-options arm_fp } */
+
 
 #include <stdint.h>
 
index 9aa530240383199625fa07eaeff2171c92d0cdd7..7add1b869ea98cf6c71e7955c69441c0895d4fbc 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mfpu=vfp -mfloat-abi=softfp -ffp-contract=off" } */
-/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-require-effective-target arm_fp_ok } */
+/* { dg-options "-O2 -ffp-contract=off" } */
+/* { dg-add-options arm_fp } */
 /* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
 
 extern float fabsf (float);
index 704157979aa32c548dc764fed3ab387ba23ec8bd..3489a2a9e2557bcb319b9a2deb8614f7856cd340 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-require-effective-target arm_fp_ok } */
 /* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
-/* { dg-options "-O2 -mfpu=vfp -mfloat-abi=softfp" } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_fp } */
 
 extern void bar (double);
 
index 0187c01606c4cb3e44da84973b15af1ba8b761b2..8fda4059c3b4b8dd1b651d8bafdf093a5d585628 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-require-effective-target arm_fp_ok } */
 /* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
-/* { dg-options "-O2 -mfpu=vfp -mfloat-abi=softfp" } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_fp } */
 
 extern void bar (float);
 
index 9c22f1f463cbc09b4fc6a71f87f4b9b6dc1c0268..422e3ed602b025eb5b6985784814931cc5331ea1 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-require-effective-target arm_fp_ok } */
 /* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
-/* { dg-options "-O2 -mfpu=vfp -mfloat-abi=softfp" } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_fp } */
 
 extern void bar (double);
 
index 92051fd18275ddb71477f275471f9efcbf426ebe..31d2ee175779549960b1fbb7c02e561a4b00da86 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-require-effective-target arm_fp_ok } */
 /* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
-/* { dg-options "-O2 -mfpu=vfp -mfloat-abi=softfp" } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_fp } */
 
 extern void bar (float);
 
index 53383b5cf0ab31193e87e796b2d70020a6475400..686fe86392b4e41d85cb3c98b1f30e57e6e9f61e 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-require-effective-target arm_fp_ok } */
 /* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
-/* { dg-options "-O2 -mfpu=vfp -mfloat-abi=softfp" } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_fp } */
 
 void
 foo (double *p, double a, double b, int n)
index 6570defa71eedaf1e9b9bf7bba54afe756bdaebf..dbb30ecd6bc8e4610f4b6252b8aa7f1b703fc235 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-require-effective-target arm_fp_ok } */
 /* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
-/* { dg-options "-O2 -mfpu=vfp -mfloat-abi=softfp" } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_fp } */
 
 void
 foo (float *p, float a, float b, int n)
index 28e9d73b3f6e01556f3d86ed5e822dfa2209eb8b..665fa7a124b9b035dfb9106fc30fb15e3ecbcaad 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-require-effective-target arm_fp_ok } */
 /* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
-/* { dg-options "-O2 -mfpu=vfp -mfloat-abi=softfp" } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_fp } */
 
 void
 foo (double *p, double a, double b, int n)
index efa5fbe57f62bd0a85959a8fca04beeee5eef2f3..90940e5c8fe760d0cad910d3a7cdb0544c8ba749 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-require-effective-target arm_fp_ok } */
 /* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
-/* { dg-options "-O2 -mfpu=vfp -mfloat-abi=softfp" } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_fp } */
 
 void
 foo (float *p, float a, float b, int n)
index af0bebed20449f7d0aec7df312b8651497f6121d..fd00388a5392e53b60f6781136263a2e2f9ca190 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-require-effective-target arm_fp_ok } */
 /* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
-/* { dg-options "-O2 -fno-rounding-math -mfpu=vfp -mfloat-abi=hard" } */
+/* { dg-options "-O2 -fno-rounding-math" } */
+/* { dg-add-options arm_fp } */
 
 double
 foo_d (double a, double b)
index 909b2a44a79bbb4b6fed45a3649daddff1960301..c299ec115f5aaaff082b79d5d81b2aa8e7939db4 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-require-effective-target arm_fp_ok } */
 /* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
-/* { dg-options "-O2 -frounding-math -mfpu=vfp -mfloat-abi=hard" } */
+/* { dg-options "-O2 -frounding-math" } */
+/* { dg-add-options arm_fp } */
 
 double
 foo_d (double a, double b)
index df028823eea27fe61dd4e2308ff8e5401da4160b..44c1967ee7b291076b773dede0b08302263425a8 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-require-effective-target arm_fp_ok } */
 /* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
-/* { dg-options "-O2 -fno-rounding-math -mfpu=vfp -mfloat-abi=hard" } */
+/* { dg-options "-O2 -fno-rounding-math" } */
+/* { dg-add-options arm_fp } */
 
 double
 foo_d (double a, double b)
index 670ee40e0c80c3e507a4ad6452076057b783ec9e..dd9cab3c727a4e85ace1714af19b540bb752dfc6 100644 (file)
@@ -1,7 +1,8 @@
 /* { dg-do compile } */
-/* { dg-require-effective-target arm_vfp_ok } */
+/* { dg-require-effective-target arm_fp_ok } */
 /* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
-/* { dg-options "-O2 -frounding-math -mfpu=vfp -mfloat-abi=hard" } */
+/* { dg-options "-O2 -frounding-math" } */
+/* { dg-add-options arm_fp } */
 
 double
 foo_d (double a, double b)
index 94e0b05a20a724761ccdad75cd2dcd1915970794..dceabb5c5fe3fbaa24cf815b78b270e04274a5f8 100644 (file)
@@ -2744,6 +2744,47 @@ proc check_effective_target_arm_hard_vfp_ok { } {
     }
 }
 
+# Return 1 if this is an ARM target defining __ARM_FP. We may need
+# -mfloat-abi=softfp or equivalent options.  Some multilibs may be
+# incompatible with these options.  Also set et_arm_fp_flags to the
+# best options to add.
+
+proc check_effective_target_arm_fp_ok_nocache { } {
+    global et_arm_fp_flags
+    set et_arm_fp_flags ""
+    if { [check_effective_target_arm32] } {
+       foreach flags {"" "-mfloat-abi=softfp" "-mfloat-abi=hard"} {
+           if { [check_no_compiler_messages_nocache arm_fp_ok object {
+               #ifndef __ARM_FP
+               #error __ARM_FP not defined
+               #endif
+           } "$flags"] } {
+               set et_arm_fp_flags $flags
+               return 1
+           }
+       }
+    }
+
+    return 0
+}
+
+proc check_effective_target_arm_fp_ok { } {
+    return [check_cached_effective_target arm_fp_ok \
+               check_effective_target_arm_fp_ok_nocache]
+}
+
+# Add the options needed to define __ARM_FP.  We need either
+# -mfloat-abi=softfp or -mfloat-abi=hard, but if one is already
+# specified by the multilib, use it.
+
+proc add_options_for_arm_fp { flags } {
+    if { ! [check_effective_target_arm_fp_ok] } {
+       return "$flags"
+    }
+    global et_arm_fp_flags
+    return "$flags $et_arm_fp_flags"
+}
+
 # Return 1 if this is an ARM target that supports DSP multiply with
 # current multilib flags.
 
@@ -2776,7 +2817,7 @@ proc check_effective_target_arm_unaligned { } {
 proc check_effective_target_arm_crypto_ok_nocache { } {
     global et_arm_crypto_flags
     set et_arm_crypto_flags ""
-    if { [check_effective_target_arm32] } {
+    if { [check_effective_target_arm_v8_neon_ok] } {
        foreach flags {"" "-mfloat-abi=softfp" "-mfpu=crypto-neon-fp-armv8" "-mfpu=crypto-neon-fp-armv8 -mfloat-abi=softfp"} {
            if { [check_no_compiler_messages_nocache arm_crypto_ok object {
                #include "arm_neon.h"
@@ -2811,6 +2852,52 @@ proc add_options_for_arm_crypto { flags } {
     return "$flags $et_arm_crypto_flags"
 }
 
+# Return 1 if this is an ARM target supporting pragma target
+# fpu=crypto-neon-fp-armv8, possibly needing -mfloat-abi=softfp or
+# equivalent options.  Some multilibs may be incompatible with these
+# options.  Also set et_arm_crypto_pragma_flags to the best options to
+# add.
+
+proc check_effective_target_arm_crypto_pragma_ok_nocache { } {
+    global et_arm_crypto_pragma_flags
+    set et_arm_crypto_pragma_flags ""
+    if { [check_effective_target_arm_v8_neon_ok] } {
+       foreach flags {"" "-mfloat-abi=softfp" "-mfpu=crypto-neon-fp-armv8" "-mfpu=crypto-neon-fp-armv8 -mfloat-abi=softfp"} {
+           if { [check_no_compiler_messages_nocache arm_crypto_pragmaok object {
+               #pragma GCC target ("fpu=crypto-neon-fp-armv8")
+               #include "arm_neon.h"
+               uint8x16_t
+               foo (uint8x16_t a, uint8x16_t b)
+               {
+                 return vaeseq_u8 (a, b);
+               }
+           } "[add_options_for_arm_v8_neon ""] $flags"] } {
+               set et_arm_crypto_pragma_flags "[add_options_for_arm_v8_neon ""] $flags"
+               return 1
+           }
+       }
+    }
+
+    return 0
+}
+
+# Return 1 if this is an ARM target supporting pragma target
+# -mfpu=crypto-neon-fp-armv8.
+
+proc check_effective_target_arm_crypto_pragma_ok { } {
+    return [check_cached_effective_target arm_crypto_pragma_ok \
+               check_effective_target_arm_crypto_pragma_ok_nocache]
+}
+
+# Add options for crypto extensions pragma.
+proc add_options_for_arm_crypto_pragma { flags } {
+    if { ! [check_effective_target_arm_crypto_pragma_ok] } {
+        return "$flags"
+    }
+    global et_arm_crypto_pragma_flags
+    return "$flags $et_arm_crypto_pragma_flags"
+}
+
 # Add the options needed for NEON.  We need either -mfloat-abi=softfp
 # or -mfloat-abi=hard, but if one is already specified by the
 # multilib, use it.  Similarly, if a -mfpu option already enables
@@ -2931,8 +3018,8 @@ proc check_effective_target_arm_crc_ok { } {
 
 # Return 1 if this is an ARM target supporting -mfpu=neon-fp16
 # -mfloat-abi=softfp or equivalent options.  Some multilibs may be
-# incompatible with these options.  Also set et_arm_neon_flags to the
-# best options to add.
+# incompatible with these options.  Also set et_arm_neon_fp16_flags to
+# the best options to add.
 
 proc check_effective_target_arm_neon_fp16_ok_nocache { } {
     global et_arm_neon_fp16_flags