[libclc] r236649 - r600: Use __clc_ldexp on asics that don't implement the intruction

Jan Vesely jan.vesely at rutgers.edu
Wed May 6 14:59:31 PDT 2015


Author: jvesely
Date: Wed May  6 16:59:30 2015
New Revision: 236649

URL: http://llvm.org/viewvc/llvm-project?rev=236649&view=rev
Log:
r600: Use __clc_ldexp on asics that don't implement the intruction

Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>

Modified:
    libclc/trunk/r600/lib/math/ldexp.cl

Modified: libclc/trunk/r600/lib/math/ldexp.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/math/ldexp.cl?rev=236649&r1=236648&r2=236649&view=diff
==============================================================================
--- libclc/trunk/r600/lib/math/ldexp.cl (original)
+++ libclc/trunk/r600/lib/math/ldexp.cl Wed May  6 16:59:30 2015
@@ -24,8 +24,15 @@
 
 #include "../../../generic/lib/clcmacro.h"
 
+#ifdef __HAS_LDEXPF__
+#define BUILTINF __builtin_amdgpu_ldexpf
+#else
+#include "math/clc_ldexp.h"
+#define BUILTINF __clc_ldexp
+#endif
+
 // This defines all the ldexp(floatN, intN) variants.
-_CLC_DEFINE_BINARY_BUILTIN(float, ldexp, __builtin_amdgpu_ldexpf, float, int);
+_CLC_DEFINE_BINARY_BUILTIN(float, ldexp, BUILTINF, float, int);
 
 #ifdef cl_khr_fp64
   #pragma OPENCL EXTENSION cl_khr_fp64 : enable
@@ -36,3 +43,5 @@ _CLC_DEFINE_BINARY_BUILTIN(float, ldexp,
 // This defines all the ldexp(GENTYPE, int);
 #define __CLC_BODY <../../../generic/lib/math/ldexp.inc>
 #include <clc/math/gentype.inc>
+
+#undef BUILTINF





More information about the cfe-commits mailing list