Use llvm instrinsic by default
Provide amdgpu workaround
v2: drop old amd copyrights
Reviewer: Aaron Watry
Reviewed-by: Vedran Miletić <vedran@miletic.net>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 316588
math/native_log.cl
+math/native_log10.cl
math/nextafter.cl
math/sqrt.cl
--- /dev/null
+#include <clc/clc.h>
+
+#define __CLC_BODY <native_log10.inc>
+#define __FLOAT_ONLY
+#include <clc/math/gentype.inc>
--- /dev/null
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_log10(__CLC_GENTYPE val) {
+ return native_log2(val) * (M_LN2_F / M_LN10_F);
+}
#include <clc/math/native_exp10.h>
#include <clc/math/native_exp2.h>
#include <clc/math/native_log.h>
+#include <clc/math/native_log10.h>
#include <clc/math/native_log2.h>
#include <clc/math/native_powr.h>
#include <clc/math/native_recip.h>
--- /dev/null
+#define __CLC_BODY <clc/math/native_log10.inc>
+#define __FLOAT_ONLY
+#include <clc/math/gentype.inc>
+#undef __CLC_BODY
+#undef __FLOAT_ONLY
--- /dev/null
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE native_log10(__CLC_GENTYPE a);
math/mad.cl
math/modf.cl
math/native_log.cl
+math/native_log10.cl
math/native_log2.cl
math/tables.cl
math/clc_nextafter.cl
--- /dev/null
+#include <clc/clc.h>
+
+#define __CLC_FUNCTION __clc_native_log10
+#define __CLC_INTRINSIC "llvm.log10"
+#undef cl_khr_fp64
+#include <clc/math/unary_intrin.inc>
+
+#define __CLC_BODY <native_log10.inc>
+#define __FLOAT_ONLY
+#include <clc/math/gentype.inc>
--- /dev/null
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_log10(__CLC_GENTYPE val) {
+ return __clc_native_log10(val);
+}