summaryrefslogtreecommitdiff
path: root/r600
diff options
context:
space:
mode:
authorJan Vesely <jan.vesely@rutgers.edu>2015-05-06 21:59:30 +0000
committerJan Vesely <jan.vesely@rutgers.edu>2015-05-06 21:59:30 +0000
commita34526380a732e32a4d56a1d05a20b5accd25d1a (patch)
tree0f7b67db3e1dbdc142c19bd36be4e1adf11dce4f /r600
parentf2a34e6a77bea3cd3f522bcc6f686f2f2efce81b (diff)
r600: Use __clc_ldexp on asics that don't implement the intruction
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@236649 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'r600')
-rw-r--r--r600/lib/math/ldexp.cl11
1 files changed, 10 insertions, 1 deletions
diff --git a/r600/lib/math/ldexp.cl b/r600/lib/math/ldexp.cl
index 0461a53..80439ce 100644
--- a/r600/lib/math/ldexp.cl
+++ b/r600/lib/math/ldexp.cl
@@ -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, __builtin_amdgpu_ldexpf, float, int);
// This defines all the ldexp(GENTYPE, int);
#define __CLC_BODY <../../../generic/lib/math/ldexp.inc>
#include <clc/math/gentype.inc>
+
+#undef BUILTINF