#ifdef TEST_HTM
void test_htm() {
__builtin_tbegin(4); __builtin_tend(-1); __builtin_tsr(55); __builtin_tabortwc(-5, 2, 3); __builtin_tabortdc(55, 2, 3); __builtin_tabortwci(-5, 2, 5); __builtin_tabortwci(5, 2, 55); __builtin_tabortdci(-5, 2, 5); __builtin_tabortdci(5, 2, 55); }
#endif
#ifdef TEST_CRYPTO
#include <altivec.h>
#define W_INIT { 0x01020304, 0x05060708, 0x090A0B0C, 0x0D0E0F10 };
#define D_INIT { 0x0102030405060708, 0x090A0B0C0D0E0F10 };
vector unsigned int test_vshasigmaw_or(void)
{
vector unsigned int a = W_INIT
vector unsigned int b = __builtin_crypto_vshasigmaw(a, 2, 15); vector unsigned int c = __builtin_crypto_vshasigmaw(a, -1, 15); vector unsigned int d = __builtin_crypto_vshasigmaw(a, 0, 85); vector unsigned int e = __builtin_crypto_vshasigmaw(a, 1, -15); return __builtin_crypto_vshasigmaw(a, 1, 15);
}
#ifdef __VSX__
vector unsigned long long test_vshasigmad_or(void)
{
vector unsigned long long a = D_INIT
vector unsigned long long b = __builtin_crypto_vshasigmad(a, 2, 15); vector unsigned long long c = __builtin_crypto_vshasigmad(a, -1, 15); vector unsigned long long d = __builtin_crypto_vshasigmad(a, 0, 85); vector unsigned long long e = __builtin_crypto_vshasigmad(a, 1, -15); return __builtin_crypto_vshasigmad(a, 0, 15);
}
#endif
#endif
#ifdef TEST_MAXMIN
void test_maxmin() {
long double fe;
double fl;
float fs;
#ifdef _AIX
__builtin_ppc_maxfe(fe, fe, fe, fe); __builtin_ppc_minfe(fe, fe, fe, fe); __builtin_ppc_maxfl(fs, fs, fs, fs); __builtin_ppc_minfl(fs, fs, fs, fs); __builtin_ppc_maxfs(fe, fe, fe, fe); __builtin_ppc_minfs(fe, fe, fe, fe); #else
__builtin_ppc_maxfe(fl, fl, fl, fl); __builtin_ppc_minfe(fl, fl, fl, fl); __builtin_ppc_maxfl(fs, fs, fs, fs); __builtin_ppc_minfl(fs, fs, fs, fs); __builtin_ppc_maxfs(fe, fe, fe, fe); __builtin_ppc_minfs(fe, fe, fe, fe); #endif
}
#endif