diff options
author | Jan Vesely <jan.vesely@rutgers.edu> | 2014-06-24 15:15:41 -0400 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2014-07-25 13:07:30 -0400 |
commit | b01b4a08395f5c4bfe0812bdf959dda36f15da6d (patch) | |
tree | 4afcca114d0910412f61aefbbc4f7651d4d2ea1f | |
parent | 4e99f93b149f6f4f5c3e0324f6660a741422463a (diff) |
cl: Extend float to long conversion test
Fill in subtest name
v2: Add 2^63 as a test value
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
-rw-r--r-- | tests/cl/program/execute/builtin/convert/float-convert_long.cl | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/tests/cl/program/execute/builtin/convert/float-convert_long.cl b/tests/cl/program/execute/builtin/convert/float-convert_long.cl index 3d6930ac3..c8baa3845 100644 --- a/tests/cl/program/execute/builtin/convert/float-convert_long.cl +++ b/tests/cl/program/execute/builtin/convert/float-convert_long.cl @@ -4,9 +4,10 @@ name: convert_long(float) dimensions: 1 global_size: 1 1 1 local_size: 1 1 1 -kernel_name: test [test] +name: convert_long(float) +kernel_name: test_long arg_out: 0 buffer long[8] 0 36864 -47104 41943040 -35651584 131 5000000000 -6000000000 # These values were choosen to exercise all code paths in the generic # implementation of __fixsfdi in compiler-rt: @@ -20,11 +21,34 @@ arg_in: 1 buffer float[8] 0x1.2p-5 \ # exp < 0 5000000000.0 \ # Positive value requiring more than 32-bits -6000000000.0 # Negative value requiring more than 32-bits +[test] +name: convert_ulong(float) +kernel_name: test_ulong +arg_out: 0 buffer ulong[8] 0 36864 47104 41943040 35651584 131 5000000000 9223372036854775808 +# These values were choosen to exercise all code paths in the generic +# implementation of __fixsfdi in compiler-rt: +# https://github.com/llvm-mirror/compiler-rt/blob/master/lib/builtins/fixsfdi.c +arg_in: 1 buffer float[8] 0x1.2p-5 \ # exp < 0 + 0x1.2p+15 \ # pos exp <= 23 + 0x1.7p+15 \ # pos exp <= 23 + 0x1.4p25 \ # pos exp > 23 + 0x1.1p25 \ # pos exp > 23 + 131.35 \ # Random non-integer value + 5000000000.0 \ # Positive value requiring more than 32-bits + 9223372036854775808.0 # Positive value requiring 64-bits + !*/ -kernel void test(global long *out, global float *in) { +kernel void test_long(global long *out, global float *in) { unsigned i; for (i = 0; i < 8; i++) { out[i] = convert_long(in[i]); } } + +kernel void test_ulong(global ulong *out, global float *in) { + unsigned i; + for (i = 0; i < 8; i++) { + out[i] = convert_ulong(in[i]); + } +} |