[PATCH] D33592: [OpenCL] Test on half immediate support.

2017-05-26 Thread Egor Churaev via Phabricator via cfe-commits
echuraev created this revision.
Herald added a subscriber: yaxunl.

https://reviews.llvm.org/D33592

Files:
  test/CodeGenOpenCL/half.cl


Index: test/CodeGenOpenCL/half.cl
===
--- test/CodeGenOpenCL/half.cl
+++ test/CodeGenOpenCL/half.cl
@@ -21,3 +21,20 @@
 {
   return ++x;
 }
+
+__attribute__((overloadable)) int min(int, int);
+__attribute__((overloadable)) half min(half, half);
+__attribute__((overloadable)) float min(float, float);
+
+__kernel void foo( __global half* buf, __global float* buf2 )
+{
+buf[0] = min( buf[0], 1.5h );
+// CHECK: half 0xH3E00
+buf[0] = min( buf2[0], 1.5f );
+// CHECK: float 1.50e+00
+
+const half one = 1.;
+buf[1] = min( buf[1], one );
+// CHECK: half 0xH3EAB
+}
+


Index: test/CodeGenOpenCL/half.cl
===
--- test/CodeGenOpenCL/half.cl
+++ test/CodeGenOpenCL/half.cl
@@ -21,3 +21,20 @@
 {
   return ++x;
 }
+
+__attribute__((overloadable)) int min(int, int);
+__attribute__((overloadable)) half min(half, half);
+__attribute__((overloadable)) float min(float, float);
+
+__kernel void foo( __global half* buf, __global float* buf2 )
+{
+buf[0] = min( buf[0], 1.5h );
+// CHECK: half 0xH3E00
+buf[0] = min( buf2[0], 1.5f );
+// CHECK: float 1.50e+00
+
+const half one = 1.;
+buf[1] = min( buf[1], one );
+// CHECK: half 0xH3EAB
+}
+
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D33592: [OpenCL] Test on half immediate support.

2017-05-26 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision.
Anastasia added a comment.
This revision is now accepted and ready to land.

LGTM! Thanks!


https://reviews.llvm.org/D33592



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits