summaryrefslogtreecommitdiff
path: root/generic/lib
diff options
context:
space:
mode:
Diffstat (limited to 'generic/lib')
-rw-r--r--generic/lib/geometric/length.cl2
-rw-r--r--generic/lib/geometric/length.inc2
-rw-r--r--generic/lib/geometric/normalize.cl2
-rw-r--r--generic/lib/geometric/normalize.inc2
-rw-r--r--generic/lib/integer/abs.cl2
-rw-r--r--generic/lib/integer/abs.inc4
-rw-r--r--generic/lib/integer/abs_diff.cl2
-rw-r--r--generic/lib/integer/abs_diff.inc4
-rw-r--r--generic/lib/integer/rotate.cl2
-rw-r--r--generic/lib/integer/rotate.inc30
-rw-r--r--generic/lib/math/binary_impl.inc12
-rw-r--r--generic/lib/math/fmax.cl2
-rw-r--r--generic/lib/math/fmin.cl2
-rw-r--r--generic/lib/math/hypot.cl2
-rw-r--r--generic/lib/math/hypot.inc2
-rw-r--r--generic/lib/math/mad.cl2
-rw-r--r--generic/lib/math/mad.inc2
-rw-r--r--generic/lib/shared/clamp.cl4
-rw-r--r--generic/lib/shared/clamp.inc10
-rw-r--r--generic/lib/shared/max.cl4
-rw-r--r--generic/lib/shared/max.inc10
-rw-r--r--generic/lib/shared/min.cl4
-rw-r--r--generic/lib/shared/min.inc8
-rw-r--r--generic/lib/shared/vload.cl12
-rw-r--r--generic/lib/shared/vstore.cl8
25 files changed, 68 insertions, 68 deletions
diff --git a/generic/lib/geometric/length.cl b/generic/lib/geometric/length.cl
index e26f2b8..ef087c7 100644
--- a/generic/lib/geometric/length.cl
+++ b/generic/lib/geometric/length.cl
@@ -4,5 +4,5 @@
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
#endif
-#define BODY <length.inc>
+#define __CLC_BODY <length.inc>
#include <clc/geometric/floatn.inc>
diff --git a/generic/lib/geometric/length.inc b/generic/lib/geometric/length.inc
index 494789c..5faaaff 100644
--- a/generic/lib/geometric/length.inc
+++ b/generic/lib/geometric/length.inc
@@ -1,3 +1,3 @@
-_CLC_OVERLOAD _CLC_DEF FLOAT length(FLOATN p) {
+_CLC_OVERLOAD _CLC_DEF __CLC_FLOAT length(__CLC_FLOATN p) {
return native_sqrt(dot(p, p));
}
diff --git a/generic/lib/geometric/normalize.cl b/generic/lib/geometric/normalize.cl
index 70d255d..b06b2fe 100644
--- a/generic/lib/geometric/normalize.cl
+++ b/generic/lib/geometric/normalize.cl
@@ -4,5 +4,5 @@
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
#endif
-#define BODY <normalize.inc>
+#define __CLC_BODY <normalize.inc>
#include <clc/geometric/floatn.inc>
diff --git a/generic/lib/geometric/normalize.inc b/generic/lib/geometric/normalize.inc
index a23908b..423ff79 100644
--- a/generic/lib/geometric/normalize.inc
+++ b/generic/lib/geometric/normalize.inc
@@ -1,3 +1,3 @@
-_CLC_OVERLOAD _CLC_DEF FLOATN normalize(FLOATN p) {
+_CLC_OVERLOAD _CLC_DEF __CLC_FLOATN normalize(__CLC_FLOATN p) {
return p/length(p);
}
diff --git a/generic/lib/integer/abs.cl b/generic/lib/integer/abs.cl
index 86f1a34..faff8d0 100644
--- a/generic/lib/integer/abs.cl
+++ b/generic/lib/integer/abs.cl
@@ -1,4 +1,4 @@
#include <clc/clc.h>
-#define BODY <abs.inc>
+#define __CLC_BODY <abs.inc>
#include <clc/integer/gentype.inc>
diff --git a/generic/lib/integer/abs.inc b/generic/lib/integer/abs.inc
index fff6691..cfe7bfe 100644
--- a/generic/lib/integer/abs.inc
+++ b/generic/lib/integer/abs.inc
@@ -1,3 +1,3 @@
-_CLC_OVERLOAD _CLC_DEF UGENTYPE abs(GENTYPE x) {
- return __builtin_astype((GENTYPE)(x > (GENTYPE)(0) ? x : -x), UGENTYPE);
+_CLC_OVERLOAD _CLC_DEF __CLC_U_GENTYPE abs(__CLC_GENTYPE x) {
+ return __builtin_astype((__CLC_GENTYPE)(x > (__CLC_GENTYPE)(0) ? x : -x), __CLC_U_GENTYPE);
}
diff --git a/generic/lib/integer/abs_diff.cl b/generic/lib/integer/abs_diff.cl
index c9ca821..3d75105 100644
--- a/generic/lib/integer/abs_diff.cl
+++ b/generic/lib/integer/abs_diff.cl
@@ -1,4 +1,4 @@
#include <clc/clc.h>
-#define BODY <abs_diff.inc>
+#define __CLC_BODY <abs_diff.inc>
#include <clc/integer/gentype.inc>
diff --git a/generic/lib/integer/abs_diff.inc b/generic/lib/integer/abs_diff.inc
index 6ad57ee..f39c3ff 100644
--- a/generic/lib/integer/abs_diff.inc
+++ b/generic/lib/integer/abs_diff.inc
@@ -1,3 +1,3 @@
-_CLC_OVERLOAD _CLC_DEF UGENTYPE abs_diff(GENTYPE x, GENTYPE y) {
- return __builtin_astype((GENTYPE)(x > y ? x-y : y-x), UGENTYPE);
+_CLC_OVERLOAD _CLC_DEF __CLC_U_GENTYPE abs_diff(__CLC_GENTYPE x, __CLC_GENTYPE y) {
+ return __builtin_astype((__CLC_GENTYPE)(x > y ? x-y : y-x), __CLC_U_GENTYPE);
}
diff --git a/generic/lib/integer/rotate.cl b/generic/lib/integer/rotate.cl
index d7eff2b..27ce515 100644
--- a/generic/lib/integer/rotate.cl
+++ b/generic/lib/integer/rotate.cl
@@ -1,4 +1,4 @@
#include <clc/clc.h>
-#define BODY <rotate.inc>
+#define __CLC_BODY <rotate.inc>
#include <clc/integer/gentype.inc>
diff --git a/generic/lib/integer/rotate.inc b/generic/lib/integer/rotate.inc
index 2aa6cc9..33bb0a8 100644
--- a/generic/lib/integer/rotate.inc
+++ b/generic/lib/integer/rotate.inc
@@ -7,36 +7,36 @@
* Eventually, someone should feel free to implement an llvm-specific version
*/
-_CLC_OVERLOAD _CLC_DEF GENTYPE rotate(GENTYPE x, GENTYPE n){
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE rotate(__CLC_GENTYPE x, __CLC_GENTYPE n){
//Try to avoid extra work if someone's spinning the value through multiple
//full rotations
- n = n % (GENTYPE)GENSIZE;
+ n = n % (__CLC_GENTYPE)__CLC_GENSIZE;
-#ifdef SCALAR
+#ifdef __CLC_SCALAR
if (n > 0){
- return (x << n) | (((UGENTYPE)x) >> (GENSIZE - n));
+ return (x << n) | (((__CLC_U_GENTYPE)x) >> (__CLC_GENSIZE - n));
} else if (n == 0){
return x;
} else {
- return ( (((UGENTYPE)x) >> -n) | (x << (GENSIZE + n)) );
+ return ( (((__CLC_U_GENTYPE)x) >> -n) | (x << (__CLC_GENSIZE + n)) );
}
#else
//XXX: There's a lot of __builtin_astype calls to cast everything to
- // unsigned ... This should be improved so that if GENTYPE==UGENTYPE, no
+ // unsigned ... This should be improved so that if __CLC_GENTYPE==__CLC_U_GENTYPE, no
// casts are required.
- UGENTYPE x_1 = __builtin_astype(x, UGENTYPE);
+ __CLC_U_GENTYPE x_1 = __builtin_astype(x, __CLC_U_GENTYPE);
- //XXX: Is (UGENTYPE >> SGENTYPE) | (UGENTYPE << SGENTYPE) legal?
+ //XXX: Is (__CLC_U_GENTYPE >> S__CLC_GENTYPE) | (__CLC_U_GENTYPE << S__CLC_GENTYPE) legal?
// If so, then combine the amt and shifts into a single set of statements
- UGENTYPE amt;
- amt = (n < (GENTYPE)0 ? __builtin_astype((GENTYPE)0-n, UGENTYPE) : (UGENTYPE)0);
- x_1 = (x_1 >> amt) | (x_1 << ((UGENTYPE)GENSIZE - amt));
+ __CLC_U_GENTYPE amt;
+ amt = (n < (__CLC_GENTYPE)0 ? __builtin_astype((__CLC_GENTYPE)0-n, __CLC_U_GENTYPE) : (__CLC_U_GENTYPE)0);
+ x_1 = (x_1 >> amt) | (x_1 << ((__CLC_U_GENTYPE)__CLC_GENSIZE - amt));
- amt = (n < (GENTYPE)0 ? (UGENTYPE)0 : __builtin_astype(n, UGENTYPE));
- x_1 = (x_1 << amt) | (x_1 >> ((UGENTYPE)GENSIZE - amt));
+ amt = (n < (__CLC_GENTYPE)0 ? (__CLC_U_GENTYPE)0 : __builtin_astype(n, __CLC_U_GENTYPE));
+ x_1 = (x_1 << amt) | (x_1 >> ((__CLC_U_GENTYPE)__CLC_GENSIZE - amt));
- return __builtin_astype(x_1, GENTYPE);
+ return __builtin_astype(x_1, __CLC_GENTYPE);
#endif
-} \ No newline at end of file
+}
diff --git a/generic/lib/math/binary_impl.inc b/generic/lib/math/binary_impl.inc
index e4b1e5f..83872d2 100644
--- a/generic/lib/math/binary_impl.inc
+++ b/generic/lib/math/binary_impl.inc
@@ -1,18 +1,18 @@
-#ifndef SCALAR
+#ifndef __CLC_SCALAR
-_CLC_OVERLOAD _CLC_DEF GENTYPE FUNCTION(GENTYPE x, GENTYPE y) {
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, __CLC_GENTYPE y) {
return FUNCTION_IMPL(x, y);
}
#endif
-_CLC_OVERLOAD _CLC_DEF GENTYPE FUNCTION(GENTYPE x, double y) {
- GENTYPE vec_y = (GENTYPE) (y);
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, double y) {
+ __CLC_GENTYPE vec_y = (__CLC_GENTYPE) (y);
return FUNCTION_IMPL(x, vec_y);
}
-_CLC_OVERLOAD _CLC_DEF GENTYPE FUNCTION(GENTYPE x, float y) {
- GENTYPE vec_y = (GENTYPE) (y);
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, float y) {
+ __CLC_GENTYPE vec_y = (__CLC_GENTYPE) (y);
return FUNCTION_IMPL(x, vec_y);
}
diff --git a/generic/lib/math/fmax.cl b/generic/lib/math/fmax.cl
index 68a67ac..58583d6 100644
--- a/generic/lib/math/fmax.cl
+++ b/generic/lib/math/fmax.cl
@@ -7,5 +7,5 @@
#define FUNCTION __clc_fmax
#define FUNCTION_IMPL(x, y) ((x) < (y) ? (y) : (x))
-#define BODY <binary_impl.inc>
+#define __CLC_BODY <binary_impl.inc>
#include <clc/math/gentype.inc>
diff --git a/generic/lib/math/fmin.cl b/generic/lib/math/fmin.cl
index cac188e..a61ad47 100644
--- a/generic/lib/math/fmin.cl
+++ b/generic/lib/math/fmin.cl
@@ -7,5 +7,5 @@
#define FUNCTION __clc_fmin
#define FUNCTION_IMPL(x, y) ((y) < (x) ? (y) : (x))
-#define BODY <binary_impl.inc>
+#define __CLC_BODY <binary_impl.inc>
#include <clc/math/gentype.inc>
diff --git a/generic/lib/math/hypot.cl b/generic/lib/math/hypot.cl
index dcdc1ed..eca042c 100644
--- a/generic/lib/math/hypot.cl
+++ b/generic/lib/math/hypot.cl
@@ -4,5 +4,5 @@
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
#endif
-#define BODY <hypot.inc>
+#define __CLC_BODY <hypot.inc>
#include <clc/math/gentype.inc>
diff --git a/generic/lib/math/hypot.inc b/generic/lib/math/hypot.inc
index 3f529c8..036cee7 100644
--- a/generic/lib/math/hypot.inc
+++ b/generic/lib/math/hypot.inc
@@ -1,3 +1,3 @@
-_CLC_OVERLOAD _CLC_DEF GENTYPE hypot(GENTYPE x, GENTYPE y) {
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE hypot(__CLC_GENTYPE x, __CLC_GENTYPE y) {
return sqrt(x*x + y*y);
}
diff --git a/generic/lib/math/mad.cl b/generic/lib/math/mad.cl
index e66e204..6c7b90d 100644
--- a/generic/lib/math/mad.cl
+++ b/generic/lib/math/mad.cl
@@ -4,5 +4,5 @@
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
#endif
-#define BODY <mad.inc>
+#define __CLC_BODY <mad.inc>
#include <clc/math/gentype.inc>
diff --git a/generic/lib/math/mad.inc b/generic/lib/math/mad.inc
index aec9c06..d32c783 100644
--- a/generic/lib/math/mad.inc
+++ b/generic/lib/math/mad.inc
@@ -1,3 +1,3 @@
-_CLC_OVERLOAD _CLC_DEF GENTYPE mad(GENTYPE a, GENTYPE b, GENTYPE c) {
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE mad(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_GENTYPE c) {
return a * b + c;
}
diff --git a/generic/lib/shared/clamp.cl b/generic/lib/shared/clamp.cl
index 0e8d223..c79a358 100644
--- a/generic/lib/shared/clamp.cl
+++ b/generic/lib/shared/clamp.cl
@@ -1,11 +1,11 @@
#include <clc/clc.h>
-#define BODY <clamp.inc>
+#define __CLC_BODY <clamp.inc>
#include <clc/integer/gentype.inc>
#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
#endif
-#define BODY <clamp.inc>
+#define __CLC_BODY <clamp.inc>
#include <clc/math/gentype.inc>
diff --git a/generic/lib/shared/clamp.inc b/generic/lib/shared/clamp.inc
index 58370d3..c918f9c 100644
--- a/generic/lib/shared/clamp.inc
+++ b/generic/lib/shared/clamp.inc
@@ -1,9 +1,9 @@
-_CLC_OVERLOAD _CLC_DEF GENTYPE clamp(GENTYPE x, GENTYPE y, GENTYPE z) {
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z) {
return (x > z ? z : (x < y ? y : x));
}
-#ifndef SCALAR
-_CLC_OVERLOAD _CLC_DEF GENTYPE clamp(GENTYPE x, SCALAR_GENTYPE y, SCALAR_GENTYPE z) {
- return (x > (GENTYPE)z ? (GENTYPE)z : (x < (GENTYPE)y ? (GENTYPE)y : x));
+#ifndef __CLC_SCALAR
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_SCALAR_GENTYPE y, __CLC_SCALAR_GENTYPE z) {
+ return (x > (__CLC_GENTYPE)z ? (__CLC_GENTYPE)z : (x < (__CLC_GENTYPE)y ? (__CLC_GENTYPE)y : x));
}
-#endif \ No newline at end of file
+#endif
diff --git a/generic/lib/shared/max.cl b/generic/lib/shared/max.cl
index 5a48537..1c4457c 100644
--- a/generic/lib/shared/max.cl
+++ b/generic/lib/shared/max.cl
@@ -1,11 +1,11 @@
#include <clc/clc.h>
-#define BODY <max.inc>
+#define __CLC_BODY <max.inc>
#include <clc/integer/gentype.inc>
#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
#endif
-#define BODY <max.inc>
+#define __CLC_BODY <max.inc>
#include <clc/math/gentype.inc>
diff --git a/generic/lib/shared/max.inc b/generic/lib/shared/max.inc
index 6a12b6f..75a24c0 100644
--- a/generic/lib/shared/max.inc
+++ b/generic/lib/shared/max.inc
@@ -1,9 +1,9 @@
-_CLC_OVERLOAD _CLC_DEF GENTYPE max(GENTYPE a, GENTYPE b) {
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE max(__CLC_GENTYPE a, __CLC_GENTYPE b) {
return (a > b ? a : b);
}
-#ifndef SCALAR
-_CLC_OVERLOAD _CLC_DEF GENTYPE max(GENTYPE a, SCALAR_GENTYPE b) {
- return (a > (GENTYPE)b ? a : (GENTYPE)b);
+#ifndef __CLC_SCALAR
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE max(__CLC_GENTYPE a, __CLC_SCALAR_GENTYPE b) {
+ return (a > (__CLC_GENTYPE)b ? a : (__CLC_GENTYPE)b);
}
-#endif \ No newline at end of file
+#endif
diff --git a/generic/lib/shared/min.cl b/generic/lib/shared/min.cl
index 49481cb..433087a 100644
--- a/generic/lib/shared/min.cl
+++ b/generic/lib/shared/min.cl
@@ -1,11 +1,11 @@
#include <clc/clc.h>
-#define BODY <min.inc>
+#define __CLC_BODY <min.inc>
#include <clc/integer/gentype.inc>
#ifdef cl_khr_fp64
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
#endif
-#define BODY <min.inc>
+#define __CLC_BODY <min.inc>
#include <clc/math/gentype.inc>
diff --git a/generic/lib/shared/min.inc b/generic/lib/shared/min.inc
index 58a22e1..fe42864 100644
--- a/generic/lib/shared/min.inc
+++ b/generic/lib/shared/min.inc
@@ -1,9 +1,9 @@
-_CLC_OVERLOAD _CLC_DEF GENTYPE min(GENTYPE a, GENTYPE b) {
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE min(__CLC_GENTYPE a, __CLC_GENTYPE b) {
return (a < b ? a : b);
}
-#ifndef SCALAR
-_CLC_OVERLOAD _CLC_DEF GENTYPE min(GENTYPE a, SCALAR_GENTYPE b) {
- return (a < (GENTYPE)b ? a : (GENTYPE)b);
+#ifndef __CLC_SCALAR
+_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE min(__CLC_GENTYPE a, __CLC_SCALAR_GENTYPE b) {
+ return (a < (__CLC_GENTYPE)b ? a : (__CLC_GENTYPE)b);
}
#endif
diff --git a/generic/lib/shared/vload.cl b/generic/lib/shared/vload.cl
index f6ebd37..4dd7918 100644
--- a/generic/lib/shared/vload.cl
+++ b/generic/lib/shared/vload.cl
@@ -21,11 +21,11 @@
return (PRIM_TYPE##16)(vload8(offset, x), vload8(offset+8, x)); \
} \
-#define VLOAD_ADDR_SPACES(SCALAR_GENTYPE) \
- VLOAD_VECTORIZE(SCALAR_GENTYPE, __private) \
- VLOAD_VECTORIZE(SCALAR_GENTYPE, __local) \
- VLOAD_VECTORIZE(SCALAR_GENTYPE, __constant) \
- VLOAD_VECTORIZE(SCALAR_GENTYPE, __global) \
+#define VLOAD_ADDR_SPACES(__CLC_SCALAR_GENTYPE) \
+ VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __private) \
+ VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __local) \
+ VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __constant) \
+ VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __global) \
//int/uint are special... see below
#define VLOAD_TYPES() \
@@ -93,4 +93,4 @@ _CLC_OVERLOAD _CLC_DEF uint8 vload8(size_t offset, const global uint *x) {
}
_CLC_OVERLOAD _CLC_DEF uint16 vload16(size_t offset, const global uint *x) {
return __clc_vload16_uint__global(offset, x);
-} \ No newline at end of file
+}
diff --git a/generic/lib/shared/vstore.cl b/generic/lib/shared/vstore.cl
index 5b84f47..17c2c4c 100644
--- a/generic/lib/shared/vstore.cl
+++ b/generic/lib/shared/vstore.cl
@@ -29,10 +29,10 @@
vstore8(vec.hi, offset+8, mem); \
} \
-#define VSTORE_ADDR_SPACES(SCALAR_GENTYPE) \
- VSTORE_VECTORIZE(SCALAR_GENTYPE, __private) \
- VSTORE_VECTORIZE(SCALAR_GENTYPE, __local) \
- VSTORE_VECTORIZE(SCALAR_GENTYPE, __global) \
+#define VSTORE_ADDR_SPACES(__CLC_SCALAR___CLC_GENTYPE) \
+ VSTORE_VECTORIZE(__CLC_SCALAR___CLC_GENTYPE, __private) \
+ VSTORE_VECTORIZE(__CLC_SCALAR___CLC_GENTYPE, __local) \
+ VSTORE_VECTORIZE(__CLC_SCALAR___CLC_GENTYPE, __global) \
//int/uint are special... see below
#define VSTORE_TYPES() \