diff options
author | Aaron Watry <awatry@gmail.com> | 2013-04-16 18:53:56 -0500 |
---|---|---|
committer | Aaron Watry <awatry@gmail.com> | 2013-04-16 18:53:56 -0500 |
commit | 7d3313adc6c209f7110d0f0fba39ec77d0db96e3 (patch) | |
tree | 7db2b7157bb1fea02290617cb6621fb0e34144f5 /generic | |
parent | fbb4198b6ea4e5b6946dba9b003bd79304c091b5 (diff) |
libclc: Add mul24() implementation
Diffstat (limited to 'generic')
-rw-r--r-- | generic/include/clc/clc.h | 1 | ||||
-rw-r--r-- | generic/include/clc/integer/mul24.h | 25 | ||||
-rw-r--r-- | generic/lib/SOURCES | 1 | ||||
-rw-r--r-- | generic/lib/integer/mul24.cl | 55 | ||||
-rw-r--r-- | generic/lib/integer/mul24.inc | 3 |
5 files changed, 85 insertions, 0 deletions
diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h index 746a301..55e5fe4 100644 --- a/generic/include/clc/clc.h +++ b/generic/include/clc/clc.h @@ -65,6 +65,7 @@ #include <clc/integer/add_sat.h> #include <clc/integer/clz.h> #include <clc/integer/mad24.h> +#include <clc/integer/mul24.h> #include <clc/integer/rotate.h> #include <clc/integer/sub_sat.h> diff --git a/generic/include/clc/integer/mul24.h b/generic/include/clc/integer/mul24.h new file mode 100644 index 0000000..e025d77 --- /dev/null +++ b/generic/include/clc/integer/mul24.h @@ -0,0 +1,25 @@ + +_CLC_OVERLOAD _CLC_DECL int mul24(int x, int y); + +_CLC_OVERLOAD _CLC_DECL int2 mul24(int2 x, int2 y); + +_CLC_OVERLOAD _CLC_DECL int3 mul24(int3 x, int3 y); + +_CLC_OVERLOAD _CLC_DECL int4 mul24(int4 x, int4 y); + +_CLC_OVERLOAD _CLC_DECL int8 mul24(int8 x, int8 y); + +_CLC_OVERLOAD _CLC_DECL int16 mul24(int16 x, int16 y); + +_CLC_OVERLOAD _CLC_DECL uint mul24(uint x, uint y); + +_CLC_OVERLOAD _CLC_DECL uint2 mul24(uint2 x, uint2 y); + +_CLC_OVERLOAD _CLC_DECL uint3 mul24(uint3 x, uint3 y); + +_CLC_OVERLOAD _CLC_DECL uint4 mul24(uint4 x, uint4 y); + +_CLC_OVERLOAD _CLC_DECL uint8 mul24(uint8 x, uint8 y); + +_CLC_OVERLOAD _CLC_DECL uint16 mul24(uint16 x, uint16 y); + diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES index ce9f638..cd79ac1 100644 --- a/generic/lib/SOURCES +++ b/generic/lib/SOURCES @@ -12,6 +12,7 @@ integer/clz.cl integer/clz_if.ll integer/clz_impl.ll integer/mad24.cl +integer/mul24.cl integer/rotate.cl integer/sub_sat.cl integer/sub_sat_if.ll diff --git a/generic/lib/integer/mul24.cl b/generic/lib/integer/mul24.cl new file mode 100644 index 0000000..a2cad96 --- /dev/null +++ b/generic/lib/integer/mul24.cl @@ -0,0 +1,55 @@ +#include <clc/clc.h> + + +#define BODY <mul24.inc> + +#define GENTYPE int +#include BODY +#undef GENTYPE + +#define GENTYPE int2 +#include BODY +#undef GENTYPE + +#define GENTYPE int3 +#include BODY +#undef GENTYPE + +#define GENTYPE int4 +#include BODY +#undef GENTYPE + +#define GENTYPE int8 +#include BODY +#undef GENTYPE + +#define GENTYPE int16 +#include BODY +#undef GENTYPE + +#define GENTYPE uint +#include BODY +#undef GENTYPE + +#define GENTYPE uint2 +#include BODY +#undef GENTYPE + +#define GENTYPE uint3 +#include BODY +#undef GENTYPE + +#define GENTYPE uint4 +#include BODY +#undef GENTYPE + +#define GENTYPE uint8 +#include BODY +#undef GENTYPE + +#define GENTYPE uint16 +#include BODY +#undef GENTYPE + + +#undef BODY diff --git a/generic/lib/integer/mul24.inc b/generic/lib/integer/mul24.inc new file mode 100644 index 0000000..b568ca8 --- /dev/null +++ b/generic/lib/integer/mul24.inc @@ -0,0 +1,3 @@ +_CLC_OVERLOAD _CLC_DEF GENTYPE mul24(GENTYPE x, GENTYPE y) { + return x * y; +} |