summaryrefslogtreecommitdiff
path: root/misc.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-12-10 11:09:50 -0500
committerJeffrey Walton <noloader@gmail.com>2017-12-10 11:09:50 -0500
commit195ac2c7c9483bdfd6d06d2abc02fc6afd293db5 (patch)
treed5e2b2a40676b12f11485573f81bd73c7f266cde /misc.h
parente90cc9a0289c550f2fbf721c0ef12d5087a2d3d5 (diff)
downloadcryptopp-git-195ac2c7c9483bdfd6d06d2abc02fc6afd293db5.tar.gz
Refactor rijndael-simd.cpp and simon.simd.cpp to use adv-simd.h
Diffstat (limited to 'misc.h')
-rw-r--r--misc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/misc.h b/misc.h
index ce09d366..cb85e665 100644
--- a/misc.h
+++ b/misc.h
@@ -469,8 +469,15 @@ inline void memmove_s(void *dest, size_t sizeInBytes, const void *src, size_t co
template <class T>
inline void vec_swap(T& a, T& b)
{
+ // __m128i is an unsigned long long[2], and support for swapping it was
+ // not added until C++11. SunCC 12.1 - 12.3 fail to consume the swap; while
+ // SunCC 12.4 consumes it without -std=c++11.
+#if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x5120)
T t;
t=a, a=b, b=t;
+#else
+ std::swap(a, b);
+#endif
}
/// \brief Memory block initializer and eraser that attempts to survive optimizations