[libclc] 161/291: relational: Implement isgreaterequal
Andreas Beckmann
anbe at moszumanska.debian.org
Tue Sep 8 10:53:45 UTC 2015
This is an automated email from the git hooks/post-receive script.
anbe pushed a commit to branch master
in repository libclc.
commit d5efed4cb5519393bf40e65190e3ffef8f5940d2
Author: Aaron Watry <awatry at gmail.com>
Date: Thu Jul 17 22:07:27 2014 +0000
relational: Implement isgreaterequal
v2: Use relational macros instead of hand-rolled macros
Signed-off-by: Aaron Watry <awatry at gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@213319 91177308-0d34-0410-b5e6-96231b3b80d8
---
generic/include/clc/clc.h | 1 +
generic/include/clc/relational/isgreaterequal.h | 9 +++++++++
generic/lib/SOURCES | 1 +
generic/lib/relational/isgreaterequal.cl | 22 ++++++++++++++++++++++
4 files changed, 33 insertions(+)
diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index 34123d9..fd5c323 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -111,6 +111,7 @@
#include <clc/relational/bitselect.h>
#include <clc/relational/isequal.h>
#include <clc/relational/isgreater.h>
+#include <clc/relational/isgreaterequal.h>
#include <clc/relational/isnan.h>
#include <clc/relational/select.h>
#include <clc/relational/signbit.h>
diff --git a/generic/include/clc/relational/isgreaterequal.h b/generic/include/clc/relational/isgreaterequal.h
new file mode 100644
index 0000000..8353328
--- /dev/null
+++ b/generic/include/clc/relational/isgreaterequal.h
@@ -0,0 +1,9 @@
+#undef isgreaterequal
+
+#define __CLC_FUNCTION isgreaterequal
+#define __CLC_BODY <clc/relational/binary_decl.inc>
+
+#include <clc/relational/floatn.inc>
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION
diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES
index 671fff2..dfe1016 100644
--- a/generic/lib/SOURCES
+++ b/generic/lib/SOURCES
@@ -42,6 +42,7 @@ relational/all.cl
relational/any.cl
relational/isequal.cl
relational/isgreater.cl
+relational/isgreaterequal.cl
relational/isnan.cl
relational/signbit.cl
shared/clamp.cl
diff --git a/generic/lib/relational/isgreaterequal.cl b/generic/lib/relational/isgreaterequal.cl
new file mode 100644
index 0000000..2d5ebe5
--- /dev/null
+++ b/generic/lib/relational/isgreaterequal.cl
@@ -0,0 +1,22 @@
+#include <clc/clc.h>
+#include "relational.h"
+
+//Note: It would be nice to use __builtin_isgreaterequal 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, isgreaterequal, __builtin_isgreaterequal, float, float)
+
+#ifdef cl_khr_fp64
+
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
+
+// The scalar version of isgreaterequal(double, double) returns an int, but the vector versions
+// return long.
+
+_CLC_DEF _CLC_OVERLOAD int isgreaterequal(double x, double y){
+ return __builtin_isgreaterequal(x, y);
+}
+
+_CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(long, isgreaterequal, double, double)
+
+#endif
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/libclc.git
More information about the Pkg-opencl-commits
mailing list