From 0998b40d2da6da5b257f38e9535a981ebc1b6e30 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Wed, 21 Nov 2018 00:25:05 -0500 Subject: [PATCH] Disable Altivec for BLAKE2s on AIX 7.1 and XLC 12.01 (GH #743) --- blake2.cpp | 8 ++++++++ blake2b_simd.cpp | 8 ++++++++ blake2s_simd.cpp | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/blake2.cpp b/blake2.cpp index c05856d0..a9bea136 100644 --- a/blake2.cpp +++ b/blake2.cpp @@ -34,6 +34,14 @@ # undef CRYPTOPP_ARM_NEON_AVAILABLE #endif +// BLAKE2s bug on AIX 7.1 (POWER7) with XLC 12.01 +// https://github.com/weidai11/cryptopp/issues/743 +#if defined(__xlC__) && (__xlC__ < 0x0d01) +# define CRYPTOPP_DISABLE_ALTIVEC 1 +# undef CRYPTOPP_POWER7_AVAILABLE +# undef CRYPTOPP_ALTIVEC_AVAILABLE +#endif + NAMESPACE_BEGIN(CryptoPP) // Export the tables to the SIMD files diff --git a/blake2b_simd.cpp b/blake2b_simd.cpp index 2f26c816..ca5aa054 100644 --- a/blake2b_simd.cpp +++ b/blake2b_simd.cpp @@ -24,6 +24,14 @@ # undef CRYPTOPP_ARM_NEON_AVAILABLE #endif +// BLAKE2s bug on AIX 7.1 (POWER7) with XLC 12.01 +// https://github.com/weidai11/cryptopp/issues/743 +#if defined(__xlC__) && (__xlC__ < 0x0d01) +# define CRYPTOPP_DISABLE_ALTIVEC 1 +# undef CRYPTOPP_POWER7_AVAILABLE +# undef CRYPTOPP_ALTIVEC_AVAILABLE +#endif + #if (CRYPTOPP_SSE41_AVAILABLE) # include # include diff --git a/blake2s_simd.cpp b/blake2s_simd.cpp index 9ad56252..efcd5967 100644 --- a/blake2s_simd.cpp +++ b/blake2s_simd.cpp @@ -34,6 +34,14 @@ # undef CRYPTOPP_ARM_NEON_AVAILABLE #endif +// BLAKE2s bug on AIX 7.1 (POWER7) with XLC 12.01 +// https://github.com/weidai11/cryptopp/issues/743 +#if defined(__xlC__) && (__xlC__ < 0x0d01) +# define CRYPTOPP_DISABLE_ALTIVEC 1 +# undef CRYPTOPP_POWER7_AVAILABLE +# undef CRYPTOPP_ALTIVEC_AVAILABLE +#endif + #if (CRYPTOPP_SSE41_AVAILABLE) # include # include