[PATCH 1/2] relational: Add isless(floatN) builtin

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
---

Based on Aaron's isgreater/isgreaterequal.

generic/include/clc/clc.h | 1 +
generic/include/clc/relational/isless.h | 9 +++++++++
generic/lib/SOURCES | 1 +
generic/lib/relational/isless.cl | 22 ++++++++++++++++++++++
4 files changed, 33 insertions(+)
create mode 100644 generic/include/clc/relational/isless.h
create mode 100644 generic/lib/relational/isless.cl

diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index 60b5a6c..83bf8fa 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -115,6 +115,7 @@
#include <clc/relational/isequal.h>
#include <clc/relational/isgreater.h>
#include <clc/relational/isgreaterequal.h>
+#include <clc/relational/isless.h>
#include <clc/relational/isnan.h>
#include <clc/relational/isnotequal.h>
#include <clc/relational/select.h>
diff --git a/generic/include/clc/relational/isless.h b/generic/include/clc/relational/isless.h
new file mode 100644
index 0000000..1954a59
--- /dev/null
+++ b/generic/include/clc/relational/isless.h
@@ -0,0 +1,9 @@
+#undef isless
+

Many of the math built-ins require the #undef of the builtin function
name, but it turns out that this isn't the case for at least this
relational.

Get rid of the #undef isless and this patch is byte-identical to the
isless implementation that I hadn't yet gotten around to sending yet
and therefore would be:
Reviewed-by: Aaron Watry <awatry@gmail.com>

---
generic/include/clc/clc.h | 1 +
generic/include/clc/relational/islessequal.h | 9 +++++++++
generic/lib/SOURCES | 1 +
generic/lib/relational/islessequal.cl | 22 ++++++++++++++++++++++
4 files changed, 33 insertions(+)
create mode 100644 generic/include/clc/relational/islessequal.h
create mode 100644 generic/lib/relational/islessequal.cl

diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index 83bf8fa..9815c56 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -116,6 +116,7 @@
#include <clc/relational/isgreater.h>
#include <clc/relational/isgreaterequal.h>
#include <clc/relational/isless.h>
+#include <clc/relational/islessequal.h>
#include <clc/relational/isnan.h>
#include <clc/relational/isnotequal.h>
#include <clc/relational/select.h>
diff --git a/generic/include/clc/relational/islessequal.h b/generic/include/clc/relational/islessequal.h
new file mode 100644
index 0000000..a3215a2
--- /dev/null
+++ b/generic/include/clc/relational/islessequal.h
@@ -0,0 +1,9 @@
+#undef islessequal
+

Same comment about this one as with isless(floatn). If we can get by
without it, let's remove this undef.

Otherwise, looks good to me.

--Aaron

> ---
> generic/include/clc/clc.h | 1 +
> generic/include/clc/relational/islessequal.h | 9 +++++++++
> generic/lib/SOURCES | 1 +
> generic/lib/relational/islessequal.cl | 22 ++++++++++++++++++++++
> 4 files changed, 33 insertions(+)
> create mode 100644 generic/include/clc/relational/islessequal.h
> create mode 100644 generic/lib/relational/islessequal.cl
>
> diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
> index 83bf8fa..9815c56 100644
> --- a/generic/include/clc/clc.h
> +++ b/generic/include/clc/clc.h
> @@ -116,6 +116,7 @@
> #include <clc/relational/isgreater.h>
> #include <clc/relational/isgreaterequal.h>
> #include <clc/relational/isless.h>
> +#include <clc/relational/islessequal.h>
> #include <clc/relational/isnan.h>
> #include <clc/relational/isnotequal.h>
> #include <clc/relational/select.h>
> diff --git a/generic/include/clc/relational/islessequal.h b/generic/include/clc/relational/islessequal.h
> new file mode 100644
> index 0000000..a3215a2
> --- /dev/null
> +++ b/generic/include/clc/relational/islessequal.h
> @@ -0,0 +1,9 @@
> +#undef islessequal
> +

Same comment about this one as with isless(floatn). If we can get by
without it, let's remove this undef.

Otherwise, looks good to me.

Thanks. pushed.
What is the rule behind those undefs? why do we keep them for isgreater
and not isless?

Jan

We can actually remove them for isgreater and any other relational
functions (patch incoming). I had originally patterned them after the
math/* functions, where quite a few do require that undef (due to
collisions with libm definitions?). At least when working on some of
the math functions, I was getting redeclaration warnings/errors if I
tried to remove them...

--Aaron