summaryrefslogtreecommitdiff
path: root/TestPrograms
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-11-27 06:34:44 -0500
committerJeffrey Walton <noloader@gmail.com>2018-11-27 06:34:44 -0500
commit7a9970f02e8a873ee4ea5f7c09d62d1203a4dd22 (patch)
treeb0c744c78d6a28ba70763bd0dc0b4bd2c48c965d /TestPrograms
parentd41085e907bf6bb8dac128ad0249f9dd3502e5f7 (diff)
downloadcryptopp-git-7a9970f02e8a873ee4ea5f7c09d62d1203a4dd22.tar.gz
Update comments and cpu feature test
Diffstat (limited to 'TestPrograms')
-rw-r--r--TestPrograms/test_ppc_power9.cxx31
1 files changed, 17 insertions, 14 deletions
diff --git a/TestPrograms/test_ppc_power9.cxx b/TestPrograms/test_ppc_power9.cxx
index 82e1e755..38e87398 100644
--- a/TestPrograms/test_ppc_power9.cxx
+++ b/TestPrograms/test_ppc_power9.cxx
@@ -1,6 +1,20 @@
+// The problem we have here is, it appears only GCC 7.0 and above
+// support Power9 builtins. Clang 7.0 has support for some (all?)
+// assembly instructions but we don't see builtin support. We can't
+// determine the state of XLC. Searching IBM's website for
+// terms like 'darn' 'random number' is returning irrelevant hits.
+// Searching with Google from the outside returns 0 hits.
+//
+// The support disconnect means we may report Power9 as unavailable
+// and support DARN at the same time. We get into that state because
+// we use inline asm to detect DARN availablity in the compiler.
+// Also see cpu.cpp and the two query functions; and ppc_power9.cpp
+// and the two probe functions.
+
#include <altivec.h>
int main(int argc, char* argv[])
{
+#if 0
const unsigned char b = (unsigned char)argc;
const unsigned int r = (0xf << 24) | (0x3 << 16) | (0xf << 8) | (0x3 << 0);
#if defined(__clang__)
@@ -10,23 +24,12 @@ int main(int argc, char* argv[])
#else
int XXX[-1];
#endif
+#endif
-#if UINTPTR_MAX == 0xffffffffffffffffULL
-# if defined(__clang__)
- unsigned long long y = __builtin_altivec_darn();
-# elif defined(__GNUC__)
- unsigned long long y = __builtin_darn();
-# else
- int XXX[-1];
-# endif
-#else
-# if defined(__clang__)
- unsigned int y = __builtin_altivec_darn_32();
-# elif defined(__GNUC__)
+#if defined(__GNUC__) || defined(__IBM_GCC_ASM)
unsigned int y = __builtin_darn_32();
-# else
+#else
int XXX[-1];
-# endif
#endif
return 0;