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 /cipher/chacha20-ppc.c | |
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 'cipher/chacha20-ppc.c')
-rw-r--r-- | cipher/chacha20-ppc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cipher/chacha20-ppc.c b/cipher/chacha20-ppc.c index 3fe7bc8c..243c12ff 100644 --- a/cipher/chacha20-ppc.c +++ b/cipher/chacha20-ppc.c @@ -657,7 +657,10 @@ chacha20_poly1305_ppc_blocks4(u32 *state, byte *dst, const byte *src, # define FUNC_ATTR_OPT_O2 #endif -#ifdef HAVE_GCC_ATTRIBUTE_PPC_TARGET +#if defined(__clang__) && defined(HAVE_CLANG_ATTRIBUTE_PPC_TARGET) +# define FUNC_ATTR_TARGET_P8 __attribute__((target("arch=pwr8"))) +# define FUNC_ATTR_TARGET_P9 __attribute__((target("arch=pwr9"))) +#elif defined(HAVE_GCC_ATTRIBUTE_PPC_TARGET) # define FUNC_ATTR_TARGET_P8 __attribute__((target("cpu=power8"))) # define FUNC_ATTR_TARGET_P9 __attribute__((target("cpu=power9"))) #else |