popcount: Provide function implementation rather than intrinsic redirect
amdgcn will need to override this Reviewer: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 327042
This commit is contained in:
parent
7b66ef1036
commit
17e8679493
|
@ -1,6 +1,5 @@
|
|||
#undef popcount
|
||||
#define popcount __clc_popcount
|
||||
|
||||
#define __CLC_FUNCTION __clc_popcount
|
||||
#define __CLC_INTRINSIC "llvm.ctpop"
|
||||
#include <clc/integer/unary_intrin.inc>
|
||||
#define __CLC_FUNCTION popcount
|
||||
#define __CLC_BODY <clc/integer/unary.inc>
|
||||
#include <clc/integer/gentype.inc>
|
||||
#undef __CLC_FUNCTION
|
||||
#undef __CLC_BODY
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x);
|
|
@ -0,0 +1,3 @@
|
|||
#define __CLC_FUNCTION __clc_native_popcount
|
||||
#define __CLC_INTRINSIC "llvm.ctpop"
|
||||
#include <integer/unary_intrin.inc>
|
|
@ -70,6 +70,7 @@ integer/mad24.cl
|
|||
integer/mad_sat.cl
|
||||
integer/mul24.cl
|
||||
integer/mul_hi.cl
|
||||
integer/popcount.cl
|
||||
integer/rhadd.cl
|
||||
integer/rotate.cl
|
||||
integer/sub_sat.cl
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNC(__CLC_GENTYPE x) {
|
||||
return __CLC_IMPL_FUNC(x);
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
#include <clc/clc.h>
|
||||
#include <integer/popcount.h>
|
||||
|
||||
#define __CLC_FUNC popcount
|
||||
#define __CLC_IMPL_FUNC __clc_native_popcount
|
||||
|
||||
#define __CLC_BODY "../clc_unary.inc"
|
||||
#include <clc/integer/gentype.inc>
|
Loading…
Reference in New Issue