diff options
author | Jack Lloyd <[email protected]> | 2020-12-16 09:09:59 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2020-12-16 09:09:59 -0500 |
commit | 073b2bdc9f71e82ee11ef838a7eaef8471e63104 (patch) | |
tree | 1276ad96ca170dbd4ce6c5caf8c04aac6cc6e7cb /src/lib | |
parent | 931b5257eccf86fcff9f88663e05f618d1b61c1c (diff) |
Fix build on clang ppc64
GH #2554 #2547
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/utils/ghash/ghash_cpu/ghash_cpu.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/utils/ghash/ghash_cpu/ghash_cpu.cpp b/src/lib/utils/ghash/ghash_cpu/ghash_cpu.cpp index b1feb98f0..5d725933d 100644 --- a/src/lib/utils/ghash/ghash_cpu/ghash_cpu.cpp +++ b/src/lib/utils/ghash/ghash_cpu/ghash_cpu.cpp @@ -68,10 +68,16 @@ BOTAN_FORCE_INLINE SIMD_4x32 BOTAN_FUNC_ISA(BOTAN_CLMUL_ISA) clmul(const SIMD_4x i2 = mask_lo.andc(i2); } - return SIMD_4x32((__vector unsigned int)__builtin_crypto_vpmsumd( - (__vector unsigned long)i1.raw(), - (__vector unsigned long)i2.raw()) - ); + auto i1v = reinterpret_cast<__vector unsigned long long>(i1.raw()); + auto i2v = reinterpret_cast<__vector unsigned long long>(i2.raw()); + +#if defined(__clang__) + auto rv = __builtin_altivec_crypto_vpmsumd(i1v, i2v); +#else + auto rv = __builtin_crypto_vpmsumd(i1v, i2v); +#endif + + return SIMD_4x32(reinterpret_cast<__vector unsigned int>(rv)); #endif } |