diff options
author | Jeffrey Walton <noloader@gmail.com> | 2019-04-27 20:35:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-27 20:35:01 -0400 |
commit | 39418a85122fa7954cca6354be30a44d6335874e (patch) | |
tree | eae89a92177cb1c2e96a44435821d4d65086b481 /blake2.cpp | |
parent | d451751eb269ff1345c9937107788d678c70e36f (diff) | |
download | cryptopp-git-39418a85122fa7954cca6354be30a44d6335874e.tar.gz |
Use PowerPC unaligned loads and stores with Power8 (GH #825, PR #826)
Use PowerPC unaligned loads and stores with Power8. Formerly we were using Power7 as the floor because the IBM POWER Architecture manuals said unaligned loads and stores were available. However, some compilers generate bad code for unaligned loads and stores using `-march=power7`, so bump to a known good.
Diffstat (limited to 'blake2.cpp')
-rw-r--r-- | blake2.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -38,8 +38,8 @@ // https://github.com/weidai11/cryptopp/issues/743
#if defined(__xlC__) && (__xlC__ < 0x0d01)
# define CRYPTOPP_DISABLE_ALTIVEC 1
-# define CRYPTOPP_POWER7_ALTIVEC 1
# undef CRYPTOPP_POWER7_AVAILABLE
+# undef CRYPTOPP_POWER8_AVAILABLE
# undef CRYPTOPP_ALTIVEC_AVAILABLE
#endif
@@ -171,8 +171,8 @@ extern void BLAKE2_Compress32_NEON(const byte* input, BLAKE2s_State& state); extern void BLAKE2_Compress64_NEON(const byte* input, BLAKE2b_State& state);
#endif
-#if CRYPTOPP_POWER7_AVAILABLE
-extern void BLAKE2_Compress32_POWER7(const byte* input, BLAKE2s_State& state);
+#if CRYPTOPP_POWER8_AVAILABLE
+extern void BLAKE2_Compress32_POWER8(const byte* input, BLAKE2s_State& state);
#elif CRYPTOPP_ALTIVEC_AVAILABLE
extern void BLAKE2_Compress32_ALTIVEC(const byte* input, BLAKE2s_State& state);
#endif
@@ -233,8 +233,8 @@ unsigned int BLAKE2s::OptimalDataAlignment() const return 4;
else
#endif
-#if (CRYPTOPP_POWER7_AVAILABLE)
- if (HasPower7())
+#if (CRYPTOPP_POWER8_AVAILABLE)
+ if (HasPower8())
return 16;
else
#elif (CRYPTOPP_ALTIVEC_AVAILABLE)
@@ -257,9 +257,9 @@ std::string BLAKE2s::AlgorithmProvider() const return "NEON";
else
#endif
-#if (CRYPTOPP_POWER7_AVAILABLE)
- if (HasPower7())
- return "Power7";
+#if (CRYPTOPP_POWER8_AVAILABLE)
+ if (HasPower8())
+ return "Power8";
else
#elif (CRYPTOPP_ALTIVEC_AVAILABLE)
if (HasAltivec())
@@ -690,10 +690,10 @@ void BLAKE2s::Compress(const byte *input) return BLAKE2_Compress32_NEON(input, m_state);
}
#endif
-#if CRYPTOPP_POWER7_AVAILABLE
- if(HasPower7())
+#if CRYPTOPP_POWER8_AVAILABLE
+ if(HasPower8())
{
- return BLAKE2_Compress32_POWER7(input, m_state);
+ return BLAKE2_Compress32_POWER8(input, m_state);
}
#elif CRYPTOPP_ALTIVEC_AVAILABLE
if(HasAltivec())
|