diff options
author | Jan Vesely <jan.vesely@rutgers.edu> | 2018-01-18 21:12:06 +0000 |
---|---|---|
committer | Jan Vesely <jan.vesely@rutgers.edu> | 2018-01-18 21:12:06 +0000 |
commit | 44e0522c09a8338101a26f471b4abae96feb7a8d (patch) | |
tree | 7a2b87cec10fed2fa10a200d1d718e784cfe26b1 | |
parent | 2813b4f8d9f9797f69cac72d685aabc366fcd523 (diff) | |
download | bcm5719-llvm-44e0522c09a8338101a26f471b4abae96feb7a8d.tar.gz bcm5719-llvm-44e0522c09a8338101a26f471b4abae96feb7a8d.zip |
half_divide: Implement using x/y
Passes CTS on carrizo
v2: Use full precision implementation
Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322899
-rw-r--r-- | libclc/generic/include/clc/clc.h | 1 | ||||
-rw-r--r-- | libclc/generic/include/clc/math/half_divide.h | 7 | ||||
-rw-r--r-- | libclc/generic/lib/SOURCES | 1 | ||||
-rw-r--r-- | libclc/generic/lib/math/half_binary.inc | 9 | ||||
-rw-r--r-- | libclc/generic/lib/math/half_divide.cl | 9 |
5 files changed, 27 insertions, 0 deletions
diff --git a/libclc/generic/include/clc/clc.h b/libclc/generic/include/clc/clc.h index 9e4b18591dc..930bbfc176d 100644 --- a/libclc/generic/include/clc/clc.h +++ b/libclc/generic/include/clc/clc.h @@ -71,6 +71,7 @@ #include <clc/math/fract.h> #include <clc/math/frexp.h> #include <clc/math/half_cos.h> +#include <clc/math/half_divide.h> #include <clc/math/half_exp.h> #include <clc/math/half_exp10.h> #include <clc/math/half_exp2.h> diff --git a/libclc/generic/include/clc/math/half_divide.h b/libclc/generic/include/clc/math/half_divide.h new file mode 100644 index 00000000000..84096b94734 --- /dev/null +++ b/libclc/generic/include/clc/math/half_divide.h @@ -0,0 +1,7 @@ +#define __CLC_BODY <clc/math/binary_decl_tt.inc> +#define __CLC_FUNCTION half_divide + +#include <clc/math/gentype.inc> + +#undef __CLC_BODY +#undef __CLC_FUNCTION diff --git a/libclc/generic/lib/SOURCES b/libclc/generic/lib/SOURCES index c0d123854c4..9dbd35e4f76 100644 --- a/libclc/generic/lib/SOURCES +++ b/libclc/generic/lib/SOURCES @@ -105,6 +105,7 @@ math/fmod.cl math/fract.cl math/frexp.cl math/half_cos.cl +math/half_divide.cl math/half_exp.cl math/half_exp10.cl math/half_exp2.cl diff --git a/libclc/generic/lib/math/half_binary.inc b/libclc/generic/lib/math/half_binary.inc new file mode 100644 index 00000000000..f831b530b4b --- /dev/null +++ b/libclc/generic/lib/math/half_binary.inc @@ -0,0 +1,9 @@ +#include <utils.h> + +#define __CLC_HALF_FUNC(x) __CLC_CONCAT(half_, x) + +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_HALF_FUNC(__CLC_FUNC)(__CLC_GENTYPE x, __CLC_GENTYPE y) { + return __CLC_FUNC(x, y); +} + +#undef __CLC_HALF_FUNC diff --git a/libclc/generic/lib/math/half_divide.cl b/libclc/generic/lib/math/half_divide.cl new file mode 100644 index 00000000000..ee9c895a988 --- /dev/null +++ b/libclc/generic/lib/math/half_divide.cl @@ -0,0 +1,9 @@ +#include <clc/clc.h> + +#define divide(x,y) (x/y) + +#define __CLC_FUNC divide +#define __CLC_BODY <half_binary.inc> +#define __FLOAT_ONLY +#include <clc/math/gentype.inc> +#undef divide |