aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-04-11 09:23:38 -0700
committerTom Stellard <thomas.stellard@amd.com>2013-04-24 07:08:06 -0700
commit632e7f23b2dfd9331184299c0e542f707af63467 (patch)
tree8523fa1d3365a3c42b476648de681cdb5c59c8ed
parentd168a2eef36c7b2f1f6de41929acae1f9c1c638a (diff)
downloadpiglit-632e7f23b2dfd9331184299c0e542f707af63467.tar.gz
cl: Add test for SHA-256 Ch function
Reviewed-By: Aaron Watry <awatry@gmail.com>
-rw-r--r--tests/cl/program/execute/sha256-Ch.cl71
1 files changed, 71 insertions, 0 deletions
diff --git a/tests/cl/program/execute/sha256-Ch.cl b/tests/cl/program/execute/sha256-Ch.cl
new file mode 100644
index 00000000..f56df381
--- /dev/null
+++ b/tests/cl/program/execute/sha256-Ch.cl
@@ -0,0 +1,71 @@
+
+/*!
+[config]
+dimensions: 1
+global_size: 1 0 0
+kernel_name: Ch
+
+[test]
+name: 000
+arg_out: 0 buffer uint[1] 0
+arg_in: 1 uint 0
+arg_in: 2 uint 0
+arg_in: 3 uint 0
+
+[test]
+name: 001
+arg_out: 0 buffer uint[1] 1
+arg_in: 1 uint 0
+arg_in: 2 uint 0
+arg_in: 3 uint 1
+
+[test]
+name: 010
+arg_out: 0 buffer uint[1] 0
+arg_in: 1 uint 0
+arg_in: 2 uint 1
+arg_in: 3 uint 0
+
+[test]
+name: 011
+arg_out: 0 buffer uint[1] 1
+arg_in: 1 uint 0
+arg_in: 2 uint 1
+arg_in: 3 uint 1
+
+[test]
+name: 100
+arg_out: 0 buffer uint[1] 0
+arg_in: 1 uint 1
+arg_in: 2 uint 0
+arg_in: 3 uint 0
+
+[test]
+name: 101
+arg_out: 0 buffer uint[1] 0
+arg_in: 1 uint 1
+arg_in: 2 uint 0
+arg_in: 3 uint 1
+
+[test]
+name: 110
+arg_out: 0 buffer uint[1] 1
+arg_in: 1 uint 1
+arg_in: 2 uint 1
+arg_in: 3 uint 0
+
+[test]
+name: 111
+arg_out: 0 buffer uint[1] 1
+arg_in: 1 uint 1
+arg_in: 2 uint 1
+arg_in: 3 uint 1
+
+!*/
+
+kernel void Ch(global uint *out, uint x, uint y, uint z)
+{
+ // There are several ways to implement this, but this is a commonly used
+ // optimized version of it.
+ out[0] = (z ^ (x & (y ^ z)));
+}