[Libclc-dev] [PATCH 1/1] math: Use single precision builtin in sp fdim path

Jan Vesely via Libclc-dev libclc-dev at lists.llvm.org
Fri May 13 17:36:18 PDT 2016


Fixes fdim piglit on Turks

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

Not sure when llvm started inserting double promotion:
<unknown>:0:0: in function test_1_fdim_float void (float addrspace(1)*, float addrspace(1)*, float addrspace(1)*): unsupported call to function __extendsfdf2

 generic/lib/math/fdim.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/generic/lib/math/fdim.inc b/generic/lib/math/fdim.inc
index a67c76e..0e57513 100644
--- a/generic/lib/math/fdim.inc
+++ b/generic/lib/math/fdim.inc
@@ -25,7 +25,7 @@
 _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE fdim(__CLC_GENTYPE x, __CLC_GENTYPE y) {
     if (__builtin_isnan(x) || __builtin_isnan(y))
         return as_float(QNANBITPATT_SP32);
-    return __builtin_fmax(x - y, 0);
+    return __builtin_fmaxf(x - y, 0);
 }
 #define __CLC_FDIM_VEC(width) \
 _CLC_OVERLOAD _CLC_DEF float##width fdim(float##width x, float##width y) { \
-- 
2.5.5



More information about the Libclc-dev mailing list