diff options
author | Jan Vesely <jan.vesely@rutgers.edu> | 2018-02-13 22:09:31 +0000 |
---|---|---|
committer | Jan Vesely <jan.vesely@rutgers.edu> | 2018-02-13 22:09:31 +0000 |
commit | aad28681c2198833d6ac2dcbb8ba1de5cffd8508 (patch) | |
tree | 765299e14787938f408fe07e19d63b30b13920c4 | |
parent | 758fbacea5b93307d7456dc4e2c6d3379b8aa781 (diff) | |
download | bcm5719-llvm-aad28681c2198833d6ac2dcbb8ba1de5cffd8508.tar.gz bcm5719-llvm-aad28681c2198833d6ac2dcbb8ba1de5cffd8508.zip |
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
-rw-r--r-- | libclc/amdgpu/lib/SOURCES | 1 | ||||
-rw-r--r-- | libclc/amdgpu/lib/math/half_native_unary.inc | 11 | ||||
-rw-r--r-- | libclc/amdgpu/lib/math/half_rsqrt.cl | 6 |
3 files changed, 18 insertions, 0 deletions
diff --git a/libclc/amdgpu/lib/SOURCES b/libclc/amdgpu/lib/SOURCES index 20322ecf844..461c7734beb 100644 --- a/libclc/amdgpu/lib/SOURCES +++ b/libclc/amdgpu/lib/SOURCES @@ -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 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 00000000000..0f99ba5e521 --- /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 00000000000..90566906265 --- /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> |