summaryrefslogtreecommitdiff
path: root/ppc_simd.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2020-04-10 14:36:06 -0400
committerJeffrey Walton <noloader@gmail.com>2020-04-10 14:36:06 -0400
commit6a13273942a30bf514747b32983a7cae5b9c5622 (patch)
tree0828c0254d370cdf837a2740cc60a6c12149ccd1 /ppc_simd.h
parent5f41f3ad597058e4540287c1bbb90104312090ab (diff)
downloadcryptopp-git-6a13273942a30bf514747b32983a7cae5b9c5622.tar.gz
Fix compile with XL C++ on Power7
Diffstat (limited to 'ppc_simd.h')
-rw-r--r--ppc_simd.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/ppc_simd.h b/ppc_simd.h
index 785acb26..31080f5a 100644
--- a/ppc_simd.h
+++ b/ppc_simd.h
@@ -1786,14 +1786,15 @@ inline T VecMergeHigh(const T vec1, const T vec2)
/// \since Crypto++ 8.3
inline uint32x4_p VecSplatWord(word32 val)
{
- // Apple Altivec does not offer vec_splats. GCC offers
- // vec_splats back to -mcpu=power4. We can't test
- // further back because -mcpu=power3 is not supported.
-#if defined(_ARCH_PWR4)
+ // Apple Altivec and XL C++ do not offer vec_splats.
+ // GCC offers vec_splats back to -mcpu=power4.
+#if defined(_ARCH_PWR4) && defined(__GNUC__)
return vec_splats(val);
#else
- const word32 x[4] = {val,val,val,val};
- return VecLoad(x);
+ //const word32 x[4] = {val,val,val,val};
+ //return VecLoad(x);
+ const word32 x[4] = {val};
+ return vec_splat(VecLoad(x),0);
#endif
}