From 2bb9f49544d90740a0c5db3472a32e6581a85f92 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 18 Nov 2018 22:26:34 -0500 Subject: [PATCH] Add test_ppc_aes.cxx test program --- TestPrograms/test_ppc_aes.cxx | 26 ++++++++++++++++++++++++++ TestPrograms/test_ppc_power8.cxx | 14 +------------- 2 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 TestPrograms/test_ppc_aes.cxx diff --git a/TestPrograms/test_ppc_aes.cxx b/TestPrograms/test_ppc_aes.cxx new file mode 100644 index 00000000..9e8690bb --- /dev/null +++ b/TestPrograms/test_ppc_aes.cxx @@ -0,0 +1,26 @@ +#include +int main(int argc, char* argv[]) +{ +#if defined(__ibmxl__) + __vector unsigned char x; + x=__vcipher(x,x); + x=__vcipherlast(x,x); + x=__vncipher(x,x); + x=__vncipherlast(x,x); +#elif defined(__clang__) + __vector unsigned long long x; + x=__builtin_altivec_crypto_vcipher(x,x); + x=__builtin_altivec_crypto_vcipherlast(x,x); + x=__builtin_altivec_crypto_vncipher(x,x); + x=__builtin_altivec_crypto_vncipherlast(x,x); +#elif defined(__GNUC__) + __vector unsigned long long x; + x=__builtin_crypto_vcipher(x,x); + x=__builtin_crypto_vcipherlast(x,x); + x=__builtin_crypto_vncipher(x,x); + x=__builtin_crypto_vncipherlast(x,x); +#else + int XXX[-1]; +#endif + return 0; +} diff --git a/TestPrograms/test_ppc_power8.cxx b/TestPrograms/test_ppc_power8.cxx index 74ae561e..eb32e8c4 100644 --- a/TestPrograms/test_ppc_power8.cxx +++ b/TestPrograms/test_ppc_power8.cxx @@ -2,18 +2,6 @@ int main(int argc, char* argv[]) { __vector unsigned long long z; -#if defined(__xlc__) || defined(__xlC__) || defined(__clang__) - __vector unsigned char x; - x=__vcipher(x,x); - x=__vcipherlast(x,x); - x=__vncipher(x,x); - x=__vncipherlast(x,x); -#elif defined(__GNUC__) - __vector unsigned long long x; - x=__builtin_crypto_vcipher(x,x); - x=__builtin_crypto_vcipherlast(x,x); - x=__builtin_crypto_vncipher(x,x); - x=__builtin_crypto_vncipherlast(x,x); -#endif + z=vec_add(z,z); return 0; }