diff options
author | Jan Vesely <jan.vesely@rutgers.edu> | 2017-10-25 16:49:22 +0000 |
---|---|---|
committer | Jan Vesely <jan.vesely@rutgers.edu> | 2017-10-25 16:49:22 +0000 |
commit | 47e093da9b48260e6f030fc21a96ef03b4a1fec5 (patch) | |
tree | 9b8410be2a7a2f25bbb121050916679947b70a69 /libclc/amdgpu | |
parent | 9fedbb9d8e0c43cead1dbb5ae5877ee02a18ea3d (diff) | |
download | llvm-47e093da9b48260e6f030fc21a96ef03b4a1fec5.zip llvm-47e093da9b48260e6f030fc21a96ef03b4a1fec5.tar.gz llvm-47e093da9b48260e6f030fc21a96ef03b4a1fec5.tar.bz2 |
math: Implement native_log10
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
Diffstat (limited to 'libclc/amdgpu')
-rw-r--r-- | libclc/amdgpu/lib/SOURCES | 1 | ||||
-rw-r--r-- | libclc/amdgpu/lib/math/native_log10.cl | 5 | ||||
-rw-r--r-- | libclc/amdgpu/lib/math/native_log10.inc | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/libclc/amdgpu/lib/SOURCES b/libclc/amdgpu/lib/SOURCES index 8cbe1d4..59d8b22 100644 --- a/libclc/amdgpu/lib/SOURCES +++ b/libclc/amdgpu/lib/SOURCES @@ -1,3 +1,4 @@ math/native_log.cl +math/native_log10.cl math/nextafter.cl math/sqrt.cl diff --git a/libclc/amdgpu/lib/math/native_log10.cl b/libclc/amdgpu/lib/math/native_log10.cl new file mode 100644 index 0000000..2e7c11e --- /dev/null +++ b/libclc/amdgpu/lib/math/native_log10.cl @@ -0,0 +1,5 @@ +#include <clc/clc.h> + +#define __CLC_BODY <native_log10.inc> +#define __FLOAT_ONLY +#include <clc/math/gentype.inc> diff --git a/libclc/amdgpu/lib/math/native_log10.inc b/libclc/amdgpu/lib/math/native_log10.inc new file mode 100644 index 0000000..96b1a0a --- /dev/null +++ b/libclc/amdgpu/lib/math/native_log10.inc @@ -0,0 +1,3 @@ +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_log10(__CLC_GENTYPE val) { + return native_log2(val) * (M_LN2_F / M_LN10_F); +} |