[PATCH 1/5] add isfinite builtin

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

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

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

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

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

Not that it matters (since it's UNDEF'd later), but you used ISINF for
the macro name (copied from isinfinite?).

Also, you could simplify this by using <clc/relational/unary_decl.inc>

Check out <clc/relational/signbit.h> for a pattern (minus the undef of
the function name at the beginning probably).

I've tested this on evergreen successfully, so we're mostly just
talking maintainability of the code here.

Also, the first 4 patches of this series have EOF whitespace errors
when applying:

Applying: add isfinite builtin
/home/awatry/src/libclc/.git/rebase-apply/patch:49: new blank line at EOF.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
---
generic/include/clc/clc.h | 1 +
generic/include/clc/relational/isnormal.h | 22 ++++++++++++++++++++++
generic/lib/SOURCES | 1 +
generic/lib/relational/isnormal.cl | 19 +++++++++++++++++++
4 files changed, 43 insertions(+)
create mode 100644 generic/include/clc/relational/isnormal.h
create mode 100644 generic/lib/relational/isnormal.cl

diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index f7085ce..148a83b 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -121,6 +121,7 @@
#include <clc/relational/isless.h>
#include <clc/relational/islessequal.h>
#include <clc/relational/isnan.h>
+#include <clc/relational/isnormal.h>
#include <clc/relational/isnotequal.h>
#include <clc/relational/select.h>
#include <clc/relational/signbit.h>
diff --git a/generic/include/clc/relational/isnormal.h b/generic/include/clc/relational/isnormal.h
new file mode 100644
index 0000000..9efda7c
--- /dev/null
+++ b/generic/include/clc/relational/isnormal.h
@@ -0,0 +1,22 @@
+
+#define _CLC_ISNAN_DECL(RET_TYPE, ARG_TYPE) \
+ _CLC_OVERLOAD _CLC_DECL RET_TYPE isnormal(ARG_TYPE);
+

Same comment here as in patch 1. copy/paste macro name which doesn't
really break anything since it's undef'd at the end. Same comment
about floatn.inc and EOF whitespace as well.

--Aaron

> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
> ---
> generic/include/clc/clc.h | 1 +
> generic/include/clc/relational/isfinite.h | 22 ++++++++++++++++++++++
> generic/lib/SOURCES | 1 +
> generic/lib/relational/isfinite.cl | 19 +++++++++++++++++++
> 4 files changed, 43 insertions(+)
> create mode 100644 generic/include/clc/relational/isfinite.h
> create mode 100644 generic/lib/relational/isfinite.cl
>
> diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
> index 17d8454..f7085ce 100644
> --- a/generic/include/clc/clc.h
> +++ b/generic/include/clc/clc.h
> @@ -114,6 +114,7 @@
> #include <clc/relational/any.h>
> #include <clc/relational/bitselect.h>
> #include <clc/relational/isequal.h>
> +#include <clc/relational/isfinite.h>
> #include <clc/relational/isgreater.h>
> #include <clc/relational/isgreaterequal.h>
> #include <clc/relational/isinf.h>
> diff --git a/generic/include/clc/relational/isfinite.h b/generic/include/clc/relational/isfinite.h
> new file mode 100644
> index 0000000..60dea56
> --- /dev/null
> +++ b/generic/include/clc/relational/isfinite.h
> @@ -0,0 +1,22 @@
> +
> +#define _CLC_ISINF_DECL(RET_TYPE, ARG_TYPE) \
> + _CLC_OVERLOAD _CLC_DECL RET_TYPE isfinite(ARG_TYPE);
> +

Not that it matters (since it's UNDEF'd later), but you used ISINF for
the macro name (copied from isinfinite?).

Also, you could simplify this by using <clc/relational/unary_decl.inc>

Check out <clc/relational/signbit.h> for a pattern (minus the undef of
the function name at the beginning probably).

I've tested this on evergreen successfully, so we're mostly just
talking maintainability of the code here.

Also, the first 4 patches of this series have EOF whitespace errors
when applying:

Applying: add isfinite builtin
/home/awatry/src/libclc/.git/rebase-apply/patch:49: new blank line at EOF.
+
/home/awatry/src/libclc/.git/rebase-apply/patch:86: new blank line at EOF.
+
warning: 2 lines add whitespace errors.
<etc>

thanks for review. I should have cleaned the patches up before posting.
v2 addresses all of the above.

jan

For the series:
Reviewed-by: Aaron Watry <awatry@gmail.com>

--Aaron

For the series:
Reviewed-by: Aaron Watry <awatry@gmail.com>

thanks. I assume that's for v2 of the series.
jan

For the series:
Reviewed-by: Aaron Watry <awatry@gmail.com>

thanks. I assume that's for v2 of the series.
jan

Yes, that's for v2.