summaryrefslogtreecommitdiff
path: root/kernels/compiler_long_hi_sat.cl
diff options
context:
space:
mode:
Diffstat (limited to 'kernels/compiler_long_hi_sat.cl')
-rw-r--r--kernels/compiler_long_hi_sat.cl19
1 files changed, 19 insertions, 0 deletions
diff --git a/kernels/compiler_long_hi_sat.cl b/kernels/compiler_long_hi_sat.cl
new file mode 100644
index 00000000..66e4ab91
--- /dev/null
+++ b/kernels/compiler_long_hi_sat.cl
@@ -0,0 +1,19 @@
+kernel void compiler_long_mul_hi(global long *src, global long *dst, long num0, long num1) {
+ int i = get_local_id(0);
+ long c;
+
+ if (i % 2 == 0) {
+ c = mul_hi(src[i], num0);
+ } else {
+ c = mul_hi(src[i], num1);
+ }
+ dst[i] = c;
+}
+
+kernel void compiler_long_mul_sat(global long *src, global long *dst, long num0, long num1) {
+ int i = get_local_id(0);
+ long c;
+
+ c = mad_sat(src[i], num0, num1);
+ dst[i] = c;
+}