[libclc] r325053 - amdgpu/half_rsqrt: Switch implementation to native_rsqrt

Jan Vesely via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 13 14:09:31 PST 2018


Author: jvesely
Date: Tue Feb 13 14:09:31 2018
New Revision: 325053

URL: http://llvm.org/viewvc/llvm-project?rev=325053&view=rev
Log:
amdgpu/half_rsqrt: Switch implementation to native_rsqrt

Reviewer: Tom Stellard <tstellar at redhat.com>
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>

Added:
    libclc/trunk/amdgpu/lib/math/half_native_unary.inc
    libclc/trunk/amdgpu/lib/math/half_rsqrt.cl
Modified:
    libclc/trunk/amdgpu/lib/SOURCES

Modified: libclc/trunk/amdgpu/lib/SOURCES
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgpu/lib/SOURCES?rev=325053&r1=325052&r2=325053&view=diff
==============================================================================
--- libclc/trunk/amdgpu/lib/SOURCES (original)
+++ libclc/trunk/amdgpu/lib/SOURCES Tue Feb 13 14:09:31 2018
@@ -1,5 +1,6 @@
 math/native_exp.cl
 math/native_log.cl
 math/native_log10.cl
+math/half_rsqrt.cl
 math/nextafter.cl
 math/sqrt.cl

Added: libclc/trunk/amdgpu/lib/math/half_native_unary.inc
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgpu/lib/math/half_native_unary.inc?rev=325053&view=auto
==============================================================================
--- libclc/trunk/amdgpu/lib/math/half_native_unary.inc (added)
+++ libclc/trunk/amdgpu/lib/math/half_native_unary.inc Tue Feb 13 14:09:31 2018
@@ -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

Added: libclc/trunk/amdgpu/lib/math/half_rsqrt.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgpu/lib/math/half_rsqrt.cl?rev=325053&view=auto
==============================================================================
--- libclc/trunk/amdgpu/lib/math/half_rsqrt.cl (added)
+++ libclc/trunk/amdgpu/lib/math/half_rsqrt.cl Tue Feb 13 14:09:31 2018
@@ -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>




More information about the cfe-commits mailing list