summaryrefslogtreecommitdiff
path: root/TestPrograms
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-10-24 15:36:39 -0400
committerGitHub <noreply@github.com>2019-10-24 15:36:39 -0400
commit670ceb19a25630d8e18265d081c922af3ea5998e (patch)
treec08673048490b73ac906ef93115b89715fa0bc56 /TestPrograms
parenta4da9bf6bee36aa412281bfc08b7e14bd6870ac4 (diff)
downloadcryptopp-git-670ceb19a25630d8e18265d081c922af3ea5998e.tar.gz
Some more workarounds for Clang and XLC on PowerPC (PR #903)
Diffstat (limited to 'TestPrograms')
-rw-r--r--TestPrograms/test_ppc_altivec.cxx8
-rw-r--r--TestPrograms/test_ppc_power7.cxx7
-rw-r--r--TestPrograms/test_ppc_power8.cxx15
3 files changed, 16 insertions, 14 deletions
diff --git a/TestPrograms/test_ppc_altivec.cxx b/TestPrograms/test_ppc_altivec.cxx
index ac1a20fc..b28a39dd 100644
--- a/TestPrograms/test_ppc_altivec.cxx
+++ b/TestPrograms/test_ppc_altivec.cxx
@@ -6,8 +6,8 @@
#include <altivec.h>
int main(int argc, char* argv[])
{
- __vector unsigned char x;
- x=vec_ld(0, (unsigned char*)argv[0]);
- x=vec_add(x,x);
- return 0;
+ __vector unsigned char x;
+ x=vec_ld(0, (unsigned char*)argv[0]);
+ x=vec_add(x,x);
+ return 0;
}
diff --git a/TestPrograms/test_ppc_power7.cxx b/TestPrograms/test_ppc_power7.cxx
index 3e0cb3df..e7dd9901 100644
--- a/TestPrograms/test_ppc_power7.cxx
+++ b/TestPrograms/test_ppc_power7.cxx
@@ -8,16 +8,15 @@ int main(int argc, char* argv[])
{
#if defined(_ARCH_PWR7)
__vector unsigned int a = {1,2,3,4};
- __vector unsigned int b = vec_ld(0, (__vector unsigned int*)argv[0]);
+ __vector unsigned int b = vec_ld(0, (unsigned int*)argv[0]);
__vector unsigned int c = vec_xor(a, b);
__vector unsigned int x = {5,6,7,8};
- __vector unsigned int y = vec_xl(0, (__vector unsigned int*)argv[0]);
+ __vector unsigned int y = vec_xl(0, (unsigned int*)argv[0]);
__vector unsigned int z = vec_xor(x, y);
# if defined(__VSX__)
__vector unsigned long long xx = {1,2};
- __vector unsigned long long yy = vec_xl(0, (__vector unsigned long long*)argv[0]);
- __vector unsigned long long zz = vec_xor(xx, yy);
+ __vector unsigned long long yy = (__vector unsigned long long)y;
# endif
#else
int x[-1];
diff --git a/TestPrograms/test_ppc_power8.cxx b/TestPrograms/test_ppc_power8.cxx
index b5a56322..ded44656 100644
--- a/TestPrograms/test_ppc_power8.cxx
+++ b/TestPrograms/test_ppc_power8.cxx
@@ -7,15 +7,18 @@
int main(int argc, char* argv[])
{
#if defined(_ARCH_PWR8)
- __vector unsigned long long x = {1, 2};
- __vector unsigned long long y = vec_xl(0, (__vector unsigned long long*)argv[0]);
- __vector unsigned long long z = vec_add(x, y);
+ __vector unsigned long long r = {1, 2};
+ __vector unsigned int s = vec_xl(0, (unsigned int*)argv[0]);
+ __vector unsigned long long w = (__vector unsigned long long)r;
+ __vector unsigned long long x = (__vector unsigned long long)s;
+ __vector unsigned long long y = vec_xor(w, x);
+ __vector unsigned long long z = vec_add(y, vec_add(w, x));
# if defined(__ibmxl__) || (defined(_AIX) && defined(__xlC__))
- __vector unsigned long long u = __vpmsumd (x, y);
+ __vector unsigned long long u = __vpmsumd (y, z);
# elif defined(__clang__)
- __vector unsigned long long u = __builtin_altivec_crypto_vpmsumd (x, y);
+ __vector unsigned long long u = __builtin_altivec_crypto_vpmsumd (y, z);
# else
- __vector unsigned long long u = __builtin_crypto_vpmsumd (x, y);
+ __vector unsigned long long u = __builtin_crypto_vpmsumd (y, z);
# endif
#else
int x[-1];