[libclc] 143/291: Fix definition of INFINITY and add NAN/HUGE_VAL[F]

Andreas Beckmann anbe at moszumanska.debian.org
Tue Sep 8 10:53:43 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 850f3578fdeca2370fb27d2f319dc8354bd51774
Author: Aaron Watry <awatry at gmail.com>
Date:   Mon Jun 16 22:32:58 2014 +0000

    Fix definition of INFINITY and add NAN/HUGE_VAL[F]
    
    v3: change __builtin_nanf() to __builtin_nanf("")
        This doesn't work yet, but it was agreed to commit as-is with the logic
        that "broken" is better than "completely missing" and this should be
        fixed in clang.
    
    v2: use __builtin_inff() and also add nan/huge_val definitions
    
    Signed-off-by: Aaron Watry <awatry at gmail.com>
    
    git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@211065 91177308-0d34-0410-b5e6-96231b3b80d8
---
 generic/include/clc/float/definitions.h | 6 ++++++
 generic/lib/gen_convert.py              | 2 --
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/generic/include/clc/float/definitions.h b/generic/include/clc/float/definitions.h
index 0fb0edf..c395964 100644
--- a/generic/include/clc/float/definitions.h
+++ b/generic/include/clc/float/definitions.h
@@ -1,3 +1,7 @@
+#define INFINITY __builtin_inff()
+#define NAN __builtin_nanf("")
+#define HUGE_VALF __builtin_huge_valf()
+
 #define FLT_DIG         6
 #define FLT_MANT_DIG    24
 #define FLT_MAX_10_EXP  +38
@@ -25,6 +29,8 @@
 
 #ifdef cl_khr_fp64
 
+#define HUGE_VAL __builtin_huge_val()
+
 #define DBL_DIG         15
 #define DBL_MANT_DIG    53
 #define DBL_MAX_10_EXP  +308
diff --git a/generic/lib/gen_convert.py b/generic/lib/gen_convert.py
index 8e54f0c..f91a89a 100644
--- a/generic/lib/gen_convert.py
+++ b/generic/lib/gen_convert.py
@@ -144,8 +144,6 @@ print("""/* !!!! AUTOGENERATED FILE generated by convert_type.py !!!!!
 #pragma OPENCL EXTENSION cl_khr_fp64 : enable
 #endif
 
-#define INFINITY 1.0f / 0.0f
-
 """)
 
 #

-- 
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