aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/utils/ghash/ghash_cpu/ghash_cpu.cpp14
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
}