amdgpu/half_rsqrt: Switch implementation to native_rsqrt
Reviewer: Tom Stellard <tstellar@redhat.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 325053
diff --git a/libclc/amdgpu/lib/math/half_native_unary.inc b/libclc/amdgpu/lib/math/half_native_unary.inc
new file mode 100644
index 0000000..0f99ba5
--- /dev/null
+++ b/libclc/amdgpu/lib/math/half_native_unary.inc
@@ -0,0 +1,11 @@
+#include <utils.h>
+
+#define __CLC_HALF_FUNC(x) __CLC_CONCAT(half_, x)
+#define __CLC_NATIVE_FUNC(x) __CLC_CONCAT(native_, x)
+
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_HALF_FUNC(__CLC_FUNC)(__CLC_GENTYPE val) {
+ return __CLC_NATIVE_FUNC(__CLC_FUNC)(val);
+}
+
+#undef __CLC_NATIVE_FUNC
+#undef __CLC_HALF_FUNC
diff --git a/libclc/amdgpu/lib/math/half_rsqrt.cl b/libclc/amdgpu/lib/math/half_rsqrt.cl
new file mode 100644
index 0000000..9056690
--- /dev/null
+++ b/libclc/amdgpu/lib/math/half_rsqrt.cl
@@ -0,0 +1,6 @@
+#include <clc/clc.h>
+
+#define __CLC_FUNC rsqrt
+#define __FLOAT_ONLY
+#define __CLC_BODY <half_native_unary.inc>
+#include <clc/math/gentype.inc>