aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils/cpuid.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-09-21 17:23:45 -0400
committerJack Lloyd <[email protected]>2015-09-21 17:23:45 -0400
commitb999079ebdfd1c9bd288763ae06dfdf6a31325e0 (patch)
treeb68ccafd36b7d9c9b07042e31ddd44908876584f /src/lib/utils/cpuid.cpp
parent4a82605e745cf9a288806b31929ec0fe7c0c1bdc (diff)
Move check for SIMD instructions to CPUID
Avoids needing to include simd_32 to see if SIMD is disabled. This had caused a build break on Linux x86-32 as SSE2 must be enabled on a per-file basis.
Diffstat (limited to 'src/lib/utils/cpuid.cpp')
-rw-r--r--src/lib/utils/cpuid.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/utils/cpuid.cpp b/src/lib/utils/cpuid.cpp
index 218b6553c..c98829789 100644
--- a/src/lib/utils/cpuid.cpp
+++ b/src/lib/utils/cpuid.cpp
@@ -157,6 +157,19 @@ bool altivec_check_pvr_emul()
}
+bool CPUID::has_simd_32()
+ {
+#if defined(BOTAN_HAS_SIMD_SSE2)
+ return CPUID::has_sse2();
+#elif defined(BOTAN_HAS_SIMD_ALTIVEC)
+ return CPUID::has_altivec();
+#elif defined(BOTAN_HAS_SIMD_SCALAR)
+ return true;
+#else
+ return false;
+#endif
+ }
+
void CPUID::print(std::ostream& o)
{
o << "CPUID flags: ";