diff options
Diffstat (limited to 'libclc/generic/include/clc')
-rw-r--r-- | libclc/generic/include/clc/integer/popcount.h | 11 | ||||
-rw-r--r-- | libclc/generic/include/clc/integer/unary.inc | 1 | ||||
-rw-r--r-- | libclc/generic/include/clc/integer/unary_intrin.inc | 20 |
3 files changed, 6 insertions, 26 deletions
diff --git a/libclc/generic/include/clc/integer/popcount.h b/libclc/generic/include/clc/integer/popcount.h index 99e402171de..23335f45b6f 100644 --- a/libclc/generic/include/clc/integer/popcount.h +++ b/libclc/generic/include/clc/integer/popcount.h @@ -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 diff --git a/libclc/generic/include/clc/integer/unary.inc b/libclc/generic/include/clc/integer/unary.inc new file mode 100644 index 00000000000..9858d908da0 --- /dev/null +++ b/libclc/generic/include/clc/integer/unary.inc @@ -0,0 +1 @@ +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/integer/unary_intrin.inc b/libclc/generic/include/clc/integer/unary_intrin.inc deleted file mode 100644 index ee9862a4c5b..00000000000 --- a/libclc/generic/include/clc/integer/unary_intrin.inc +++ /dev/null @@ -1,20 +0,0 @@ -#define __CLC_INTRINSIC_DEF(SCALAR_TYPE, BIT_SIZE) \ -_CLC_OVERLOAD SCALAR_TYPE __CLC_FUNCTION(SCALAR_TYPE x) __asm(__CLC_INTRINSIC ".i" BIT_SIZE); \ -_CLC_OVERLOAD SCALAR_TYPE##2 __CLC_FUNCTION(SCALAR_TYPE##2 x) __asm(__CLC_INTRINSIC ".v2i" BIT_SIZE); \ -_CLC_OVERLOAD SCALAR_TYPE##3 __CLC_FUNCTION(SCALAR_TYPE##3 x) __asm(__CLC_INTRINSIC ".v3i" BIT_SIZE); \ -_CLC_OVERLOAD SCALAR_TYPE##4 __CLC_FUNCTION(SCALAR_TYPE##4 x) __asm(__CLC_INTRINSIC ".v4i" BIT_SIZE); \ -_CLC_OVERLOAD SCALAR_TYPE##8 __CLC_FUNCTION(SCALAR_TYPE##8 x) __asm(__CLC_INTRINSIC ".v8i" BIT_SIZE); \ -_CLC_OVERLOAD SCALAR_TYPE##16 __CLC_FUNCTION(SCALAR_TYPE##16 x) __asm(__CLC_INTRINSIC ".v16i" BIT_SIZE); - -__CLC_INTRINSIC_DEF(char, "8") -__CLC_INTRINSIC_DEF(uchar, "8") -__CLC_INTRINSIC_DEF(short, "16") -__CLC_INTRINSIC_DEF(ushort, "16") -__CLC_INTRINSIC_DEF(int, "32") -__CLC_INTRINSIC_DEF(uint, "32") -__CLC_INTRINSIC_DEF(long, "64") -__CLC_INTRINSIC_DEF(ulong, "64") - -#undef __CLC_FUNCTION -#undef __CLC_INTRINSIC -#undef __CLC_INTRINSIC_DEF |