diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2023-02-26 15:33:43 +0200 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2023-02-26 15:34:04 +0200 |
commit | 937a76a34540bd2558f5b34a98fbe53227000646 (patch) | |
tree | 2857979390ab1c74f938dcb63d8eced17af420dc /configure.ac | |
parent | f3d1d4a8c9f0df107a57e2cd3699253766d6e45a (diff) | |
download | libgcrypt-937a76a34540bd2558f5b34a98fbe53227000646.tar.gz |
ppc: add support for clang target attribute
* configure.ac (gcry_cv_clang_attribute_ppc_target): New.
* cipher/chacha20-ppc.c [HAVE_CLANG_ATTRIBUTE_PPC_TARGET]
(FUNC_ATTR_TARGET_P8, FUNC_ATTR_TARGET_P9): New.
* cipher/rijndael-ppc.c [HAVE_CLANG_ATTRIBUTE_PPC_TARGET]
(FPC_OPT_ATTR): New.
* cipher/rijndael-ppc9le.c [HAVE_CLANG_ATTRIBUTE_PPC_TARGET]
(FPC_OPT_ATTR): New.
* cipher/sha256-ppc.c [HAVE_CLANG_ATTRIBUTE_PPC_TARGET]
(FUNC_ATTR_TARGET_P8, FUNC_ATTR_TARGET_P9): New.
* cipher/sha512-ppc.c [HAVE_CLANG_ATTRIBUTE_PPC_TARGET]
(FUNC_ATTR_TARGET_P8, FUNC_ATTR_TARGET_P9): New.
(ror64): Remove unused function.
--
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 63f705ea..b9ac99bb 100644 --- a/configure.ac +++ b/configure.ac @@ -2292,6 +2292,28 @@ fi # +# Check whether compiler supports clang PowerPC target attributes +# +AC_CACHE_CHECK([whether compiler supports clang PowerPC target attributes], + [gcry_cv_clang_attribute_ppc_target], + [if test "$mpi_cpu_arch" != "ppc" ; then + gcry_cv_clang_attribute_ppc_target="n/a" + else + gcry_cv_clang_attribute_ppc_target=no + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[void __attribute__((target("arch=pwr8"))) testfn8(void) {} + void __attribute__((target("arch=pwr9"))) testfn9(void) + { testfn8(); } + ]], [ testfn9(); ])], + [gcry_cv_clang_attribute_ppc_target=yes]) + fi]) +if test "$gcry_cv_clang_attribute_ppc_target" = "yes" ; then + AC_DEFINE(HAVE_CLANG_ATTRIBUTE_PPC_TARGET,1, + [Defined if compiler supports clang PowerPC target attributes]) +fi + + +# # Check whether GCC inline assembler supports zSeries instructions # AC_CACHE_CHECK([whether GCC inline assembler supports zSeries instructions], |