diff options
| author | Jeffrey Walton <noloader@gmail.com> | 2017-10-17 22:50:45 -0400 |
|---|---|---|
| committer | Jeffrey Walton <noloader@gmail.com> | 2017-10-17 22:50:45 -0400 |
| commit | 7ba8c6bc81f4785162c1f7ede1a0e8e5b95b7c67 (patch) | |
| tree | a7b62f2b1964cd2de31f3bc389e4737a608dbe3b /ppc-simd.cpp | |
| parent | f8d97b83ed6d65946570a2ec9d6aa1ac5ff7ce94 (diff) | |
| download | cryptopp-git-7ba8c6bc81f4785162c1f7ede1a0e8e5b95b7c67.tar.gz | |
Cleanup Altivec and Power7 code paths
This changes the dependency from Altivec to Power7. Internally we needed Power7 but it was cut-in as a pseudo Altivec dependency. Also see http://groups.google.com/forum/#!topic/cryptopp-users/fmEKOG41SG8
Diffstat (limited to 'ppc-simd.cpp')
| -rw-r--r-- | ppc-simd.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ppc-simd.cpp b/ppc-simd.cpp index b2d7b11c..471ca06b 100644 --- a/ppc-simd.cpp +++ b/ppc-simd.cpp @@ -97,12 +97,11 @@ bool CPU_ProbeAltivec() #endif // CRYPTOPP_ALTIVEC_AVAILABLE
}
-#if 0
bool CPU_ProbePower7()
{
#if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES)
return false;
-#elif (CRYPTOPP_POWER7_AVAILABLE) && 0
+#elif (CRYPTOPP_POWER7_AVAILABLE)
# if defined(CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY)
// longjmp and clobber warnings. Volatile is required.
@@ -121,7 +120,11 @@ bool CPU_ProbePower7() result = false;
else
{
- // TODO
+ byte b1[19] = {255, 255, 255, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, b2[17];
+ const uint8x16_p8 v1 = (uint8x16_p8)VectorLoad(0, b1+3);
+ VectorStore(v1, b2+1);
+
+ result = (0 == std::memcmp(b1+3, b2+1, 16));
}
sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR);
@@ -132,7 +135,6 @@ bool CPU_ProbePower7() return false;
#endif // CRYPTOPP_POWER7_AVAILABLE
}
-#endif
bool CPU_ProbePower8()
{
|
