ext-cryptopp/TestPrograms/test_ppc_power7.cxx

27 lines
849 B
C++
Raw Normal View History

#define GNUC_VERSION (__GNUC__*1000 + __GNUC_MAJOR__*10)
#if (GNUC_VERSION >= 4060) || defined(__clang__)
# pragma GCC diagnostic ignored "-Wdeprecated"
#endif
2018-11-13 18:48:38 +00:00
#include <altivec.h>
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 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 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);
# endif
#else
int x[-1];
2018-11-13 18:48:38 +00:00
#endif
return 0;
2018-11-13 18:48:38 +00:00
}