summaryrefslogtreecommitdiff
path: root/TestPrograms
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-11-19 20:02:51 -0500
committerJeffrey Walton <noloader@gmail.com>2018-11-19 20:02:51 -0500
commit66b3ba5d66b4c37534b754d1374871686975b5d6 (patch)
tree32673247856b24a82721014dac451a2470f5c4d6 /TestPrograms
parentf52a141f6e8a7c28182eafa107a9135ecc2ab618 (diff)
downloadcryptopp-git-66b3ba5d66b4c37534b754d1374871686975b5d6.tar.gz
Update comments
Diffstat (limited to 'TestPrograms')
-rw-r--r--TestPrograms/test_ppc_power7.cxx27
1 files changed, 15 insertions, 12 deletions
diff --git a/TestPrograms/test_ppc_power7.cxx b/TestPrograms/test_ppc_power7.cxx
index 52276700..103034ea 100644
--- a/TestPrograms/test_ppc_power7.cxx
+++ b/TestPrograms/test_ppc_power7.cxx
@@ -1,17 +1,20 @@
#include <altivec.h>
-// This follows ppc_simd.h. XLC compilers for POWER7 use vec_xlw4 and vec_xstw4.
-// XLC compilers for POWER8 and above use vec_xl and vec_xst. The way to tell
-// the difference is, POWER7 XLC compilers are version 12.x and earlier.
-// The open question is, how to handle early Clang compilers for POWER7.
-// We know the latest Clang compilers support vec_xl and vec_xst.
+// This follows ppc_simd.h. XLC compilers for POWER7 use vec_xlw4 and
+// vec_xstw4. Some XLC compilers for POWER7 and above use vec_xl and
+// vec_xst. The way to tell the difference is, XLC compilers version
+// 13.0 and earlier use use vec_xlw4 and vec_xstw4 XLC compilers 13.1
+// and later are use vec_xl and vec_xst. The open question is, how to
+// handle early Clang compilers for POWER7. We know the latest Clang
+// compilers support vec_xl and vec_xst. Also see
+// https://www-01.ibm.com/support/docview.wss?uid=swg21683541
-#if defined(__xlc__) && (__xlc__ < 0x0d00)
-# define __old_xlc__ 1
+#if defined(__xlc__) && (__xlc__ < 0x0d01)
+# define __early_xlc__ 1
#endif
-#if defined(__xlC__) && (__xlC__ < 0x0d00)
-# define __old_xlC__ 1
+#if defined(__xlC__) && (__xlC__ < 0x0d01)
+# define __early_xlC__ 1
#endif
int main(int argc, char* argv[])
@@ -19,15 +22,15 @@ int main(int argc, char* argv[])
__vector unsigned char x;
unsigned char res[16];
-#if defined(__old_xlc__) || defined(__old_xlC__)
+#if defined(_ARCH_PWR7) && (defined(__early_xlc__) || defined(__early_xlC__))
x=vec_xlw4(0, (unsigned char*)argv[0]);
x=vec_add(x,x);
vec_xstw4(x, 0, res);
-#elif defined(__xlc__) || defined(__xlC__) || defined(__clang__)
+#elif defined(_ARCH_PWR7) && (defined(__xlc__) || defined(__xlC__) || defined(__clang__))
x=vec_xl(0, (unsigned char*)argv[0]);
x=vec_add(x,x);
vec_xst(x, 0, res);
-#elif defined(__GNUC__)
+#elif defined(_ARCH_PWR7) && defined(__GNUC__)
x=vec_vsx_ld(0, (unsigned char*)argv[0]);
x=vec_add(x,x);
vec_vsx_st(x, 0, res);