mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 19:44:38 +08:00
native_recip: provide function implementation instead of macro
Reviewer: Jeroen Ketema Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 318066
This commit is contained in:
@@ -1 +1,9 @@
|
||||
#define native_recip(x) ((1) / (x))
|
||||
#define __CLC_BODY <clc/math/unary_decl.inc>
|
||||
#define __CLC_FUNCTION native_recip
|
||||
#define __FLOAT_ONLY
|
||||
|
||||
#include <clc/math/gentype.inc>
|
||||
|
||||
#undef __FLOAT_ONLY
|
||||
#undef __CLC_BODY
|
||||
#undef __CLC_FUNCTION
|
||||
|
||||
@@ -126,6 +126,7 @@ math/native_exp2.cl
|
||||
math/native_log.cl
|
||||
math/native_log10.cl
|
||||
math/native_log2.cl
|
||||
math/native_recip.cl
|
||||
math/native_rsqrt.cl
|
||||
math/native_sin.cl
|
||||
math/native_sqrt.cl
|
||||
|
||||
5
libclc/generic/lib/math/native_recip.cl
Normal file
5
libclc/generic/lib/math/native_recip.cl
Normal file
@@ -0,0 +1,5 @@
|
||||
#include <clc/clc.h>
|
||||
|
||||
#define __CLC_BODY <native_recip.inc>
|
||||
#define __FLOAT_ONLY
|
||||
#include <clc/math/gentype.inc>
|
||||
3
libclc/generic/lib/math/native_recip.inc
Normal file
3
libclc/generic/lib/math/native_recip.inc
Normal file
@@ -0,0 +1,3 @@
|
||||
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_recip(__CLC_GENTYPE val) {
|
||||
return 1.0f / val;
|
||||
}
|
||||
Reference in New Issue
Block a user