summaryrefslogtreecommitdiffstats
path: root/libclc/generic/lib/relational
diff options
context:
space:
mode:
authorJan Vesely <jan.vesely@rutgers.edu>2014-08-01 21:50:59 +0000
committerJan Vesely <jan.vesely@rutgers.edu>2014-08-01 21:50:59 +0000
commit12c660827e561d42fb3cfc9a7ed5f00af4975c9a (patch)
treea52fedefd99684e9932aa519584b84ef2f7d5def /libclc/generic/lib/relational
parentacba2c98eb2ab1c96498f88c0a1bbbbfbcadb5b2 (diff)
downloadbcm5719-llvm-12c660827e561d42fb3cfc9a7ed5f00af4975c9a.tar.gz
bcm5719-llvm-12c660827e561d42fb3cfc9a7ed5f00af4975c9a.zip
relational: Add islessequal(floatN) builtin
v2: remove the initial undef Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 214568
Diffstat (limited to 'libclc/generic/lib/relational')
-rw-r--r--libclc/generic/lib/relational/islessequal.cl22
1 files changed, 22 insertions, 0 deletions
diff --git a/libclc/generic/lib/relational/islessequal.cl b/libclc/generic/lib/relational/islessequal.cl
new file mode 100644
index 00000000000..259c307da45
--- /dev/null
+++ b/libclc/generic/lib/relational/islessequal.cl
@@ -0,0 +1,22 @@
+#include <clc/clc.h>
+#include "relational.h"
+
+//Note: It would be nice to use __builtin_islessequal with vector inputs, but it seems to only take scalar values as
+// input, which will produce incorrect output for vector input types.
+
+_CLC_DEFINE_RELATIONAL_BINARY(int, islessequal, __builtin_islessequal, float, float)
+
+#ifdef cl_khr_fp64
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+// The scalar version of islessequal(double, double) returns an int, but the vector versions
+// return long.
+
+_CLC_DEF _CLC_OVERLOAD int islessequal(double x, double y){
+ return __builtin_islessequal(x, y);
+}
+
+_CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(long, islessequal, double, double)
+
+#endif
OpenPOWER on IntegriCloud