From 70f105e623dddeb27be258fedb56bd0e9a59d190 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Sat, 25 Jul 2020 17:13:05 +0200 Subject: Refactor regression testing of built-in functions Share the testing code for built-in functions that are available on all target platforms. Improve testing of __builtin_clz* and __builtin_ctz* --- test/regression/builtins-powerpc.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'test/regression/builtins-powerpc.c') diff --git a/test/regression/builtins-powerpc.c b/test/regression/builtins-powerpc.c index 8fd5818b..55809106 100644 --- a/test/regression/builtins-powerpc.c +++ b/test/regression/builtins-powerpc.c @@ -1,4 +1,4 @@ -/* Fun with builtins */ +/* PowerPC-specific builtins */ #include #include @@ -11,7 +11,6 @@ char * check_relative_error(double exact, double actual, double precision) unsigned int x = 0x12345678; unsigned int y = 0xDEADBEEF; -unsigned long long xx = 0x1234567812345678ULL; double a = 3.14159; double b = 2.718; double c = 1.414; @@ -23,19 +22,9 @@ int main(int argc, char ** argv) printf("mulhw(%x, %x) = %x\n", x, y, __builtin_mulhw(x, y)); printf("mulhwu(%x, %x) = %x\n", x, y, __builtin_mulhwu(x, y)); - printf("clz(%x) = %d\n", x, __builtin_clz(x)); - printf("clzll(%llx) = %d\n", (unsigned long long) x, __builtin_clzll(x)); - printf("clzll(%llx) = %d\n", xx, __builtin_clzll(xx)); - z = __builtin_bswap(x); - printf("clzll(%lx) = %d\n", z, __builtin_clzll(z)); - printf("bswap(%x) = %x\n", x, __builtin_bswap(x)); - printf("bswap16(%x) = %x\n", s, __builtin_bswap16(s)); printf("fmadd(%f, %f, %f) = %f\n", a, b, c, __builtin_fmadd(a, b, c)); printf("fmsub(%f, %f, %f) = %f\n", a, b, c, __builtin_fmsub(a, b, c)); - printf("fabs(%f) = %f\n", a, __builtin_fabs(a)); - printf("fabs(%f) = %f\n", -a, __builtin_fabs(-a)); - printf("fsqrt(%f) = %f\n", a, __builtin_fsqrt(a)); printf("frsqrte(%f) = %s\n", a, check_relative_error(1.0 / sqrt(a), __builtin_frsqrte(a), 1./32.)); printf("fres(%f) = %s\n", -- cgit