From f531d386db7051761bd31f2740a893ff97ce65aa Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Tue, 22 Dec 2015 11:06:35 +0100 Subject: Add CLZ builtins for ARM and IA32 ARM: add __builtin_clzl, __builtin_clzll IA32: add __builtin_clzl, __builtin_clzll, __builtin_ctzl, __builtin_ctzll Add corresponding tests in tests/regression/ --- test/regression/builtins-ia32.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/regression/builtins-ia32.c') diff --git a/test/regression/builtins-ia32.c b/test/regression/builtins-ia32.c index 558c3153..8df81800 100644 --- a/test/regression/builtins-ia32.c +++ b/test/regression/builtins-ia32.c @@ -6,6 +6,8 @@ int main(int argc, char ** argv) { unsigned int x = 0x12345678; unsigned int y = 0xDEADBEEF; + unsigned long long xx = 0x1234567812345678ULL; + unsigned long long yy = 0x1234567800000000ULL; double a = 3.14159; double b = 2.718; double c = 1.414; @@ -14,7 +16,11 @@ int main(int argc, char ** argv) printf("bswap(%x) = %x\n", x, __builtin_bswap(x)); printf("bswap16(%x) = %x\n", s, __builtin_bswap16(s)); 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)); printf("ctz(%x) = %d\n", s, __builtin_ctz(s)); + printf("ctzll(%llx) = %d\n", xx, __builtin_ctzll(xx)); + printf("ctzll(%llx) = %d\n", yy, __builtin_ctzll(yy)); printf("fsqrt(%f) = %f\n", a, __builtin_fsqrt(a)); printf("fmin(%f, %f) = %f\n", a, b, __builtin_fmin(a, b)); -- cgit