aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils/cpuid
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-12-12 09:10:34 -0500
committerJack Lloyd <[email protected]>2019-12-12 09:10:34 -0500
commit8f684a6f533feb54f888639f48c1ac6637a87950 (patch)
treeeec8d73e1d6381a31fa72979fae76f4cfa72652e /src/lib/utils/cpuid
parent1b65377689d8522dfd80a34506594414b7d6ab61 (diff)
Clean up handling of POWER ISA extensions
See #2226
Diffstat (limited to 'src/lib/utils/cpuid')
-rw-r--r--src/lib/utils/cpuid/cpuid.cpp6
-rw-r--r--src/lib/utils/cpuid/cpuid.h6
-rw-r--r--src/lib/utils/cpuid/cpuid_ppc.cpp2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/utils/cpuid/cpuid.cpp b/src/lib/utils/cpuid/cpuid.cpp
index 81fabf0a3..199feca66 100644
--- a/src/lib/utils/cpuid/cpuid.cpp
+++ b/src/lib/utils/cpuid/cpuid.cpp
@@ -55,7 +55,7 @@ std::string CPUID::to_string()
#if defined(BOTAN_TARGET_CPU_IS_PPC_FAMILY)
CPUID_PRINT(altivec);
- CPUID_PRINT(ppc_crypto);
+ CPUID_PRINT(power_crypto);
CPUID_PRINT(darn_rng);
#endif
@@ -167,8 +167,8 @@ CPUID::bit_from_string(const std::string& tok)
#elif defined(BOTAN_TARGET_CPU_IS_PPC_FAMILY)
if(tok == "altivec" || tok == "simd")
return {Botan::CPUID::CPUID_ALTIVEC_BIT};
- if(tok == "ppc_crypto")
- return {Botan::CPUID::CPUID_PPC_CRYPTO_BIT};
+ if(tok == "power_crypto")
+ return {Botan::CPUID::CPUID_POWER_CRYPTO_BIT};
#elif defined(BOTAN_TARGET_CPU_IS_ARM_FAMILY)
if(tok == "neon" || tok == "simd")
diff --git a/src/lib/utils/cpuid/cpuid.h b/src/lib/utils/cpuid/cpuid.h
index 84201b910..77b0c99f6 100644
--- a/src/lib/utils/cpuid/cpuid.h
+++ b/src/lib/utils/cpuid/cpuid.h
@@ -120,7 +120,7 @@ class BOTAN_PUBLIC_API(2,1) CPUID final
#if defined(BOTAN_TARGET_CPU_IS_PPC_FAMILY)
CPUID_ALTIVEC_BIT = (1ULL << 0),
- CPUID_PPC_CRYPTO_BIT = (1ULL << 1),
+ CPUID_POWER_CRYPTO_BIT = (1ULL << 1),
CPUID_DARN_BIT = (1ULL << 2),
#endif
@@ -150,8 +150,8 @@ class BOTAN_PUBLIC_API(2,1) CPUID final
/**
* Check if the processor supports POWER8 crypto extensions
*/
- static bool has_ppc_crypto()
- { return has_cpuid_bit(CPUID_PPC_CRYPTO_BIT); }
+ static bool has_power_crypto()
+ { return has_cpuid_bit(CPUID_POWER_CRYPTO_BIT); }
/**
* Check if the processor supports POWER9 DARN RNG
diff --git a/src/lib/utils/cpuid/cpuid_ppc.cpp b/src/lib/utils/cpuid/cpuid_ppc.cpp
index 4fb24f24b..604b97947 100644
--- a/src/lib/utils/cpuid/cpuid_ppc.cpp
+++ b/src/lib/utils/cpuid/cpuid_ppc.cpp
@@ -72,7 +72,7 @@ uint64_t CPUID::CPUID_Data::detect_cpu_features(size_t* cache_line_size)
const unsigned long hwcap_crypto = OS::get_auxval(PPC_hwcap_bit::ARCH_hwcap_crypto);
if(hwcap_crypto & PPC_hwcap_bit::CRYPTO_bit)
- detected_features |= CPUID::CPUID_PPC_CRYPTO_BIT;
+ detected_features |= CPUID::CPUID_POWER_CRYPTO_BIT;
if(hwcap_crypto & PPC_hwcap_bit::DARN_bit)
detected_features |= CPUID::CPUID_DARN_BIT;