diff --git a/libclc/clc/include/clc/atomic/atomic_decl.inc b/libclc/clc/include/clc/atomic/atomic_decl.inc index b790a94c7d28..5e0f456e3400 100644 --- a/libclc/clc/include/clc/atomic/atomic_decl.inc +++ b/libclc/clc/include/clc/atomic/atomic_decl.inc @@ -14,23 +14,23 @@ #ifdef __CLC_NO_VALUE_ARG #define __CLC_DECLARE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION( \ + _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION( \ volatile ADDRSPACE __CLC_GENTYPE *Ptr, int MemoryOrder, \ int MemoryScope); #elif defined(__CLC_RETURN_VOID) #define __CLC_DECLARE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DECL void FUNCTION(volatile ADDRSPACE __CLC_GENTYPE *Ptr, \ - __CLC_GENTYPE Value, int MemoryOrder, \ - int MemoryScope); + _CLC_OVERLOAD _CLC_DECL void __CLC_FUNCTION( \ + volatile ADDRSPACE __CLC_GENTYPE *Ptr, __CLC_GENTYPE Value, \ + int MemoryOrder, int MemoryScope); #elif defined(__CLC_COMPARE_EXCHANGE) #define __CLC_DECLARE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION( \ + _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION( \ volatile ADDRSPACE __CLC_GENTYPE *Ptr, __CLC_GENTYPE Comparator, \ __CLC_GENTYPE Value, int MemoryOrderEqual, int MemoryOrderUnequal, \ int MemoryScope); #else #define __CLC_DECLARE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION( \ + _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION( \ volatile ADDRSPACE __CLC_GENTYPE *Ptr, __CLC_GENTYPE Value, \ int MemoryOrder, int MemoryScope); #endif diff --git a/libclc/clc/include/clc/atomic/clc_atomic_compare_exchange.h b/libclc/clc/include/clc/atomic/clc_atomic_compare_exchange.h index ae7918ac32e4..31b816722350 100644 --- a/libclc/clc/include/clc/atomic/clc_atomic_compare_exchange.h +++ b/libclc/clc/include/clc/atomic/clc_atomic_compare_exchange.h @@ -11,7 +11,7 @@ #include -#define FUNCTION __clc_atomic_compare_exchange +#define __CLC_FUNCTION __clc_atomic_compare_exchange #define __CLC_COMPARE_EXCHANGE #define __CLC_BODY @@ -21,6 +21,6 @@ #include #undef __CLC_COMPARE_EXCHANGE -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_ATOMIC_CLC_ATOMIC_COMPARE_EXCHANGE_H__ diff --git a/libclc/clc/include/clc/atomic/clc_atomic_dec.h b/libclc/clc/include/clc/atomic/clc_atomic_dec.h index ada36ba3ff9b..66302b6b9ade 100644 --- a/libclc/clc/include/clc/atomic/clc_atomic_dec.h +++ b/libclc/clc/include/clc/atomic/clc_atomic_dec.h @@ -11,13 +11,13 @@ #include -#define FUNCTION __clc_atomic_dec +#define __CLC_FUNCTION __clc_atomic_dec #define __CLC_NO_VALUE_ARG #define __CLC_BODY #include #undef __CLC_NO_VALUE_ARG -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_ATOMIC_CLC_ATOMIC_DEC_H__ diff --git a/libclc/clc/include/clc/atomic/clc_atomic_exchange.h b/libclc/clc/include/clc/atomic/clc_atomic_exchange.h index 7e626d4a8830..321cfb403085 100644 --- a/libclc/clc/include/clc/atomic/clc_atomic_exchange.h +++ b/libclc/clc/include/clc/atomic/clc_atomic_exchange.h @@ -11,7 +11,7 @@ #include -#define FUNCTION __clc_atomic_exchange +#define __CLC_FUNCTION __clc_atomic_exchange #define __CLC_BODY #include @@ -19,6 +19,6 @@ #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_ATOMIC_CLC_ATOMIC_EXCHANGE_H__ diff --git a/libclc/clc/include/clc/atomic/clc_atomic_fetch_add.h b/libclc/clc/include/clc/atomic/clc_atomic_fetch_add.h index ad0c2eb4607a..4ef29fce50af 100644 --- a/libclc/clc/include/clc/atomic/clc_atomic_fetch_add.h +++ b/libclc/clc/include/clc/atomic/clc_atomic_fetch_add.h @@ -11,7 +11,7 @@ #include -#define FUNCTION __clc_atomic_fetch_add +#define __CLC_FUNCTION __clc_atomic_fetch_add #define __CLC_BODY #include @@ -19,6 +19,6 @@ #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_ATOMIC_CLC_ATOMIC_FETCH_ADD_H__ diff --git a/libclc/clc/include/clc/atomic/clc_atomic_fetch_and.h b/libclc/clc/include/clc/atomic/clc_atomic_fetch_and.h index 80810c38cbbb..688c11287db5 100644 --- a/libclc/clc/include/clc/atomic/clc_atomic_fetch_and.h +++ b/libclc/clc/include/clc/atomic/clc_atomic_fetch_and.h @@ -11,11 +11,11 @@ #include -#define FUNCTION __clc_atomic_fetch_and +#define __CLC_FUNCTION __clc_atomic_fetch_and #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_ATOMIC_CLC_ATOMIC_FETCH_AND_H__ diff --git a/libclc/clc/include/clc/atomic/clc_atomic_fetch_max.h b/libclc/clc/include/clc/atomic/clc_atomic_fetch_max.h index 56f511922e5c..a4e44b88a697 100644 --- a/libclc/clc/include/clc/atomic/clc_atomic_fetch_max.h +++ b/libclc/clc/include/clc/atomic/clc_atomic_fetch_max.h @@ -11,7 +11,7 @@ #include -#define FUNCTION __clc_atomic_fetch_max +#define __CLC_FUNCTION __clc_atomic_fetch_max #define __CLC_BODY #include @@ -19,6 +19,6 @@ #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_ATOMIC_CLC_ATOMIC_FETCH_MAX_H__ diff --git a/libclc/clc/include/clc/atomic/clc_atomic_fetch_min.h b/libclc/clc/include/clc/atomic/clc_atomic_fetch_min.h index f17408d28a35..b58b538649e1 100644 --- a/libclc/clc/include/clc/atomic/clc_atomic_fetch_min.h +++ b/libclc/clc/include/clc/atomic/clc_atomic_fetch_min.h @@ -11,7 +11,7 @@ #include -#define FUNCTION __clc_atomic_fetch_min +#define __CLC_FUNCTION __clc_atomic_fetch_min #define __CLC_BODY #include @@ -19,6 +19,6 @@ #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_ATOMIC_CLC_ATOMIC_FETCH_MIN_H__ diff --git a/libclc/clc/include/clc/atomic/clc_atomic_fetch_or.h b/libclc/clc/include/clc/atomic/clc_atomic_fetch_or.h index b82069e6f960..ab303cc673ba 100644 --- a/libclc/clc/include/clc/atomic/clc_atomic_fetch_or.h +++ b/libclc/clc/include/clc/atomic/clc_atomic_fetch_or.h @@ -11,11 +11,11 @@ #include -#define FUNCTION __clc_atomic_fetch_or +#define __CLC_FUNCTION __clc_atomic_fetch_or #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_ATOMIC_CLC_ATOMIC_FETCH_OR_H__ diff --git a/libclc/clc/include/clc/atomic/clc_atomic_fetch_sub.h b/libclc/clc/include/clc/atomic/clc_atomic_fetch_sub.h index 6cfd224629d6..d9deae085a61 100644 --- a/libclc/clc/include/clc/atomic/clc_atomic_fetch_sub.h +++ b/libclc/clc/include/clc/atomic/clc_atomic_fetch_sub.h @@ -11,7 +11,7 @@ #include -#define FUNCTION __clc_atomic_fetch_sub +#define __CLC_FUNCTION __clc_atomic_fetch_sub #define __CLC_BODY #include @@ -19,6 +19,6 @@ #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_ATOMIC_CLC_ATOMIC_FETCH_SUB_H__ diff --git a/libclc/clc/include/clc/atomic/clc_atomic_fetch_xor.h b/libclc/clc/include/clc/atomic/clc_atomic_fetch_xor.h index b007b47a9369..fe13a641fc1c 100644 --- a/libclc/clc/include/clc/atomic/clc_atomic_fetch_xor.h +++ b/libclc/clc/include/clc/atomic/clc_atomic_fetch_xor.h @@ -11,11 +11,11 @@ #include -#define FUNCTION __clc_atomic_fetch_xor +#define __CLC_FUNCTION __clc_atomic_fetch_xor #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_ATOMIC_CLC_ATOMIC_FETCH_XOR_H__ diff --git a/libclc/clc/include/clc/atomic/clc_atomic_inc.h b/libclc/clc/include/clc/atomic/clc_atomic_inc.h index 3ddef4a8bf35..c6fcdad30949 100644 --- a/libclc/clc/include/clc/atomic/clc_atomic_inc.h +++ b/libclc/clc/include/clc/atomic/clc_atomic_inc.h @@ -11,13 +11,13 @@ #include -#define FUNCTION __clc_atomic_inc +#define __CLC_FUNCTION __clc_atomic_inc #define __CLC_NO_VALUE_ARG #define __CLC_BODY #include #undef __CLC_NO_VALUE_ARG -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_ATOMIC_CLC_ATOMIC_INC_H__ diff --git a/libclc/clc/include/clc/atomic/clc_atomic_load.h b/libclc/clc/include/clc/atomic/clc_atomic_load.h index a4899b34b88a..3abfce86b194 100644 --- a/libclc/clc/include/clc/atomic/clc_atomic_load.h +++ b/libclc/clc/include/clc/atomic/clc_atomic_load.h @@ -11,7 +11,7 @@ #include -#define FUNCTION __clc_atomic_load +#define __CLC_FUNCTION __clc_atomic_load #define __CLC_NO_VALUE_ARG #define __CLC_BODY @@ -21,6 +21,6 @@ #include #undef __CLC_NO_VALUE_ARG -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_ATOMIC_CLC_ATOMIC_LOAD_H__ diff --git a/libclc/clc/include/clc/atomic/clc_atomic_store.h b/libclc/clc/include/clc/atomic/clc_atomic_store.h index 6baf0eb7ea32..94d77621735d 100644 --- a/libclc/clc/include/clc/atomic/clc_atomic_store.h +++ b/libclc/clc/include/clc/atomic/clc_atomic_store.h @@ -11,7 +11,7 @@ #include -#define FUNCTION __clc_atomic_store +#define __CLC_FUNCTION __clc_atomic_store #define __CLC_RETURN_VOID #define __CLC_BODY @@ -21,6 +21,6 @@ #include #undef __CLC_RETURN_VOID -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_ATOMIC_CLC_ATOMIC_STORE_H__ diff --git a/libclc/clc/include/clc/clcmacro.h b/libclc/clc/include/clc/clcmacro.h index 5c67c937cb1d..9fa11489b145 100644 --- a/libclc/clc/include/clc/clcmacro.h +++ b/libclc/clc/include/clc/clcmacro.h @@ -12,58 +12,58 @@ #include #include -#define _CLC_V_V_VP_VECTORIZE(DECLSPEC, RET_TYPE, FUNCTION, ARG1_TYPE, \ +#define _CLC_V_V_VP_VECTORIZE(DECLSPEC, RET_TYPE, __CLC_FUNCTION, ARG1_TYPE, \ ADDR_SPACE, ARG2_TYPE) \ DECLSPEC __CLC_XCONCAT(RET_TYPE, 2) \ - FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 2) x, \ - ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 2) * y) { \ + __CLC_FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 2) x, \ + ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 2) * y) { \ ADDR_SPACE ARG2_TYPE *ptr = (ADDR_SPACE ARG2_TYPE *)y; \ - return (__CLC_XCONCAT(RET_TYPE, 2))(FUNCTION(x.s0, ptr), \ - FUNCTION(x.s1, ptr + 1)); \ + return (__CLC_XCONCAT(RET_TYPE, 2))(__CLC_FUNCTION(x.s0, ptr), \ + __CLC_FUNCTION(x.s1, ptr + 1)); \ } \ \ DECLSPEC __CLC_XCONCAT(RET_TYPE, 3) \ - FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 3) x, \ - ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 3) * y) { \ + __CLC_FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 3) x, \ + ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 3) * y) { \ ADDR_SPACE ARG2_TYPE *ptr = (ADDR_SPACE ARG2_TYPE *)y; \ - return (__CLC_XCONCAT(RET_TYPE, 3))(FUNCTION(x.s0, ptr), \ - FUNCTION(x.s1, ptr + 1), \ - FUNCTION(x.s2, ptr + 2)); \ + return (__CLC_XCONCAT(RET_TYPE, 3))(__CLC_FUNCTION(x.s0, ptr), \ + __CLC_FUNCTION(x.s1, ptr + 1), \ + __CLC_FUNCTION(x.s2, ptr + 2)); \ } \ \ DECLSPEC __CLC_XCONCAT(RET_TYPE, 4) \ - FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 4) x, \ - ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 4) * y) { \ + __CLC_FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 4) x, \ + ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 4) * y) { \ ADDR_SPACE ARG2_TYPE *ptr = (ADDR_SPACE ARG2_TYPE *)y; \ return (__CLC_XCONCAT(RET_TYPE, 4))( \ - FUNCTION(x.s0, ptr), FUNCTION(x.s1, ptr + 1), FUNCTION(x.s2, ptr + 2), \ - FUNCTION(x.s3, ptr + 3)); \ + __CLC_FUNCTION(x.s0, ptr), __CLC_FUNCTION(x.s1, ptr + 1), \ + __CLC_FUNCTION(x.s2, ptr + 2), __CLC_FUNCTION(x.s3, ptr + 3)); \ } \ \ DECLSPEC __CLC_XCONCAT(RET_TYPE, 8) \ - FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 8) x, \ - ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 8) * y) { \ + __CLC_FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 8) x, \ + ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 8) * y) { \ ADDR_SPACE ARG2_TYPE *ptr = (ADDR_SPACE ARG2_TYPE *)y; \ return (__CLC_XCONCAT(RET_TYPE, 8))( \ - FUNCTION(x.s0, ptr), FUNCTION(x.s1, ptr + 1), FUNCTION(x.s2, ptr + 2), \ - FUNCTION(x.s3, ptr + 3), FUNCTION(x.s4, ptr + 4), \ - FUNCTION(x.s5, ptr + 5), FUNCTION(x.s6, ptr + 6), \ - FUNCTION(x.s7, ptr + 7)); \ + __CLC_FUNCTION(x.s0, ptr), __CLC_FUNCTION(x.s1, ptr + 1), \ + __CLC_FUNCTION(x.s2, ptr + 2), __CLC_FUNCTION(x.s3, ptr + 3), \ + __CLC_FUNCTION(x.s4, ptr + 4), __CLC_FUNCTION(x.s5, ptr + 5), \ + __CLC_FUNCTION(x.s6, ptr + 6), __CLC_FUNCTION(x.s7, ptr + 7)); \ } \ \ DECLSPEC __CLC_XCONCAT(RET_TYPE, 16) \ - FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 16) x, \ - ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 16) * y) { \ + __CLC_FUNCTION(__CLC_XCONCAT(ARG1_TYPE, 16) x, \ + ADDR_SPACE __CLC_XCONCAT(ARG2_TYPE, 16) * y) { \ ADDR_SPACE ARG2_TYPE *ptr = (ADDR_SPACE ARG2_TYPE *)y; \ return (__CLC_XCONCAT(RET_TYPE, 16))( \ - FUNCTION(x.s0, ptr), FUNCTION(x.s1, ptr + 1), FUNCTION(x.s2, ptr + 2), \ - FUNCTION(x.s3, ptr + 3), FUNCTION(x.s4, ptr + 4), \ - FUNCTION(x.s5, ptr + 5), FUNCTION(x.s6, ptr + 6), \ - FUNCTION(x.s7, ptr + 7), FUNCTION(x.s8, ptr + 8), \ - FUNCTION(x.s9, ptr + 9), FUNCTION(x.sa, ptr + 10), \ - FUNCTION(x.sb, ptr + 11), FUNCTION(x.sc, ptr + 12), \ - FUNCTION(x.sd, ptr + 13), FUNCTION(x.se, ptr + 14), \ - FUNCTION(x.sf, ptr + 15)); \ + __CLC_FUNCTION(x.s0, ptr), __CLC_FUNCTION(x.s1, ptr + 1), \ + __CLC_FUNCTION(x.s2, ptr + 2), __CLC_FUNCTION(x.s3, ptr + 3), \ + __CLC_FUNCTION(x.s4, ptr + 4), __CLC_FUNCTION(x.s5, ptr + 5), \ + __CLC_FUNCTION(x.s6, ptr + 6), __CLC_FUNCTION(x.s7, ptr + 7), \ + __CLC_FUNCTION(x.s8, ptr + 8), __CLC_FUNCTION(x.s9, ptr + 9), \ + __CLC_FUNCTION(x.sa, ptr + 10), __CLC_FUNCTION(x.sb, ptr + 11), \ + __CLC_FUNCTION(x.sc, ptr + 12), __CLC_FUNCTION(x.sd, ptr + 13), \ + __CLC_FUNCTION(x.se, ptr + 14), __CLC_FUNCTION(x.sf, ptr + 15)); \ } #endif // __CLC_CLCMACRO_H__ diff --git a/libclc/clc/include/clc/common/clc_degrees.h b/libclc/clc/include/clc/common/clc_degrees.h index e633344c291c..5f04fac1f261 100644 --- a/libclc/clc/include/clc/common/clc_degrees.h +++ b/libclc/clc/include/clc/common/clc_degrees.h @@ -10,10 +10,10 @@ #define __CLC_COMMON_CLC_DEGREES_H__ #define __CLC_BODY -#define FUNCTION __clc_degrees +#define __CLC_FUNCTION __clc_degrees #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_COMMON_CLC_DEGREES_H__ diff --git a/libclc/clc/include/clc/common/clc_radians.h b/libclc/clc/include/clc/common/clc_radians.h index 0b075efbcce2..03d7c4b9e301 100644 --- a/libclc/clc/include/clc/common/clc_radians.h +++ b/libclc/clc/include/clc/common/clc_radians.h @@ -10,10 +10,10 @@ #define __CLC_COMMON_CLC_RADIANS_H__ #define __CLC_BODY -#define FUNCTION __clc_radians +#define __CLC_FUNCTION __clc_radians #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_COMMON_CLC_RADIANS_H__ diff --git a/libclc/clc/include/clc/common/clc_sign.h b/libclc/clc/include/clc/common/clc_sign.h index 0a8c4cc94d80..9737f1e54441 100644 --- a/libclc/clc/include/clc/common/clc_sign.h +++ b/libclc/clc/include/clc/common/clc_sign.h @@ -9,11 +9,11 @@ #ifndef __CLC_COMMON_CLC_SIGN_H__ #define __CLC_COMMON_CLC_SIGN_H__ -#define FUNCTION __clc_sign +#define __CLC_FUNCTION __clc_sign #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_COMMON_CLC_SIGN_H__ diff --git a/libclc/clc/include/clc/common/clc_step.h b/libclc/clc/include/clc/common/clc_step.h index 96b4759cabf7..6b093d06896c 100644 --- a/libclc/clc/include/clc/common/clc_step.h +++ b/libclc/clc/include/clc/common/clc_step.h @@ -9,11 +9,11 @@ #ifndef __CLC_COMMON_CLC_STEP_H__ #define __CLC_COMMON_CLC_STEP_H__ -#define FUNCTION __clc_step +#define __CLC_FUNCTION __clc_step #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_COMMON_CLC_STEP_H__ diff --git a/libclc/clc/include/clc/geometric/binary_decl.inc b/libclc/clc/include/clc/geometric/binary_decl.inc index 4a4235ae44db..ab64c9bece32 100644 --- a/libclc/clc/include/clc/geometric/binary_decl.inc +++ b/libclc/clc/include/clc/geometric/binary_decl.inc @@ -11,6 +11,6 @@ __CLC_VECSIZE_OR_1 == 3 || __CLC_VECSIZE_OR_1 == 4) _CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_SCALAR_GENTYPE -FUNCTION(__CLC_GENTYPE a, __CLC_GENTYPE b); +__CLC_FUNCTION(__CLC_GENTYPE a, __CLC_GENTYPE b); #endif diff --git a/libclc/clc/include/clc/geometric/binary_def.inc b/libclc/clc/include/clc/geometric/binary_def.inc index ad4fa4c01683..bbd4f5798002 100644 --- a/libclc/clc/include/clc/geometric/binary_def.inc +++ b/libclc/clc/include/clc/geometric/binary_def.inc @@ -8,17 +8,17 @@ #include -#ifndef __IMPL_FUNCTION -#define __IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) +#ifndef __CLC_IMPL_FUNCTION +#define __CLC_IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) #endif // Geometric functions are only defined for scalar, vec2, vec3 and vec4 #if (__CLC_VECSIZE_OR_1 == 1 || __CLC_VECSIZE_OR_1 == 2 || \ __CLC_VECSIZE_OR_1 == 3 || __CLC_VECSIZE_OR_1 == 4) -_CLC_OVERLOAD _CLC_DEF __CLC_SCALAR_GENTYPE FUNCTION(__CLC_GENTYPE a, - __CLC_GENTYPE b) { - return __IMPL_FUNCTION(FUNCTION)(a, b); +_CLC_OVERLOAD _CLC_DEF __CLC_SCALAR_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE a, + __CLC_GENTYPE b) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(a, b); } #endif diff --git a/libclc/clc/include/clc/geometric/clc_distance.h b/libclc/clc/include/clc/geometric/clc_distance.h index 666e2c881bc9..1acea411a08b 100644 --- a/libclc/clc/include/clc/geometric/clc_distance.h +++ b/libclc/clc/include/clc/geometric/clc_distance.h @@ -9,11 +9,11 @@ #ifndef __CLC_GEOMETRIC_CLC_DISTANCE_H__ #define __CLC_GEOMETRIC_CLC_DISTANCE_H__ -#define FUNCTION __clc_distance +#define __CLC_FUNCTION __clc_distance #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_GEOMETRIC_CLC_DISTANCE_H__ diff --git a/libclc/clc/include/clc/geometric/clc_dot.h b/libclc/clc/include/clc/geometric/clc_dot.h index 4bfed6e3abc5..a5a97d1bdd2b 100644 --- a/libclc/clc/include/clc/geometric/clc_dot.h +++ b/libclc/clc/include/clc/geometric/clc_dot.h @@ -9,11 +9,11 @@ #ifndef __CLC_GEOMETRIC_CLC_DOT_H__ #define __CLC_GEOMETRIC_CLC_DOT_H__ -#define FUNCTION __clc_dot +#define __CLC_FUNCTION __clc_dot #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_GEOMETRIC_CLC_DOT_H__ diff --git a/libclc/clc/include/clc/geometric/clc_fast_distance.h b/libclc/clc/include/clc/geometric/clc_fast_distance.h index 2932d0147a6d..47292130e9d6 100644 --- a/libclc/clc/include/clc/geometric/clc_fast_distance.h +++ b/libclc/clc/include/clc/geometric/clc_fast_distance.h @@ -9,12 +9,12 @@ #ifndef __CLC_GEOMETRIC_CLC_FAST_DISTANCE_H__ #define __CLC_GEOMETRIC_CLC_FAST_DISTANCE_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_fast_distance +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_fast_distance #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_GEOMETRIC_CLC_FAST_DISTANCE_H__ diff --git a/libclc/clc/include/clc/geometric/clc_fast_length.h b/libclc/clc/include/clc/geometric/clc_fast_length.h index 903ecc8b9175..2244d8c77fea 100644 --- a/libclc/clc/include/clc/geometric/clc_fast_length.h +++ b/libclc/clc/include/clc/geometric/clc_fast_length.h @@ -9,12 +9,12 @@ #ifndef __CLC_GEOMETRIC_CLC_FAST_LENGTH_H__ #define __CLC_GEOMETRIC_CLC_FAST_LENGTH_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_fast_length +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_fast_length #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_GEOMETRIC_CLC_FAST_LENGTH_H__ diff --git a/libclc/clc/include/clc/geometric/clc_fast_normalize.h b/libclc/clc/include/clc/geometric/clc_fast_normalize.h index a91862fe61cb..ee9747c1af1e 100644 --- a/libclc/clc/include/clc/geometric/clc_fast_normalize.h +++ b/libclc/clc/include/clc/geometric/clc_fast_normalize.h @@ -9,13 +9,13 @@ #ifndef __CLC_GEOMETRIC_CLC_FAST_NORMALIZE_H__ #define __CLC_GEOMETRIC_CLC_FAST_NORMALIZE_H__ -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_GEOMETRIC_RET_GENTYPE -#define FUNCTION __clc_fast_normalize +#define __CLC_FUNCTION __clc_fast_normalize #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #undef __CLC_GEOMETRIC_RET_GENTYPE #endif // __CLC_GEOMETRIC_CLC_FAST_NORMALIZE_H__ diff --git a/libclc/clc/include/clc/geometric/clc_length.h b/libclc/clc/include/clc/geometric/clc_length.h index 35b206e6c3fb..f8ce12db0787 100644 --- a/libclc/clc/include/clc/geometric/clc_length.h +++ b/libclc/clc/include/clc/geometric/clc_length.h @@ -9,11 +9,11 @@ #ifndef __CLC_GEOMETRIC_CLC_LENGTH_H__ #define __CLC_GEOMETRIC_CLC_LENGTH_H__ -#define FUNCTION __clc_length +#define __CLC_FUNCTION __clc_length #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_GEOMETRIC_CLC_LENGTH_H__ diff --git a/libclc/clc/include/clc/geometric/clc_normalize.h b/libclc/clc/include/clc/geometric/clc_normalize.h index 745ed7f4887d..3058a72b2bbb 100644 --- a/libclc/clc/include/clc/geometric/clc_normalize.h +++ b/libclc/clc/include/clc/geometric/clc_normalize.h @@ -10,11 +10,11 @@ #define __CLC_GEOMETRIC_CLC_NORMALIZE_H__ #define __CLC_GEOMETRIC_RET_GENTYPE -#define FUNCTION __clc_normalize +#define __CLC_FUNCTION __clc_normalize #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #undef __CLC_GEOMETRIC_RET_GENTYPE #endif // __CLC_GEOMETRIC_CLC_NORMALIZE_H__ diff --git a/libclc/clc/include/clc/geometric/unary_decl.inc b/libclc/clc/include/clc/geometric/unary_decl.inc index bca1f3b78f17..6641d28d0967 100644 --- a/libclc/clc/include/clc/geometric/unary_decl.inc +++ b/libclc/clc/include/clc/geometric/unary_decl.inc @@ -16,6 +16,6 @@ _CLC_OVERLOAD _CLC_CONST _CLC_DECL #else __CLC_SCALAR_GENTYPE #endif - FUNCTION(__CLC_GENTYPE a); + __CLC_FUNCTION(__CLC_GENTYPE a); #endif diff --git a/libclc/clc/include/clc/geometric/unary_def.inc b/libclc/clc/include/clc/geometric/unary_def.inc index ea90de0ec581..78c144b35af2 100644 --- a/libclc/clc/include/clc/geometric/unary_def.inc +++ b/libclc/clc/include/clc/geometric/unary_def.inc @@ -8,8 +8,8 @@ #include -#ifndef __IMPL_FUNCTION -#define __IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) +#ifndef __CLC_IMPL_FUNCTION +#define __CLC_IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) #endif // Geometric functions are only defined for scalar, vec2, vec3 and vec4 @@ -22,8 +22,8 @@ _CLC_OVERLOAD _CLC_DEF #else __CLC_SCALAR_GENTYPE #endif - FUNCTION(__CLC_GENTYPE a) { - return __IMPL_FUNCTION(FUNCTION)(a); + __CLC_FUNCTION(__CLC_GENTYPE a) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(a); } #endif diff --git a/libclc/clc/include/clc/integer/clc_add_sat.h b/libclc/clc/include/clc/integer/clc_add_sat.h index be095d38225e..8c3495f6c519 100644 --- a/libclc/clc/include/clc/integer/clc_add_sat.h +++ b/libclc/clc/include/clc/integer/clc_add_sat.h @@ -9,11 +9,11 @@ #ifndef __CLC_INTEGER_CLC_ADD_SAT_H__ #define __CLC_INTEGER_CLC_ADD_SAT_H__ -#define FUNCTION __clc_add_sat +#define __CLC_FUNCTION __clc_add_sat #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_INTEGER_CLC_ADD_SAT_H__ diff --git a/libclc/clc/include/clc/integer/clc_bit_reverse.h b/libclc/clc/include/clc/integer/clc_bit_reverse.h index c945e326c74f..de0c354b3fa4 100644 --- a/libclc/clc/include/clc/integer/clc_bit_reverse.h +++ b/libclc/clc/include/clc/integer/clc_bit_reverse.h @@ -9,11 +9,11 @@ #ifndef __CLC_INTEGER_CLC_BIT_REVERSE_H__ #define __CLC_INTEGER_CLC_BIT_REVERSE_H__ -#define FUNCTION __clc_bit_reverse +#define __CLC_FUNCTION __clc_bit_reverse #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_INTEGER_CLC_BIT_REVERSE_H__ diff --git a/libclc/clc/include/clc/integer/clc_bitfield_extract_decl.inc b/libclc/clc/include/clc/integer/clc_bitfield_extract_decl.inc index b3f0e71a5f53..2f2366701120 100644 --- a/libclc/clc/include/clc/integer/clc_bitfield_extract_decl.inc +++ b/libclc/clc/include/clc/integer/clc_bitfield_extract_decl.inc @@ -6,5 +6,5 @@ // //===----------------------------------------------------------------------===// -_CLC_OVERLOAD _CLC_CONST _CLC_DECL __RETTYPE FUNCTION(__CLC_GENTYPE base, - uint offset, uint count); +_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_RETTYPE +__CLC_FUNCTION(__CLC_GENTYPE base, uint offset, uint count); diff --git a/libclc/clc/include/clc/integer/clc_bitfield_extract_signed.h b/libclc/clc/include/clc/integer/clc_bitfield_extract_signed.h index 9c2e047b8be0..7998196512b3 100644 --- a/libclc/clc/include/clc/integer/clc_bitfield_extract_signed.h +++ b/libclc/clc/include/clc/integer/clc_bitfield_extract_signed.h @@ -11,13 +11,13 @@ #include -#define FUNCTION __clc_bitfield_extract_signed -#define __RETTYPE __CLC_S_GENTYPE +#define __CLC_FUNCTION __clc_bitfield_extract_signed +#define __CLC_RETTYPE __CLC_S_GENTYPE #define __CLC_BODY #include -#undef __RETTYPE -#undef FUNCTION +#undef __CLC_RETTYPE +#undef __CLC_FUNCTION #endif // __CLC_INTEGER_CLC_BITFIELD_EXTRACT_SIGNED_H__ diff --git a/libclc/clc/include/clc/integer/clc_bitfield_extract_unsigned.h b/libclc/clc/include/clc/integer/clc_bitfield_extract_unsigned.h index 95305a3027e5..84614056417f 100644 --- a/libclc/clc/include/clc/integer/clc_bitfield_extract_unsigned.h +++ b/libclc/clc/include/clc/integer/clc_bitfield_extract_unsigned.h @@ -11,13 +11,13 @@ #include -#define FUNCTION __clc_bitfield_extract_unsigned -#define __RETTYPE __CLC_U_GENTYPE +#define __CLC_FUNCTION __clc_bitfield_extract_unsigned +#define __CLC_RETTYPE __CLC_U_GENTYPE #define __CLC_BODY #include -#undef __RETTYPE -#undef FUNCTION +#undef __CLC_RETTYPE +#undef __CLC_FUNCTION #endif // __CLC_INTEGER_CLC_BITFIELD_EXTRACT_SIGNED_H__ diff --git a/libclc/clc/include/clc/integer/clc_bitfield_insert.h b/libclc/clc/include/clc/integer/clc_bitfield_insert.h index f4d36b2ad2d2..b284c0bf932d 100644 --- a/libclc/clc/include/clc/integer/clc_bitfield_insert.h +++ b/libclc/clc/include/clc/integer/clc_bitfield_insert.h @@ -11,7 +11,7 @@ #include -#define FUNCTION __clc_bitfield_insert +#define __CLC_FUNCTION __clc_bitfield_insert #define __CLC_BODY #include diff --git a/libclc/clc/include/clc/integer/clc_bitfield_insert.inc b/libclc/clc/include/clc/integer/clc_bitfield_insert.inc index de0b3d946999..00a363fa4112 100644 --- a/libclc/clc/include/clc/integer/clc_bitfield_insert.inc +++ b/libclc/clc/include/clc/integer/clc_bitfield_insert.inc @@ -6,7 +6,5 @@ // //===----------------------------------------------------------------------===// -_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE base, - __CLC_GENTYPE insert, - uint offset, - uint count); +_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION( + __CLC_GENTYPE base, __CLC_GENTYPE insert, uint offset, uint count); diff --git a/libclc/clc/include/clc/integer/clc_clz.h b/libclc/clc/include/clc/integer/clc_clz.h index 3e0530bad6f1..dd62cc935f8c 100644 --- a/libclc/clc/include/clc/integer/clc_clz.h +++ b/libclc/clc/include/clc/integer/clc_clz.h @@ -9,11 +9,11 @@ #ifndef __CLC_INTEGER_CLC_CLZ_H__ #define __CLC_INTEGER_CLC_CLZ_H__ -#define FUNCTION __clc_clz +#define __CLC_FUNCTION __clc_clz #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_INTEGER_CLC_CLZ_H__ diff --git a/libclc/clc/include/clc/integer/clc_ctz.h b/libclc/clc/include/clc/integer/clc_ctz.h index 1495dc5560f1..3f2079e023f6 100644 --- a/libclc/clc/include/clc/integer/clc_ctz.h +++ b/libclc/clc/include/clc/integer/clc_ctz.h @@ -9,11 +9,11 @@ #ifndef __CLC_INTEGER_CLC_CTZ_H__ #define __CLC_INTEGER_CLC_CTZ_H__ -#define FUNCTION __clc_ctz +#define __CLC_FUNCTION __clc_ctz #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_INTEGER_CLC_CTZ_H__ diff --git a/libclc/clc/include/clc/integer/clc_hadd.h b/libclc/clc/include/clc/integer/clc_hadd.h index 7aaee9b601a2..679369d3c9d4 100644 --- a/libclc/clc/include/clc/integer/clc_hadd.h +++ b/libclc/clc/include/clc/integer/clc_hadd.h @@ -9,11 +9,11 @@ #ifndef __CLC_INTEGER_CLC_HADD_H__ #define __CLC_INTEGER_CLC_HADD_H__ -#define FUNCTION __clc_hadd +#define __CLC_FUNCTION __clc_hadd #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_INTEGER_CLC_HADD_H__ diff --git a/libclc/clc/include/clc/integer/clc_mad24.h b/libclc/clc/include/clc/integer/clc_mad24.h index 121840f81d63..e19bd905d22e 100644 --- a/libclc/clc/include/clc/integer/clc_mad24.h +++ b/libclc/clc/include/clc/integer/clc_mad24.h @@ -9,11 +9,11 @@ #ifndef __CLC_INTEGER_CLC_MAD24_H__ #define __CLC_INTEGER_CLC_MAD24_H__ -#define FUNCTION __clc_mad24 +#define __CLC_FUNCTION __clc_mad24 #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_INTEGER_CLC_MAD24_H__ diff --git a/libclc/clc/include/clc/integer/clc_mad_sat.h b/libclc/clc/include/clc/integer/clc_mad_sat.h index 0c418068ca4a..845378b3e7c4 100644 --- a/libclc/clc/include/clc/integer/clc_mad_sat.h +++ b/libclc/clc/include/clc/integer/clc_mad_sat.h @@ -9,11 +9,11 @@ #ifndef __CLC_INTEGER_CLC_MAD_SAT_H__ #define __CLC_INTEGER_CLC_MAD_SAT_H__ -#define FUNCTION __clc_mad_sat +#define __CLC_FUNCTION __clc_mad_sat #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_INTEGER_CLC_MAD_SAT_H__ diff --git a/libclc/clc/include/clc/integer/clc_mul24.h b/libclc/clc/include/clc/integer/clc_mul24.h index 9310458d5981..f813de55c71e 100644 --- a/libclc/clc/include/clc/integer/clc_mul24.h +++ b/libclc/clc/include/clc/integer/clc_mul24.h @@ -9,11 +9,11 @@ #ifndef __CLC_INTEGER_CLC_MUL24_H__ #define __CLC_INTEGER_CLC_MUL24_H__ -#define FUNCTION __clc_mul24 +#define __CLC_FUNCTION __clc_mul24 #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_INTEGER_CLC_MUL24_H__ diff --git a/libclc/clc/include/clc/integer/clc_mul_hi.h b/libclc/clc/include/clc/integer/clc_mul_hi.h index 6542f237d09b..e4738e5570e8 100644 --- a/libclc/clc/include/clc/integer/clc_mul_hi.h +++ b/libclc/clc/include/clc/integer/clc_mul_hi.h @@ -9,11 +9,11 @@ #ifndef __CLC_INTEGER_CLC_MUL_HI_H__ #define __CLC_INTEGER_CLC_MUL_HI_H__ -#define FUNCTION __clc_mul_hi +#define __CLC_FUNCTION __clc_mul_hi #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_INTEGER_CLC_MUL_HI_H__ diff --git a/libclc/clc/include/clc/integer/clc_popcount.h b/libclc/clc/include/clc/integer/clc_popcount.h index 8ece2e998862..55ca6ccfcec2 100644 --- a/libclc/clc/include/clc/integer/clc_popcount.h +++ b/libclc/clc/include/clc/integer/clc_popcount.h @@ -9,12 +9,12 @@ #ifndef __CLC_INTEGER_CLC_POPCOUNT_H__ #define __CLC_INTEGER_CLC_POPCOUNT_H__ -#define FUNCTION __clc_popcount +#define __CLC_FUNCTION __clc_popcount #define __CLC_BODY #include #undef __CLC_INTRINSIC -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_INTEGER_CLC_POPCOUNT_H__ diff --git a/libclc/clc/include/clc/integer/clc_rhadd.h b/libclc/clc/include/clc/integer/clc_rhadd.h index 882f950656df..b8b0b1a3a56e 100644 --- a/libclc/clc/include/clc/integer/clc_rhadd.h +++ b/libclc/clc/include/clc/integer/clc_rhadd.h @@ -9,11 +9,11 @@ #ifndef __CLC_INTEGER_CLC_RHADD_H__ #define __CLC_INTEGER_CLC_RHADD_H__ -#define FUNCTION __clc_rhadd +#define __CLC_FUNCTION __clc_rhadd #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_INTEGER_CLC_RHADD_H__ diff --git a/libclc/clc/include/clc/integer/clc_rotate.h b/libclc/clc/include/clc/integer/clc_rotate.h index 61cf08788ef3..513bf9852623 100644 --- a/libclc/clc/include/clc/integer/clc_rotate.h +++ b/libclc/clc/include/clc/integer/clc_rotate.h @@ -9,11 +9,11 @@ #ifndef __CLC_INTEGER_CLC_ROTATE_H__ #define __CLC_INTEGER_CLC_ROTATE_H__ -#define FUNCTION __clc_rotate +#define __CLC_FUNCTION __clc_rotate #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_INTEGER_CLC_ROTATE_H__ diff --git a/libclc/clc/include/clc/integer/clc_sub_sat.h b/libclc/clc/include/clc/integer/clc_sub_sat.h index 1b694a4a1780..94a5484adefc 100644 --- a/libclc/clc/include/clc/integer/clc_sub_sat.h +++ b/libclc/clc/include/clc/integer/clc_sub_sat.h @@ -9,11 +9,11 @@ #ifndef __CLC_INTEGER_CLC_SUB_SAT_H__ #define __CLC_INTEGER_CLC_SUB_SAT_H__ -#define FUNCTION __clc_sub_sat +#define __CLC_FUNCTION __clc_sub_sat #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_INTEGER_CLC_SUB_SAT_H__ diff --git a/libclc/clc/include/clc/internal/math/clc_sw_fma.h b/libclc/clc/include/clc/internal/math/clc_sw_fma.h index 8497f4efd113..5d6c76879ceb 100644 --- a/libclc/clc/include/clc/internal/math/clc_sw_fma.h +++ b/libclc/clc/include/clc/internal/math/clc_sw_fma.h @@ -9,11 +9,11 @@ #ifndef __CLC_INTERNAL_MATH_CLC_SW_FMA_H__ #define __CLC_INTERNAL_MATH_CLC_SW_FMA_H__ -#define FUNCTION __clc_sw_fma +#define __CLC_FUNCTION __clc_sw_fma #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_INTERNAL_MATH_CLC_SW_FMA_H__ diff --git a/libclc/clc/include/clc/math/binary_decl_with_scalar_second_arg.inc b/libclc/clc/include/clc/math/binary_decl_with_scalar_second_arg.inc index 45f39b73013b..b9acf8c4af33 100644 --- a/libclc/clc/include/clc/math/binary_decl_with_scalar_second_arg.inc +++ b/libclc/clc/include/clc/math/binary_decl_with_scalar_second_arg.inc @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE a, - __CLC_GENTYPE b); _CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_GENTYPE a, __CLC_SCALAR_GENTYPE b); +__CLC_FUNCTION(__CLC_GENTYPE a, __CLC_GENTYPE b); +_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE +__CLC_FUNCTION(__CLC_GENTYPE a, __CLC_SCALAR_GENTYPE b); diff --git a/libclc/clc/include/clc/math/binary_def_via_fp32.inc b/libclc/clc/include/clc/math/binary_def_via_fp32.inc index c8cdb1e9e5c7..ae22903dd3d0 100644 --- a/libclc/clc/include/clc/math/binary_def_via_fp32.inc +++ b/libclc/clc/include/clc/math/binary_def_via_fp32.inc @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -_CLC_OVERLOAD _CLC_CONST _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - __CLC_GENTYPE y) { +_CLC_OVERLOAD _CLC_CONST _CLC_DEF __CLC_GENTYPE +__CLC_FUNCTION(__CLC_GENTYPE x, __CLC_GENTYPE y) { return __CLC_CONVERT_GENTYPE( - FUNCTION(__CLC_CONVERT_FLOATN(x), __CLC_CONVERT_FLOATN(y))); + __CLC_FUNCTION(__CLC_CONVERT_FLOATN(x), __CLC_CONVERT_FLOATN(y))); } diff --git a/libclc/clc/include/clc/math/clc_acos.h b/libclc/clc/include/clc/math/clc_acos.h index 130e3111ec1c..1d484fa5b56c 100644 --- a/libclc/clc/include/clc/math/clc_acos.h +++ b/libclc/clc/include/clc/math/clc_acos.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_ACOS_H__ #define __CLC_BODY -#define FUNCTION __clc_acos +#define __CLC_FUNCTION __clc_acos #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_ACOS_H__ diff --git a/libclc/clc/include/clc/math/clc_acosh.h b/libclc/clc/include/clc/math/clc_acosh.h index 9b8c7184b974..9492724bb27b 100644 --- a/libclc/clc/include/clc/math/clc_acosh.h +++ b/libclc/clc/include/clc/math/clc_acosh.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_ACOSH_H__ #define __CLC_BODY -#define FUNCTION __clc_acosh +#define __CLC_FUNCTION __clc_acosh #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_ACOSH_H__ diff --git a/libclc/clc/include/clc/math/clc_acospi.h b/libclc/clc/include/clc/math/clc_acospi.h index 6d4dc694900a..90cfc06b7dff 100644 --- a/libclc/clc/include/clc/math/clc_acospi.h +++ b/libclc/clc/include/clc/math/clc_acospi.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_ACOSPI_H__ #define __CLC_BODY -#define FUNCTION __clc_acospi +#define __CLC_FUNCTION __clc_acospi #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_ACOSPI_H__ diff --git a/libclc/clc/include/clc/math/clc_asin.h b/libclc/clc/include/clc/math/clc_asin.h index f3d69a7bf995..f6246c49f802 100644 --- a/libclc/clc/include/clc/math/clc_asin.h +++ b/libclc/clc/include/clc/math/clc_asin.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_ASIN_H__ #define __CLC_BODY -#define FUNCTION __clc_asin +#define __CLC_FUNCTION __clc_asin #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_ASIN_H__ diff --git a/libclc/clc/include/clc/math/clc_asinh.h b/libclc/clc/include/clc/math/clc_asinh.h index dc4530fa68b8..05e44fa438ce 100644 --- a/libclc/clc/include/clc/math/clc_asinh.h +++ b/libclc/clc/include/clc/math/clc_asinh.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_ASINH_H__ #define __CLC_BODY -#define FUNCTION __clc_asinh +#define __CLC_FUNCTION __clc_asinh #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_ASINH_H__ diff --git a/libclc/clc/include/clc/math/clc_asinpi.h b/libclc/clc/include/clc/math/clc_asinpi.h index 19d8ec3ad0c5..8f308dd06022 100644 --- a/libclc/clc/include/clc/math/clc_asinpi.h +++ b/libclc/clc/include/clc/math/clc_asinpi.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_ASINPI_H__ #define __CLC_BODY -#define FUNCTION __clc_asinpi +#define __CLC_FUNCTION __clc_asinpi #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_ASINPI_H__ diff --git a/libclc/clc/include/clc/math/clc_atan.h b/libclc/clc/include/clc/math/clc_atan.h index 9f10efeae976..203e46c2b8a4 100644 --- a/libclc/clc/include/clc/math/clc_atan.h +++ b/libclc/clc/include/clc/math/clc_atan.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_ATAN_H__ #define __CLC_BODY -#define FUNCTION __clc_atan +#define __CLC_FUNCTION __clc_atan #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_ATAN_H__ diff --git a/libclc/clc/include/clc/math/clc_atan2.h b/libclc/clc/include/clc/math/clc_atan2.h index 99bd0760f3fe..6edc9dda48f4 100644 --- a/libclc/clc/include/clc/math/clc_atan2.h +++ b/libclc/clc/include/clc/math/clc_atan2.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_ATAN2_H__ #define __CLC_BODY -#define FUNCTION __clc_atan2 +#define __CLC_FUNCTION __clc_atan2 #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_ATAN2_H__ diff --git a/libclc/clc/include/clc/math/clc_atan2pi.h b/libclc/clc/include/clc/math/clc_atan2pi.h index ae044b7bbfaf..2f26d1d9ae98 100644 --- a/libclc/clc/include/clc/math/clc_atan2pi.h +++ b/libclc/clc/include/clc/math/clc_atan2pi.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_ATAN2PI_H__ #define __CLC_BODY -#define FUNCTION __clc_atan2pi +#define __CLC_FUNCTION __clc_atan2pi #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_ATAN2PI_H__ diff --git a/libclc/clc/include/clc/math/clc_atanh.h b/libclc/clc/include/clc/math/clc_atanh.h index c1a95d4acba1..85f9fc53be1a 100644 --- a/libclc/clc/include/clc/math/clc_atanh.h +++ b/libclc/clc/include/clc/math/clc_atanh.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_ATANH_H__ #define __CLC_BODY -#define FUNCTION __clc_atanh +#define __CLC_FUNCTION __clc_atanh #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_ATANH_H__ diff --git a/libclc/clc/include/clc/math/clc_atanpi.h b/libclc/clc/include/clc/math/clc_atanpi.h index 43f752ecfe98..2b3c6b373ed4 100644 --- a/libclc/clc/include/clc/math/clc_atanpi.h +++ b/libclc/clc/include/clc/math/clc_atanpi.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_ATANPI_H__ #define __CLC_BODY -#define FUNCTION __clc_atanpi +#define __CLC_FUNCTION __clc_atanpi #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_ATANPI_H__ diff --git a/libclc/clc/include/clc/math/clc_cbrt.inc b/libclc/clc/include/clc/math/clc_cbrt.inc index 019b5174a901..fd9b750c8fd8 100644 --- a/libclc/clc/include/clc/math/clc_cbrt.inc +++ b/libclc/clc/include/clc/math/clc_cbrt.inc @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_CBRT_H__ #define __CLC_BODY -#define FUNCTION __clc_cbrt +#define __CLC_FUNCTION __clc_cbrt #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_CBRT_H__ diff --git a/libclc/clc/include/clc/math/clc_ceil.h b/libclc/clc/include/clc/math/clc_ceil.h index c60b794c83c6..45668224c617 100644 --- a/libclc/clc/include/clc/math/clc_ceil.h +++ b/libclc/clc/include/clc/math/clc_ceil.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_CEIL_H__ #define __CLC_BODY -#define FUNCTION __clc_ceil +#define __CLC_FUNCTION __clc_ceil #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_CEIL_H__ diff --git a/libclc/clc/include/clc/math/clc_copysign.h b/libclc/clc/include/clc/math/clc_copysign.h index 5976e42de250..563dd2827839 100644 --- a/libclc/clc/include/clc/math/clc_copysign.h +++ b/libclc/clc/include/clc/math/clc_copysign.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_COPYSIGN_H__ #define __CLC_BODY -#define FUNCTION __clc_copysign +#define __CLC_FUNCTION __clc_copysign #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_COPYSIGN_H__ diff --git a/libclc/clc/include/clc/math/clc_cos.h b/libclc/clc/include/clc/math/clc_cos.h index 3a1ae9342e26..44681608efc3 100644 --- a/libclc/clc/include/clc/math/clc_cos.h +++ b/libclc/clc/include/clc/math/clc_cos.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_COS_H__ #define __CLC_BODY -#define FUNCTION __clc_cos +#define __CLC_FUNCTION __clc_cos #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_COS_H__ diff --git a/libclc/clc/include/clc/math/clc_cosh.h b/libclc/clc/include/clc/math/clc_cosh.h index 3033d76000dc..7bcfa2ea26e0 100644 --- a/libclc/clc/include/clc/math/clc_cosh.h +++ b/libclc/clc/include/clc/math/clc_cosh.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_COSH_H__ #define __CLC_BODY -#define FUNCTION __clc_cosh +#define __CLC_FUNCTION __clc_cosh #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_COSH_H__ diff --git a/libclc/clc/include/clc/math/clc_cospi.h b/libclc/clc/include/clc/math/clc_cospi.h index 3e4e73f096a0..4d82100649b0 100644 --- a/libclc/clc/include/clc/math/clc_cospi.h +++ b/libclc/clc/include/clc/math/clc_cospi.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_COSPI_H__ #define __CLC_BODY -#define FUNCTION __clc_cospi +#define __CLC_FUNCTION __clc_cospi #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_COSPI_H__ diff --git a/libclc/clc/include/clc/math/clc_erf.h b/libclc/clc/include/clc/math/clc_erf.h index 04b990c65133..01a21b36b352 100644 --- a/libclc/clc/include/clc/math/clc_erf.h +++ b/libclc/clc/include/clc/math/clc_erf.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_ERF_H__ #define __CLC_BODY -#define FUNCTION __clc_erf +#define __CLC_FUNCTION __clc_erf #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_ERF_H__ diff --git a/libclc/clc/include/clc/math/clc_erfc.h b/libclc/clc/include/clc/math/clc_erfc.h index be2578b4bfb0..efd581542879 100644 --- a/libclc/clc/include/clc/math/clc_erfc.h +++ b/libclc/clc/include/clc/math/clc_erfc.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_ERFC_H__ #define __CLC_BODY -#define FUNCTION __clc_erfc +#define __CLC_FUNCTION __clc_erfc #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_ERFC_H__ diff --git a/libclc/clc/include/clc/math/clc_exp.h b/libclc/clc/include/clc/math/clc_exp.h index 355148934427..84369bb8fbdd 100644 --- a/libclc/clc/include/clc/math/clc_exp.h +++ b/libclc/clc/include/clc/math/clc_exp.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_EXP_H__ #define __CLC_BODY -#define FUNCTION __clc_exp +#define __CLC_FUNCTION __clc_exp #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_EXP_H__ diff --git a/libclc/clc/include/clc/math/clc_exp10.h b/libclc/clc/include/clc/math/clc_exp10.h index c281ee84dd3a..500271cb0742 100644 --- a/libclc/clc/include/clc/math/clc_exp10.h +++ b/libclc/clc/include/clc/math/clc_exp10.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_EXP10_H__ #define __CLC_BODY -#define FUNCTION __clc_exp10 +#define __CLC_FUNCTION __clc_exp10 #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_EXP10_H__ diff --git a/libclc/clc/include/clc/math/clc_exp2.h b/libclc/clc/include/clc/math/clc_exp2.h index bb10f12d34e2..4ad0ddea48a7 100644 --- a/libclc/clc/include/clc/math/clc_exp2.h +++ b/libclc/clc/include/clc/math/clc_exp2.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_EXP2_H__ #define __CLC_BODY -#define FUNCTION __clc_exp2 +#define __CLC_FUNCTION __clc_exp2 #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_EXP2_H__ diff --git a/libclc/clc/include/clc/math/clc_exp_helper.h b/libclc/clc/include/clc/math/clc_exp_helper.h index 0c5028bd2385..a2b3f1bebaf4 100644 --- a/libclc/clc/include/clc/math/clc_exp_helper.h +++ b/libclc/clc/include/clc/math/clc_exp_helper.h @@ -9,7 +9,7 @@ #ifndef __CLC_MATH_CLC_EXP_HELPER #define __CLC_MATH_CLC_EXP_HELPER -#define __DOUBLE_ONLY +#define __CLC_DOUBLE_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/include/clc/math/clc_expm1.h b/libclc/clc/include/clc/math/clc_expm1.h index 7a199dca17cb..5c60960ca5b0 100644 --- a/libclc/clc/include/clc/math/clc_expm1.h +++ b/libclc/clc/include/clc/math/clc_expm1.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_EXPM1_H__ #define __CLC_BODY -#define FUNCTION __clc_expm1 +#define __CLC_FUNCTION __clc_expm1 #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_EXPM1_H__ diff --git a/libclc/clc/include/clc/math/clc_fabs.h b/libclc/clc/include/clc/math/clc_fabs.h index 8af3bb572142..1ef38a8c7595 100644 --- a/libclc/clc/include/clc/math/clc_fabs.h +++ b/libclc/clc/include/clc/math/clc_fabs.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_FABS_H__ #define __CLC_BODY -#define FUNCTION __clc_fabs +#define __CLC_FUNCTION __clc_fabs #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_FABS_H__ diff --git a/libclc/clc/include/clc/math/clc_fdim.h b/libclc/clc/include/clc/math/clc_fdim.h index c678eb25f59b..50ad045db62c 100644 --- a/libclc/clc/include/clc/math/clc_fdim.h +++ b/libclc/clc/include/clc/math/clc_fdim.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_FDIM_H__ #define __CLC_BODY -#define FUNCTION __clc_fdim +#define __CLC_FUNCTION __clc_fdim #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_FDIM_H__ diff --git a/libclc/clc/include/clc/math/clc_floor.h b/libclc/clc/include/clc/math/clc_floor.h index b3fe8ea95ce1..d243819e0a42 100644 --- a/libclc/clc/include/clc/math/clc_floor.h +++ b/libclc/clc/include/clc/math/clc_floor.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_FLOOR_H__ #define __CLC_BODY -#define FUNCTION __clc_floor +#define __CLC_FUNCTION __clc_floor #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_FLOOR_H__ diff --git a/libclc/clc/include/clc/math/clc_fma.h b/libclc/clc/include/clc/math/clc_fma.h index efe20bd150eb..5e87f4c47085 100644 --- a/libclc/clc/include/clc/math/clc_fma.h +++ b/libclc/clc/include/clc/math/clc_fma.h @@ -9,11 +9,11 @@ #ifndef __CLC_MATH_CLC_FMA_H__ #define __CLC_MATH_CLC_FMA_H__ -#define FUNCTION __clc_fma +#define __CLC_FUNCTION __clc_fma #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_FMA_H__ diff --git a/libclc/clc/include/clc/math/clc_fmax.h b/libclc/clc/include/clc/math/clc_fmax.h index fd5d38987ec1..f367a9b6ea1c 100644 --- a/libclc/clc/include/clc/math/clc_fmax.h +++ b/libclc/clc/include/clc/math/clc_fmax.h @@ -9,11 +9,11 @@ #ifndef __CLC_MATH_CLC_FMAX_H__ #define __CLC_MATH_CLC_FMAX_H__ -#define FUNCTION __clc_fmax +#define __CLC_FUNCTION __clc_fmax #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_FMAX_H__ diff --git a/libclc/clc/include/clc/math/clc_fmin.h b/libclc/clc/include/clc/math/clc_fmin.h index 9fcdb56475ff..47ed3fad2d8c 100644 --- a/libclc/clc/include/clc/math/clc_fmin.h +++ b/libclc/clc/include/clc/math/clc_fmin.h @@ -9,11 +9,11 @@ #ifndef __CLC_MATH_CLC_FMIN_H__ #define __CLC_MATH_CLC_FMIN_H__ -#define FUNCTION __clc_fmin +#define __CLC_FUNCTION __clc_fmin #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_FMIN_H__ diff --git a/libclc/clc/include/clc/math/clc_fmod.h b/libclc/clc/include/clc/math/clc_fmod.h index 840bb850d73c..44179babd7fe 100644 --- a/libclc/clc/include/clc/math/clc_fmod.h +++ b/libclc/clc/include/clc/math/clc_fmod.h @@ -9,11 +9,11 @@ #ifndef __CLC_MATH_CLC_FMOD_H__ #define __CLC_MATH_CLC_FMOD_H__ -#define FUNCTION __clc_fmod +#define __CLC_FUNCTION __clc_fmod #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_FMOD_H__ diff --git a/libclc/clc/include/clc/math/clc_fract.h b/libclc/clc/include/clc/math/clc_fract.h index 26c402c79641..af762ecc59ea 100644 --- a/libclc/clc/include/clc/math/clc_fract.h +++ b/libclc/clc/include/clc/math/clc_fract.h @@ -9,11 +9,11 @@ #ifndef __CLC_MATH_CLC_FRACT_H__ #define __CLC_MATH_CLC_FRACT_H__ -#define FUNCTION __clc_fract +#define __CLC_FUNCTION __clc_fract #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_FRACT_H__ diff --git a/libclc/clc/include/clc/math/clc_frexp.h b/libclc/clc/include/clc/math/clc_frexp.h index e3c9f6b363dd..d6ed2754d0d4 100644 --- a/libclc/clc/include/clc/math/clc_frexp.h +++ b/libclc/clc/include/clc/math/clc_frexp.h @@ -9,10 +9,10 @@ #ifndef __CLC_MATH_CLC_FREXP_H__ #define __CLC_MATH_CLC_FREXP_H__ -#define FUNCTION __clc_frexp +#define __CLC_FUNCTION __clc_frexp #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_FREXP_H__ diff --git a/libclc/clc/include/clc/math/clc_half_cos.h b/libclc/clc/include/clc/math/clc_half_cos.h index 0f9f0b61443f..d0122987899c 100644 --- a/libclc/clc/include/clc/math/clc_half_cos.h +++ b/libclc/clc/include/clc/math/clc_half_cos.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_HALF_COS_H__ #define __CLC_MATH_CLC_HALF_COS_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_half_cos +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_cos #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_HALF_COS_H__ diff --git a/libclc/clc/include/clc/math/clc_half_divide.h b/libclc/clc/include/clc/math/clc_half_divide.h index 44d90f39b4f6..e5d5cdc9df34 100644 --- a/libclc/clc/include/clc/math/clc_half_divide.h +++ b/libclc/clc/include/clc/math/clc_half_divide.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_HALF_DIVIDE_H__ #define __CLC_MATH_CLC_HALF_DIVIDE_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_half_divide +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_divide #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_HALF_DIVIDE_H__ diff --git a/libclc/clc/include/clc/math/clc_half_exp.h b/libclc/clc/include/clc/math/clc_half_exp.h index 158d28c16aab..2284eaf8df36 100644 --- a/libclc/clc/include/clc/math/clc_half_exp.h +++ b/libclc/clc/include/clc/math/clc_half_exp.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_HALF_EXP_H__ #define __CLC_MATH_CLC_HALF_EXP_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_half_exp +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_exp #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_HALF_EXP_H__ diff --git a/libclc/clc/include/clc/math/clc_half_exp10.h b/libclc/clc/include/clc/math/clc_half_exp10.h index 4982b618e505..662df93e0685 100644 --- a/libclc/clc/include/clc/math/clc_half_exp10.h +++ b/libclc/clc/include/clc/math/clc_half_exp10.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_HALF_EXP10_H__ #define __CLC_MATH_CLC_HALF_EXP10_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_half_exp10 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_exp10 #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_HALF_EXP10_H__ diff --git a/libclc/clc/include/clc/math/clc_half_exp2.h b/libclc/clc/include/clc/math/clc_half_exp2.h index dc0f67659bf9..d2af0f2e3fa9 100644 --- a/libclc/clc/include/clc/math/clc_half_exp2.h +++ b/libclc/clc/include/clc/math/clc_half_exp2.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_HALF_EXP2_H__ #define __CLC_MATH_CLC_HALF_EXP2_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_half_exp2 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_exp2 #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_HALF_EXP2_H__ diff --git a/libclc/clc/include/clc/math/clc_half_log.h b/libclc/clc/include/clc/math/clc_half_log.h index df527e1a8fb5..8ae30e5abe5f 100644 --- a/libclc/clc/include/clc/math/clc_half_log.h +++ b/libclc/clc/include/clc/math/clc_half_log.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_HALF_LOG_H__ #define __CLC_MATH_CLC_HALF_LOG_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_half_log +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_log #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_HALF_LOG_H__ diff --git a/libclc/clc/include/clc/math/clc_half_log10.h b/libclc/clc/include/clc/math/clc_half_log10.h index 47db4cd32593..fe5248350aba 100644 --- a/libclc/clc/include/clc/math/clc_half_log10.h +++ b/libclc/clc/include/clc/math/clc_half_log10.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_HALF_LOG10_H__ #define __CLC_MATH_CLC_HALF_LOG10_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_half_log10 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_log10 #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_HALF_LOG10_H__ diff --git a/libclc/clc/include/clc/math/clc_half_log2.h b/libclc/clc/include/clc/math/clc_half_log2.h index 2b95b444b3f2..c57aa1bffb33 100644 --- a/libclc/clc/include/clc/math/clc_half_log2.h +++ b/libclc/clc/include/clc/math/clc_half_log2.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_HALF_LOG2_H__ #define __CLC_MATH_CLC_HALF_LOG2_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_half_log2 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_log2 #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_HALF_LOG2_H__ diff --git a/libclc/clc/include/clc/math/clc_half_powr.h b/libclc/clc/include/clc/math/clc_half_powr.h index 2fd62213b824..188b32b8b49c 100644 --- a/libclc/clc/include/clc/math/clc_half_powr.h +++ b/libclc/clc/include/clc/math/clc_half_powr.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_HALF_POWR_H__ #define __CLC_MATH_CLC_HALF_POWR_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_half_powr +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_powr #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_HALF_POWR_H__ diff --git a/libclc/clc/include/clc/math/clc_half_recip.h b/libclc/clc/include/clc/math/clc_half_recip.h index d2ace8b7a17e..f5f71fa1988c 100644 --- a/libclc/clc/include/clc/math/clc_half_recip.h +++ b/libclc/clc/include/clc/math/clc_half_recip.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_HALF_RECIP_H__ #define __CLC_MATH_CLC_HALF_RECIP_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_half_recip +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_recip #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_HALF_RECIP_H__ diff --git a/libclc/clc/include/clc/math/clc_half_rsqrt.h b/libclc/clc/include/clc/math/clc_half_rsqrt.h index a50dabccdaaf..d5a05ac8b84a 100644 --- a/libclc/clc/include/clc/math/clc_half_rsqrt.h +++ b/libclc/clc/include/clc/math/clc_half_rsqrt.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_HALF_RSQRT_H__ #define __CLC_MATH_CLC_HALF_RSQRT_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_half_rsqrt +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_rsqrt #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_HALF_RSQRT_H__ diff --git a/libclc/clc/include/clc/math/clc_half_sin.h b/libclc/clc/include/clc/math/clc_half_sin.h index f79f6afc2b4e..d2d3da9b11db 100644 --- a/libclc/clc/include/clc/math/clc_half_sin.h +++ b/libclc/clc/include/clc/math/clc_half_sin.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_HALF_SIN_H__ #define __CLC_MATH_CLC_HALF_SIN_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_half_sin +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_sin #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_HALF_SIN_H__ diff --git a/libclc/clc/include/clc/math/clc_half_sqrt.h b/libclc/clc/include/clc/math/clc_half_sqrt.h index df5fc222a5c9..a54b8122cb15 100644 --- a/libclc/clc/include/clc/math/clc_half_sqrt.h +++ b/libclc/clc/include/clc/math/clc_half_sqrt.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_HALF_SQRT_H__ #define __CLC_MATH_CLC_HALF_SQRT_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_half_sqrt +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_sqrt #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_HALF_SQRT_H__ diff --git a/libclc/clc/include/clc/math/clc_half_tan.h b/libclc/clc/include/clc/math/clc_half_tan.h index 0f6ef8790722..503ebe29c3ce 100644 --- a/libclc/clc/include/clc/math/clc_half_tan.h +++ b/libclc/clc/include/clc/math/clc_half_tan.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_HALF_TAN_H__ #define __CLC_MATH_CLC_HALF_TAN_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_half_tan +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_tan #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_HALF_TAN_H__ diff --git a/libclc/clc/include/clc/math/clc_hypot.h b/libclc/clc/include/clc/math/clc_hypot.h index b2d69ebda96e..40b354154fa5 100644 --- a/libclc/clc/include/clc/math/clc_hypot.h +++ b/libclc/clc/include/clc/math/clc_hypot.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_HYPOT_H__ #define __CLC_BODY -#define FUNCTION __clc_hypot +#define __CLC_FUNCTION __clc_hypot #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_HYPOT_H__ diff --git a/libclc/clc/include/clc/math/clc_ilogb.h b/libclc/clc/include/clc/math/clc_ilogb.h index e02108ff1444..6aeaf6be3ac6 100644 --- a/libclc/clc/include/clc/math/clc_ilogb.h +++ b/libclc/clc/include/clc/math/clc_ilogb.h @@ -9,10 +9,10 @@ #ifndef __CLC_MATH_CLC_ILOGB_H__ #define __CLC_MATH_CLC_ILOGB_H__ -#define FUNCTION __clc_ilogb +#define __CLC_FUNCTION __clc_ilogb #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_ILOGB_H__ diff --git a/libclc/clc/include/clc/math/clc_lgamma.h b/libclc/clc/include/clc/math/clc_lgamma.h index 69b1ff9701ca..f54c5e2b61b6 100644 --- a/libclc/clc/include/clc/math/clc_lgamma.h +++ b/libclc/clc/include/clc/math/clc_lgamma.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_LGAMMA_H__ #define __CLC_BODY -#define FUNCTION __clc_lgamma +#define __CLC_FUNCTION __clc_lgamma #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_LGAMMA_H__ diff --git a/libclc/clc/include/clc/math/clc_lgamma_r.h b/libclc/clc/include/clc/math/clc_lgamma_r.h index a98f760d8032..262e62372227 100644 --- a/libclc/clc/include/clc/math/clc_lgamma_r.h +++ b/libclc/clc/include/clc/math/clc_lgamma_r.h @@ -9,11 +9,11 @@ #ifndef __CLC_MATH_CLC_LGAMMA_R_H__ #define __CLC_MATH_CLC_LGAMMA_R_H__ -#define FUNCTION __clc_lgamma_r +#define __CLC_FUNCTION __clc_lgamma_r #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_LGAMMA_R_H__ diff --git a/libclc/clc/include/clc/math/clc_log.h b/libclc/clc/include/clc/math/clc_log.h index 6bddb5ff746e..8b0e44b425a8 100644 --- a/libclc/clc/include/clc/math/clc_log.h +++ b/libclc/clc/include/clc/math/clc_log.h @@ -9,11 +9,11 @@ #ifndef __CLC_MATH_CLC_LOG_H__ #define __CLC_MATH_CLC_LOG_H__ -#define FUNCTION __clc_log +#define __CLC_FUNCTION __clc_log #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_LOG_H__ diff --git a/libclc/clc/include/clc/math/clc_log10.h b/libclc/clc/include/clc/math/clc_log10.h index e3a5b19eb418..6e086690c6ad 100644 --- a/libclc/clc/include/clc/math/clc_log10.h +++ b/libclc/clc/include/clc/math/clc_log10.h @@ -9,11 +9,11 @@ #ifndef __CLC_MATH_CLC_LOG10_H__ #define __CLC_MATH_CLC_LOG10_H__ -#define FUNCTION __clc_log10 +#define __CLC_FUNCTION __clc_log10 #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_LOG10_H__ diff --git a/libclc/clc/include/clc/math/clc_log1p.h b/libclc/clc/include/clc/math/clc_log1p.h index f502802dafb2..1be8c8548d48 100644 --- a/libclc/clc/include/clc/math/clc_log1p.h +++ b/libclc/clc/include/clc/math/clc_log1p.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_LOG1P_H__ #define __CLC_BODY -#define FUNCTION __clc_log1p +#define __CLC_FUNCTION __clc_log1p #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_LOG1P_H__ diff --git a/libclc/clc/include/clc/math/clc_log2.h b/libclc/clc/include/clc/math/clc_log2.h index 7344cabaeffa..c5f9e37f3984 100644 --- a/libclc/clc/include/clc/math/clc_log2.h +++ b/libclc/clc/include/clc/math/clc_log2.h @@ -9,11 +9,11 @@ #ifndef __CLC_MATH_CLC_LOG2_H__ #define __CLC_MATH_CLC_LOG2_H__ -#define FUNCTION __clc_log2 +#define __CLC_FUNCTION __clc_log2 #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_LOG2_H__ diff --git a/libclc/clc/include/clc/math/clc_logb.h b/libclc/clc/include/clc/math/clc_logb.h index 1339d5819171..75a2ce7e578b 100644 --- a/libclc/clc/include/clc/math/clc_logb.h +++ b/libclc/clc/include/clc/math/clc_logb.h @@ -9,10 +9,10 @@ #ifndef __CLC_MATH_CLC_LOGB_H__ #define __CLC_MATH_CLC_LOGB_H__ -#define FUNCTION __clc_logb +#define __CLC_FUNCTION __clc_logb #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_LOGB_H__ diff --git a/libclc/clc/include/clc/math/clc_mad.h b/libclc/clc/include/clc/math/clc_mad.h index 72014b7c0ef7..117e361380ed 100644 --- a/libclc/clc/include/clc/math/clc_mad.h +++ b/libclc/clc/include/clc/math/clc_mad.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_MAD_H__ #define __CLC_BODY -#define FUNCTION __clc_mad +#define __CLC_FUNCTION __clc_mad #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_MAD_H__ diff --git a/libclc/clc/include/clc/math/clc_maxmag.h b/libclc/clc/include/clc/math/clc_maxmag.h index 058230e6ebfc..857ad7867b05 100644 --- a/libclc/clc/include/clc/math/clc_maxmag.h +++ b/libclc/clc/include/clc/math/clc_maxmag.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_MAXMAG_H__ #define __CLC_BODY -#define FUNCTION __clc_maxmag +#define __CLC_FUNCTION __clc_maxmag #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_MAXMAG_H__ diff --git a/libclc/clc/include/clc/math/clc_minmag.h b/libclc/clc/include/clc/math/clc_minmag.h index 581b95782823..9615d029bfed 100644 --- a/libclc/clc/include/clc/math/clc_minmag.h +++ b/libclc/clc/include/clc/math/clc_minmag.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_MINMAG_H__ #define __CLC_BODY -#define FUNCTION __clc_minmag +#define __CLC_FUNCTION __clc_minmag #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_MINMAG_H__ diff --git a/libclc/clc/include/clc/math/clc_modf.h b/libclc/clc/include/clc/math/clc_modf.h index fbdd3f8ffd4b..aa8f9e20892a 100644 --- a/libclc/clc/include/clc/math/clc_modf.h +++ b/libclc/clc/include/clc/math/clc_modf.h @@ -9,10 +9,10 @@ #ifndef __CLC_MATH_CLC_MODF_H__ #define __CLC_MATH_CLC_MODF_H__ -#define FUNCTION __clc_modf +#define __CLC_FUNCTION __clc_modf #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_MODF_H__ diff --git a/libclc/clc/include/clc/math/clc_nan.h b/libclc/clc/include/clc/math/clc_nan.h index 45d91184cf14..91901fd9369f 100644 --- a/libclc/clc/include/clc/math/clc_nan.h +++ b/libclc/clc/include/clc/math/clc_nan.h @@ -9,11 +9,11 @@ #ifndef __CLC_MATH_CLC_NAN_H__ #define __CLC_MATH_CLC_NAN_H__ -#define FUNCTION __clc_nan +#define __CLC_FUNCTION __clc_nan #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_NAN_H__ diff --git a/libclc/clc/include/clc/math/clc_native_cos.h b/libclc/clc/include/clc/math/clc_native_cos.h index 08d51baca1f6..eefd133911e4 100644 --- a/libclc/clc/include/clc/math/clc_native_cos.h +++ b/libclc/clc/include/clc/math/clc_native_cos.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_NATIVE_COS_H__ #define __CLC_MATH_CLC_NATIVE_COS_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_native_cos +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_cos #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_NATIVE_COS_H__ diff --git a/libclc/clc/include/clc/math/clc_native_divide.h b/libclc/clc/include/clc/math/clc_native_divide.h index a10ed512f10d..97d97c2670a6 100644 --- a/libclc/clc/include/clc/math/clc_native_divide.h +++ b/libclc/clc/include/clc/math/clc_native_divide.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_NATIVE_DIVIDE_H__ #define __CLC_MATH_CLC_NATIVE_DIVIDE_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_native_divide +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_divide #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_NATIVE_DIVIDE_H__ diff --git a/libclc/clc/include/clc/math/clc_native_exp.h b/libclc/clc/include/clc/math/clc_native_exp.h index 30801fe2f8ad..30c0d1edf18f 100644 --- a/libclc/clc/include/clc/math/clc_native_exp.h +++ b/libclc/clc/include/clc/math/clc_native_exp.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_NATIVE_EXP_H__ #define __CLC_MATH_CLC_NATIVE_EXP_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_native_exp +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_exp #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_NATIVE_EXP_H__ diff --git a/libclc/clc/include/clc/math/clc_native_exp10.h b/libclc/clc/include/clc/math/clc_native_exp10.h index 91cf60ef6a2b..a88b5a389737 100644 --- a/libclc/clc/include/clc/math/clc_native_exp10.h +++ b/libclc/clc/include/clc/math/clc_native_exp10.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_NATIVE_EXP10_H__ #define __CLC_MATH_CLC_NATIVE_EXP10_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_native_exp10 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_exp10 #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_NATIVE_EXP10_H__ diff --git a/libclc/clc/include/clc/math/clc_native_exp2.h b/libclc/clc/include/clc/math/clc_native_exp2.h index fe4728053619..09f4bfe6979d 100644 --- a/libclc/clc/include/clc/math/clc_native_exp2.h +++ b/libclc/clc/include/clc/math/clc_native_exp2.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_NATIVE_EXP2_H__ #define __CLC_MATH_CLC_NATIVE_EXP2_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_native_exp2 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_exp2 #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_NATIVE_EXP2_H__ diff --git a/libclc/clc/include/clc/math/clc_native_log.h b/libclc/clc/include/clc/math/clc_native_log.h index 25a7054d2a59..c32fc812d477 100644 --- a/libclc/clc/include/clc/math/clc_native_log.h +++ b/libclc/clc/include/clc/math/clc_native_log.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_NATIVE_LOG_H__ #define __CLC_MATH_CLC_NATIVE_LOG_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_native_log +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_log #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_NATIVE_LOG_H__ diff --git a/libclc/clc/include/clc/math/clc_native_log10.h b/libclc/clc/include/clc/math/clc_native_log10.h index d46124d655ee..329b8a743755 100644 --- a/libclc/clc/include/clc/math/clc_native_log10.h +++ b/libclc/clc/include/clc/math/clc_native_log10.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_NATIVE_LOG10_H__ #define __CLC_MATH_CLC_NATIVE_LOG10_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_native_log10 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_log10 #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_NATIVE_LOG10_H__ diff --git a/libclc/clc/include/clc/math/clc_native_log2.h b/libclc/clc/include/clc/math/clc_native_log2.h index 8998553b4984..b8ad663b470d 100644 --- a/libclc/clc/include/clc/math/clc_native_log2.h +++ b/libclc/clc/include/clc/math/clc_native_log2.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_NATIVE_LOG2_H__ #define __CLC_MATH_CLC_NATIVE_LOG2_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_native_log2 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_log2 #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_NATIVE_LOG2_H__ diff --git a/libclc/clc/include/clc/math/clc_native_powr.h b/libclc/clc/include/clc/math/clc_native_powr.h index 932cfa66aeb9..3a0c8cc8b9d5 100644 --- a/libclc/clc/include/clc/math/clc_native_powr.h +++ b/libclc/clc/include/clc/math/clc_native_powr.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_NATIVE_POWR_H__ #define __CLC_MATH_CLC_NATIVE_POWR_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_native_powr +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_powr #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_NATIVE_POWR_H__ diff --git a/libclc/clc/include/clc/math/clc_native_recip.h b/libclc/clc/include/clc/math/clc_native_recip.h index 6b94cbc3d6c6..a6540e846f2b 100644 --- a/libclc/clc/include/clc/math/clc_native_recip.h +++ b/libclc/clc/include/clc/math/clc_native_recip.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_NATIVE_RECIP_H__ #define __CLC_MATH_CLC_NATIVE_RECIP_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_native_recip +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_recip #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_NATIVE_RECIP_H__ diff --git a/libclc/clc/include/clc/math/clc_native_rsqrt.h b/libclc/clc/include/clc/math/clc_native_rsqrt.h index 5fa870b3f868..0c8f3da03929 100644 --- a/libclc/clc/include/clc/math/clc_native_rsqrt.h +++ b/libclc/clc/include/clc/math/clc_native_rsqrt.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_NATIVE_RSQRT_H__ #define __CLC_MATH_CLC_NATIVE_RSQRT_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_native_rsqrt +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_rsqrt #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_NATIVE_RSQRT_H__ diff --git a/libclc/clc/include/clc/math/clc_native_sin.h b/libclc/clc/include/clc/math/clc_native_sin.h index d25968c74409..22ab7868e20f 100644 --- a/libclc/clc/include/clc/math/clc_native_sin.h +++ b/libclc/clc/include/clc/math/clc_native_sin.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_NATIVE_SIN_H__ #define __CLC_MATH_CLC_NATIVE_SIN_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_native_sin +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_sin #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_NATIVE_SIN_H__ diff --git a/libclc/clc/include/clc/math/clc_native_sqrt.h b/libclc/clc/include/clc/math/clc_native_sqrt.h index e8a28b7f7046..fd071f1d463a 100644 --- a/libclc/clc/include/clc/math/clc_native_sqrt.h +++ b/libclc/clc/include/clc/math/clc_native_sqrt.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_NATIVE_SQRT_H__ #define __CLC_MATH_CLC_NATIVE_SQRT_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_native_sqrt +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_sqrt #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_NATIVE_SQRT_H__ diff --git a/libclc/clc/include/clc/math/clc_native_tan.h b/libclc/clc/include/clc/math/clc_native_tan.h index 36fdd6d8c011..4b381312d8d5 100644 --- a/libclc/clc/include/clc/math/clc_native_tan.h +++ b/libclc/clc/include/clc/math/clc_native_tan.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_NATIVE_TAN_H__ #define __CLC_MATH_CLC_NATIVE_TAN_H__ -#define __FLOAT_ONLY -#define FUNCTION __clc_native_tan +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_tan #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_NATIVE_TAN_H__ diff --git a/libclc/clc/include/clc/math/clc_nextafter.h b/libclc/clc/include/clc/math/clc_nextafter.h index d080a40a06f0..f24742b9e9c3 100644 --- a/libclc/clc/include/clc/math/clc_nextafter.h +++ b/libclc/clc/include/clc/math/clc_nextafter.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_NEXTAFTER_H__ #define __CLC_BODY -#define FUNCTION __clc_nextafter +#define __CLC_FUNCTION __clc_nextafter #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_NEXTAFTER_H__ diff --git a/libclc/clc/include/clc/math/clc_pow.h b/libclc/clc/include/clc/math/clc_pow.h index b33391e10a42..5e37e5bf6da6 100644 --- a/libclc/clc/include/clc/math/clc_pow.h +++ b/libclc/clc/include/clc/math/clc_pow.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_POW_H__ #define __CLC_BODY -#define FUNCTION __clc_pow +#define __CLC_FUNCTION __clc_pow #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_POW_H__ diff --git a/libclc/clc/include/clc/math/clc_pown.h b/libclc/clc/include/clc/math/clc_pown.h index 473bbe1603c5..30628efb1900 100644 --- a/libclc/clc/include/clc/math/clc_pown.h +++ b/libclc/clc/include/clc/math/clc_pown.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_POWN_H__ #define __CLC_BODY -#define FUNCTION __clc_pown +#define __CLC_FUNCTION __clc_pown #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_POWN_H__ diff --git a/libclc/clc/include/clc/math/clc_powr.h b/libclc/clc/include/clc/math/clc_powr.h index a820516f1866..baa494cce698 100644 --- a/libclc/clc/include/clc/math/clc_powr.h +++ b/libclc/clc/include/clc/math/clc_powr.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_POWR_H__ #define __CLC_BODY -#define FUNCTION __clc_powr +#define __CLC_FUNCTION __clc_powr #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_POWR_H__ diff --git a/libclc/clc/include/clc/math/clc_remainder.h b/libclc/clc/include/clc/math/clc_remainder.h index bc53b043045c..a7700c95103b 100644 --- a/libclc/clc/include/clc/math/clc_remainder.h +++ b/libclc/clc/include/clc/math/clc_remainder.h @@ -9,11 +9,11 @@ #ifndef __CLC_MATH_CLC_REMAINDER_H__ #define __CLC_MATH_CLC_REMAINDER_H__ -#define FUNCTION __clc_remainder +#define __CLC_FUNCTION __clc_remainder #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_REMAINDER_H__ diff --git a/libclc/clc/include/clc/math/clc_remquo.h b/libclc/clc/include/clc/math/clc_remquo.h index b46f94ba9447..48a8844a6e38 100644 --- a/libclc/clc/include/clc/math/clc_remquo.h +++ b/libclc/clc/include/clc/math/clc_remquo.h @@ -9,11 +9,11 @@ #ifndef __CLC_MATH_CLC_REMQUO_H__ #define __CLC_MATH_CLC_REMQUO_H__ -#define FUNCTION __clc_remquo +#define __CLC_FUNCTION __clc_remquo #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_REMQUO_H__ diff --git a/libclc/clc/include/clc/math/clc_rint.h b/libclc/clc/include/clc/math/clc_rint.h index c446c7576471..17b1549f439b 100644 --- a/libclc/clc/include/clc/math/clc_rint.h +++ b/libclc/clc/include/clc/math/clc_rint.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_RINT_H__ #define __CLC_BODY -#define FUNCTION __clc_rint +#define __CLC_FUNCTION __clc_rint #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_RINT_H__ diff --git a/libclc/clc/include/clc/math/clc_rootn.h b/libclc/clc/include/clc/math/clc_rootn.h index fb7817ee250f..90a25ad52d86 100644 --- a/libclc/clc/include/clc/math/clc_rootn.h +++ b/libclc/clc/include/clc/math/clc_rootn.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_ROOTN_H__ #define __CLC_BODY -#define FUNCTION __clc_rootn +#define __CLC_FUNCTION __clc_rootn #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_ROOTN_H__ diff --git a/libclc/clc/include/clc/math/clc_round.h b/libclc/clc/include/clc/math/clc_round.h index fd1872a5cf22..78ebf4db99e9 100644 --- a/libclc/clc/include/clc/math/clc_round.h +++ b/libclc/clc/include/clc/math/clc_round.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_ROUND_H__ #define __CLC_BODY -#define FUNCTION __clc_round +#define __CLC_FUNCTION __clc_round #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_ROUND_H__ diff --git a/libclc/clc/include/clc/math/clc_rsqrt.h b/libclc/clc/include/clc/math/clc_rsqrt.h index 1690ede1b892..59402fbead2b 100644 --- a/libclc/clc/include/clc/math/clc_rsqrt.h +++ b/libclc/clc/include/clc/math/clc_rsqrt.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_RSQRT_H__ #define __CLC_BODY -#define FUNCTION __clc_rsqrt +#define __CLC_FUNCTION __clc_rsqrt #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_RSQRT_H__ diff --git a/libclc/clc/include/clc/math/clc_sin.h b/libclc/clc/include/clc/math/clc_sin.h index 89ae444eb6e3..de4c722ca123 100644 --- a/libclc/clc/include/clc/math/clc_sin.h +++ b/libclc/clc/include/clc/math/clc_sin.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_SIN_H__ #define __CLC_BODY -#define FUNCTION __clc_sin +#define __CLC_FUNCTION __clc_sin #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_SIN_H__ diff --git a/libclc/clc/include/clc/math/clc_sincos.h b/libclc/clc/include/clc/math/clc_sincos.h index bf3e0806db38..e26dc7c024c9 100644 --- a/libclc/clc/include/clc/math/clc_sincos.h +++ b/libclc/clc/include/clc/math/clc_sincos.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_SINCOS_H__ #define __CLC_BODY -#define FUNCTION __clc_sincos +#define __CLC_FUNCTION __clc_sincos #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_SINCOS_H__ diff --git a/libclc/clc/include/clc/math/clc_sincos_helpers.h b/libclc/clc/include/clc/math/clc_sincos_helpers.h index f9ceba3bf2cf..909afe476ad9 100644 --- a/libclc/clc/include/clc/math/clc_sincos_helpers.h +++ b/libclc/clc/include/clc/math/clc_sincos_helpers.h @@ -9,12 +9,12 @@ #ifndef __CLC_MATH_CLC_SINCOS_HELPERS_H__ #define __CLC_MATH_CLC_SINCOS_HELPERS_H__ -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include -#define __DOUBLE_ONLY +#define __CLC_DOUBLE_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/include/clc/math/clc_sinh.h b/libclc/clc/include/clc/math/clc_sinh.h index c94d8e37acc6..fa9cabe79cb0 100644 --- a/libclc/clc/include/clc/math/clc_sinh.h +++ b/libclc/clc/include/clc/math/clc_sinh.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_SINH_H__ #define __CLC_BODY -#define FUNCTION __clc_sinh +#define __CLC_FUNCTION __clc_sinh #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_SINH_H__ diff --git a/libclc/clc/include/clc/math/clc_sinpi.h b/libclc/clc/include/clc/math/clc_sinpi.h index 725e559600ed..db563c2e7e14 100644 --- a/libclc/clc/include/clc/math/clc_sinpi.h +++ b/libclc/clc/include/clc/math/clc_sinpi.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_SINPI_H__ #define __CLC_BODY -#define FUNCTION __clc_sinpi +#define __CLC_FUNCTION __clc_sinpi #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_SINPI_H__ diff --git a/libclc/clc/include/clc/math/clc_sqrt.h b/libclc/clc/include/clc/math/clc_sqrt.h index 74aea8e85809..708451553329 100644 --- a/libclc/clc/include/clc/math/clc_sqrt.h +++ b/libclc/clc/include/clc/math/clc_sqrt.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_SQRT_H__ #define __CLC_BODY -#define FUNCTION __clc_sqrt +#define __CLC_FUNCTION __clc_sqrt #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_SQRT_H__ diff --git a/libclc/clc/include/clc/math/clc_tan.h b/libclc/clc/include/clc/math/clc_tan.h index d16370420a03..028ff28ecd69 100644 --- a/libclc/clc/include/clc/math/clc_tan.h +++ b/libclc/clc/include/clc/math/clc_tan.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_TAN_H__ #define __CLC_BODY -#define FUNCTION __clc_tan +#define __CLC_FUNCTION __clc_tan #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_TAN_H__ diff --git a/libclc/clc/include/clc/math/clc_tanh.h b/libclc/clc/include/clc/math/clc_tanh.h index 2c860c165ca6..88fce2340d99 100644 --- a/libclc/clc/include/clc/math/clc_tanh.h +++ b/libclc/clc/include/clc/math/clc_tanh.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_TANH_H__ #define __CLC_BODY -#define FUNCTION __clc_tanh +#define __CLC_FUNCTION __clc_tanh #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_TANH_H__ diff --git a/libclc/clc/include/clc/math/clc_tanpi.h b/libclc/clc/include/clc/math/clc_tanpi.h index 2691fa696c0a..596bb72b4b8d 100644 --- a/libclc/clc/include/clc/math/clc_tanpi.h +++ b/libclc/clc/include/clc/math/clc_tanpi.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_TANPI_H__ #define __CLC_BODY -#define FUNCTION __clc_tanpi +#define __CLC_FUNCTION __clc_tanpi #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_TANPI_H__ diff --git a/libclc/clc/include/clc/math/clc_tgamma.h b/libclc/clc/include/clc/math/clc_tgamma.h index d067703c2e9d..dd76e041875d 100644 --- a/libclc/clc/include/clc/math/clc_tgamma.h +++ b/libclc/clc/include/clc/math/clc_tgamma.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_TGAMMA_H__ #define __CLC_BODY -#define FUNCTION __clc_tgamma +#define __CLC_FUNCTION __clc_tgamma #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_TGAMMA_H__ diff --git a/libclc/clc/include/clc/math/clc_trunc.h b/libclc/clc/include/clc/math/clc_trunc.h index 6a8353a4f6d4..33445f9fe15d 100644 --- a/libclc/clc/include/clc/math/clc_trunc.h +++ b/libclc/clc/include/clc/math/clc_trunc.h @@ -10,10 +10,10 @@ #define __CLC_MATH_CLC_TRUNC_H__ #define __CLC_BODY -#define FUNCTION __clc_trunc +#define __CLC_FUNCTION __clc_trunc #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MATH_CLC_TRUNC_H__ diff --git a/libclc/clc/include/clc/math/gentype.inc b/libclc/clc/include/clc/math/gentype.inc index 299ce6633cf0..3373f5fa5002 100644 --- a/libclc/clc/include/clc/math/gentype.inc +++ b/libclc/clc/include/clc/math/gentype.inc @@ -70,7 +70,7 @@ #define __CLC_CONVERT_S_GENTYPE __CLC_XCONCAT(__clc_convert_, __CLC_S_GENTYPE) #define __CLC_CONVERT_U_GENTYPE __CLC_XCONCAT(__clc_convert_, __CLC_U_GENTYPE) -#if (!defined(__HALF_ONLY) && !defined(__DOUBLE_ONLY)) +#if (!defined(__CLC_HALF_ONLY) && !defined(__CLC_DOUBLE_ONLY)) #define __CLC_SCALAR_GENTYPE float #define __CLC_FPSIZE 32 #define __CLC_FP_LIT(x) (__CLC_GENTYPE) x##F @@ -145,7 +145,7 @@ #endif -#if (!defined(__HALF_ONLY) && !defined(__FLOAT_ONLY)) +#if (!defined(__CLC_HALF_ONLY) && !defined(__CLC_FLOAT_ONLY)) #ifdef cl_khr_fp64 #pragma OPENCL EXTENSION cl_khr_fp64 : enable @@ -223,7 +223,7 @@ #endif #endif -#if (!defined(__FLOAT_ONLY) && !defined(__DOUBLE_ONLY)) +#if (!defined(__CLC_FLOAT_ONLY) && !defined(__CLC_DOUBLE_ONLY)) #ifdef cl_khr_fp16 #pragma OPENCL EXTENSION cl_khr_fp16 : enable @@ -356,6 +356,6 @@ #undef __CLC_AS_GENTYPE #undef __CLC_CONVERT_GENTYPE -#undef __HALF_ONLY -#undef __FLOAT_ONLY -#undef __DOUBLE_ONLY +#undef __CLC_HALF_ONLY +#undef __CLC_FLOAT_ONLY +#undef __CLC_DOUBLE_ONLY diff --git a/libclc/clc/include/clc/math/math.h b/libclc/clc/include/clc/math/math.h index 5df53f1b5e5d..c2647f66b400 100644 --- a/libclc/clc/include/clc/math/math.h +++ b/libclc/clc/include/clc/math/math.h @@ -120,6 +120,4 @@ _CLC_OVERLOAD _CLC_INLINE float __clc_flush_denormal_if_not_supported(float x) { #endif // cl_khr_fp16 -#define ALIGNED(x) __attribute__((aligned(x))) - #endif // __CLC_MATH_MATH_H__ diff --git a/libclc/clc/include/clc/math/remquo_decl.inc b/libclc/clc/include/clc/math/remquo_decl.inc index 24d96b048805..cba28a7244eb 100644 --- a/libclc/clc/include/clc/math/remquo_decl.inc +++ b/libclc/clc/include/clc/math/remquo_decl.inc @@ -6,15 +6,19 @@ // //===----------------------------------------------------------------------===// -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, __CLC_GENTYPE y, - private __CLC_INTN *q); +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + __CLC_GENTYPE y, + private __CLC_INTN *q); -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, __CLC_GENTYPE y, - global __CLC_INTN *q); +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + __CLC_GENTYPE y, + global __CLC_INTN *q); -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, __CLC_GENTYPE y, - local __CLC_INTN *q); +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + __CLC_GENTYPE y, + local __CLC_INTN *q); #if _CLC_GENERIC_AS_SUPPORTED -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, __CLC_GENTYPE y, - generic __CLC_INTN *q); +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + __CLC_GENTYPE y, + generic __CLC_INTN *q); #endif diff --git a/libclc/clc/include/clc/math/tables.h b/libclc/clc/include/clc/math/tables.h index 0fec778b5367..ad4b0547f8c6 100644 --- a/libclc/clc/include/clc/math/tables.h +++ b/libclc/clc/include/clc/math/tables.h @@ -11,35 +11,36 @@ #include -#define TABLE_SPACE __constant +#define __CLC_TABLE_SPACE __constant -#define TABLE_MANGLE(NAME) __clc_##NAME +#define __CLC_TABLE_MANGLE(NAME) __clc_##NAME -#define DECLARE_TABLE(TYPE, NAME, LENGTH) TABLE_SPACE TYPE NAME[LENGTH] +#define __CLC_DECLARE_TABLE(TYPE, NAME, LENGTH) \ + __CLC_TABLE_SPACE TYPE NAME[LENGTH] -#define TABLE_FUNCTION(TYPE, TABLE, NAME) \ - TYPE TABLE_MANGLE(NAME)(size_t idx) { return TABLE[idx]; } +#define __CLC_TABLE_FUNCTION(TYPE, TABLE, NAME) \ + TYPE __CLC_TABLE_MANGLE(NAME)(size_t idx) { return TABLE[idx]; } -#define CLC_TABLE_FUNCTION(TYPE, TABLE, NAME) \ - _CLC_DEF _CLC_OVERLOAD TYPE TABLE_MANGLE(NAME)(int idx) { \ +#define __CLC_TABLE_FUNCTION_VEC(TYPE, TABLE, NAME) \ + _CLC_DEF _CLC_OVERLOAD TYPE __CLC_TABLE_MANGLE(NAME)(int idx) { \ return TABLE[idx]; \ } \ - _CLC_DEF _CLC_OVERLOAD TYPE##2 TABLE_MANGLE(NAME)(int##2 idx) { \ + _CLC_DEF _CLC_OVERLOAD TYPE##2 __CLC_TABLE_MANGLE(NAME)(int##2 idx) { \ return (TYPE##2){TABLE[idx.s0], TABLE[idx.s1]}; \ } \ - _CLC_DEF _CLC_OVERLOAD TYPE##3 TABLE_MANGLE(NAME)(int##3 idx) { \ + _CLC_DEF _CLC_OVERLOAD TYPE##3 __CLC_TABLE_MANGLE(NAME)(int##3 idx) { \ return (TYPE##3){TABLE[idx.s0], TABLE[idx.s1], TABLE[idx.s2]}; \ } \ - _CLC_DEF _CLC_OVERLOAD TYPE##4 TABLE_MANGLE(NAME)(int##4 idx) { \ + _CLC_DEF _CLC_OVERLOAD TYPE##4 __CLC_TABLE_MANGLE(NAME)(int##4 idx) { \ return (TYPE##4){TABLE[idx.s0], TABLE[idx.s1], TABLE[idx.s2], \ TABLE[idx.s3]}; \ } \ - _CLC_DEF _CLC_OVERLOAD TYPE##8 TABLE_MANGLE(NAME)(int##8 idx) { \ + _CLC_DEF _CLC_OVERLOAD TYPE##8 __CLC_TABLE_MANGLE(NAME)(int##8 idx) { \ return (TYPE##8){TABLE[idx.s0], TABLE[idx.s1], TABLE[idx.s2], \ TABLE[idx.s3], TABLE[idx.s4], TABLE[idx.s5], \ TABLE[idx.s6], TABLE[idx.s7]}; \ } \ - _CLC_DEF _CLC_OVERLOAD TYPE##16 TABLE_MANGLE(NAME)(int##16 idx) { \ + _CLC_DEF _CLC_OVERLOAD TYPE##16 __CLC_TABLE_MANGLE(NAME)(int##16 idx) { \ return (TYPE##16){ \ TABLE[idx.s0], TABLE[idx.s1], TABLE[idx.s2], TABLE[idx.s3], \ TABLE[idx.s4], TABLE[idx.s5], TABLE[idx.s6], TABLE[idx.s7], \ @@ -47,58 +48,59 @@ TABLE[idx.sC], TABLE[idx.sD], TABLE[idx.sE], TABLE[idx.sF]}; \ } -#define TABLE_FUNCTION_DECL(TYPE, NAME) TYPE TABLE_MANGLE(NAME)(size_t idx); +#define __CLC_TABLE_FUNCTION_DECL(TYPE, NAME) \ + TYPE __CLC_TABLE_MANGLE(NAME)(size_t idx); -#define CLC_TABLE_FUNCTION_DECL(TYPE, NAME) \ - _CLC_DECL _CLC_OVERLOAD TYPE TABLE_MANGLE(NAME)(int idx); \ - _CLC_DECL _CLC_OVERLOAD TYPE##2 TABLE_MANGLE(NAME)(int##2 idx); \ - _CLC_DECL _CLC_OVERLOAD TYPE##3 TABLE_MANGLE(NAME)(int##3 idx); \ - _CLC_DECL _CLC_OVERLOAD TYPE##4 TABLE_MANGLE(NAME)(int##4 idx); \ - _CLC_DECL _CLC_OVERLOAD TYPE##8 TABLE_MANGLE(NAME)(int##8 idx); \ - _CLC_DECL _CLC_OVERLOAD TYPE##16 TABLE_MANGLE(NAME)(int##16 idx); +#define __CLC_TABLE_FUNCTION_DECL_VEC(TYPE, NAME) \ + _CLC_DECL _CLC_OVERLOAD TYPE __CLC_TABLE_MANGLE(NAME)(int idx); \ + _CLC_DECL _CLC_OVERLOAD TYPE##2 __CLC_TABLE_MANGLE(NAME)(int##2 idx); \ + _CLC_DECL _CLC_OVERLOAD TYPE##3 __CLC_TABLE_MANGLE(NAME)(int##3 idx); \ + _CLC_DECL _CLC_OVERLOAD TYPE##4 __CLC_TABLE_MANGLE(NAME)(int##4 idx); \ + _CLC_DECL _CLC_OVERLOAD TYPE##8 __CLC_TABLE_MANGLE(NAME)(int##8 idx); \ + _CLC_DECL _CLC_OVERLOAD TYPE##16 __CLC_TABLE_MANGLE(NAME)(int##16 idx); -#define USE_TABLE(NAME, IDX) TABLE_MANGLE(NAME)(IDX) +#define __CLC_USE_TABLE(NAME, IDX) __CLC_TABLE_MANGLE(NAME)(IDX) -TABLE_FUNCTION_DECL(float2, log2_tbl); -TABLE_FUNCTION_DECL(float2, log10_tbl); +__CLC_TABLE_FUNCTION_DECL(float2, log2_tbl); +__CLC_TABLE_FUNCTION_DECL(float2, log10_tbl); -CLC_TABLE_FUNCTION_DECL(float, log_inv_tbl_ep_head); -CLC_TABLE_FUNCTION_DECL(float, log_inv_tbl_ep_tail); -CLC_TABLE_FUNCTION_DECL(float, loge_tbl_lo); -CLC_TABLE_FUNCTION_DECL(float, loge_tbl_hi); -CLC_TABLE_FUNCTION_DECL(float, log_inv_tbl); -CLC_TABLE_FUNCTION_DECL(float, exp_tbl); -CLC_TABLE_FUNCTION_DECL(float, exp_tbl_ep_head); -CLC_TABLE_FUNCTION_DECL(float, exp_tbl_ep_tail); -CLC_TABLE_FUNCTION_DECL(float, cbrt_tbl_head); -CLC_TABLE_FUNCTION_DECL(float, cbrt_tbl_tail); -CLC_TABLE_FUNCTION_DECL(float, sinhcosh_tbl_head); -CLC_TABLE_FUNCTION_DECL(float, sinhcosh_tbl_tail); -CLC_TABLE_FUNCTION_DECL(ulong, pibits_tbl); +__CLC_TABLE_FUNCTION_DECL_VEC(float, log_inv_tbl_ep_head); +__CLC_TABLE_FUNCTION_DECL_VEC(float, log_inv_tbl_ep_tail); +__CLC_TABLE_FUNCTION_DECL_VEC(float, loge_tbl_lo); +__CLC_TABLE_FUNCTION_DECL_VEC(float, loge_tbl_hi); +__CLC_TABLE_FUNCTION_DECL_VEC(float, log_inv_tbl); +__CLC_TABLE_FUNCTION_DECL_VEC(float, exp_tbl); +__CLC_TABLE_FUNCTION_DECL_VEC(float, exp_tbl_ep_head); +__CLC_TABLE_FUNCTION_DECL_VEC(float, exp_tbl_ep_tail); +__CLC_TABLE_FUNCTION_DECL_VEC(float, cbrt_tbl_head); +__CLC_TABLE_FUNCTION_DECL_VEC(float, cbrt_tbl_tail); +__CLC_TABLE_FUNCTION_DECL_VEC(float, sinhcosh_tbl_head); +__CLC_TABLE_FUNCTION_DECL_VEC(float, sinhcosh_tbl_tail); +__CLC_TABLE_FUNCTION_DECL_VEC(ulong, pibits_tbl); #ifdef cl_khr_fp64 #pragma OPENCL EXTENSION cl_khr_fp64 : enable -CLC_TABLE_FUNCTION_DECL(double, ln_tbl_lo); -CLC_TABLE_FUNCTION_DECL(double, ln_tbl_hi); -CLC_TABLE_FUNCTION_DECL(double, atan_jby256_tbl_head); -CLC_TABLE_FUNCTION_DECL(double, atan_jby256_tbl_tail); -CLC_TABLE_FUNCTION_DECL(double, two_to_jby64_ep_tbl_head); -CLC_TABLE_FUNCTION_DECL(double, two_to_jby64_ep_tbl_tail); -CLC_TABLE_FUNCTION_DECL(double, sinh_tbl_head); -CLC_TABLE_FUNCTION_DECL(double, sinh_tbl_tail); -CLC_TABLE_FUNCTION_DECL(double, cosh_tbl_head); -CLC_TABLE_FUNCTION_DECL(double, cosh_tbl_tail); -CLC_TABLE_FUNCTION_DECL(double, cbrt_inv_tbl); -CLC_TABLE_FUNCTION_DECL(double, cbrt_dbl_tbl_head); -CLC_TABLE_FUNCTION_DECL(double, cbrt_dbl_tbl_tail); -CLC_TABLE_FUNCTION_DECL(double, cbrt_rem_tbl_head); -CLC_TABLE_FUNCTION_DECL(double, cbrt_rem_tbl_tail); -CLC_TABLE_FUNCTION_DECL(double, powlog_tbl_head); -CLC_TABLE_FUNCTION_DECL(double, powlog_tbl_tail); -CLC_TABLE_FUNCTION_DECL(double, log_f_inv_tbl_head); -CLC_TABLE_FUNCTION_DECL(double, log_f_inv_tbl_tail); +__CLC_TABLE_FUNCTION_DECL_VEC(double, ln_tbl_lo); +__CLC_TABLE_FUNCTION_DECL_VEC(double, ln_tbl_hi); +__CLC_TABLE_FUNCTION_DECL_VEC(double, atan_jby256_tbl_head); +__CLC_TABLE_FUNCTION_DECL_VEC(double, atan_jby256_tbl_tail); +__CLC_TABLE_FUNCTION_DECL_VEC(double, two_to_jby64_ep_tbl_head); +__CLC_TABLE_FUNCTION_DECL_VEC(double, two_to_jby64_ep_tbl_tail); +__CLC_TABLE_FUNCTION_DECL_VEC(double, sinh_tbl_head); +__CLC_TABLE_FUNCTION_DECL_VEC(double, sinh_tbl_tail); +__CLC_TABLE_FUNCTION_DECL_VEC(double, cosh_tbl_head); +__CLC_TABLE_FUNCTION_DECL_VEC(double, cosh_tbl_tail); +__CLC_TABLE_FUNCTION_DECL_VEC(double, cbrt_inv_tbl); +__CLC_TABLE_FUNCTION_DECL_VEC(double, cbrt_dbl_tbl_head); +__CLC_TABLE_FUNCTION_DECL_VEC(double, cbrt_dbl_tbl_tail); +__CLC_TABLE_FUNCTION_DECL_VEC(double, cbrt_rem_tbl_head); +__CLC_TABLE_FUNCTION_DECL_VEC(double, cbrt_rem_tbl_tail); +__CLC_TABLE_FUNCTION_DECL_VEC(double, powlog_tbl_head); +__CLC_TABLE_FUNCTION_DECL_VEC(double, powlog_tbl_tail); +__CLC_TABLE_FUNCTION_DECL_VEC(double, log_f_inv_tbl_head); +__CLC_TABLE_FUNCTION_DECL_VEC(double, log_f_inv_tbl_tail); #endif // cl_khr_fp64 diff --git a/libclc/clc/include/clc/math/unary_decl.inc b/libclc/clc/include/clc/math/unary_decl.inc index 46108c5fac9e..19f1c8a876e5 100644 --- a/libclc/clc/include/clc/math/unary_decl.inc +++ b/libclc/clc/include/clc/math/unary_decl.inc @@ -6,4 +6,5 @@ // //===----------------------------------------------------------------------===// -_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x); +_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE +__CLC_FUNCTION(__CLC_GENTYPE x); diff --git a/libclc/clc/include/clc/math/unary_decl_with_int_ptr.inc b/libclc/clc/include/clc/math/unary_decl_with_int_ptr.inc index d62046a5292c..8bfe17c3c681 100644 --- a/libclc/clc/include/clc/math/unary_decl_with_int_ptr.inc +++ b/libclc/clc/include/clc/math/unary_decl_with_int_ptr.inc @@ -6,13 +6,13 @@ // //===----------------------------------------------------------------------===// -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - global __CLC_INTN *iptr); -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - local __CLC_INTN *iptr); -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - private __CLC_INTN *iptr); +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + global __CLC_INTN *iptr); +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + local __CLC_INTN *iptr); +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + private __CLC_INTN *iptr); #if _CLC_GENERIC_AS_SUPPORTED -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - generic __CLC_INTN *iptr); +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + generic __CLC_INTN *iptr); #endif diff --git a/libclc/clc/include/clc/math/unary_decl_with_int_return.inc b/libclc/clc/include/clc/math/unary_decl_with_int_return.inc index 64fcf4267da3..2e86a310b018 100644 --- a/libclc/clc/include/clc/math/unary_decl_with_int_return.inc +++ b/libclc/clc/include/clc/math/unary_decl_with_int_return.inc @@ -6,4 +6,4 @@ // //===----------------------------------------------------------------------===// -_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_INTN FUNCTION(__CLC_GENTYPE x); +_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_INTN __CLC_FUNCTION(__CLC_GENTYPE x); diff --git a/libclc/clc/include/clc/math/unary_decl_with_ptr.inc b/libclc/clc/include/clc/math/unary_decl_with_ptr.inc index ca0077bec558..63a20e3d21c5 100644 --- a/libclc/clc/include/clc/math/unary_decl_with_ptr.inc +++ b/libclc/clc/include/clc/math/unary_decl_with_ptr.inc @@ -6,14 +6,14 @@ // //===----------------------------------------------------------------------===// -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - global __CLC_GENTYPE *ptr); -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - local __CLC_GENTYPE *ptr); -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - private __CLC_GENTYPE *ptr); +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + global __CLC_GENTYPE *ptr); +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + local __CLC_GENTYPE *ptr); +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE +__CLC_FUNCTION(__CLC_GENTYPE x, private __CLC_GENTYPE *ptr); #if _CLC_GENERIC_AS_SUPPORTED -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - generic __CLC_GENTYPE *ptr); +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE +__CLC_FUNCTION(__CLC_GENTYPE x, generic __CLC_GENTYPE *ptr); #endif diff --git a/libclc/clc/include/clc/math/unary_def_with_int_ptr.inc b/libclc/clc/include/clc/math/unary_def_with_int_ptr.inc index a8ed34ad04bb..db6472ad0e64 100644 --- a/libclc/clc/include/clc/math/unary_def_with_int_ptr.inc +++ b/libclc/clc/include/clc/math/unary_def_with_int_ptr.inc @@ -8,28 +8,28 @@ #include -#ifndef __IMPL_FUNCTION -#define __IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) +#ifndef __CLC_IMPL_FUNCTION +#define __CLC_IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) #endif -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - private __CLC_INTN *iptr) { - return __IMPL_FUNCTION(FUNCTION)(x, iptr); +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + private __CLC_INTN *iptr) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, iptr); } -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - global __CLC_INTN *iptr) { - return __IMPL_FUNCTION(FUNCTION)(x, iptr); +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + global __CLC_INTN *iptr) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, iptr); } -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - local __CLC_INTN *iptr) { - return __IMPL_FUNCTION(FUNCTION)(x, iptr); +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + local __CLC_INTN *iptr) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, iptr); } #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - generic __CLC_INTN *iptr) { - return __IMPL_FUNCTION(FUNCTION)(x, iptr); +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + generic __CLC_INTN *iptr) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, iptr); } #endif diff --git a/libclc/clc/include/clc/math/unary_def_with_int_return.inc b/libclc/clc/include/clc/math/unary_def_with_int_return.inc index c7bb84cf5f7c..7a47aae8ce63 100644 --- a/libclc/clc/include/clc/math/unary_def_with_int_return.inc +++ b/libclc/clc/include/clc/math/unary_def_with_int_return.inc @@ -8,10 +8,10 @@ #include -#ifndef __IMPL_FUNCTION -#define __IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) +#ifndef __CLC_IMPL_FUNCTION +#define __CLC_IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) #endif -_CLC_OVERLOAD _CLC_DEF __CLC_INTN FUNCTION(__CLC_GENTYPE a) { - return __IMPL_FUNCTION(FUNCTION)(a); +_CLC_OVERLOAD _CLC_DEF __CLC_INTN __CLC_FUNCTION(__CLC_GENTYPE a) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(a); } diff --git a/libclc/clc/include/clc/math/unary_def_with_ptr.inc b/libclc/clc/include/clc/math/unary_def_with_ptr.inc index c3faa9aab87c..8a490e1bba16 100644 --- a/libclc/clc/include/clc/math/unary_def_with_ptr.inc +++ b/libclc/clc/include/clc/math/unary_def_with_ptr.inc @@ -8,28 +8,28 @@ #include -#ifndef __IMPL_FUNCTION -#define __IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) +#ifndef __CLC_IMPL_FUNCTION +#define __CLC_IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) #endif -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - private __CLC_GENTYPE *ptr) { - return __IMPL_FUNCTION(FUNCTION)(x, ptr); +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE +__CLC_FUNCTION(__CLC_GENTYPE x, private __CLC_GENTYPE *ptr) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, ptr); } -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - global __CLC_GENTYPE *ptr) { - return __IMPL_FUNCTION(FUNCTION)(x, ptr); +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + global __CLC_GENTYPE *ptr) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, ptr); } -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - local __CLC_GENTYPE *ptr) { - return __IMPL_FUNCTION(FUNCTION)(x, ptr); +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + local __CLC_GENTYPE *ptr) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, ptr); } #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - generic __CLC_GENTYPE *ptr) { - return __IMPL_FUNCTION(FUNCTION)(x, ptr); +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE +__CLC_FUNCTION(__CLC_GENTYPE x, generic __CLC_GENTYPE *ptr) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, ptr); } #endif diff --git a/libclc/clc/include/clc/misc/clc_shuffle.h b/libclc/clc/include/clc/misc/clc_shuffle.h index 1e9ec6828f95..ba3d7a2bddd6 100644 --- a/libclc/clc/include/clc/misc/clc_shuffle.h +++ b/libclc/clc/include/clc/misc/clc_shuffle.h @@ -9,7 +9,7 @@ #ifndef __CLC_MISC_CLC_SHUFFLE_H__ #define __CLC_MISC_CLC_SHUFFLE_H__ -#define FUNCTION __clc_shuffle +#define __CLC_FUNCTION __clc_shuffle // Integer-type decls #define __CLC_BODY @@ -19,6 +19,6 @@ #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MISC_CLC_SHUFFLE_H__ diff --git a/libclc/clc/include/clc/misc/clc_shuffle2.h b/libclc/clc/include/clc/misc/clc_shuffle2.h index fb5361cfeb95..84bafba12b21 100644 --- a/libclc/clc/include/clc/misc/clc_shuffle2.h +++ b/libclc/clc/include/clc/misc/clc_shuffle2.h @@ -9,7 +9,7 @@ #ifndef __CLC_MISC_CLC_SHUFFLE2_H__ #define __CLC_MISC_CLC_SHUFFLE2_H__ -#define FUNCTION __clc_shuffle2 +#define __CLC_FUNCTION __clc_shuffle2 // Integer-type decls #define __CLC_BODY @@ -19,6 +19,6 @@ #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_MISC_CLC_SHUFFLE2_H__ diff --git a/libclc/clc/include/clc/misc/shuffle2_decl.inc b/libclc/clc/include/clc/misc/shuffle2_decl.inc index 3504e7876277..37f83cba9939 100644 --- a/libclc/clc/include/clc/misc/shuffle2_decl.inc +++ b/libclc/clc/include/clc/misc/shuffle2_decl.inc @@ -13,16 +13,16 @@ // size as the mask. Elements in the mask must be the same size (number of bits) // as the input value., e.g. char8 ret = shuffle(char2 x, uchar8 mask); _CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 2) x, - __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 2) y, __CLC_U_GENTYPE mask); +__CLC_FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 2) x, + __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 2) y, __CLC_U_GENTYPE mask); _CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 4) x, - __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 4) y, __CLC_U_GENTYPE mask); +__CLC_FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 4) x, + __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 4) y, __CLC_U_GENTYPE mask); _CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 8) x, - __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 8) y, __CLC_U_GENTYPE mask); +__CLC_FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 8) x, + __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 8) y, __CLC_U_GENTYPE mask); _CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 16) x, - __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 16) y, __CLC_U_GENTYPE mask); +__CLC_FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 16) x, + __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 16) y, __CLC_U_GENTYPE mask); #endif diff --git a/libclc/clc/include/clc/misc/shuffle2_def.inc b/libclc/clc/include/clc/misc/shuffle2_def.inc index 0415b8c18729..f25d281af116 100644 --- a/libclc/clc/include/clc/misc/shuffle2_def.inc +++ b/libclc/clc/include/clc/misc/shuffle2_def.inc @@ -11,32 +11,32 @@ #include -#ifndef __IMPL_FUNCTION -#define __IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) +#ifndef __CLC_IMPL_FUNCTION +#define __CLC_IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) #endif // The return type is same base type as the input type, with the same vector // size as the mask. Elements in the mask must be the same size (number of bits) // as the input value., e.g. char8 ret = shuffle(char2 x, uchar8 mask); _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 2) x, - __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 2) y, __CLC_U_GENTYPE mask) { - return __IMPL_FUNCTION(FUNCTION)(x, y, mask); +__CLC_FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 2) x, + __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 2) y, __CLC_U_GENTYPE mask) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, y, mask); } _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 4) x, - __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 4) y, __CLC_U_GENTYPE mask) { - return __IMPL_FUNCTION(FUNCTION)(x, y, mask); +__CLC_FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 4) x, + __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 4) y, __CLC_U_GENTYPE mask) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, y, mask); } _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 8) x, - __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 8) y, __CLC_U_GENTYPE mask) { - return __IMPL_FUNCTION(FUNCTION)(x, y, mask); +__CLC_FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 8) x, + __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 8) y, __CLC_U_GENTYPE mask) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, y, mask); } -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 16) x, - __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 16) y, __CLC_U_GENTYPE mask) { - return __IMPL_FUNCTION(FUNCTION)(x, y, mask); +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION( + __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 16) x, + __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 16) y, __CLC_U_GENTYPE mask) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, y, mask); } #endif diff --git a/libclc/clc/include/clc/misc/shuffle_decl.inc b/libclc/clc/include/clc/misc/shuffle_decl.inc index 1445aaf74052..0056d12f0f42 100644 --- a/libclc/clc/include/clc/misc/shuffle_decl.inc +++ b/libclc/clc/include/clc/misc/shuffle_decl.inc @@ -13,12 +13,12 @@ // size as the mask. Elements in the mask must be the same size (number of bits) // as the input value., e.g. char8 ret = shuffle(char2 x, uchar8 mask); _CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 2) x, __CLC_U_GENTYPE mask); +__CLC_FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 2) x, __CLC_U_GENTYPE mask); _CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 4) x, __CLC_U_GENTYPE mask); +__CLC_FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 4) x, __CLC_U_GENTYPE mask); _CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 8) x, __CLC_U_GENTYPE mask); +__CLC_FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 8) x, __CLC_U_GENTYPE mask); _CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 16) x, __CLC_U_GENTYPE mask); +__CLC_FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 16) x, __CLC_U_GENTYPE mask); #endif diff --git a/libclc/clc/include/clc/misc/shuffle_def.inc b/libclc/clc/include/clc/misc/shuffle_def.inc index d2a088498fc6..49a47daf821f 100644 --- a/libclc/clc/include/clc/misc/shuffle_def.inc +++ b/libclc/clc/include/clc/misc/shuffle_def.inc @@ -11,28 +11,28 @@ #include -#ifndef __IMPL_FUNCTION -#define __IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) +#ifndef __CLC_IMPL_FUNCTION +#define __CLC_IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) #endif // The return type is same base type as the input type, with the same vector // size as the mask. Elements in the mask must be the same size (number of bits) // as the input value., e.g. char8 ret = shuffle(char2 x, uchar8 mask); _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 2) x, __CLC_U_GENTYPE mask) { - return __IMPL_FUNCTION(FUNCTION)(x, mask); +__CLC_FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 2) x, __CLC_U_GENTYPE mask) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, mask); } _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 4) x, __CLC_U_GENTYPE mask) { - return __IMPL_FUNCTION(FUNCTION)(x, mask); +__CLC_FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 4) x, __CLC_U_GENTYPE mask) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, mask); } _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 8) x, __CLC_U_GENTYPE mask) { - return __IMPL_FUNCTION(FUNCTION)(x, mask); +__CLC_FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 8) x, __CLC_U_GENTYPE mask) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, mask); } -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE -FUNCTION(__CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 16) x, __CLC_U_GENTYPE mask) { - return __IMPL_FUNCTION(FUNCTION)(x, mask); +_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION( + __CLC_XCONCAT(__CLC_SCALAR_GENTYPE, 16) x, __CLC_U_GENTYPE mask) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, mask); } #endif diff --git a/libclc/clc/include/clc/relational/binary_decl.inc b/libclc/clc/include/clc/relational/binary_decl.inc index 87cbc8c37cdf..34749559c7e0 100644 --- a/libclc/clc/include/clc/relational/binary_decl.inc +++ b/libclc/clc/include/clc/relational/binary_decl.inc @@ -7,12 +7,12 @@ //===----------------------------------------------------------------------===// #if __CLC_VECSIZE_OR_1 == 1 -#define __RETTYPE __CLC_INTN +#define __CLC_RETTYPE __CLC_INTN #else -#define __RETTYPE __CLC_BIT_INTN +#define __CLC_RETTYPE __CLC_BIT_INTN #endif -_CLC_OVERLOAD _CLC_CONST _CLC_DECL __RETTYPE FUNCTION(__CLC_GENTYPE a, - __CLC_GENTYPE b); +_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_RETTYPE +__CLC_FUNCTION(__CLC_GENTYPE a, __CLC_GENTYPE b); -#undef __RETTYPE +#undef __CLC_RETTYPE diff --git a/libclc/clc/include/clc/relational/clc_isfinite.h b/libclc/clc/include/clc/relational/clc_isfinite.h index 444d73303981..596b81f51b85 100644 --- a/libclc/clc/include/clc/relational/clc_isfinite.h +++ b/libclc/clc/include/clc/relational/clc_isfinite.h @@ -9,11 +9,11 @@ #ifndef __CLC_RELATIONAL_CLC_ISFINITE_H__ #define __CLC_RELATIONAL_CLC_ISFINITE_H__ -#define FUNCTION __clc_isfinite +#define __CLC_FUNCTION __clc_isfinite #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_RELATIONAL_CLC_ISFINITE_H__ diff --git a/libclc/clc/include/clc/relational/clc_isgreater.h b/libclc/clc/include/clc/relational/clc_isgreater.h index 88de46854961..fc5b3cdad084 100644 --- a/libclc/clc/include/clc/relational/clc_isgreater.h +++ b/libclc/clc/include/clc/relational/clc_isgreater.h @@ -9,11 +9,11 @@ #ifndef __CLC_RELATIONAL_CLC_ISGREATER_H__ #define __CLC_RELATIONAL_CLC_ISGREATER_H__ -#define FUNCTION __clc_isgreater +#define __CLC_FUNCTION __clc_isgreater #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_RELATIONAL_CLC_ISGREATER_H__ diff --git a/libclc/clc/include/clc/relational/clc_isgreaterequal.h b/libclc/clc/include/clc/relational/clc_isgreaterequal.h index 42308036f102..6209a066cf46 100644 --- a/libclc/clc/include/clc/relational/clc_isgreaterequal.h +++ b/libclc/clc/include/clc/relational/clc_isgreaterequal.h @@ -9,11 +9,11 @@ #ifndef __CLC_RELATIONAL_CLC_ISGREATEREQUAL_H__ #define __CLC_RELATIONAL_CLC_ISGREATEREQUAL_H__ -#define FUNCTION __clc_isgreaterequal +#define __CLC_FUNCTION __clc_isgreaterequal #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_RELATIONAL_CLC_ISGREATEREQUAL_H__ diff --git a/libclc/clc/include/clc/relational/clc_isless.h b/libclc/clc/include/clc/relational/clc_isless.h index 6fdc6c54947c..4e340db12177 100644 --- a/libclc/clc/include/clc/relational/clc_isless.h +++ b/libclc/clc/include/clc/relational/clc_isless.h @@ -9,11 +9,11 @@ #ifndef __CLC_RELATIONAL_CLC_ISLESS_H__ #define __CLC_RELATIONAL_CLC_ISLESS_H__ -#define FUNCTION __clc_isless +#define __CLC_FUNCTION __clc_isless #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_RELATIONAL_CLC_ISLESS_H__ diff --git a/libclc/clc/include/clc/relational/clc_islessequal.h b/libclc/clc/include/clc/relational/clc_islessequal.h index e592287b2309..14c5a1030183 100644 --- a/libclc/clc/include/clc/relational/clc_islessequal.h +++ b/libclc/clc/include/clc/relational/clc_islessequal.h @@ -9,11 +9,11 @@ #ifndef __CLC_RELATIONAL_CLC_ISLESSEQUAL_H__ #define __CLC_RELATIONAL_CLC_ISLESSEQUAL_H__ -#define FUNCTION __clc_islessequal +#define __CLC_FUNCTION __clc_islessequal #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_RELATIONAL_CLC_ISLESSEQUAL_H__ diff --git a/libclc/clc/include/clc/relational/clc_islessgreater.h b/libclc/clc/include/clc/relational/clc_islessgreater.h index a2f10707a677..530564bbf059 100644 --- a/libclc/clc/include/clc/relational/clc_islessgreater.h +++ b/libclc/clc/include/clc/relational/clc_islessgreater.h @@ -9,11 +9,11 @@ #ifndef __CLC_RELATIONAL_CLC_ISLESSGREATER_H__ #define __CLC_RELATIONAL_CLC_ISLESSGREATER_H__ -#define FUNCTION __clc_islessgreater +#define __CLC_FUNCTION __clc_islessgreater #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_RELATIONAL_CLC_ISLESSGREATER_H__ diff --git a/libclc/clc/include/clc/relational/clc_isnormal.h b/libclc/clc/include/clc/relational/clc_isnormal.h index 2281bc4245d0..9572b0200468 100644 --- a/libclc/clc/include/clc/relational/clc_isnormal.h +++ b/libclc/clc/include/clc/relational/clc_isnormal.h @@ -9,11 +9,11 @@ #ifndef __CLC_RELATIONAL_CLC_ISNORMAL_H__ #define __CLC_RELATIONAL_CLC_ISNORMAL_H__ -#define FUNCTION __clc_isnormal +#define __CLC_FUNCTION __clc_isnormal #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_RELATIONAL_CLC_ISNORMAL_H__ diff --git a/libclc/clc/include/clc/relational/clc_isnotequal.h b/libclc/clc/include/clc/relational/clc_isnotequal.h index c2640fc0899a..f90622db9fe1 100644 --- a/libclc/clc/include/clc/relational/clc_isnotequal.h +++ b/libclc/clc/include/clc/relational/clc_isnotequal.h @@ -9,11 +9,11 @@ #ifndef __CLC_RELATIONAL_CLC_ISNOTEQUAL_H__ #define __CLC_RELATIONAL_CLC_ISNOTEQUAL_H__ -#define FUNCTION __clc_isnotequal +#define __CLC_FUNCTION __clc_isnotequal #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_RELATIONAL_CLC_ISNOTEQUAL_H__ diff --git a/libclc/clc/include/clc/relational/clc_isordered.h b/libclc/clc/include/clc/relational/clc_isordered.h index cb9be3131157..3f5cc097f4a7 100644 --- a/libclc/clc/include/clc/relational/clc_isordered.h +++ b/libclc/clc/include/clc/relational/clc_isordered.h @@ -9,11 +9,11 @@ #ifndef __CLC_RELATIONAL_CLC_ISORDERED_H__ #define __CLC_RELATIONAL_CLC_ISORDERED_H__ -#define FUNCTION __clc_isordered +#define __CLC_FUNCTION __clc_isordered #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_RELATIONAL_CLC_ISORDERED_H__ diff --git a/libclc/clc/include/clc/relational/clc_isunordered.h b/libclc/clc/include/clc/relational/clc_isunordered.h index 36d314ff0e1b..6134ba849d22 100644 --- a/libclc/clc/include/clc/relational/clc_isunordered.h +++ b/libclc/clc/include/clc/relational/clc_isunordered.h @@ -9,11 +9,11 @@ #ifndef __CLC_RELATIONAL_CLC_ISUNORDERED_H__ #define __CLC_RELATIONAL_CLC_ISUNORDERED_H__ -#define FUNCTION __clc_isunordered +#define __CLC_FUNCTION __clc_isunordered #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_RELATIONAL_CLC_ISUNORDERED_H__ diff --git a/libclc/clc/include/clc/relational/clc_signbit.h b/libclc/clc/include/clc/relational/clc_signbit.h index 9e423ab44895..a8e04ce494f2 100644 --- a/libclc/clc/include/clc/relational/clc_signbit.h +++ b/libclc/clc/include/clc/relational/clc_signbit.h @@ -9,11 +9,11 @@ #ifndef __CLC_RELATIONAL_CLC_SIGNBIT_H__ #define __CLC_RELATIONAL_CLC_SIGNBIT_H__ -#define FUNCTION __clc_signbit +#define __CLC_FUNCTION __clc_signbit #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_RELATIONAL_CLC_SIGNBIT_H__ diff --git a/libclc/clc/include/clc/relational/relational.h b/libclc/clc/include/clc/relational/relational.h index e2b577019a50..fa2223234994 100644 --- a/libclc/clc/include/clc/relational/relational.h +++ b/libclc/clc/include/clc/relational/relational.h @@ -14,29 +14,29 @@ * when the result is true. */ -#define _CLC_DEFINE_SIMPLE_RELATIONAL_BINARY(RET_TYPE, RET_TYPE_VEC, FUNCTION, \ - ARG1_TYPE, ARG2_TYPE) \ - _CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG1_TYPE x, ARG2_TYPE y) { \ +#define _CLC_DEFINE_SIMPLE_RELATIONAL_BINARY( \ + RET_TYPE, RET_TYPE_VEC, __CLC_FUNCTION, ARG1_TYPE, ARG2_TYPE) \ + _CLC_DEF _CLC_OVERLOAD RET_TYPE __CLC_FUNCTION(ARG1_TYPE x, ARG2_TYPE y) { \ return _CLC_RELATIONAL_OP(x, y); \ } \ - _CLC_DEF _CLC_OVERLOAD RET_TYPE_VEC##2 FUNCTION(ARG1_TYPE##2 x, \ - ARG2_TYPE##2 y) { \ + _CLC_DEF _CLC_OVERLOAD RET_TYPE_VEC##2 __CLC_FUNCTION(ARG1_TYPE##2 x, \ + ARG2_TYPE##2 y) { \ return _CLC_RELATIONAL_OP(x, y); \ } \ - _CLC_DEF _CLC_OVERLOAD RET_TYPE_VEC##3 FUNCTION(ARG1_TYPE##3 x, \ - ARG2_TYPE##3 y) { \ + _CLC_DEF _CLC_OVERLOAD RET_TYPE_VEC##3 __CLC_FUNCTION(ARG1_TYPE##3 x, \ + ARG2_TYPE##3 y) { \ return _CLC_RELATIONAL_OP(x, y); \ } \ - _CLC_DEF _CLC_OVERLOAD RET_TYPE_VEC##4 FUNCTION(ARG1_TYPE##4 x, \ - ARG2_TYPE##4 y) { \ + _CLC_DEF _CLC_OVERLOAD RET_TYPE_VEC##4 __CLC_FUNCTION(ARG1_TYPE##4 x, \ + ARG2_TYPE##4 y) { \ return _CLC_RELATIONAL_OP(x, y); \ } \ - _CLC_DEF _CLC_OVERLOAD RET_TYPE_VEC##8 FUNCTION(ARG1_TYPE##8 x, \ - ARG2_TYPE##8 y) { \ + _CLC_DEF _CLC_OVERLOAD RET_TYPE_VEC##8 __CLC_FUNCTION(ARG1_TYPE##8 x, \ + ARG2_TYPE##8 y) { \ return _CLC_RELATIONAL_OP(x, y); \ } \ - _CLC_DEF _CLC_OVERLOAD RET_TYPE_VEC##16 FUNCTION(ARG1_TYPE##16 x, \ - ARG2_TYPE##16 y) { \ + _CLC_DEF _CLC_OVERLOAD RET_TYPE_VEC##16 __CLC_FUNCTION(ARG1_TYPE##16 x, \ + ARG2_TYPE##16 y) { \ return _CLC_RELATIONAL_OP(x, y); \ } @@ -49,20 +49,25 @@ (__FPCLASS_NEGNORMAL | __FPCLASS_NEGSUBNORMAL | __FPCLASS_NEGZERO) #define fcFinite (fcPosFinite | fcNegFinite) -#define _CLC_DEFINE_ISFPCLASS_VEC(RET_TYPE, FUNCTION, MASK, ARG_TYPE) \ - _CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \ +#define _CLC_DEFINE_ISFPCLASS_VEC(RET_TYPE, __CLC_FUNCTION, MASK, ARG_TYPE) \ + _CLC_DEF _CLC_OVERLOAD RET_TYPE __CLC_FUNCTION(ARG_TYPE x) { \ return (RET_TYPE)(__builtin_isfpclass(x, (MASK)) != (RET_TYPE)0); \ } -#define _CLC_DEFINE_ISFPCLASS(RET_TYPE, VEC_RET_TYPE, FUNCTION, MASK, \ +#define _CLC_DEFINE_ISFPCLASS(RET_TYPE, VEC_RET_TYPE, __CLC_FUNCTION, MASK, \ ARG_TYPE) \ - _CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \ + _CLC_DEF _CLC_OVERLOAD RET_TYPE __CLC_FUNCTION(ARG_TYPE x) { \ return __builtin_isfpclass(x, (MASK)); \ } \ - _CLC_DEFINE_ISFPCLASS_VEC(VEC_RET_TYPE##2, FUNCTION, MASK, ARG_TYPE##2) \ - _CLC_DEFINE_ISFPCLASS_VEC(VEC_RET_TYPE##3, FUNCTION, MASK, ARG_TYPE##3) \ - _CLC_DEFINE_ISFPCLASS_VEC(VEC_RET_TYPE##4, FUNCTION, MASK, ARG_TYPE##4) \ - _CLC_DEFINE_ISFPCLASS_VEC(VEC_RET_TYPE##8, FUNCTION, MASK, ARG_TYPE##8) \ - _CLC_DEFINE_ISFPCLASS_VEC(VEC_RET_TYPE##16, FUNCTION, MASK, ARG_TYPE##16) + _CLC_DEFINE_ISFPCLASS_VEC(VEC_RET_TYPE##2, __CLC_FUNCTION, MASK, \ + ARG_TYPE##2) \ + _CLC_DEFINE_ISFPCLASS_VEC(VEC_RET_TYPE##3, __CLC_FUNCTION, MASK, \ + ARG_TYPE##3) \ + _CLC_DEFINE_ISFPCLASS_VEC(VEC_RET_TYPE##4, __CLC_FUNCTION, MASK, \ + ARG_TYPE##4) \ + _CLC_DEFINE_ISFPCLASS_VEC(VEC_RET_TYPE##8, __CLC_FUNCTION, MASK, \ + ARG_TYPE##8) \ + _CLC_DEFINE_ISFPCLASS_VEC(VEC_RET_TYPE##16, __CLC_FUNCTION, MASK, \ + ARG_TYPE##16) #endif // __CLC_RELATIONAL_RELATIONAL_H__ diff --git a/libclc/clc/include/clc/relational/unary_decl.inc b/libclc/clc/include/clc/relational/unary_decl.inc index f8123eee316c..df7419404025 100644 --- a/libclc/clc/include/clc/relational/unary_decl.inc +++ b/libclc/clc/include/clc/relational/unary_decl.inc @@ -7,11 +7,12 @@ //===----------------------------------------------------------------------===// #if __CLC_VECSIZE_OR_1 == 1 -#define __RETTYPE __CLC_INTN +#define __CLC_RETTYPE __CLC_INTN #else -#define __RETTYPE __CLC_BIT_INTN +#define __CLC_RETTYPE __CLC_BIT_INTN #endif -_CLC_OVERLOAD _CLC_CONST _CLC_DECL __RETTYPE FUNCTION(__CLC_GENTYPE x); +_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_RETTYPE +__CLC_FUNCTION(__CLC_GENTYPE x); -#undef __RETTYPE +#undef __CLC_RETTYPE diff --git a/libclc/clc/include/clc/shared/binary_decl.inc b/libclc/clc/include/clc/shared/binary_decl.inc index c6e2b2a5b060..f7f49519f6fc 100644 --- a/libclc/clc/include/clc/shared/binary_decl.inc +++ b/libclc/clc/include/clc/shared/binary_decl.inc @@ -6,5 +6,5 @@ // //===----------------------------------------------------------------------===// -_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - __CLC_GENTYPE y); +_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE +__CLC_FUNCTION(__CLC_GENTYPE x, __CLC_GENTYPE y); diff --git a/libclc/clc/include/clc/shared/binary_decl_with_int_second_arg.inc b/libclc/clc/include/clc/shared/binary_decl_with_int_second_arg.inc index a091eb8e8d1d..25cf52c84811 100644 --- a/libclc/clc/include/clc/shared/binary_decl_with_int_second_arg.inc +++ b/libclc/clc/include/clc/shared/binary_decl_with_int_second_arg.inc @@ -8,5 +8,5 @@ #include -_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, - __CLC_INTN y); +_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + __CLC_INTN y); diff --git a/libclc/clc/include/clc/shared/binary_def.inc b/libclc/clc/include/clc/shared/binary_def.inc index 9ab5a7c5a79e..5487ad926768 100644 --- a/libclc/clc/include/clc/shared/binary_def.inc +++ b/libclc/clc/include/clc/shared/binary_def.inc @@ -8,11 +8,11 @@ #include -#ifndef __IMPL_FUNCTION -#define __IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) +#ifndef __CLC_IMPL_FUNCTION +#define __CLC_IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) #endif -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE a, - __CLC_GENTYPE b) { - return __IMPL_FUNCTION(FUNCTION)(a, b); +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE a, + __CLC_GENTYPE b) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(a, b); } diff --git a/libclc/clc/include/clc/shared/binary_def_scalarize.inc b/libclc/clc/include/clc/shared/binary_def_scalarize.inc index 53d4d3fa23b1..2505f2ee0da2 100644 --- a/libclc/clc/include/clc/shared/binary_def_scalarize.inc +++ b/libclc/clc/include/clc/shared/binary_def_scalarize.inc @@ -14,8 +14,8 @@ #define __CLC_MIN_VECSIZE 2 #endif -#ifndef __IMPL_FUNCTION -#define __IMPL_FUNCTION FUNCTION +#ifndef __CLC_IMPL_FUNCTION +#define __CLC_IMPL_FUNCTION __CLC_FUNCTION #endif #ifndef __CLC_DEF_SPEC @@ -35,9 +35,9 @@ #endif #if __CLC_MIN_VECSIZE == 1 -_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE FUNCTION(__CLC_ARG1_TYPE x, - __CLC_ARG2_TYPE y) { - return __IMPL_FUNCTION(x, y); +_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE __CLC_FUNCTION(__CLC_ARG1_TYPE x, + __CLC_ARG2_TYPE y) { + return __CLC_IMPL_FUNCTION(x, y); } #endif // __CLC_MIN_VECSIZE == 1 @@ -45,10 +45,10 @@ _CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE FUNCTION(__CLC_ARG1_TYPE x, #define __CLC_RET_TYPE2 __CLC_XCONCAT(__CLC_RET_TYPE, 2) #define __CLC_ARG1_TYPE2 __CLC_XCONCAT(__CLC_ARG1_TYPE, 2) #define __CLC_ARG2_TYPE2 __CLC_XCONCAT(__CLC_ARG2_TYPE, 2) -_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE2 FUNCTION(__CLC_ARG1_TYPE2 x, - __CLC_ARG2_TYPE2 y) { - return (__CLC_RET_TYPE2)(__IMPL_FUNCTION(x.s0, y.s0), - __IMPL_FUNCTION(x.s1, y.s1)); +_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE2 +__CLC_FUNCTION(__CLC_ARG1_TYPE2 x, __CLC_ARG2_TYPE2 y) { + return (__CLC_RET_TYPE2)(__CLC_IMPL_FUNCTION(x.s0, y.s0), + __CLC_IMPL_FUNCTION(x.s1, y.s1)); } #undef __CLC_RET_TYPE2 #undef __CLC_ARG1_TYPE2 @@ -62,11 +62,11 @@ _CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE2 FUNCTION(__CLC_ARG1_TYPE2 x, #define __CLC_RET_TYPE3 __CLC_XCONCAT(__CLC_RET_TYPE, 3) #define __CLC_ARG1_TYPE3 __CLC_XCONCAT(__CLC_ARG1_TYPE, 3) #define __CLC_ARG2_TYPE3 __CLC_XCONCAT(__CLC_ARG2_TYPE, 3) -_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE3 FUNCTION(__CLC_ARG1_TYPE3 x, - __CLC_ARG2_TYPE3 y) { - return (__CLC_RET_TYPE3)(__IMPL_FUNCTION(x.s0, y.s0), - __IMPL_FUNCTION(x.s1, y.s1), - __IMPL_FUNCTION(x.s2, y.s2)); +_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE3 +__CLC_FUNCTION(__CLC_ARG1_TYPE3 x, __CLC_ARG2_TYPE3 y) { + return (__CLC_RET_TYPE3)(__CLC_IMPL_FUNCTION(x.s0, y.s0), + __CLC_IMPL_FUNCTION(x.s1, y.s1), + __CLC_IMPL_FUNCTION(x.s2, y.s2)); } #undef __CLC_RET_TYPE3 #undef __CLC_ARG1_TYPE3 @@ -75,12 +75,12 @@ _CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE3 FUNCTION(__CLC_ARG1_TYPE3 x, #define __CLC_RET_TYPE4 __CLC_XCONCAT(__CLC_RET_TYPE, 4) #define __CLC_ARG1_TYPE4 __CLC_XCONCAT(__CLC_ARG1_TYPE, 4) #define __CLC_ARG2_TYPE4 __CLC_XCONCAT(__CLC_ARG2_TYPE, 4) -_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE4 FUNCTION(__CLC_ARG1_TYPE4 x, - __CLC_ARG2_TYPE4 y) { - return (__CLC_RET_TYPE4)(__IMPL_FUNCTION(x.s0, y.s0), - __IMPL_FUNCTION(x.s1, y.s1), - __IMPL_FUNCTION(x.s2, y.s2), - __IMPL_FUNCTION(x.s3, y.s3)); +_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE4 +__CLC_FUNCTION(__CLC_ARG1_TYPE4 x, __CLC_ARG2_TYPE4 y) { + return (__CLC_RET_TYPE4)(__CLC_IMPL_FUNCTION(x.s0, y.s0), + __CLC_IMPL_FUNCTION(x.s1, y.s1), + __CLC_IMPL_FUNCTION(x.s2, y.s2), + __CLC_IMPL_FUNCTION(x.s3, y.s3)); } #undef __CLC_RET_TYPE4 #undef __CLC_ARG1_TYPE4 @@ -89,14 +89,16 @@ _CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE4 FUNCTION(__CLC_ARG1_TYPE4 x, #define __CLC_RET_TYPE8 __CLC_XCONCAT(__CLC_RET_TYPE, 8) #define __CLC_ARG1_TYPE8 __CLC_XCONCAT(__CLC_ARG1_TYPE, 8) #define __CLC_ARG2_TYPE8 __CLC_XCONCAT(__CLC_ARG2_TYPE, 8) -_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE8 FUNCTION(__CLC_ARG1_TYPE8 x, - __CLC_ARG2_TYPE8 y) { - return ( - __CLC_RET_TYPE8)(__IMPL_FUNCTION(x.s0, y.s0), __IMPL_FUNCTION(x.s1, y.s1), - __IMPL_FUNCTION(x.s2, y.s2), __IMPL_FUNCTION(x.s3, y.s3), - __IMPL_FUNCTION(x.s4, y.s4), __IMPL_FUNCTION(x.s5, y.s5), - __IMPL_FUNCTION(x.s6, y.s6), - __IMPL_FUNCTION(x.s7, y.s7)); +_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE8 +__CLC_FUNCTION(__CLC_ARG1_TYPE8 x, __CLC_ARG2_TYPE8 y) { + return (__CLC_RET_TYPE8)(__CLC_IMPL_FUNCTION(x.s0, y.s0), + __CLC_IMPL_FUNCTION(x.s1, y.s1), + __CLC_IMPL_FUNCTION(x.s2, y.s2), + __CLC_IMPL_FUNCTION(x.s3, y.s3), + __CLC_IMPL_FUNCTION(x.s4, y.s4), + __CLC_IMPL_FUNCTION(x.s5, y.s5), + __CLC_IMPL_FUNCTION(x.s6, y.s6), + __CLC_IMPL_FUNCTION(x.s7, y.s7)); } #undef __CLC_RET_TYPE8 #undef __CLC_ARG1_TYPE8 @@ -105,24 +107,24 @@ _CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE8 FUNCTION(__CLC_ARG1_TYPE8 x, #define __CLC_RET_TYPE16 __CLC_XCONCAT(__CLC_RET_TYPE, 16) #define __CLC_ARG1_TYPE16 __CLC_XCONCAT(__CLC_ARG1_TYPE, 16) #define __CLC_ARG2_TYPE16 __CLC_XCONCAT(__CLC_ARG2_TYPE, 16) -_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE16 FUNCTION(__CLC_ARG1_TYPE16 x, - __CLC_ARG2_TYPE16 y) { - return (__CLC_RET_TYPE16)(__IMPL_FUNCTION(x.s0, y.s0), - __IMPL_FUNCTION(x.s1, y.s1), - __IMPL_FUNCTION(x.s2, y.s2), - __IMPL_FUNCTION(x.s3, y.s3), - __IMPL_FUNCTION(x.s4, y.s4), - __IMPL_FUNCTION(x.s5, y.s5), - __IMPL_FUNCTION(x.s6, y.s6), - __IMPL_FUNCTION(x.s7, y.s7), - __IMPL_FUNCTION(x.s8, y.s8), - __IMPL_FUNCTION(x.s9, y.s9), - __IMPL_FUNCTION(x.sa, y.sa), - __IMPL_FUNCTION(x.sb, y.sb), - __IMPL_FUNCTION(x.sc, y.sc), - __IMPL_FUNCTION(x.sd, y.sd), - __IMPL_FUNCTION(x.se, y.se), - __IMPL_FUNCTION(x.sf, y.sf)); +_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE16 +__CLC_FUNCTION(__CLC_ARG1_TYPE16 x, __CLC_ARG2_TYPE16 y) { + return (__CLC_RET_TYPE16)(__CLC_IMPL_FUNCTION(x.s0, y.s0), + __CLC_IMPL_FUNCTION(x.s1, y.s1), + __CLC_IMPL_FUNCTION(x.s2, y.s2), + __CLC_IMPL_FUNCTION(x.s3, y.s3), + __CLC_IMPL_FUNCTION(x.s4, y.s4), + __CLC_IMPL_FUNCTION(x.s5, y.s5), + __CLC_IMPL_FUNCTION(x.s6, y.s6), + __CLC_IMPL_FUNCTION(x.s7, y.s7), + __CLC_IMPL_FUNCTION(x.s8, y.s8), + __CLC_IMPL_FUNCTION(x.s9, y.s9), + __CLC_IMPL_FUNCTION(x.sa, y.sa), + __CLC_IMPL_FUNCTION(x.sb, y.sb), + __CLC_IMPL_FUNCTION(x.sc, y.sc), + __CLC_IMPL_FUNCTION(x.sd, y.sd), + __CLC_IMPL_FUNCTION(x.se, y.se), + __CLC_IMPL_FUNCTION(x.sf, y.sf)); } #undef __CLC_RET_TYPE16 #undef __CLC_ARG1_TYPE16 diff --git a/libclc/clc/include/clc/shared/binary_def_with_int_second_arg.inc b/libclc/clc/include/clc/shared/binary_def_with_int_second_arg.inc index 262b6b21cc64..2c32754044db 100644 --- a/libclc/clc/include/clc/shared/binary_def_with_int_second_arg.inc +++ b/libclc/clc/include/clc/shared/binary_def_with_int_second_arg.inc @@ -8,10 +8,11 @@ #include -#ifndef __IMPL_FUNCTION -#define __IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) +#ifndef __CLC_IMPL_FUNCTION +#define __CLC_IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) #endif -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, __CLC_INTN y) { - return __IMPL_FUNCTION(FUNCTION)(x, y); +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, + __CLC_INTN y) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(x, y); } diff --git a/libclc/clc/include/clc/shared/binary_def_with_scalar_second_arg.inc b/libclc/clc/include/clc/shared/binary_def_with_scalar_second_arg.inc index 103f775ab87e..7a6283d7190d 100644 --- a/libclc/clc/include/clc/shared/binary_def_with_scalar_second_arg.inc +++ b/libclc/clc/include/clc/shared/binary_def_with_scalar_second_arg.inc @@ -8,18 +8,18 @@ #include -#ifndef __IMPL_FUNCTION -#define __IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) +#ifndef __CLC_IMPL_FUNCTION +#define __CLC_IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) #endif -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE a, - __CLC_GENTYPE b) { - return __IMPL_FUNCTION(FUNCTION)(a, b); +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE a, + __CLC_GENTYPE b) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(a, b); } #ifndef __CLC_SCALAR -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE a, - __CLC_SCALAR_GENTYPE b) { - return __IMPL_FUNCTION(FUNCTION)(a, (__CLC_GENTYPE)b); +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE a, + __CLC_SCALAR_GENTYPE b) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(a, (__CLC_GENTYPE)b); } #endif diff --git a/libclc/clc/include/clc/shared/clc_vload.inc b/libclc/clc/include/clc/shared/clc_vload.inc index 8f3b00ec0445..70bca250e413 100644 --- a/libclc/clc/include/clc/shared/clc_vload.inc +++ b/libclc/clc/include/clc/shared/clc_vload.inc @@ -6,29 +6,29 @@ // //===----------------------------------------------------------------------===// -#define CLC_VLOAD_NAME __CLC_XCONCAT(__clc_vload, __CLC_VECSIZE) -#define CLC_VLOAD_HALF_NAME __CLC_XCONCAT(__clc_vload_half, __CLC_VECSIZE) -#define CLC_VLOADA_HALF_NAME __CLC_XCONCAT(__clc_vloada_half, __CLC_VECSIZE) +#define __CLC_VLOAD_NAME __CLC_XCONCAT(__clc_vload, __CLC_VECSIZE) +#define __CLC_VLOAD_HALF_NAME __CLC_XCONCAT(__clc_vload_half, __CLC_VECSIZE) +#define __CLC_VLOADA_HALF_NAME __CLC_XCONCAT(__clc_vloada_half, __CLC_VECSIZE) #ifndef __CLC_SCALAR -#define CLC_VLOAD_TY __CLC_XCONCAT(less_aligned_, __CLC_GENTYPE) +#define __CLC_VLOAD_TY __CLC_XCONCAT(less_aligned_, __CLC_GENTYPE) -#define CLC_VLOAD_DECL(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DECL CLC_VLOAD_TY CLC_VLOAD_NAME( \ +#define __CLC_VLOAD_DECL(ADDRSPACE) \ + _CLC_OVERLOAD _CLC_DECL __CLC_VLOAD_TY __CLC_VLOAD_NAME( \ size_t offset, const ADDRSPACE __CLC_SCALAR_GENTYPE *x); -CLC_VLOAD_DECL(__private) -CLC_VLOAD_DECL(__local) -CLC_VLOAD_DECL(__constant) -CLC_VLOAD_DECL(__global) +__CLC_VLOAD_DECL(__private) +__CLC_VLOAD_DECL(__local) +__CLC_VLOAD_DECL(__constant) +__CLC_VLOAD_DECL(__global) #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -CLC_VLOAD_DECL(__generic) +__CLC_VLOAD_DECL(__generic) #endif -#undef CLC_VLOAD_DECL -#undef CLC_VLOAD_TY +#undef __CLC_VLOAD_DECL +#undef __CLC_VLOAD_TY #endif // __CLC_SCALAR @@ -38,27 +38,27 @@ CLC_VLOAD_DECL(__generic) #ifdef __CLC_FPSIZE #if __CLC_FPSIZE == 32 -#define CLC_VLOAD_HALF_DECL(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE CLC_VLOAD_HALF_NAME( \ +#define __CLC_VLOAD_HALF_DECL(ADDRSPACE) \ + _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_VLOAD_HALF_NAME( \ size_t offset, const ADDRSPACE half *mem); \ \ - _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE CLC_VLOADA_HALF_NAME( \ + _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_VLOADA_HALF_NAME( \ size_t offset, const ADDRSPACE half *mem); -CLC_VLOAD_HALF_DECL(__private) -CLC_VLOAD_HALF_DECL(__local) -CLC_VLOAD_HALF_DECL(__constant) -CLC_VLOAD_HALF_DECL(__global) +__CLC_VLOAD_HALF_DECL(__private) +__CLC_VLOAD_HALF_DECL(__local) +__CLC_VLOAD_HALF_DECL(__constant) +__CLC_VLOAD_HALF_DECL(__global) #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -CLC_VLOAD_HALF_DECL(__generic) +__CLC_VLOAD_HALF_DECL(__generic) #endif -#undef CLC_VLOAD_HALF_DECL +#undef __CLC_VLOAD_HALF_DECL #endif #endif -#undef CLC_VLOAD_NAME -#undef CLC_VLOAD_HALF_NAME -#undef CLC_VLOADA_HALF_NAME +#undef __CLC_VLOAD_NAME +#undef __CLC_VLOAD_HALF_NAME +#undef __CLC_VLOADA_HALF_NAME diff --git a/libclc/clc/include/clc/shared/clc_vstore.inc b/libclc/clc/include/clc/shared/clc_vstore.inc index 38d54b2f1b67..cd3377e077af 100644 --- a/libclc/clc/include/clc/shared/clc_vstore.inc +++ b/libclc/clc/include/clc/shared/clc_vstore.inc @@ -6,28 +6,28 @@ // //===----------------------------------------------------------------------===// -#define CLC_VSTORE_TY __CLC_XCONCAT(less_aligned_, __CLC_GENTYPE) -#define CLC_VSTORE_NAME __CLC_XCONCAT(__clc_vstore, __CLC_VECSIZE) -#define CLC_VSTORE_HALF_NAME(x) \ +#define __CLC_VSTORE_TY __CLC_XCONCAT(less_aligned_, __CLC_GENTYPE) +#define __CLC_VSTORE_NAME __CLC_XCONCAT(__clc_vstore, __CLC_VECSIZE) +#define __CLC_VSTORE_HALF_NAME(x) \ __CLC_XCONCAT(__CLC_XCONCAT(__clc_vstore_half, __CLC_VECSIZE), x) -#define CLC_VSTOREA_HALF_NAME(x) \ +#define __CLC_VSTOREA_HALF_NAME(x) \ __CLC_XCONCAT(__CLC_XCONCAT(__clc_vstorea_half, __CLC_VECSIZE), x) #ifndef __CLC_SCALAR -#define CLC_VSTORE_DECL(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DECL void CLC_VSTORE_NAME( \ - CLC_VSTORE_TY data, size_t offset, ADDRSPACE __CLC_SCALAR_GENTYPE *p); +#define __CLC_VSTORE_DECL(ADDRSPACE) \ + _CLC_OVERLOAD _CLC_DECL void __CLC_VSTORE_NAME( \ + __CLC_VSTORE_TY data, size_t offset, ADDRSPACE __CLC_SCALAR_GENTYPE *p); -CLC_VSTORE_DECL(__private) -CLC_VSTORE_DECL(__local) -CLC_VSTORE_DECL(__global) +__CLC_VSTORE_DECL(__private) +__CLC_VSTORE_DECL(__local) +__CLC_VSTORE_DECL(__global) #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -CLC_VSTORE_DECL(__generic) +__CLC_VSTORE_DECL(__generic) #endif -#undef CLC_VSTORE_DECL +#undef __CLC_VSTORE_DECL #endif // __CLC_SCALAR @@ -36,35 +36,35 @@ CLC_VSTORE_DECL(__generic) #ifdef __CLC_FPSIZE #if __CLC_FPSIZE == 32 || __CLC_FPSIZE == 64 -#define CLC_VSTORE_HALF_DECL(ADDRSPACE, SUFFIX) \ - _CLC_OVERLOAD _CLC_DECL void CLC_VSTORE_HALF_NAME(SUFFIX)( \ - CLC_VSTORE_TY data, size_t offset, ADDRSPACE half *p); \ +#define __CLC_VSTORE_HALF_DECL(ADDRSPACE, SUFFIX) \ + _CLC_OVERLOAD _CLC_DECL void __CLC_VSTORE_HALF_NAME(SUFFIX)( \ + __CLC_VSTORE_TY data, size_t offset, ADDRSPACE half *p); \ \ - _CLC_OVERLOAD _CLC_DECL void CLC_VSTOREA_HALF_NAME(SUFFIX)( \ - CLC_VSTORE_TY data, size_t offset, ADDRSPACE half *p); + _CLC_OVERLOAD _CLC_DECL void __CLC_VSTOREA_HALF_NAME(SUFFIX)( \ + __CLC_VSTORE_TY data, size_t offset, ADDRSPACE half *p); -#define CLC_VSTORE_HALF_DECL_ALL_MODES(ADDRSPACE) \ - CLC_VSTORE_HALF_DECL(ADDRSPACE, ) \ - CLC_VSTORE_HALF_DECL(ADDRSPACE, _rtz) \ - CLC_VSTORE_HALF_DECL(ADDRSPACE, _rtn) \ - CLC_VSTORE_HALF_DECL(ADDRSPACE, _rtp) \ - CLC_VSTORE_HALF_DECL(ADDRSPACE, _rte) +#define __CLC_VSTORE_HALF_DECL_ALL_MODES(ADDRSPACE) \ + __CLC_VSTORE_HALF_DECL(ADDRSPACE, ) \ + __CLC_VSTORE_HALF_DECL(ADDRSPACE, _rtz) \ + __CLC_VSTORE_HALF_DECL(ADDRSPACE, _rtn) \ + __CLC_VSTORE_HALF_DECL(ADDRSPACE, _rtp) \ + __CLC_VSTORE_HALF_DECL(ADDRSPACE, _rte) -CLC_VSTORE_HALF_DECL_ALL_MODES(__private) -CLC_VSTORE_HALF_DECL_ALL_MODES(__local) -CLC_VSTORE_HALF_DECL_ALL_MODES(__global) +__CLC_VSTORE_HALF_DECL_ALL_MODES(__private) +__CLC_VSTORE_HALF_DECL_ALL_MODES(__local) +__CLC_VSTORE_HALF_DECL_ALL_MODES(__global) #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -CLC_VSTORE_HALF_DECL_ALL_MODES(__generic) +__CLC_VSTORE_HALF_DECL_ALL_MODES(__generic) #endif -#undef CLC_VSTORE_HALF_DECL -#undef CLC_VSTORE_HALF_DECL_ALL_MODES +#undef __CLC_VSTORE_HALF_DECL +#undef __CLC_VSTORE_HALF_DECL_ALL_MODES #endif #endif -#undef CLC_VSTORE_TY -#undef CLC_VSTORE_NAME -#undef CLC_VSTORE_HALF_NAME -#undef CLC_VSTOREA_HALF_NAME +#undef __CLC_VSTORE_TY +#undef __CLC_VSTORE_NAME +#undef __CLC_VSTORE_HALF_NAME +#undef __CLC_VSTOREA_HALF_NAME diff --git a/libclc/clc/include/clc/shared/ternary_decl.inc b/libclc/clc/include/clc/shared/ternary_decl.inc index 1dc8672e3f42..21acb0042518 100644 --- a/libclc/clc/include/clc/shared/ternary_decl.inc +++ b/libclc/clc/include/clc/shared/ternary_decl.inc @@ -6,6 +6,5 @@ // //===----------------------------------------------------------------------===// -_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE a, - __CLC_GENTYPE b, - __CLC_GENTYPE c); +_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE +__CLC_FUNCTION(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_GENTYPE c); diff --git a/libclc/clc/include/clc/shared/ternary_def.inc b/libclc/clc/include/clc/shared/ternary_def.inc index 92134e8cb6f2..566cfb4ca58c 100644 --- a/libclc/clc/include/clc/shared/ternary_def.inc +++ b/libclc/clc/include/clc/shared/ternary_def.inc @@ -8,11 +8,12 @@ #include -#ifndef __IMPL_FUNCTION -#define __IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) +#ifndef __CLC_IMPL_FUNCTION +#define __CLC_IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) #endif -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE a, __CLC_GENTYPE b, - __CLC_GENTYPE c) { - return __IMPL_FUNCTION(FUNCTION)(a, b, c); +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE a, + __CLC_GENTYPE b, + __CLC_GENTYPE c) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(a, b, c); } diff --git a/libclc/clc/include/clc/shared/ternary_def_scalarize.inc b/libclc/clc/include/clc/shared/ternary_def_scalarize.inc index c216fa4db4ca..7bdaee85a612 100644 --- a/libclc/clc/include/clc/shared/ternary_def_scalarize.inc +++ b/libclc/clc/include/clc/shared/ternary_def_scalarize.inc @@ -14,8 +14,8 @@ #define __CLC_MIN_VECSIZE 2 #endif -#ifndef __IMPL_FUNCTION -#define __IMPL_FUNCTION FUNCTION +#ifndef __CLC_IMPL_FUNCTION +#define __CLC_IMPL_FUNCTION __CLC_FUNCTION #endif #ifndef __CLC_DEF_SPEC @@ -39,10 +39,10 @@ #endif #if __CLC_MIN_VECSIZE == 1 -_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE FUNCTION(__CLC_ARG1_TYPE x, - __CLC_ARG2_TYPE y, - __CLC_ARG3_TYPE z) { - return __IMPL_FUNCTION(x, y, z); +_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE __CLC_FUNCTION(__CLC_ARG1_TYPE x, + __CLC_ARG2_TYPE y, + __CLC_ARG3_TYPE z) { + return __CLC_IMPL_FUNCTION(x, y, z); } #endif // __CLC_MIN_VECSIZE == 1 @@ -51,11 +51,10 @@ _CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE FUNCTION(__CLC_ARG1_TYPE x, #define __CLC_ARG1_TYPE2 __CLC_XCONCAT(__CLC_ARG1_TYPE, 2) #define __CLC_ARG2_TYPE2 __CLC_XCONCAT(__CLC_ARG2_TYPE, 2) #define __CLC_ARG3_TYPE2 __CLC_XCONCAT(__CLC_ARG3_TYPE, 2) -_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE2 FUNCTION(__CLC_ARG1_TYPE2 x, - __CLC_ARG2_TYPE2 y, - __CLC_ARG3_TYPE2 z) { - return (__CLC_RET_TYPE2)(__IMPL_FUNCTION(x.s0, y.s0, z.s0), - __IMPL_FUNCTION(x.s1, y.s1, z.s1)); +_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE2 +__CLC_FUNCTION(__CLC_ARG1_TYPE2 x, __CLC_ARG2_TYPE2 y, __CLC_ARG3_TYPE2 z) { + return (__CLC_RET_TYPE2)(__CLC_IMPL_FUNCTION(x.s0, y.s0, z.s0), + __CLC_IMPL_FUNCTION(x.s1, y.s1, z.s1)); } #undef __CLC_RET_TYPE2 #undef __CLC_ARG1_TYPE2 @@ -71,12 +70,11 @@ _CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE2 FUNCTION(__CLC_ARG1_TYPE2 x, #define __CLC_ARG1_TYPE3 __CLC_XCONCAT(__CLC_ARG1_TYPE, 3) #define __CLC_ARG2_TYPE3 __CLC_XCONCAT(__CLC_ARG2_TYPE, 3) #define __CLC_ARG3_TYPE3 __CLC_XCONCAT(__CLC_ARG3_TYPE, 3) -_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE3 FUNCTION(__CLC_ARG1_TYPE3 x, - __CLC_ARG2_TYPE3 y, - __CLC_ARG3_TYPE3 z) { - return (__CLC_RET_TYPE3)(__IMPL_FUNCTION(x.s0, y.s0, z.s0), - __IMPL_FUNCTION(x.s1, y.s1, z.s1), - __IMPL_FUNCTION(x.s2, y.s2, z.s2)); +_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE3 +__CLC_FUNCTION(__CLC_ARG1_TYPE3 x, __CLC_ARG2_TYPE3 y, __CLC_ARG3_TYPE3 z) { + return (__CLC_RET_TYPE3)(__CLC_IMPL_FUNCTION(x.s0, y.s0, z.s0), + __CLC_IMPL_FUNCTION(x.s1, y.s1, z.s1), + __CLC_IMPL_FUNCTION(x.s2, y.s2, z.s2)); } #undef __CLC_RET_TYPE3 #undef __CLC_ARG1_TYPE3 @@ -87,13 +85,12 @@ _CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE3 FUNCTION(__CLC_ARG1_TYPE3 x, #define __CLC_ARG1_TYPE4 __CLC_XCONCAT(__CLC_ARG1_TYPE, 4) #define __CLC_ARG2_TYPE4 __CLC_XCONCAT(__CLC_ARG2_TYPE, 4) #define __CLC_ARG3_TYPE4 __CLC_XCONCAT(__CLC_ARG3_TYPE, 4) -_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE4 FUNCTION(__CLC_ARG1_TYPE4 x, - __CLC_ARG2_TYPE4 y, - __CLC_ARG3_TYPE4 z) { - return (__CLC_RET_TYPE4)(__IMPL_FUNCTION(x.s0, y.s0, z.s0), - __IMPL_FUNCTION(x.s1, y.s1, z.s1), - __IMPL_FUNCTION(x.s2, y.s2, z.s2), - __IMPL_FUNCTION(x.s3, y.s3, z.s3)); +_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE4 +__CLC_FUNCTION(__CLC_ARG1_TYPE4 x, __CLC_ARG2_TYPE4 y, __CLC_ARG3_TYPE4 z) { + return (__CLC_RET_TYPE4)(__CLC_IMPL_FUNCTION(x.s0, y.s0, z.s0), + __CLC_IMPL_FUNCTION(x.s1, y.s1, z.s1), + __CLC_IMPL_FUNCTION(x.s2, y.s2, z.s2), + __CLC_IMPL_FUNCTION(x.s3, y.s3, z.s3)); } #undef __CLC_RET_TYPE4 #undef __CLC_ARG1_TYPE4 @@ -104,17 +101,16 @@ _CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE4 FUNCTION(__CLC_ARG1_TYPE4 x, #define __CLC_ARG1_TYPE8 __CLC_XCONCAT(__CLC_ARG1_TYPE, 8) #define __CLC_ARG2_TYPE8 __CLC_XCONCAT(__CLC_ARG2_TYPE, 8) #define __CLC_ARG3_TYPE8 __CLC_XCONCAT(__CLC_ARG3_TYPE, 8) -_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE8 FUNCTION(__CLC_ARG1_TYPE8 x, - __CLC_ARG2_TYPE8 y, - __CLC_ARG3_TYPE8 z) { - return (__CLC_RET_TYPE8)(__IMPL_FUNCTION(x.s0, y.s0, z.s0), - __IMPL_FUNCTION(x.s1, y.s1, z.s1), - __IMPL_FUNCTION(x.s2, y.s2, z.s2), - __IMPL_FUNCTION(x.s3, y.s3, z.s3), - __IMPL_FUNCTION(x.s4, y.s4, z.s4), - __IMPL_FUNCTION(x.s5, y.s5, z.s5), - __IMPL_FUNCTION(x.s6, y.s6, z.s6), - __IMPL_FUNCTION(x.s7, y.s7, z.s7)); +_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE8 +__CLC_FUNCTION(__CLC_ARG1_TYPE8 x, __CLC_ARG2_TYPE8 y, __CLC_ARG3_TYPE8 z) { + return (__CLC_RET_TYPE8)(__CLC_IMPL_FUNCTION(x.s0, y.s0, z.s0), + __CLC_IMPL_FUNCTION(x.s1, y.s1, z.s1), + __CLC_IMPL_FUNCTION(x.s2, y.s2, z.s2), + __CLC_IMPL_FUNCTION(x.s3, y.s3, z.s3), + __CLC_IMPL_FUNCTION(x.s4, y.s4, z.s4), + __CLC_IMPL_FUNCTION(x.s5, y.s5, z.s5), + __CLC_IMPL_FUNCTION(x.s6, y.s6, z.s6), + __CLC_IMPL_FUNCTION(x.s7, y.s7, z.s7)); } #undef __CLC_RET_TYPE8 #undef __CLC_ARG1_TYPE8 @@ -125,25 +121,24 @@ _CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE8 FUNCTION(__CLC_ARG1_TYPE8 x, #define __CLC_ARG1_TYPE16 __CLC_XCONCAT(__CLC_ARG1_TYPE, 16) #define __CLC_ARG2_TYPE16 __CLC_XCONCAT(__CLC_ARG2_TYPE, 16) #define __CLC_ARG3_TYPE16 __CLC_XCONCAT(__CLC_ARG3_TYPE, 16) -_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE16 FUNCTION(__CLC_ARG1_TYPE16 x, - __CLC_ARG2_TYPE16 y, - __CLC_ARG3_TYPE16 z) { - return (__CLC_RET_TYPE16)(__IMPL_FUNCTION(x.s0, y.s0, z.s0), - __IMPL_FUNCTION(x.s1, y.s1, z.s1), - __IMPL_FUNCTION(x.s2, y.s2, z.s2), - __IMPL_FUNCTION(x.s3, y.s3, z.s3), - __IMPL_FUNCTION(x.s4, y.s4, z.s4), - __IMPL_FUNCTION(x.s5, y.s5, z.s5), - __IMPL_FUNCTION(x.s6, y.s6, z.s6), - __IMPL_FUNCTION(x.s7, y.s7, z.s7), - __IMPL_FUNCTION(x.s8, y.s8, z.s8), - __IMPL_FUNCTION(x.s9, y.s9, z.s9), - __IMPL_FUNCTION(x.sa, y.sa, z.sa), - __IMPL_FUNCTION(x.sb, y.sb, z.sb), - __IMPL_FUNCTION(x.sc, y.sc, z.sc), - __IMPL_FUNCTION(x.sd, y.sd, z.sd), - __IMPL_FUNCTION(x.se, y.se, z.se), - __IMPL_FUNCTION(x.sf, y.sf, z.sf)); +_CLC_OVERLOAD __CLC_DEF_SPEC __CLC_RET_TYPE16 +__CLC_FUNCTION(__CLC_ARG1_TYPE16 x, __CLC_ARG2_TYPE16 y, __CLC_ARG3_TYPE16 z) { + return (__CLC_RET_TYPE16)(__CLC_IMPL_FUNCTION(x.s0, y.s0, z.s0), + __CLC_IMPL_FUNCTION(x.s1, y.s1, z.s1), + __CLC_IMPL_FUNCTION(x.s2, y.s2, z.s2), + __CLC_IMPL_FUNCTION(x.s3, y.s3, z.s3), + __CLC_IMPL_FUNCTION(x.s4, y.s4, z.s4), + __CLC_IMPL_FUNCTION(x.s5, y.s5, z.s5), + __CLC_IMPL_FUNCTION(x.s6, y.s6, z.s6), + __CLC_IMPL_FUNCTION(x.s7, y.s7, z.s7), + __CLC_IMPL_FUNCTION(x.s8, y.s8, z.s8), + __CLC_IMPL_FUNCTION(x.s9, y.s9, z.s9), + __CLC_IMPL_FUNCTION(x.sa, y.sa, z.sa), + __CLC_IMPL_FUNCTION(x.sb, y.sb, z.sb), + __CLC_IMPL_FUNCTION(x.sc, y.sc, z.sc), + __CLC_IMPL_FUNCTION(x.sd, y.sd, z.sd), + __CLC_IMPL_FUNCTION(x.se, y.se, z.se), + __CLC_IMPL_FUNCTION(x.sf, y.sf, z.sf)); } #undef __CLC_RET_TYPE16 #undef __CLC_ARG1_TYPE16 diff --git a/libclc/clc/include/clc/shared/unary_decl.inc b/libclc/clc/include/clc/shared/unary_decl.inc index 46108c5fac9e..19f1c8a876e5 100644 --- a/libclc/clc/include/clc/shared/unary_decl.inc +++ b/libclc/clc/include/clc/shared/unary_decl.inc @@ -6,4 +6,5 @@ // //===----------------------------------------------------------------------===// -_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x); +_CLC_OVERLOAD _CLC_CONST _CLC_DECL __CLC_GENTYPE +__CLC_FUNCTION(__CLC_GENTYPE x); diff --git a/libclc/clc/include/clc/shared/unary_def.inc b/libclc/clc/include/clc/shared/unary_def.inc index e746a6bc89f3..b6826b023c70 100644 --- a/libclc/clc/include/clc/shared/unary_def.inc +++ b/libclc/clc/include/clc/shared/unary_def.inc @@ -8,10 +8,10 @@ #include -#ifndef __IMPL_FUNCTION -#define __IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) +#ifndef __CLC_IMPL_FUNCTION +#define __CLC_IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) #endif -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE a) { - return __IMPL_FUNCTION(FUNCTION)(a); +_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE a) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(a); } diff --git a/libclc/clc/include/clc/shared/unary_def_scalarize.inc b/libclc/clc/include/clc/shared/unary_def_scalarize.inc index 6c82babad2b5..e941918312da 100644 --- a/libclc/clc/include/clc/shared/unary_def_scalarize.inc +++ b/libclc/clc/include/clc/shared/unary_def_scalarize.inc @@ -14,8 +14,8 @@ #define __CLC_MIN_VECSIZE 2 #endif -#ifndef __IMPL_FUNCTION -#define __IMPL_FUNCTION FUNCTION +#ifndef __CLC_IMPL_FUNCTION +#define __CLC_IMPL_FUNCTION __CLC_FUNCTION #endif #ifndef __CLC_RET_TYPE @@ -31,16 +31,17 @@ #endif #if __CLC_MIN_VECSIZE == 1 -_CLC_OVERLOAD _CLC_DEF __CLC_RET_TYPE FUNCTION(__CLC_ARG1_TYPE x) { - return __IMPL_FUNCTION(x); +_CLC_OVERLOAD _CLC_DEF __CLC_RET_TYPE __CLC_FUNCTION(__CLC_ARG1_TYPE x) { + return __CLC_IMPL_FUNCTION(x); } #endif // __CLC_MIN_VECSIZE == 1 #if __CLC_MIN_VECSIZE <= 2 #define __CLC_RET_TYPE2 __CLC_XCONCAT(__CLC_RET_TYPE, 2) #define __CLC_ARG1_TYPE2 __CLC_XCONCAT(__CLC_ARG1_TYPE, 2) -_CLC_OVERLOAD _CLC_DEF __CLC_RET_TYPE2 FUNCTION(__CLC_ARG1_TYPE2 x) { - return (__CLC_RET_TYPE2)(__IMPL_FUNCTION(x.s0), __IMPL_FUNCTION(x.s1)); +_CLC_OVERLOAD _CLC_DEF __CLC_RET_TYPE2 __CLC_FUNCTION(__CLC_ARG1_TYPE2 x) { + return (__CLC_RET_TYPE2)(__CLC_IMPL_FUNCTION(x.s0), + __CLC_IMPL_FUNCTION(x.s1)); } #undef __CLC_RET_TYPE2 #undef __CLC_ARG1_TYPE2 @@ -52,44 +53,47 @@ _CLC_OVERLOAD _CLC_DEF __CLC_RET_TYPE2 FUNCTION(__CLC_ARG1_TYPE2 x) { #define __CLC_RET_TYPE3 __CLC_XCONCAT(__CLC_RET_TYPE, 3) #define __CLC_ARG1_TYPE3 __CLC_XCONCAT(__CLC_ARG1_TYPE, 3) -_CLC_OVERLOAD _CLC_DEF __CLC_RET_TYPE3 FUNCTION(__CLC_ARG1_TYPE3 x) { - return (__CLC_RET_TYPE3)(__IMPL_FUNCTION(x.s0), __IMPL_FUNCTION(x.s1), - __IMPL_FUNCTION(x.s2)); +_CLC_OVERLOAD _CLC_DEF __CLC_RET_TYPE3 __CLC_FUNCTION(__CLC_ARG1_TYPE3 x) { + return (__CLC_RET_TYPE3)(__CLC_IMPL_FUNCTION(x.s0), __CLC_IMPL_FUNCTION(x.s1), + __CLC_IMPL_FUNCTION(x.s2)); } #undef __CLC_RET_TYPE3 #undef __CLC_ARG1_TYPE3 #define __CLC_RET_TYPE4 __CLC_XCONCAT(__CLC_RET_TYPE, 4) #define __CLC_ARG1_TYPE4 __CLC_XCONCAT(__CLC_ARG1_TYPE, 4) -_CLC_OVERLOAD _CLC_DEF __CLC_RET_TYPE4 FUNCTION(__CLC_ARG1_TYPE4 x) { - return (__CLC_RET_TYPE4)(__IMPL_FUNCTION(x.s0), __IMPL_FUNCTION(x.s1), - __IMPL_FUNCTION(x.s2), __IMPL_FUNCTION(x.s3)); +_CLC_OVERLOAD _CLC_DEF __CLC_RET_TYPE4 __CLC_FUNCTION(__CLC_ARG1_TYPE4 x) { + return (__CLC_RET_TYPE4)(__CLC_IMPL_FUNCTION(x.s0), __CLC_IMPL_FUNCTION(x.s1), + __CLC_IMPL_FUNCTION(x.s2), + __CLC_IMPL_FUNCTION(x.s3)); } #undef __CLC_RET_TYPE4 #undef __CLC_ARG1_TYPE4 #define __CLC_RET_TYPE8 __CLC_XCONCAT(__CLC_RET_TYPE, 8) #define __CLC_ARG1_TYPE8 __CLC_XCONCAT(__CLC_ARG1_TYPE, 8) -_CLC_OVERLOAD _CLC_DEF __CLC_RET_TYPE8 FUNCTION(__CLC_ARG1_TYPE8 x) { - return (__CLC_RET_TYPE8)(__IMPL_FUNCTION(x.s0), __IMPL_FUNCTION(x.s1), - __IMPL_FUNCTION(x.s2), __IMPL_FUNCTION(x.s3), - __IMPL_FUNCTION(x.s4), __IMPL_FUNCTION(x.s5), - __IMPL_FUNCTION(x.s6), __IMPL_FUNCTION(x.s7)); +_CLC_OVERLOAD _CLC_DEF __CLC_RET_TYPE8 __CLC_FUNCTION(__CLC_ARG1_TYPE8 x) { + return (__CLC_RET_TYPE8)(__CLC_IMPL_FUNCTION(x.s0), __CLC_IMPL_FUNCTION(x.s1), + __CLC_IMPL_FUNCTION(x.s2), __CLC_IMPL_FUNCTION(x.s3), + __CLC_IMPL_FUNCTION(x.s4), __CLC_IMPL_FUNCTION(x.s5), + __CLC_IMPL_FUNCTION(x.s6), + __CLC_IMPL_FUNCTION(x.s7)); } #undef __CLC_RET_TYPE8 #undef __CLC_ARG1_TYPE8 #define __CLC_RET_TYPE16 __CLC_XCONCAT(__CLC_RET_TYPE, 16) #define __CLC_ARG1_TYPE16 __CLC_XCONCAT(__CLC_ARG1_TYPE, 16) -_CLC_OVERLOAD _CLC_DEF __CLC_RET_TYPE16 FUNCTION(__CLC_ARG1_TYPE16 x) { - return (__CLC_RET_TYPE16)(__IMPL_FUNCTION(x.s0), __IMPL_FUNCTION(x.s1), - __IMPL_FUNCTION(x.s2), __IMPL_FUNCTION(x.s3), - __IMPL_FUNCTION(x.s4), __IMPL_FUNCTION(x.s5), - __IMPL_FUNCTION(x.s6), __IMPL_FUNCTION(x.s7), - __IMPL_FUNCTION(x.s8), __IMPL_FUNCTION(x.s9), - __IMPL_FUNCTION(x.sa), __IMPL_FUNCTION(x.sb), - __IMPL_FUNCTION(x.sc), __IMPL_FUNCTION(x.sd), - __IMPL_FUNCTION(x.se), __IMPL_FUNCTION(x.sf)); +_CLC_OVERLOAD _CLC_DEF __CLC_RET_TYPE16 __CLC_FUNCTION(__CLC_ARG1_TYPE16 x) { + return ( + __CLC_RET_TYPE16)(__CLC_IMPL_FUNCTION(x.s0), __CLC_IMPL_FUNCTION(x.s1), + __CLC_IMPL_FUNCTION(x.s2), __CLC_IMPL_FUNCTION(x.s3), + __CLC_IMPL_FUNCTION(x.s4), __CLC_IMPL_FUNCTION(x.s5), + __CLC_IMPL_FUNCTION(x.s6), __CLC_IMPL_FUNCTION(x.s7), + __CLC_IMPL_FUNCTION(x.s8), __CLC_IMPL_FUNCTION(x.s9), + __CLC_IMPL_FUNCTION(x.sa), __CLC_IMPL_FUNCTION(x.sb), + __CLC_IMPL_FUNCTION(x.sc), __CLC_IMPL_FUNCTION(x.sd), + __CLC_IMPL_FUNCTION(x.se), __CLC_IMPL_FUNCTION(x.sf)); } #undef __CLC_RET_TYPE16 #undef __CLC_ARG1_TYPE16 diff --git a/libclc/clc/lib/amdgcn/math/clc_ldexp_override.cl b/libclc/clc/lib/amdgcn/math/clc_ldexp_override.cl index b2990647a00a..90bd50ac1551 100644 --- a/libclc/clc/lib/amdgcn/math/clc_ldexp_override.cl +++ b/libclc/clc/lib/amdgcn/math/clc_ldexp_override.cl @@ -10,25 +10,25 @@ #include #include -#define FUNCTION __clc_ldexp +#define __CLC_FUNCTION __clc_ldexp #define __CLC_ARG2_TYPE int #define __CLC_MIN_VECSIZE 1 #ifdef __HAS_LDEXPF__ // This defines all the ldexp(floatN, intN) variants. -#define __FLOAT_ONLY -#define __IMPL_FUNCTION __builtin_amdgcn_ldexpf +#define __CLC_FLOAT_ONLY +#define __CLC_IMPL_FUNCTION __builtin_amdgcn_ldexpf #define __CLC_BODY #include -#undef __IMPL_FUNCTION +#undef __CLC_IMPL_FUNCTION #endif #ifdef cl_khr_fp64 #pragma OPENCL EXTENSION cl_khr_fp64 : enable // This defines all the ldexp(doubleN, intN) variants. -#define __DOUBLE_ONLY -#define __IMPL_FUNCTION __builtin_amdgcn_ldexp +#define __CLC_DOUBLE_ONLY +#define __CLC_IMPL_FUNCTION __builtin_amdgcn_ldexp #define __CLC_BODY #include -#undef __IMPL_FUNCTION +#undef __CLC_IMPL_FUNCTION #endif diff --git a/libclc/clc/lib/amdgpu/math/clc_half_exp.cl b/libclc/clc/lib/amdgpu/math/clc_half_exp.cl index 5fa9d0b9a9de..c332708615e1 100644 --- a/libclc/clc/lib/amdgpu/math/clc_half_exp.cl +++ b/libclc/clc/lib/amdgpu/math/clc_half_exp.cl @@ -9,6 +9,6 @@ #include #define __CLC_FUNC exp -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/amdgpu/math/clc_half_exp10.cl b/libclc/clc/lib/amdgpu/math/clc_half_exp10.cl index 5c119eb5a535..5560f7ac9796 100644 --- a/libclc/clc/lib/amdgpu/math/clc_half_exp10.cl +++ b/libclc/clc/lib/amdgpu/math/clc_half_exp10.cl @@ -9,6 +9,6 @@ #include #define __CLC_FUNC exp10 -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/amdgpu/math/clc_half_exp2.cl b/libclc/clc/lib/amdgpu/math/clc_half_exp2.cl index 9750d5008986..3e38cbee3285 100644 --- a/libclc/clc/lib/amdgpu/math/clc_half_exp2.cl +++ b/libclc/clc/lib/amdgpu/math/clc_half_exp2.cl @@ -10,6 +10,6 @@ #include #define __CLC_FUNC exp2 -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/amdgpu/math/clc_half_log.cl b/libclc/clc/lib/amdgpu/math/clc_half_log.cl index ea19bd5a4c7a..0b731c202e20 100644 --- a/libclc/clc/lib/amdgpu/math/clc_half_log.cl +++ b/libclc/clc/lib/amdgpu/math/clc_half_log.cl @@ -9,6 +9,6 @@ #include #define __CLC_FUNC log -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/amdgpu/math/clc_half_log10.cl b/libclc/clc/lib/amdgpu/math/clc_half_log10.cl index af3a2695396d..1fd8ba520411 100644 --- a/libclc/clc/lib/amdgpu/math/clc_half_log10.cl +++ b/libclc/clc/lib/amdgpu/math/clc_half_log10.cl @@ -9,6 +9,6 @@ #include #define __CLC_FUNC log10 -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/amdgpu/math/clc_half_log2.cl b/libclc/clc/lib/amdgpu/math/clc_half_log2.cl index 81795f012c77..e4d27421f8fe 100644 --- a/libclc/clc/lib/amdgpu/math/clc_half_log2.cl +++ b/libclc/clc/lib/amdgpu/math/clc_half_log2.cl @@ -9,6 +9,6 @@ #include #define __CLC_FUNC log2 -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/amdgpu/math/clc_half_recip.cl b/libclc/clc/lib/amdgpu/math/clc_half_recip.cl index edbec07e4484..0a1c17037531 100644 --- a/libclc/clc/lib/amdgpu/math/clc_half_recip.cl +++ b/libclc/clc/lib/amdgpu/math/clc_half_recip.cl @@ -9,6 +9,6 @@ #include #define __CLC_FUNC recip -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/amdgpu/math/clc_half_rsqrt.cl b/libclc/clc/lib/amdgpu/math/clc_half_rsqrt.cl index c0a5489ec8fc..a17ac508b5ad 100644 --- a/libclc/clc/lib/amdgpu/math/clc_half_rsqrt.cl +++ b/libclc/clc/lib/amdgpu/math/clc_half_rsqrt.cl @@ -9,6 +9,6 @@ #include #define __CLC_FUNC rsqrt -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/amdgpu/math/clc_half_sqrt.cl b/libclc/clc/lib/amdgpu/math/clc_half_sqrt.cl index 4dc6fa31f21a..142a87881853 100644 --- a/libclc/clc/lib/amdgpu/math/clc_half_sqrt.cl +++ b/libclc/clc/lib/amdgpu/math/clc_half_sqrt.cl @@ -9,6 +9,6 @@ #include #define __CLC_FUNC sqrt -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/amdgpu/math/clc_native_exp.cl b/libclc/clc/lib/amdgpu/math/clc_native_exp.cl index 591ecb0ac00b..946b9beed5be 100644 --- a/libclc/clc/lib/amdgpu/math/clc_native_exp.cl +++ b/libclc/clc/lib/amdgpu/math/clc_native_exp.cl @@ -11,5 +11,5 @@ #include #define __CLC_BODY -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #include diff --git a/libclc/clc/lib/amdgpu/math/clc_native_exp2.cl b/libclc/clc/lib/amdgpu/math/clc_native_exp2.cl index 63f28921dc17..5959ea2786a5 100644 --- a/libclc/clc/lib/amdgpu/math/clc_native_exp2.cl +++ b/libclc/clc/lib/amdgpu/math/clc_native_exp2.cl @@ -9,9 +9,9 @@ #include #include -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_MIN_VECSIZE 1 -#define FUNCTION __clc_native_exp2 -#define __IMPL_FUNCTION __builtin_amdgcn_exp2f +#define __CLC_FUNCTION __clc_native_exp2 +#define __CLC_IMPL_FUNCTION __builtin_amdgcn_exp2f #define __CLC_BODY #include diff --git a/libclc/clc/lib/amdgpu/math/clc_native_log10.cl b/libclc/clc/lib/amdgpu/math/clc_native_log10.cl index 0668a635d24d..c356b22b6b6e 100644 --- a/libclc/clc/lib/amdgpu/math/clc_native_log10.cl +++ b/libclc/clc/lib/amdgpu/math/clc_native_log10.cl @@ -11,5 +11,5 @@ #include #define __CLC_BODY -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #include diff --git a/libclc/clc/lib/amdgpu/math/clc_sqrt_fp64.cl b/libclc/clc/lib/amdgpu/math/clc_sqrt_fp64.cl index b7cb635a2ae8..d2790f3a8260 100644 --- a/libclc/clc/lib/amdgpu/math/clc_sqrt_fp64.cl +++ b/libclc/clc/lib/amdgpu/math/clc_sqrt_fp64.cl @@ -43,8 +43,8 @@ _CLC_OVERLOAD _CLC_DEF double __clc_sqrt(double x) { return (x == __builtin_inf() || (x == 0.0)) ? v01 : v23; } -#define __DOUBLE_ONLY -#define FUNCTION __clc_sqrt +#define __CLC_DOUBLE_ONLY +#define __CLC_FUNCTION __clc_sqrt #define __CLC_BODY #include diff --git a/libclc/clc/lib/clspv/math/clc_sw_fma.cl b/libclc/clc/lib/clspv/math/clc_sw_fma.cl index 266269644721..1dc9a0e6407b 100644 --- a/libclc/clc/lib/clspv/math/clc_sw_fma.cl +++ b/libclc/clc/lib/clspv/math/clc_sw_fma.cl @@ -269,7 +269,7 @@ _CLC_DEF _CLC_OVERLOAD float __clc_sw_fma(float a, float b, float c) { ((uint)st_fma.mantissa.lo & 0x7fffff)); } -#define __FLOAT_ONLY -#define FUNCTION __clc_sw_fma +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_sw_fma #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/atomic/clc_atomic_dec.cl b/libclc/clc/lib/generic/atomic/clc_atomic_dec.cl index f35a9624fd01..7984dba5731e 100644 --- a/libclc/clc/lib/generic/atomic/clc_atomic_dec.cl +++ b/libclc/clc/lib/generic/atomic/clc_atomic_dec.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_atomic_dec -#define __IMPL_FUNCTION __scoped_atomic_fetch_add +#define __CLC_FUNCTION __clc_atomic_dec +#define __CLC_IMPL_FUNCTION __scoped_atomic_fetch_add #define __CLC_INC_DEC #define __CLC_BODY diff --git a/libclc/clc/lib/generic/atomic/clc_atomic_def.inc b/libclc/clc/lib/generic/atomic/clc_atomic_def.inc index 2c45f49f6084..c1a0731eb843 100644 --- a/libclc/clc/lib/generic/atomic/clc_atomic_def.inc +++ b/libclc/clc/lib/generic/atomic/clc_atomic_def.inc @@ -31,37 +31,37 @@ #ifdef __CLC_NO_VALUE_ARG #define __CLC_DEFINE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION( \ + _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION( \ volatile ADDRSPACE __CLC_GENTYPE *Ptr, int MemoryOrder, \ int MemoryScope) { \ - return __CLC_AS_RETTYPE(__IMPL_FUNCTION( \ + return __CLC_AS_RETTYPE(__CLC_IMPL_FUNCTION( \ (ADDRSPACE __CLC_PTR_CASTTYPE *)Ptr, MemoryOrder, MemoryScope)); \ } #elif defined(__CLC_INC_DEC) #define __CLC_DEFINE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION( \ + _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION( \ volatile ADDRSPACE __CLC_GENTYPE *Ptr, int MemoryOrder, \ int MemoryScope) { \ return __CLC_AS_RETTYPE( \ - __IMPL_FUNCTION((ADDRSPACE __CLC_PTR_CASTTYPE *)Ptr, (__CLC_GENTYPE)1, \ - MemoryOrder, MemoryScope)); \ + __CLC_IMPL_FUNCTION((ADDRSPACE __CLC_PTR_CASTTYPE *)Ptr, \ + (__CLC_GENTYPE)1, MemoryOrder, MemoryScope)); \ } #elif defined(__CLC_RETURN_VOID) #define __CLC_DEFINE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DECL void FUNCTION(volatile ADDRSPACE __CLC_GENTYPE *Ptr, \ - __CLC_GENTYPE Value, int MemoryOrder, \ - int MemoryScope) { \ - __IMPL_FUNCTION((ADDRSPACE __CLC_PTR_CASTTYPE *)Ptr, Value, MemoryOrder, \ - MemoryScope); \ + _CLC_OVERLOAD _CLC_DECL void __CLC_FUNCTION( \ + volatile ADDRSPACE __CLC_GENTYPE *Ptr, __CLC_GENTYPE Value, \ + int MemoryOrder, int MemoryScope) { \ + __CLC_IMPL_FUNCTION((ADDRSPACE __CLC_PTR_CASTTYPE *)Ptr, Value, \ + MemoryOrder, MemoryScope); \ } #else #define __CLC_DEFINE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION( \ + _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION( \ volatile ADDRSPACE __CLC_GENTYPE *Ptr, __CLC_GENTYPE Value, \ int MemoryOrder, int MemoryScope) { \ return __CLC_AS_RETTYPE( \ - __IMPL_FUNCTION((ADDRSPACE __CLC_PTR_CASTTYPE *)Ptr, Value, \ - MemoryOrder, MemoryScope)); \ + __CLC_IMPL_FUNCTION((ADDRSPACE __CLC_PTR_CASTTYPE *)Ptr, Value, \ + MemoryOrder, MemoryScope)); \ } #endif diff --git a/libclc/clc/lib/generic/atomic/clc_atomic_exchange.cl b/libclc/clc/lib/generic/atomic/clc_atomic_exchange.cl index 52fd11afed6a..ee80256d3dbb 100644 --- a/libclc/clc/lib/generic/atomic/clc_atomic_exchange.cl +++ b/libclc/clc/lib/generic/atomic/clc_atomic_exchange.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_atomic_exchange -#define __IMPL_FUNCTION __scoped_atomic_exchange_n +#define __CLC_FUNCTION __clc_atomic_exchange +#define __CLC_IMPL_FUNCTION __scoped_atomic_exchange_n #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/atomic/clc_atomic_fetch_add.cl b/libclc/clc/lib/generic/atomic/clc_atomic_fetch_add.cl index 0dc44919627b..06fa21344ec8 100644 --- a/libclc/clc/lib/generic/atomic/clc_atomic_fetch_add.cl +++ b/libclc/clc/lib/generic/atomic/clc_atomic_fetch_add.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_atomic_fetch_add -#define __IMPL_FUNCTION __scoped_atomic_fetch_add +#define __CLC_FUNCTION __clc_atomic_fetch_add +#define __CLC_IMPL_FUNCTION __scoped_atomic_fetch_add #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/atomic/clc_atomic_fetch_and.cl b/libclc/clc/lib/generic/atomic/clc_atomic_fetch_and.cl index ec89738bc0f6..7b9750d8d4db 100644 --- a/libclc/clc/lib/generic/atomic/clc_atomic_fetch_and.cl +++ b/libclc/clc/lib/generic/atomic/clc_atomic_fetch_and.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_atomic_fetch_and -#define __IMPL_FUNCTION __scoped_atomic_fetch_and +#define __CLC_FUNCTION __clc_atomic_fetch_and +#define __CLC_IMPL_FUNCTION __scoped_atomic_fetch_and #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/atomic/clc_atomic_fetch_max.cl b/libclc/clc/lib/generic/atomic/clc_atomic_fetch_max.cl index 0acac711aa96..6401d3e9439f 100644 --- a/libclc/clc/lib/generic/atomic/clc_atomic_fetch_max.cl +++ b/libclc/clc/lib/generic/atomic/clc_atomic_fetch_max.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_atomic_fetch_max -#define __IMPL_FUNCTION __scoped_atomic_fetch_max +#define __CLC_FUNCTION __clc_atomic_fetch_max +#define __CLC_IMPL_FUNCTION __scoped_atomic_fetch_max #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/atomic/clc_atomic_fetch_min.cl b/libclc/clc/lib/generic/atomic/clc_atomic_fetch_min.cl index 7a098588ec00..51e3904a5c6e 100644 --- a/libclc/clc/lib/generic/atomic/clc_atomic_fetch_min.cl +++ b/libclc/clc/lib/generic/atomic/clc_atomic_fetch_min.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_atomic_fetch_min -#define __IMPL_FUNCTION __scoped_atomic_fetch_min +#define __CLC_FUNCTION __clc_atomic_fetch_min +#define __CLC_IMPL_FUNCTION __scoped_atomic_fetch_min #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/atomic/clc_atomic_fetch_or.cl b/libclc/clc/lib/generic/atomic/clc_atomic_fetch_or.cl index e0f48fa40835..e92e351db3f4 100644 --- a/libclc/clc/lib/generic/atomic/clc_atomic_fetch_or.cl +++ b/libclc/clc/lib/generic/atomic/clc_atomic_fetch_or.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_atomic_fetch_or -#define __IMPL_FUNCTION __scoped_atomic_fetch_or +#define __CLC_FUNCTION __clc_atomic_fetch_or +#define __CLC_IMPL_FUNCTION __scoped_atomic_fetch_or #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/atomic/clc_atomic_fetch_sub.cl b/libclc/clc/lib/generic/atomic/clc_atomic_fetch_sub.cl index a4c2c1da1555..fbbf7a4def56 100644 --- a/libclc/clc/lib/generic/atomic/clc_atomic_fetch_sub.cl +++ b/libclc/clc/lib/generic/atomic/clc_atomic_fetch_sub.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_atomic_fetch_sub -#define __IMPL_FUNCTION __scoped_atomic_fetch_sub +#define __CLC_FUNCTION __clc_atomic_fetch_sub +#define __CLC_IMPL_FUNCTION __scoped_atomic_fetch_sub #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/atomic/clc_atomic_fetch_xor.cl b/libclc/clc/lib/generic/atomic/clc_atomic_fetch_xor.cl index 4424a298178f..d041fd164d38 100644 --- a/libclc/clc/lib/generic/atomic/clc_atomic_fetch_xor.cl +++ b/libclc/clc/lib/generic/atomic/clc_atomic_fetch_xor.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_atomic_fetch_xor -#define __IMPL_FUNCTION __scoped_atomic_fetch_xor +#define __CLC_FUNCTION __clc_atomic_fetch_xor +#define __CLC_IMPL_FUNCTION __scoped_atomic_fetch_xor #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/atomic/clc_atomic_inc.cl b/libclc/clc/lib/generic/atomic/clc_atomic_inc.cl index 019aa8d9d6dd..7171f84c30ce 100644 --- a/libclc/clc/lib/generic/atomic/clc_atomic_inc.cl +++ b/libclc/clc/lib/generic/atomic/clc_atomic_inc.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_atomic_inc -#define __IMPL_FUNCTION __scoped_atomic_fetch_sub +#define __CLC_FUNCTION __clc_atomic_inc +#define __CLC_IMPL_FUNCTION __scoped_atomic_fetch_sub #define __CLC_INC_DEC #define __CLC_BODY diff --git a/libclc/clc/lib/generic/atomic/clc_atomic_load.cl b/libclc/clc/lib/generic/atomic/clc_atomic_load.cl index 1f083073e43f..f7fe2510569e 100644 --- a/libclc/clc/lib/generic/atomic/clc_atomic_load.cl +++ b/libclc/clc/lib/generic/atomic/clc_atomic_load.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_atomic_load -#define __IMPL_FUNCTION __scoped_atomic_load_n +#define __CLC_FUNCTION __clc_atomic_load +#define __CLC_IMPL_FUNCTION __scoped_atomic_load_n #define __CLC_NO_VALUE_ARG #define __CLC_BODY diff --git a/libclc/clc/lib/generic/atomic/clc_atomic_store.cl b/libclc/clc/lib/generic/atomic/clc_atomic_store.cl index 8fd165b9a83b..a93d21e8430c 100644 --- a/libclc/clc/lib/generic/atomic/clc_atomic_store.cl +++ b/libclc/clc/lib/generic/atomic/clc_atomic_store.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_atomic_store -#define __IMPL_FUNCTION __scoped_atomic_store_n +#define __CLC_FUNCTION __clc_atomic_store +#define __CLC_IMPL_FUNCTION __scoped_atomic_store_n #define __CLC_RETURN_VOID #define __CLC_BODY diff --git a/libclc/clc/lib/generic/common/clc_radians.cl b/libclc/clc/lib/generic/common/clc_radians.cl index f8a1635ecb5c..497263a15f51 100644 --- a/libclc/clc/lib/generic/common/clc_radians.cl +++ b/libclc/clc/lib/generic/common/clc_radians.cl @@ -9,27 +9,27 @@ #include #include -#define RADIANS_SINGLE_DEF(TYPE, LITERAL) \ +#define __CLC_RADIANS_SINGLE_DEF(TYPE, LITERAL) \ _CLC_OVERLOAD _CLC_DEF TYPE __clc_radians(TYPE radians) { \ return (TYPE)LITERAL * radians; \ } -#define RADIANS_DEF(TYPE, LITERAL) \ - RADIANS_SINGLE_DEF(TYPE, LITERAL) \ - RADIANS_SINGLE_DEF(TYPE##2, LITERAL) \ - RADIANS_SINGLE_DEF(TYPE##3, LITERAL) \ - RADIANS_SINGLE_DEF(TYPE##4, LITERAL) \ - RADIANS_SINGLE_DEF(TYPE##8, LITERAL) \ - RADIANS_SINGLE_DEF(TYPE##16, LITERAL) +#define __CLC_RADIANS_DEF(TYPE, LITERAL) \ + __CLC_RADIANS_SINGLE_DEF(TYPE, LITERAL) \ + __CLC_RADIANS_SINGLE_DEF(TYPE##2, LITERAL) \ + __CLC_RADIANS_SINGLE_DEF(TYPE##3, LITERAL) \ + __CLC_RADIANS_SINGLE_DEF(TYPE##4, LITERAL) \ + __CLC_RADIANS_SINGLE_DEF(TYPE##8, LITERAL) \ + __CLC_RADIANS_SINGLE_DEF(TYPE##16, LITERAL) // pi/180 = ~0.01745329251994329577 or 0x1.1df46a2529d39p-6 or 0x1.1df46ap-6F -RADIANS_DEF(float, 0x1.1df46ap-6F) +__CLC_RADIANS_DEF(float, 0x1.1df46ap-6F) #ifdef cl_khr_fp64 #pragma OPENCL EXTENSION cl_khr_fp64 : enable // pi/180 = ~0.01745329251994329577 or 0x1.1df46a2529d39p-6 or 0x1.1df46ap-6F -RADIANS_DEF(double, 0x1.1df46a2529d39p-6) +__CLC_RADIANS_DEF(double, 0x1.1df46a2529d39p-6) #endif @@ -37,6 +37,6 @@ RADIANS_DEF(double, 0x1.1df46a2529d39p-6) #pragma OPENCL EXTENSION cl_khr_fp16 : enable // pi/180 = ~0.01745329251994329577 or 0x1.1df46a2529d39p-6 or 0x1.1df46ap-6F -RADIANS_DEF(half, (half)0x1.1df46a2529d39p-6) +__CLC_RADIANS_DEF(half, (half)0x1.1df46a2529d39p-6) #endif diff --git a/libclc/clc/lib/generic/geometric/clc_fast_distance.cl b/libclc/clc/lib/generic/geometric/clc_fast_distance.cl index 996039898480..6b645df0b3dd 100644 --- a/libclc/clc/lib/generic/geometric/clc_fast_distance.cl +++ b/libclc/clc/lib/generic/geometric/clc_fast_distance.cl @@ -9,6 +9,6 @@ #include #include -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/geometric/clc_fast_normalize.cl b/libclc/clc/lib/generic/geometric/clc_fast_normalize.cl index 85684d0f49bc..a5883efe7bd9 100644 --- a/libclc/clc/lib/generic/geometric/clc_fast_normalize.cl +++ b/libclc/clc/lib/generic/geometric/clc_fast_normalize.cl @@ -10,6 +10,6 @@ #include #include -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/integer/clc_add_sat.cl b/libclc/clc/lib/generic/integer/clc_add_sat.cl index 8241ee5d547a..08337bf533fc 100644 --- a/libclc/clc/lib/generic/integer/clc_add_sat.cl +++ b/libclc/clc/lib/generic/integer/clc_add_sat.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_add_sat -#define __IMPL_FUNCTION(x) __builtin_elementwise_add_sat +#define __CLC_FUNCTION __clc_add_sat +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_add_sat #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/integer/clc_bit_reverse.cl b/libclc/clc/lib/generic/integer/clc_bit_reverse.cl index 439957383f58..9bf57e2c7d83 100644 --- a/libclc/clc/lib/generic/integer/clc_bit_reverse.cl +++ b/libclc/clc/lib/generic/integer/clc_bit_reverse.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_bit_reverse -#define __IMPL_FUNCTION(x) __builtin_elementwise_bitreverse +#define __CLC_FUNCTION __clc_bit_reverse +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_bitreverse #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/integer/clc_clz.cl b/libclc/clc/lib/generic/integer/clc_clz.cl index c6e1da680b7b..0d0c80b7cd1f 100644 --- a/libclc/clc/lib/generic/integer/clc_clz.cl +++ b/libclc/clc/lib/generic/integer/clc_clz.cl @@ -42,6 +42,6 @@ _CLC_OVERLOAD _CLC_DEF ulong __clc_clz(ulong x) { return x ? __builtin_clzl(x) : 64; } -#define FUNCTION __clc_clz +#define __CLC_FUNCTION __clc_clz #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/integer/clc_ctz.cl b/libclc/clc/lib/generic/integer/clc_ctz.cl index d82d99d539df..8dbebb3f345a 100644 --- a/libclc/clc/lib/generic/integer/clc_ctz.cl +++ b/libclc/clc/lib/generic/integer/clc_ctz.cl @@ -38,6 +38,6 @@ _CLC_OVERLOAD _CLC_DEF ulong __clc_ctz(ulong x) { return __builtin_ctzg(x, 64); } -#define FUNCTION __clc_ctz +#define __CLC_FUNCTION __clc_ctz #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/integer/clc_popcount.cl b/libclc/clc/lib/generic/integer/clc_popcount.cl index 078ceecc9769..2781ead638c9 100644 --- a/libclc/clc/lib/generic/integer/clc_popcount.cl +++ b/libclc/clc/lib/generic/integer/clc_popcount.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_popcount -#define __IMPL_FUNCTION(x) __builtin_elementwise_popcount +#define __CLC_FUNCTION __clc_popcount +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_popcount #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/integer/clc_sub_sat.cl b/libclc/clc/lib/generic/integer/clc_sub_sat.cl index e664f04b1748..8a7ffd06f8b0 100644 --- a/libclc/clc/lib/generic/integer/clc_sub_sat.cl +++ b/libclc/clc/lib/generic/integer/clc_sub_sat.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_sub_sat -#define __IMPL_FUNCTION(x) __builtin_elementwise_sub_sat +#define __CLC_FUNCTION __clc_sub_sat +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_sub_sat #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_atan2.inc b/libclc/clc/lib/generic/math/clc_atan2.inc index 61ffeebbc5d1..19eaaeee0092 100644 --- a/libclc/clc/lib/generic/math/clc_atan2.inc +++ b/libclc/clc/lib/generic/math/clc_atan2.inc @@ -131,8 +131,8 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_atan2(__CLC_GENTYPE y, { __CLC_GENTYPE val = vbyu > 0.0625 ? vbyu : 0.063; __CLC_INTN index = __CLC_CONVERT_INTN(__clc_fma(256.0, val, 0.5)); - q1 = USE_TABLE(atan_jby256_tbl_head, index - 16); - q2 = USE_TABLE(atan_jby256_tbl_tail, index - 16); + q1 = __CLC_USE_TABLE(atan_jby256_tbl_head, index - 16); + q2 = __CLC_USE_TABLE(atan_jby256_tbl_tail, index - 16); __CLC_GENTYPE c = __CLC_CONVERT_GENTYPE(index) * 0x1.0p-8; // We're going to scale u and v by 2^(-u_exponent) to bring them close to 1 diff --git a/libclc/clc/lib/generic/math/clc_atan2pi.inc b/libclc/clc/lib/generic/math/clc_atan2pi.inc index 79b2551e077c..9f901947887d 100644 --- a/libclc/clc/lib/generic/math/clc_atan2pi.inc +++ b/libclc/clc/lib/generic/math/clc_atan2pi.inc @@ -110,8 +110,8 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_atan2pi(__CLC_GENTYPE y, { __CLC_GENTYPE val = vbyu > 0.0625 ? vbyu : 0.063; __CLC_INTN index = __CLC_CONVERT_INTN(__clc_fma(256.0, val, 0.5)); - q1 = USE_TABLE(atan_jby256_tbl_head, (index - 16)); - q2 = USE_TABLE(atan_jby256_tbl_tail, (index - 16)); + q1 = __CLC_USE_TABLE(atan_jby256_tbl_head, (index - 16)); + q2 = __CLC_USE_TABLE(atan_jby256_tbl_tail, (index - 16)); __CLC_GENTYPE c = __CLC_CONVERT_GENTYPE(index) * 0x1.0p-8; // We're going to scale u and v by 2^(-u_exponent) to bring them close to 1 diff --git a/libclc/clc/lib/generic/math/clc_cbrt.inc b/libclc/clc/lib/generic/math/clc_cbrt.inc index 2aba2484e33f..ce0e0fe45316 100644 --- a/libclc/clc/lib/generic/math/clc_cbrt.inc +++ b/libclc/clc/lib/generic/math/clc_cbrt.inc @@ -32,7 +32,7 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_cbrt(__CLC_GENTYPE x) { __CLC_AS_GENTYPE(indx | 0x3f000000); indx >>= 16; - __CLC_GENTYPE r = f * USE_TABLE(log_inv_tbl, __CLC_AS_INTN(indx)); + __CLC_GENTYPE r = f * __CLC_USE_TABLE(log_inv_tbl, __CLC_AS_INTN(indx)); __CLC_GENTYPE poly = __clc_mad(__clc_mad(r, 0x1.f9add4p-5f, -0x1.c71c72p-4f), r * r, r * 0x1.555556p-2f); @@ -52,8 +52,8 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_cbrt(__CLC_GENTYPE x) { remH = rem == 2 ? 0x1.964000p+0f : remH; remT = rem == 2 ? 0x1.fea53ep-12f : remT; - __CLC_GENTYPE cbrtH = USE_TABLE(cbrt_tbl_head, __CLC_AS_INTN(indx)); - __CLC_GENTYPE cbrtT = USE_TABLE(cbrt_tbl_tail, __CLC_AS_INTN(indx)); + __CLC_GENTYPE cbrtH = __CLC_USE_TABLE(cbrt_tbl_head, __CLC_AS_INTN(indx)); + __CLC_GENTYPE cbrtT = __CLC_USE_TABLE(cbrt_tbl_tail, __CLC_AS_INTN(indx)); __CLC_GENTYPE bH = cbrtH * remH; __CLC_GENTYPE bT = @@ -97,7 +97,7 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_cbrt(__CLC_GENTYPE x) { __CLC_GENTYPE F = __CLC_CONVERT_GENTYPE(index) * 0x1.0p-9; __CLC_GENTYPE f = Y - F; - __CLC_GENTYPE r = f * USE_TABLE(cbrt_inv_tbl, index - 256); + __CLC_GENTYPE r = f * __CLC_USE_TABLE(cbrt_inv_tbl, index - 256); __CLC_GENTYPE z = r * __clc_fma( @@ -112,11 +112,11 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_cbrt(__CLC_GENTYPE x) { -0x1.c71c71c71c71cp-4), 0x1.5555555555555p-2); - __CLC_GENTYPE Rem_h = USE_TABLE(cbrt_rem_tbl_head, rem + 2); - __CLC_GENTYPE Rem_t = USE_TABLE(cbrt_rem_tbl_tail, rem + 2); + __CLC_GENTYPE Rem_h = __CLC_USE_TABLE(cbrt_rem_tbl_head, rem + 2); + __CLC_GENTYPE Rem_t = __CLC_USE_TABLE(cbrt_rem_tbl_tail, rem + 2); - __CLC_GENTYPE F_h = USE_TABLE(cbrt_dbl_tbl_head, index - 256); - __CLC_GENTYPE F_t = USE_TABLE(cbrt_dbl_tbl_tail, index - 256); + __CLC_GENTYPE F_h = __CLC_USE_TABLE(cbrt_dbl_tbl_head, index - 256); + __CLC_GENTYPE F_t = __CLC_USE_TABLE(cbrt_dbl_tbl_tail, index - 256); __CLC_GENTYPE b_h = F_h * Rem_h; __CLC_GENTYPE b_t = __clc_fma(Rem_t, F_h, __clc_fma(F_t, Rem_h, F_t * Rem_t)); diff --git a/libclc/clc/lib/generic/math/clc_ceil.cl b/libclc/clc/lib/generic/math/clc_ceil.cl index b06cb364b58d..e48ad1a482ef 100644 --- a/libclc/clc/lib/generic/math/clc_ceil.cl +++ b/libclc/clc/lib/generic/math/clc_ceil.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_ceil -#define __IMPL_FUNCTION(x) __builtin_elementwise_ceil +#define __CLC_FUNCTION __clc_ceil +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_ceil #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_copysign.cl b/libclc/clc/lib/generic/math/clc_copysign.cl index 06f126b16dfd..89829e2375ea 100644 --- a/libclc/clc/lib/generic/math/clc_copysign.cl +++ b/libclc/clc/lib/generic/math/clc_copysign.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_copysign -#define __IMPL_FUNCTION(x) __builtin_elementwise_copysign +#define __CLC_FUNCTION __clc_copysign +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_copysign #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_cosh.inc b/libclc/clc/lib/generic/math/clc_cosh.inc index a9fa1bb14140..c80b1a38c776 100644 --- a/libclc/clc/lib/generic/math/clc_cosh.inc +++ b/libclc/clc/lib/generic/math/clc_cosh.inc @@ -71,8 +71,8 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_cosh(__CLC_GENTYPE x) { 0.500000000000000005911074e0f); cdy = __clc_mad(cdy, dy2, 1.0f); - __CLC_GENTYPE sinhcoshh = USE_TABLE(sinhcosh_tbl_head, ind); - __CLC_GENTYPE sinhcosht = USE_TABLE(sinhcosh_tbl_tail, ind); + __CLC_GENTYPE sinhcoshh = __CLC_USE_TABLE(sinhcosh_tbl_head, ind); + __CLC_GENTYPE sinhcosht = __CLC_USE_TABLE(sinhcosh_tbl_tail, ind); __CLC_GENTYPE z = __clc_mad(sinhcoshh, sdy, sinhcosht * cdy); // When exp(-x) is insignificant compared to exp(x), return exp(x)/2 @@ -162,10 +162,10 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_cosh(__CLC_GENTYPE x) { // At this point sinh(dy) is approximated by dy + sdy, // and cosh(dy) is approximated by 1 + cdy. - __CLC_GENTYPE cl = USE_TABLE(cosh_tbl_head, ind); - __CLC_GENTYPE ct = USE_TABLE(cosh_tbl_tail, ind); - __CLC_GENTYPE sl = USE_TABLE(sinh_tbl_head, ind); - __CLC_GENTYPE st = USE_TABLE(sinh_tbl_tail, ind); + __CLC_GENTYPE cl = __CLC_USE_TABLE(cosh_tbl_head, ind); + __CLC_GENTYPE ct = __CLC_USE_TABLE(cosh_tbl_tail, ind); + __CLC_GENTYPE sl = __CLC_USE_TABLE(sinh_tbl_head, ind); + __CLC_GENTYPE st = __CLC_USE_TABLE(sinh_tbl_tail, ind); __CLC_GENTYPE z = __clc_fma( diff --git a/libclc/clc/lib/generic/math/clc_ep_log.inc b/libclc/clc/lib/generic/math/clc_ep_log.inc index f51e487bedca..d8cc886ffc74 100644 --- a/libclc/clc/lib/generic/math/clc_ep_log.inc +++ b/libclc/clc/lib/generic/math/clc_ep_log.inc @@ -58,8 +58,8 @@ _CLC_DEF _CLC_OVERLOAD void __clc_ep_log(__CLC_GENTYPE x, __CLC_GENTYPE f2 = f - f1; __CLC_GENTYPE u2 = MATH_DIVIDE(f2, __clc_fma(0.5, f2, f1)); - __CLC_GENTYPE z1 = USE_TABLE(ln_tbl_lo, (index - 64)); - __CLC_GENTYPE q = USE_TABLE(ln_tbl_hi, (index - 64)); + __CLC_GENTYPE z1 = __CLC_USE_TABLE(ln_tbl_lo, (index - 64)); + __CLC_GENTYPE q = __CLC_USE_TABLE(ln_tbl_hi, (index - 64)); z1 = near_one ? r : z1; q = near_one ? 0.0 : q; diff --git a/libclc/clc/lib/generic/math/clc_erf.cl b/libclc/clc/lib/generic/math/clc_erf.cl index bea392445c93..34c7d586131e 100644 --- a/libclc/clc/lib/generic/math/clc_erf.cl +++ b/libclc/clc/lib/generic/math/clc_erf.cl @@ -506,6 +506,6 @@ _CLC_OVERLOAD _CLC_DEF half __clc_erf(half x) { #endif -#define FUNCTION __clc_erf +#define __CLC_FUNCTION __clc_erf #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_erfc.cl b/libclc/clc/lib/generic/math/clc_erfc.cl index fab696004602..7922807818ea 100644 --- a/libclc/clc/lib/generic/math/clc_erfc.cl +++ b/libclc/clc/lib/generic/math/clc_erfc.cl @@ -517,6 +517,6 @@ _CLC_OVERLOAD _CLC_DEF half __clc_erfc(half x) { #endif -#define FUNCTION __clc_erfc +#define __CLC_FUNCTION __clc_erfc #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_exp10.inc b/libclc/clc/lib/generic/math/clc_exp10.inc index 96bc5331fef1..8bf4ec4c0b37 100644 --- a/libclc/clc/lib/generic/math/clc_exp10.inc +++ b/libclc/clc/lib/generic/math/clc_exp10.inc @@ -69,7 +69,7 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_exp10(__CLC_GENTYPE x) { 0x1.000000p-1f), r * r, r); - __CLC_GENTYPE two_to_jby64 = USE_TABLE(exp_tbl, j); + __CLC_GENTYPE two_to_jby64 = __CLC_USE_TABLE(exp_tbl, j); z2 = __clc_mad(two_to_jby64, z2, two_to_jby64); __CLC_GENTYPE z2s = z2 * __CLC_AS_GENTYPE((__CLC_UINTN)0x1 << (m + 149)); @@ -122,8 +122,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_exp10(__CLC_GENTYPE x) { 0x1.0000000000000p-1), 1.0); - __CLC_GENTYPE tv0 = USE_TABLE(two_to_jby64_ep_tbl_head, j); - __CLC_GENTYPE tv1 = USE_TABLE(two_to_jby64_ep_tbl_tail, j); + __CLC_GENTYPE tv0 = __CLC_USE_TABLE(two_to_jby64_ep_tbl_head, j); + __CLC_GENTYPE tv1 = __CLC_USE_TABLE(two_to_jby64_ep_tbl_tail, j); z2 = __clc_fma(tv0 + tv1, z2, tv1) + tv0; __CLC_INTN small_value = diff --git a/libclc/clc/lib/generic/math/clc_exp_helper.cl b/libclc/clc/lib/generic/math/clc_exp_helper.cl index 92ff8f7fe4e6..1670b73b6c98 100644 --- a/libclc/clc/lib/generic/math/clc_exp_helper.cl +++ b/libclc/clc/lib/generic/math/clc_exp_helper.cl @@ -14,7 +14,7 @@ #include #include -#define __DOUBLE_ONLY +#define __CLC_DOUBLE_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_exp_helper.inc b/libclc/clc/lib/generic/math/clc_exp_helper.inc index 70ced7e9ea48..4ccf2d12b8cf 100644 --- a/libclc/clc/lib/generic/math/clc_exp_helper.inc +++ b/libclc/clc/lib/generic/math/clc_exp_helper.inc @@ -29,8 +29,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_exp_helper(__CLC_GENTYPE x, 0x1.0000000000000p-1), 1.0); - __CLC_GENTYPE tv0 = USE_TABLE(two_to_jby64_ep_tbl_head, j); - __CLC_GENTYPE tv1 = USE_TABLE(two_to_jby64_ep_tbl_tail, j); + __CLC_GENTYPE tv0 = __CLC_USE_TABLE(two_to_jby64_ep_tbl_head, j); + __CLC_GENTYPE tv1 = __CLC_USE_TABLE(two_to_jby64_ep_tbl_tail, j); z2 = __clc_fma(tv0 + tv1, z2, tv1) + tv0; __CLC_INTN small_value = diff --git a/libclc/clc/lib/generic/math/clc_expm1.inc b/libclc/clc/lib/generic/math/clc_expm1.inc index 6abee9b3f0cc..a7ff90ea86ca 100644 --- a/libclc/clc/lib/generic/math/clc_expm1.inc +++ b/libclc/clc/lib/generic/math/clc_expm1.inc @@ -37,8 +37,8 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_expm1(__CLC_GENTYPE x) { r); __CLC_GENTYPE m2 = __CLC_AS_GENTYPE((m + EXPBIAS_SP32) << EXPSHIFTBITS_SP32); - __CLC_GENTYPE exp_head = USE_TABLE(exp_tbl_ep_head, j); - __CLC_GENTYPE exp_tail = USE_TABLE(exp_tbl_ep_tail, j); + __CLC_GENTYPE exp_head = __CLC_USE_TABLE(exp_tbl_ep_head, j); + __CLC_GENTYPE exp_tail = __CLC_USE_TABLE(exp_tbl_ep_tail, j); __CLC_GENTYPE two_to_jby64_h = exp_head * m2; __CLC_GENTYPE two_to_jby64_t = exp_tail * m2; @@ -108,8 +108,8 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_expm1(__CLC_GENTYPE x) { __CLC_INTN j = n & 0x3f; __CLC_INTN m = n >> 6; - __CLC_GENTYPE f1 = USE_TABLE(two_to_jby64_ep_tbl_head, j); - __CLC_GENTYPE f2 = USE_TABLE(two_to_jby64_ep_tbl_tail, j); + __CLC_GENTYPE f1 = __CLC_USE_TABLE(two_to_jby64_ep_tbl_head, j); + __CLC_GENTYPE f2 = __CLC_USE_TABLE(two_to_jby64_ep_tbl_tail, j); __CLC_GENTYPE f = f1 + f2; __CLC_GENTYPE dn = __CLC_CONVERT_GENTYPE(-n); diff --git a/libclc/clc/lib/generic/math/clc_fabs.cl b/libclc/clc/lib/generic/math/clc_fabs.cl index a0f0f3af07e2..e0c7685bfdb6 100644 --- a/libclc/clc/lib/generic/math/clc_fabs.cl +++ b/libclc/clc/lib/generic/math/clc_fabs.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_fabs -#define __IMPL_FUNCTION(x) __builtin_elementwise_abs +#define __CLC_FUNCTION __clc_fabs +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_abs #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_floor.cl b/libclc/clc/lib/generic/math/clc_floor.cl index a14adb98297e..f31bed2e9ee6 100644 --- a/libclc/clc/lib/generic/math/clc_floor.cl +++ b/libclc/clc/lib/generic/math/clc_floor.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_floor -#define __IMPL_FUNCTION(x) __builtin_elementwise_floor +#define __CLC_FUNCTION __clc_floor +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_floor #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_fmax.cl b/libclc/clc/lib/generic/math/clc_fmax.cl index b334207365b9..0fdbaa5eef5f 100644 --- a/libclc/clc/lib/generic/math/clc_fmax.cl +++ b/libclc/clc/lib/generic/math/clc_fmax.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_fmax -#define __IMPL_FUNCTION(x) __builtin_elementwise_maximumnum +#define __CLC_FUNCTION __clc_fmax +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_maximumnum #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_fmin.cl b/libclc/clc/lib/generic/math/clc_fmin.cl index d21bb8d07679..572d54b128a6 100644 --- a/libclc/clc/lib/generic/math/clc_fmin.cl +++ b/libclc/clc/lib/generic/math/clc_fmin.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_fmin -#define __IMPL_FUNCTION(x) __builtin_elementwise_minimumnum +#define __CLC_FUNCTION __clc_fmin +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_minimumnum #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_fmod.cl b/libclc/clc/lib/generic/math/clc_fmod.cl index 3162ef60d46e..3cb01e67292e 100644 --- a/libclc/clc/lib/generic/math/clc_fmod.cl +++ b/libclc/clc/lib/generic/math/clc_fmod.cl @@ -64,11 +64,11 @@ _CLC_DEF _CLC_OVERLOAD float __clc_fmod(float x, float y) { return xr; } -#define __FLOAT_ONLY -#define FUNCTION __clc_fmod +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_fmod #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #ifdef cl_khr_fp64 @@ -176,11 +176,11 @@ _CLC_DEF _CLC_OVERLOAD double __clc_fmod(double x, double y) { return ret; } -#define __DOUBLE_ONLY -#define FUNCTION __clc_fmod +#define __CLC_DOUBLE_ONLY +#define __CLC_FUNCTION __clc_fmod #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif @@ -189,8 +189,8 @@ _CLC_DEF _CLC_OVERLOAD double __clc_fmod(double x, double y) { #pragma OPENCL EXTENSION cl_khr_fp16 : enable // Forward the half version of this builtin onto the float one -#define __HALF_ONLY -#define FUNCTION __clc_fmod +#define __CLC_HALF_ONLY +#define __CLC_FUNCTION __clc_fmod #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_fract.inc b/libclc/clc/lib/generic/math/clc_fract.inc index f0466e339b34..5b12c74f293f 100644 --- a/libclc/clc/lib/generic/math/clc_fract.inc +++ b/libclc/clc/lib/generic/math/clc_fract.inc @@ -23,7 +23,7 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_fract(__CLC_GENTYPE x, return r; } -#define FRACT_DEF(addrspace) \ +#define __CLC_FRACT_DEF(addrspace) \ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_fract( \ __CLC_GENTYPE x, addrspace __CLC_GENTYPE *iptr) { \ __CLC_GENTYPE private_iptr; \ @@ -32,10 +32,10 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_fract(__CLC_GENTYPE x, return ret; \ } -FRACT_DEF(local); -FRACT_DEF(global); +__CLC_FRACT_DEF(local); +__CLC_FRACT_DEF(global); #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -FRACT_DEF(generic); +__CLC_FRACT_DEF(generic); #endif #undef MIN_CONSTANT diff --git a/libclc/clc/lib/generic/math/clc_half_cos.cl b/libclc/clc/lib/generic/math/clc_half_cos.cl index 79a7ee7b483f..4420ad31afae 100644 --- a/libclc/clc/lib/generic/math/clc_half_cos.cl +++ b/libclc/clc/lib/generic/math/clc_half_cos.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_half_cos -#define __IMPL_FUNCTION(x) __clc_cos +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_cos +#define __CLC_IMPL_FUNCTION(x) __clc_cos #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_half_divide.cl b/libclc/clc/lib/generic/math/clc_half_divide.cl index 88676a4ac785..16af197d29a7 100644 --- a/libclc/clc/lib/generic/math/clc_half_divide.cl +++ b/libclc/clc/lib/generic/math/clc_half_divide.cl @@ -8,7 +8,7 @@ #include -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_half_exp.cl b/libclc/clc/lib/generic/math/clc_half_exp.cl index b53454580e3c..4b4717672d36 100644 --- a/libclc/clc/lib/generic/math/clc_half_exp.cl +++ b/libclc/clc/lib/generic/math/clc_half_exp.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_half_exp -#define __IMPL_FUNCTION(x) __clc_exp +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_exp +#define __CLC_IMPL_FUNCTION(x) __clc_exp #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_half_exp10.cl b/libclc/clc/lib/generic/math/clc_half_exp10.cl index 7bd107bf59e8..5bacca1ee0b7 100644 --- a/libclc/clc/lib/generic/math/clc_half_exp10.cl +++ b/libclc/clc/lib/generic/math/clc_half_exp10.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_half_exp10 -#define __IMPL_FUNCTION(x) __clc_exp10 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_exp10 +#define __CLC_IMPL_FUNCTION(x) __clc_exp10 #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_half_exp2.cl b/libclc/clc/lib/generic/math/clc_half_exp2.cl index a20d79bfff6e..9a8f2f980c5a 100644 --- a/libclc/clc/lib/generic/math/clc_half_exp2.cl +++ b/libclc/clc/lib/generic/math/clc_half_exp2.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_half_exp2 -#define __IMPL_FUNCTION(x) __clc_exp2 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_exp2 +#define __CLC_IMPL_FUNCTION(x) __clc_exp2 #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_half_log.cl b/libclc/clc/lib/generic/math/clc_half_log.cl index 26b2c756c988..160b193e8040 100644 --- a/libclc/clc/lib/generic/math/clc_half_log.cl +++ b/libclc/clc/lib/generic/math/clc_half_log.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_half_log -#define __IMPL_FUNCTION(x) __clc_log +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_log +#define __CLC_IMPL_FUNCTION(x) __clc_log #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_half_log10.cl b/libclc/clc/lib/generic/math/clc_half_log10.cl index 36f5bf55bb53..83d57db1bdf2 100644 --- a/libclc/clc/lib/generic/math/clc_half_log10.cl +++ b/libclc/clc/lib/generic/math/clc_half_log10.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_half_log10 -#define __IMPL_FUNCTION(x) __clc_log10 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_log10 +#define __CLC_IMPL_FUNCTION(x) __clc_log10 #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_half_log2.cl b/libclc/clc/lib/generic/math/clc_half_log2.cl index cbf1d350dd8e..7de0053fd750 100644 --- a/libclc/clc/lib/generic/math/clc_half_log2.cl +++ b/libclc/clc/lib/generic/math/clc_half_log2.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_half_log2 -#define __IMPL_FUNCTION(x) __clc_log2 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_log2 +#define __CLC_IMPL_FUNCTION(x) __clc_log2 #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_half_powr.cl b/libclc/clc/lib/generic/math/clc_half_powr.cl index f7ef2074b840..7065377ede66 100644 --- a/libclc/clc/lib/generic/math/clc_half_powr.cl +++ b/libclc/clc/lib/generic/math/clc_half_powr.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_half_powr -#define __IMPL_FUNCTION(x) __clc_powr +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_powr +#define __CLC_IMPL_FUNCTION(x) __clc_powr #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_half_recip.cl b/libclc/clc/lib/generic/math/clc_half_recip.cl index 0ae1e922d489..a988ad5e05a8 100644 --- a/libclc/clc/lib/generic/math/clc_half_recip.cl +++ b/libclc/clc/lib/generic/math/clc_half_recip.cl @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_half_rsqrt.cl b/libclc/clc/lib/generic/math/clc_half_rsqrt.cl index 7e5d9e052685..4e0cdd252f65 100644 --- a/libclc/clc/lib/generic/math/clc_half_rsqrt.cl +++ b/libclc/clc/lib/generic/math/clc_half_rsqrt.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_half_rsqrt -#define __IMPL_FUNCTION(x) __clc_rsqrt +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_rsqrt +#define __CLC_IMPL_FUNCTION(x) __clc_rsqrt #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_half_sin.cl b/libclc/clc/lib/generic/math/clc_half_sin.cl index ef333dae3797..acc5d43156ab 100644 --- a/libclc/clc/lib/generic/math/clc_half_sin.cl +++ b/libclc/clc/lib/generic/math/clc_half_sin.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_half_sin -#define __IMPL_FUNCTION(x) __clc_sin +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_sin +#define __CLC_IMPL_FUNCTION(x) __clc_sin #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_half_sqrt.cl b/libclc/clc/lib/generic/math/clc_half_sqrt.cl index 293eb81196b6..01e779960df6 100644 --- a/libclc/clc/lib/generic/math/clc_half_sqrt.cl +++ b/libclc/clc/lib/generic/math/clc_half_sqrt.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_half_sqrt -#define __IMPL_FUNCTION(x) __clc_sqrt +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_sqrt +#define __CLC_IMPL_FUNCTION(x) __clc_sqrt #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_half_tan.cl b/libclc/clc/lib/generic/math/clc_half_tan.cl index ecc9f8f32831..1427fe02555f 100644 --- a/libclc/clc/lib/generic/math/clc_half_tan.cl +++ b/libclc/clc/lib/generic/math/clc_half_tan.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_half_tan -#define __IMPL_FUNCTION(x) __clc_tan +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_half_tan +#define __CLC_IMPL_FUNCTION(x) __clc_tan #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_ldexp.cl b/libclc/clc/lib/generic/math/clc_ldexp.cl index cb4185d89c72..a5327c58e424 100644 --- a/libclc/clc/lib/generic/math/clc_ldexp.cl +++ b/libclc/clc/lib/generic/math/clc_ldexp.cl @@ -131,7 +131,7 @@ _CLC_OVERLOAD _CLC_DEF_ldexp half __clc_ldexp(half x, int n) { #endif -#define FUNCTION __clc_ldexp +#define __CLC_FUNCTION __clc_ldexp #define __CLC_DEF_SPEC _CLC_DEF_ldexp #define __CLC_ARG2_TYPE int #define __CLC_BODY diff --git a/libclc/clc/lib/generic/math/clc_log.cl b/libclc/clc/lib/generic/math/clc_log.cl index cf5628f206ca..7eb0180de971 100644 --- a/libclc/clc/lib/generic/math/clc_log.cl +++ b/libclc/clc/lib/generic/math/clc_log.cl @@ -39,6 +39,6 @@ _CLC_OVERLOAD _CLC_DEF half __clc_log(half x) { #endif // cl_khr_fp16 -#define FUNCTION __clc_log +#define __CLC_FUNCTION __clc_log #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_log10.cl b/libclc/clc/lib/generic/math/clc_log10.cl index f5f0e8cc7083..35489f467562 100644 --- a/libclc/clc/lib/generic/math/clc_log10.cl +++ b/libclc/clc/lib/generic/math/clc_log10.cl @@ -22,6 +22,6 @@ #include "clc_log_base.h" #undef COMPILING_LOG10 -#define FUNCTION __clc_log10 +#define __CLC_FUNCTION __clc_log10 #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_log1p.inc b/libclc/clc/lib/generic/math/clc_log1p.inc index 8c7dcfc48c18..2dd616818c71 100644 --- a/libclc/clc/lib/generic/math/clc_log1p.inc +++ b/libclc/clc/lib/generic/math/clc_log1p.inc @@ -56,7 +56,7 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_log1p(__CLC_GENTYPE x) { __CLC_GENTYPE f = mf > 24.0f ? fg24 : fl24; indx = indx >> 16; - __CLC_GENTYPE r = f * USE_TABLE(log_inv_tbl, __CLC_CONVERT_INTN(indx)); + __CLC_GENTYPE r = f * __CLC_USE_TABLE(log_inv_tbl, __CLC_CONVERT_INTN(indx)); // 1/3, 1/2 __CLC_GENTYPE poly = @@ -65,8 +65,8 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_log1p(__CLC_GENTYPE x) { const __CLC_GENTYPE LOG2_HEAD = 0x1.62e000p-1f; // 0.693115234 const __CLC_GENTYPE LOG2_TAIL = 0x1.0bfbe8p-15f; // 0.0000319461833 - __CLC_GENTYPE tv0 = USE_TABLE(loge_tbl_lo, __CLC_AS_INTN(indx)); - __CLC_GENTYPE tv1 = USE_TABLE(loge_tbl_hi, __CLC_AS_INTN(indx)); + __CLC_GENTYPE tv0 = __CLC_USE_TABLE(loge_tbl_lo, __CLC_AS_INTN(indx)); + __CLC_GENTYPE tv1 = __CLC_USE_TABLE(loge_tbl_hi, __CLC_AS_INTN(indx)); __CLC_GENTYPE z1 = __clc_mad(mf, LOG2_HEAD, tv0); __CLC_GENTYPE z2 = __clc_mad(mf, LOG2_TAIL, -poly) + tv1; __CLC_GENTYPE z = z1 + z2; @@ -108,8 +108,8 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_log1p(__CLC_GENTYPE x) { f2 = __CLC_CONVERT_LONGN(xexp <= -2 || (xexp >= MANTLENGTH_DP64 + 8)) ? f2temp : f2; - __CLC_GENTYPE z1 = USE_TABLE(ln_tbl_lo, j); - __CLC_GENTYPE q = USE_TABLE(ln_tbl_hi, j); + __CLC_GENTYPE z1 = __CLC_USE_TABLE(ln_tbl_lo, j); + __CLC_GENTYPE q = __CLC_USE_TABLE(ln_tbl_hi, j); __CLC_GENTYPE u = MATH_DIVIDE(f2, __clc_fma(0.5, f2, f1)); __CLC_GENTYPE v = u * u; diff --git a/libclc/clc/lib/generic/math/clc_log2.cl b/libclc/clc/lib/generic/math/clc_log2.cl index 335488af2f3d..d9d8cef54255 100644 --- a/libclc/clc/lib/generic/math/clc_log2.cl +++ b/libclc/clc/lib/generic/math/clc_log2.cl @@ -22,6 +22,6 @@ #include "clc_log_base.h" #undef COMPILING_LOG2 -#define FUNCTION __clc_log2 +#define __CLC_FUNCTION __clc_log2 #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_log_base.h b/libclc/clc/lib/generic/math/clc_log_base.h index 9418535db827..ba92679dbaaf 100644 --- a/libclc/clc/lib/generic/math/clc_log_base.h +++ b/libclc/clc/lib/generic/math/clc_log_base.h @@ -142,21 +142,21 @@ __clc_log(float x) __clc_as_float(0x3f000000 | (xin & MANTBITS_SP32)); indx = indx >> 16; - r = f * USE_TABLE(log_inv_tbl, indx); + r = f * __CLC_USE_TABLE(log_inv_tbl, indx); // 1/3, 1/2 float poly = __clc_mad(__clc_mad(r, 0x1.555556p-2f, 0.5f), r * r, r); #if defined(COMPILING_LOG2) - float2 tv = USE_TABLE(log2_tbl, indx); + float2 tv = __CLC_USE_TABLE(log2_tbl, indx); z1 = tv.s0 + mf; z2 = __clc_mad(poly, -LOG2E, tv.s1); #elif defined(COMPILING_LOG10) - float2 tv = USE_TABLE(log10_tbl, indx); + float2 tv = __CLC_USE_TABLE(log10_tbl, indx); z1 = __clc_mad(mf, LOG10_2_HEAD, tv.s0); z2 = __clc_mad(poly, -LOG10E, mf * LOG10_2_TAIL) + tv.s1; #else - float2 tv = USE_TABLE(log_tbl, indx); + float2 tv = __CLC_USE_TABLE(log_tbl, indx); z1 = __clc_mad(mf, LOG2_HEAD, tv.s0); z2 = __clc_mad(mf, LOG2_TAIL, -poly) + tv.s1; #endif @@ -261,8 +261,8 @@ __clc_log(double x) int index = __clc_as_int2(ux).hi >> 13; index = ((0x80 | (index & 0x7e)) >> 1) + (index & 0x1); - double z1 = USE_TABLE(ln_tbl_lo, index - 64); - double q = USE_TABLE(ln_tbl_hi, index - 64); + double z1 = __CLC_USE_TABLE(ln_tbl_lo, index - 64); + double q = __CLC_USE_TABLE(ln_tbl_hi, index - 64); double f1 = index * 0x1.0p-7; double f2 = f - f1; diff --git a/libclc/clc/lib/generic/math/clc_modf.inc b/libclc/clc/lib/generic/math/clc_modf.inc index 962d859ce9f6..4344c65a12be 100644 --- a/libclc/clc/lib/generic/math/clc_modf.inc +++ b/libclc/clc/lib/generic/math/clc_modf.inc @@ -11,7 +11,7 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_modf(__CLC_GENTYPE x, return __clc_copysign(__clc_isinf(x) ? __CLC_FP_LIT(0.0) : x - *iptr, x); } -#define CLC_MODF_DEF(addrspace) \ +#define __CLC_MODF_DEF(addrspace) \ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_modf( \ __CLC_GENTYPE x, addrspace __CLC_GENTYPE *iptr) { \ __CLC_GENTYPE private_iptr; \ @@ -20,11 +20,11 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_modf(__CLC_GENTYPE x, return ret; \ } -CLC_MODF_DEF(local); -CLC_MODF_DEF(global); +__CLC_MODF_DEF(local); +__CLC_MODF_DEF(global); #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -CLC_MODF_DEF(generic); +__CLC_MODF_DEF(generic); #endif -#undef CLC_MODF_DEF +#undef __CLC_MODF_DEF diff --git a/libclc/clc/lib/generic/math/clc_native_cos.cl b/libclc/clc/lib/generic/math/clc_native_cos.cl index 2e63e9c9493f..4e9a6c91b426 100644 --- a/libclc/clc/lib/generic/math/clc_native_cos.cl +++ b/libclc/clc/lib/generic/math/clc_native_cos.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_native_cos -#define __IMPL_FUNCTION(x) __builtin_elementwise_cos +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_cos +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_cos #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_native_divide.cl b/libclc/clc/lib/generic/math/clc_native_divide.cl index 005089b1ba15..abec9add4fd6 100644 --- a/libclc/clc/lib/generic/math/clc_native_divide.cl +++ b/libclc/clc/lib/generic/math/clc_native_divide.cl @@ -8,7 +8,7 @@ #include -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_native_exp.cl b/libclc/clc/lib/generic/math/clc_native_exp.cl index 2f50a0aefac9..63b4e5691397 100644 --- a/libclc/clc/lib/generic/math/clc_native_exp.cl +++ b/libclc/clc/lib/generic/math/clc_native_exp.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_native_exp -#define __IMPL_FUNCTION(x) __builtin_elementwise_exp +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_exp +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_exp #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_native_exp10.cl b/libclc/clc/lib/generic/math/clc_native_exp10.cl index 7ca5d1992c61..2819cd59c4be 100644 --- a/libclc/clc/lib/generic/math/clc_native_exp10.cl +++ b/libclc/clc/lib/generic/math/clc_native_exp10.cl @@ -10,7 +10,7 @@ #include #include -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_native_exp2.cl b/libclc/clc/lib/generic/math/clc_native_exp2.cl index 25f557306c35..a995b0347cac 100644 --- a/libclc/clc/lib/generic/math/clc_native_exp2.cl +++ b/libclc/clc/lib/generic/math/clc_native_exp2.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_native_exp2 -#define __IMPL_FUNCTION(x) __builtin_elementwise_exp2 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_exp2 +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_exp2 #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_native_log.cl b/libclc/clc/lib/generic/math/clc_native_log.cl index b9b9d274f8b9..617908277fb6 100644 --- a/libclc/clc/lib/generic/math/clc_native_log.cl +++ b/libclc/clc/lib/generic/math/clc_native_log.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_native_log -#define __IMPL_FUNCTION(x) __builtin_elementwise_log +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_log +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_log #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_native_log10.cl b/libclc/clc/lib/generic/math/clc_native_log10.cl index 221aa406466c..0558f8cb7049 100644 --- a/libclc/clc/lib/generic/math/clc_native_log10.cl +++ b/libclc/clc/lib/generic/math/clc_native_log10.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_native_log10 -#define __IMPL_FUNCTION(x) __builtin_elementwise_log10 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_log10 +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_log10 #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_native_log2.cl b/libclc/clc/lib/generic/math/clc_native_log2.cl index c3008ce242c7..c897ac07acb4 100644 --- a/libclc/clc/lib/generic/math/clc_native_log2.cl +++ b/libclc/clc/lib/generic/math/clc_native_log2.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_native_log2 -#define __IMPL_FUNCTION(x) __builtin_elementwise_log2 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_log2 +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_log2 #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_native_powr.cl b/libclc/clc/lib/generic/math/clc_native_powr.cl index 7c7dcaf8c508..dac9b7edf78b 100644 --- a/libclc/clc/lib/generic/math/clc_native_powr.cl +++ b/libclc/clc/lib/generic/math/clc_native_powr.cl @@ -10,7 +10,7 @@ #include #include -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_native_recip.cl b/libclc/clc/lib/generic/math/clc_native_recip.cl index 4377f10b1543..75d832c8467e 100644 --- a/libclc/clc/lib/generic/math/clc_native_recip.cl +++ b/libclc/clc/lib/generic/math/clc_native_recip.cl @@ -8,7 +8,7 @@ #include -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_native_rsqrt.cl b/libclc/clc/lib/generic/math/clc_native_rsqrt.cl index d5e6fcdae491..9b88e72126f8 100644 --- a/libclc/clc/lib/generic/math/clc_native_rsqrt.cl +++ b/libclc/clc/lib/generic/math/clc_native_rsqrt.cl @@ -10,5 +10,5 @@ #include #define __CLC_BODY -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #include diff --git a/libclc/clc/lib/generic/math/clc_native_sin.cl b/libclc/clc/lib/generic/math/clc_native_sin.cl index 533f8d726d41..941342f387a1 100644 --- a/libclc/clc/lib/generic/math/clc_native_sin.cl +++ b/libclc/clc/lib/generic/math/clc_native_sin.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_native_sin -#define __IMPL_FUNCTION(x) __builtin_elementwise_sin +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_sin +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_sin #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_native_sqrt.cl b/libclc/clc/lib/generic/math/clc_native_sqrt.cl index e0f028e988b4..cc18a4b7ba1d 100644 --- a/libclc/clc/lib/generic/math/clc_native_sqrt.cl +++ b/libclc/clc/lib/generic/math/clc_native_sqrt.cl @@ -8,9 +8,9 @@ #include -#define __FLOAT_ONLY -#define FUNCTION __clc_native_sqrt -#define __IMPL_FUNCTION(x) __builtin_elementwise_sqrt +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_sqrt +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_sqrt #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_native_tan.cl b/libclc/clc/lib/generic/math/clc_native_tan.cl index a9ac46688c8f..6b69067be388 100644 --- a/libclc/clc/lib/generic/math/clc_native_tan.cl +++ b/libclc/clc/lib/generic/math/clc_native_tan.cl @@ -10,7 +10,7 @@ #include #include -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_nextafter.cl b/libclc/clc/lib/generic/math/clc_nextafter.cl index 6fc699ce711a..40e1b5a2c57f 100644 --- a/libclc/clc/lib/generic/math/clc_nextafter.cl +++ b/libclc/clc/lib/generic/math/clc_nextafter.cl @@ -14,67 +14,69 @@ // This file provides OpenCL C implementations of __clc_nextafter for // targets that don't support the clang builtin. -#define CLC_AS_TYPE(x) __clc_as_##x +#define __CLC_CLC_AS_TYPE(x) __clc_as_##x -#define NEXTAFTER(FLOAT_TYPE, UINT_TYPE, INT_TYPE, INT_TYPE_SCALAR) \ +#define __CLC_NEXTAFTER(FLOAT_TYPE, UINT_TYPE, INT_TYPE, INT_TYPE_SCALAR) \ _CLC_OVERLOAD _CLC_DEF FLOAT_TYPE __clc_nextafter(FLOAT_TYPE x, \ FLOAT_TYPE y) { \ const UINT_TYPE sign_bit = (UINT_TYPE)1 \ << (sizeof(INT_TYPE_SCALAR) * 8 - 1); \ - UINT_TYPE ix = CLC_AS_TYPE(UINT_TYPE)(x); \ + UINT_TYPE ix = __CLC_CLC_AS_TYPE(UINT_TYPE)(x); \ FLOAT_TYPE absx = __clc_fabs(x); \ UINT_TYPE mxu = sign_bit - ix; \ - INT_TYPE mx = CLC_AS_TYPE(INT_TYPE)(mxu); \ - mx = CLC_AS_TYPE(INT_TYPE)(ix) < (INT_TYPE)0 ? mx \ - : CLC_AS_TYPE(INT_TYPE)(ix); \ - UINT_TYPE iy = CLC_AS_TYPE(UINT_TYPE)(y); \ + INT_TYPE mx = __CLC_CLC_AS_TYPE(INT_TYPE)(mxu); \ + mx = __CLC_CLC_AS_TYPE(INT_TYPE)(ix) < (INT_TYPE)0 \ + ? mx \ + : __CLC_CLC_AS_TYPE(INT_TYPE)(ix); \ + UINT_TYPE iy = __CLC_CLC_AS_TYPE(UINT_TYPE)(y); \ FLOAT_TYPE absy = __clc_fabs(y); \ UINT_TYPE myu = sign_bit - iy; \ - INT_TYPE my = CLC_AS_TYPE(INT_TYPE)(myu); \ - my = CLC_AS_TYPE(INT_TYPE)(iy) < (INT_TYPE)0 ? my \ - : CLC_AS_TYPE(INT_TYPE)(iy); \ - INT_TYPE t = mx + (mx < my ? (INT_TYPE)1 : (INT_TYPE)-1); \ - UINT_TYPE r = sign_bit - CLC_AS_TYPE(UINT_TYPE)(t); \ + INT_TYPE my = __CLC_CLC_AS_TYPE(INT_TYPE)(myu); \ + my = __CLC_CLC_AS_TYPE(INT_TYPE)(iy) < (INT_TYPE)0 \ + ? my \ + : __CLC_CLC_AS_TYPE(INT_TYPE)(iy); \ + INT_TYPE t = mx + (mx < my ? (INT_TYPE)1 : (INT_TYPE) - 1); \ + UINT_TYPE r = sign_bit - __CLC_CLC_AS_TYPE(UINT_TYPE)(t); \ r = (t < (INT_TYPE)0 || (t == (INT_TYPE)0 && mx < my)) \ ? r \ - : CLC_AS_TYPE(UINT_TYPE)(t); \ + : __CLC_CLC_AS_TYPE(UINT_TYPE)(t); \ r = __clc_isnan(x) ? ix : r; \ r = __clc_isnan(y) ? iy : r; \ - r = ((CLC_AS_TYPE(UINT_TYPE)(absx) | CLC_AS_TYPE(UINT_TYPE)(absy)) == \ - (UINT_TYPE)0 || \ + r = ((__CLC_CLC_AS_TYPE(UINT_TYPE)(absx) | \ + __CLC_CLC_AS_TYPE(UINT_TYPE)(absy)) == (UINT_TYPE)0 || \ ix == iy) \ ? iy \ : r; \ - return CLC_AS_TYPE(FLOAT_TYPE)(r); \ + return __CLC_CLC_AS_TYPE(FLOAT_TYPE)(r); \ } -NEXTAFTER(float, uint, int, int) -NEXTAFTER(float2, uint2, int2, int) -NEXTAFTER(float3, uint3, int3, int) -NEXTAFTER(float4, uint4, int4, int) -NEXTAFTER(float8, uint8, int8, int) -NEXTAFTER(float16, uint16, int16, int) +__CLC_NEXTAFTER(float, uint, int, int) +__CLC_NEXTAFTER(float2, uint2, int2, int) +__CLC_NEXTAFTER(float3, uint3, int3, int) +__CLC_NEXTAFTER(float4, uint4, int4, int) +__CLC_NEXTAFTER(float8, uint8, int8, int) +__CLC_NEXTAFTER(float16, uint16, int16, int) #ifdef cl_khr_fp64 #pragma OPENCL EXTENSION cl_khr_fp64 : enable -NEXTAFTER(double, ulong, long, long) -NEXTAFTER(double2, ulong2, long2, long) -NEXTAFTER(double3, ulong3, long3, long) -NEXTAFTER(double4, ulong4, long4, long) -NEXTAFTER(double8, ulong8, long8, long) -NEXTAFTER(double16, ulong16, long16, long) +__CLC_NEXTAFTER(double, ulong, long, long) +__CLC_NEXTAFTER(double2, ulong2, long2, long) +__CLC_NEXTAFTER(double3, ulong3, long3, long) +__CLC_NEXTAFTER(double4, ulong4, long4, long) +__CLC_NEXTAFTER(double8, ulong8, long8, long) +__CLC_NEXTAFTER(double16, ulong16, long16, long) #endif #ifdef cl_khr_fp16 #pragma OPENCL EXTENSION cl_khr_fp16 : enable -NEXTAFTER(half, ushort, short, short) -NEXTAFTER(half2, ushort2, short2, short) -NEXTAFTER(half3, ushort3, short3, short) -NEXTAFTER(half4, ushort4, short4, short) -NEXTAFTER(half8, ushort8, short8, short) -NEXTAFTER(half16, ushort16, short16, short) +__CLC_NEXTAFTER(half, ushort, short, short) +__CLC_NEXTAFTER(half2, ushort2, short2, short) +__CLC_NEXTAFTER(half3, ushort3, short3, short) +__CLC_NEXTAFTER(half4, ushort4, short4, short) +__CLC_NEXTAFTER(half8, ushort8, short8, short) +__CLC_NEXTAFTER(half16, ushort16, short16, short) #endif diff --git a/libclc/clc/lib/generic/math/clc_pow.inc b/libclc/clc/lib/generic/math/clc_pow.inc index 8b1f820268ba..35cbcdae8fff 100644 --- a/libclc/clc/lib/generic/math/clc_pow.inc +++ b/libclc/clc/lib/generic/math/clc_pow.inc @@ -103,8 +103,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_pow(__CLC_GENTYPE x, __CLC_AS_GENTYPE(0x3f000000 | (ixn & MANTBITS_SP32)); indx = indx >> 16; - __CLC_GENTYPE rh = f * USE_TABLE(log_inv_tbl_ep_head, indx); - __CLC_GENTYPE rt = f * USE_TABLE(log_inv_tbl_ep_tail, indx); + __CLC_GENTYPE rh = f * __CLC_USE_TABLE(log_inv_tbl_ep_head, indx); + __CLC_GENTYPE rt = f * __CLC_USE_TABLE(log_inv_tbl_ep_tail, indx); r = rh + rt; poly = __clc_mad(r, __clc_mad(r, 0x1.0p-2f, 0x1.555556p-2f), 0x1.0p-1f) * @@ -113,8 +113,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_pow(__CLC_GENTYPE x, const __CLC_GENTYPE LOG2_HEAD = 0x1.62e000p-1f; /* 0.693115234 */ const __CLC_GENTYPE LOG2_TAIL = 0x1.0bfbe8p-15f; /* 0.0000319461833 */ - __CLC_GENTYPE logel = USE_TABLE(loge_tbl_lo, indx); - __CLC_GENTYPE logeh = USE_TABLE(loge_tbl_hi, indx); + __CLC_GENTYPE logel = __CLC_USE_TABLE(loge_tbl_lo, indx); + __CLC_GENTYPE logeh = __CLC_USE_TABLE(loge_tbl_hi, indx); __CLC_GENTYPE lth = -r; __CLC_GENTYPE ltt = __clc_mad(mfn, LOG2_TAIL, -poly) + logeh; __CLC_GENTYPE lt = lth + ltt; @@ -161,8 +161,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_pow(__CLC_GENTYPE x, 0x1.000000p-1f), r * r, r); - __CLC_GENTYPE exp_head = USE_TABLE(exp_tbl_ep_head, j); - __CLC_GENTYPE exp_tail = USE_TABLE(exp_tbl_ep_tail, j); + __CLC_GENTYPE exp_head = __CLC_USE_TABLE(exp_tbl_ep_head, j); + __CLC_GENTYPE exp_tail = __CLC_USE_TABLE(exp_tbl_ep_tail, j); __CLC_GENTYPE expylogx = __clc_mad(exp_head, poly, __clc_mad(exp_tail, poly, exp_tail)) + exp_head; @@ -275,8 +275,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_pow(__CLC_GENTYPE x, __CLC_GENTYPE F = __CLC_AS_GENTYPE(rax | 0x3FE0000000000000L); __CLC_GENTYPE Y = __CLC_AS_GENTYPE(mantissa | 0x3FE0000000000000L); __CLC_GENTYPE f = F - Y; - __CLC_GENTYPE log_h = USE_TABLE(log_f_inv_tbl_head, index); - __CLC_GENTYPE log_t = USE_TABLE(log_f_inv_tbl_tail, index); + __CLC_GENTYPE log_h = __CLC_USE_TABLE(log_f_inv_tbl_head, index); + __CLC_GENTYPE log_t = __CLC_USE_TABLE(log_f_inv_tbl_tail, index); __CLC_GENTYPE f_inv = (log_h + log_t) * f; __CLC_GENTYPE r1 = __CLC_AS_GENTYPE(__CLC_AS_ULONGN(f_inv) & 0xfffffffff8000000L); @@ -296,8 +296,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_pow(__CLC_GENTYPE x, __CLC_GENTYPE poly0t = r1 - poly0h + hr1r1; poly = __clc_fma(r1, r2, __clc_fma(0.5 * r2, r2, poly)) + r2 + poly0t; - log_h = USE_TABLE(powlog_tbl_head, index); - log_t = USE_TABLE(powlog_tbl_tail, index); + log_h = __CLC_USE_TABLE(powlog_tbl_head, index); + log_t = __CLC_USE_TABLE(powlog_tbl_tail, index); __CLC_GENTYPE resT_t = __clc_fma(xexp, real_log2_tail, +log_t) - poly; __CLC_GENTYPE resT = resT_t - poly0h; @@ -345,8 +345,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_pow(__CLC_GENTYPE x, __CLC_INTN j = n & 0x0000003f; __CLC_INTN m = n >> 6; - __CLC_GENTYPE f1 = USE_TABLE(two_to_jby64_ep_tbl_head, j); - __CLC_GENTYPE f2 = USE_TABLE(two_to_jby64_ep_tbl_tail, j); + __CLC_GENTYPE f1 = __CLC_USE_TABLE(two_to_jby64_ep_tbl_head, j); + __CLC_GENTYPE f2 = __CLC_USE_TABLE(two_to_jby64_ep_tbl_tail, j); __CLC_GENTYPE f = f1 + f2; __CLC_GENTYPE r1 = __clc_fma(dn, -lnof2_by_64_head, v); diff --git a/libclc/clc/lib/generic/math/clc_pown.inc b/libclc/clc/lib/generic/math/clc_pown.inc index 483fd2faf271..1a681b5e4b39 100644 --- a/libclc/clc/lib/generic/math/clc_pown.inc +++ b/libclc/clc/lib/generic/math/clc_pown.inc @@ -104,8 +104,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_pown(__CLC_GENTYPE x, __CLC_AS_GENTYPE(0x3f000000 | (ixn & MANTBITS_SP32)); indx = indx >> 16; - __CLC_GENTYPE rh = f * USE_TABLE(log_inv_tbl_ep_head, indx); - __CLC_GENTYPE rt = f * USE_TABLE(log_inv_tbl_ep_tail, indx); + __CLC_GENTYPE rh = f * __CLC_USE_TABLE(log_inv_tbl_ep_head, indx); + __CLC_GENTYPE rt = f * __CLC_USE_TABLE(log_inv_tbl_ep_tail, indx); r = rh + rt; poly = __clc_mad(r, __clc_mad(r, 0x1.0p-2f, 0x1.555556p-2f), 0x1.0p-1f) * @@ -114,8 +114,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_pown(__CLC_GENTYPE x, const __CLC_GENTYPE LOG2_HEAD = 0x1.62e000p-1f; // 0.693115234 const __CLC_GENTYPE LOG2_TAIL = 0x1.0bfbe8p-15f; // 0.0000319461833 - __CLC_GENTYPE logel = USE_TABLE(loge_tbl_lo, indx); - __CLC_GENTYPE logeh = USE_TABLE(loge_tbl_hi, indx); + __CLC_GENTYPE logel = __CLC_USE_TABLE(loge_tbl_lo, indx); + __CLC_GENTYPE logeh = __CLC_USE_TABLE(loge_tbl_hi, indx); __CLC_GENTYPE lth = -r; __CLC_GENTYPE ltt = __clc_mad(mfn, LOG2_TAIL, -poly) + logeh; __CLC_GENTYPE lt = lth + ltt; @@ -162,8 +162,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_pown(__CLC_GENTYPE x, 0x1.000000p-1f), r * r, r); - __CLC_GENTYPE exp_head = USE_TABLE(exp_tbl_ep_head, j); - __CLC_GENTYPE exp_tail = USE_TABLE(exp_tbl_ep_tail, j); + __CLC_GENTYPE exp_head = __CLC_USE_TABLE(exp_tbl_ep_head, j); + __CLC_GENTYPE exp_tail = __CLC_USE_TABLE(exp_tbl_ep_tail, j); __CLC_GENTYPE expylogx = __clc_mad(exp_head, poly, __clc_mad(exp_tail, poly, exp_tail)) + exp_head; @@ -256,8 +256,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_pown(__CLC_GENTYPE x, __CLC_GENTYPE F = __CLC_AS_GENTYPE(rax | 0x3FE0000000000000L); __CLC_GENTYPE Y = __CLC_AS_GENTYPE(mantissa | 0x3FE0000000000000L); __CLC_GENTYPE f = F - Y; - __CLC_GENTYPE log_h = USE_TABLE(log_f_inv_tbl_head, index); - __CLC_GENTYPE log_t = USE_TABLE(log_f_inv_tbl_tail, index); + __CLC_GENTYPE log_h = __CLC_USE_TABLE(log_f_inv_tbl_head, index); + __CLC_GENTYPE log_t = __CLC_USE_TABLE(log_f_inv_tbl_tail, index); __CLC_GENTYPE f_inv = (log_h + log_t) * f; __CLC_GENTYPE r1 = __CLC_AS_GENTYPE(__CLC_AS_ULONGN(f_inv) & 0xfffffffff8000000L); @@ -277,8 +277,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_pown(__CLC_GENTYPE x, __CLC_GENTYPE poly0t = r1 - poly0h + hr1r1; poly = __clc_fma(r1, r2, __clc_fma(0.5 * r2, r2, poly)) + r2 + poly0t; - log_h = USE_TABLE(powlog_tbl_head, index); - log_t = USE_TABLE(powlog_tbl_tail, index); + log_h = __CLC_USE_TABLE(powlog_tbl_head, index); + log_t = __CLC_USE_TABLE(powlog_tbl_tail, index); __CLC_GENTYPE resT_t = __clc_fma(xexp, real_log2_tail, +log_t) - poly; __CLC_GENTYPE resT = resT_t - poly0h; @@ -332,8 +332,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_pown(__CLC_GENTYPE x, __CLC_INTN j = n & 0x0000003f; __CLC_INTN m = n >> 6; - __CLC_GENTYPE f1 = USE_TABLE(two_to_jby64_ep_tbl_head, j); - __CLC_GENTYPE f2 = USE_TABLE(two_to_jby64_ep_tbl_tail, j); + __CLC_GENTYPE f1 = __CLC_USE_TABLE(two_to_jby64_ep_tbl_head, j); + __CLC_GENTYPE f2 = __CLC_USE_TABLE(two_to_jby64_ep_tbl_tail, j); __CLC_GENTYPE f = f1 + f2; __CLC_GENTYPE r1 = __clc_fma(dn, -lnof2_by_64_head, v); diff --git a/libclc/clc/lib/generic/math/clc_powr.inc b/libclc/clc/lib/generic/math/clc_powr.inc index 1244f7f6ac5d..b94dbfdcbdeb 100644 --- a/libclc/clc/lib/generic/math/clc_powr.inc +++ b/libclc/clc/lib/generic/math/clc_powr.inc @@ -102,8 +102,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_powr(__CLC_GENTYPE x, __CLC_AS_GENTYPE(0x3f000000 | (ixn & MANTBITS_SP32)); indx = indx >> 16; - __CLC_GENTYPE rh = f * USE_TABLE(log_inv_tbl_ep_head, indx); - __CLC_GENTYPE rt = f * USE_TABLE(log_inv_tbl_ep_tail, indx); + __CLC_GENTYPE rh = f * __CLC_USE_TABLE(log_inv_tbl_ep_head, indx); + __CLC_GENTYPE rt = f * __CLC_USE_TABLE(log_inv_tbl_ep_tail, indx); r = rh + rt; poly = __clc_mad(r, __clc_mad(r, 0x1.0p-2f, 0x1.555556p-2f), 0x1.0p-1f) * @@ -112,8 +112,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_powr(__CLC_GENTYPE x, const __CLC_GENTYPE LOG2_HEAD = 0x1.62e000p-1f; // 0.693115234 const __CLC_GENTYPE LOG2_TAIL = 0x1.0bfbe8p-15f; // 0.0000319461833 - __CLC_GENTYPE logel = USE_TABLE(loge_tbl_lo, indx); - __CLC_GENTYPE logeh = USE_TABLE(loge_tbl_hi, indx); + __CLC_GENTYPE logel = __CLC_USE_TABLE(loge_tbl_lo, indx); + __CLC_GENTYPE logeh = __CLC_USE_TABLE(loge_tbl_hi, indx); __CLC_GENTYPE lth = -r; __CLC_GENTYPE ltt = __clc_mad(mfn, LOG2_TAIL, -poly) + logeh; __CLC_GENTYPE lt = lth + ltt; @@ -159,8 +159,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_powr(__CLC_GENTYPE x, 0x1.000000p-1f), r * r, r); - __CLC_GENTYPE exp_head = USE_TABLE(exp_tbl_ep_head, j); - __CLC_GENTYPE exp_tail = USE_TABLE(exp_tbl_ep_tail, j); + __CLC_GENTYPE exp_head = __CLC_USE_TABLE(exp_tbl_ep_head, j); + __CLC_GENTYPE exp_tail = __CLC_USE_TABLE(exp_tbl_ep_tail, j); __CLC_GENTYPE expylogx = __clc_mad(exp_head, poly, __clc_mad(exp_tail, poly, exp_tail)) + exp_head; @@ -261,8 +261,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_powr(__CLC_GENTYPE x, __CLC_GENTYPE F = __CLC_AS_GENTYPE(rax | 0x3FE0000000000000L); __CLC_GENTYPE Y = __CLC_AS_GENTYPE(mantissa | 0x3FE0000000000000L); __CLC_GENTYPE f = F - Y; - __CLC_GENTYPE log_h = USE_TABLE(log_f_inv_tbl_head, index); - __CLC_GENTYPE log_t = USE_TABLE(log_f_inv_tbl_tail, index); + __CLC_GENTYPE log_h = __CLC_USE_TABLE(log_f_inv_tbl_head, index); + __CLC_GENTYPE log_t = __CLC_USE_TABLE(log_f_inv_tbl_tail, index); __CLC_GENTYPE f_inv = (log_h + log_t) * f; __CLC_GENTYPE r1 = __CLC_AS_GENTYPE(__CLC_AS_ULONGN(f_inv) & 0xfffffffff8000000L); @@ -282,8 +282,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_powr(__CLC_GENTYPE x, __CLC_GENTYPE poly0t = r1 - poly0h + hr1r1; poly = __clc_fma(r1, r2, __clc_fma(0.5 * r2, r2, poly)) + r2 + poly0t; - log_h = USE_TABLE(powlog_tbl_head, index); - log_t = USE_TABLE(powlog_tbl_tail, index); + log_h = __CLC_USE_TABLE(powlog_tbl_head, index); + log_t = __CLC_USE_TABLE(powlog_tbl_tail, index); __CLC_GENTYPE resT_t = __clc_fma(xexp, real_log2_tail, +log_t) - poly; __CLC_GENTYPE resT = resT_t - poly0h; @@ -331,8 +331,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_powr(__CLC_GENTYPE x, __CLC_INTN j = n & 0x0000003f; __CLC_INTN m = n >> 6; - __CLC_GENTYPE f1 = USE_TABLE(two_to_jby64_ep_tbl_head, j); - __CLC_GENTYPE f2 = USE_TABLE(two_to_jby64_ep_tbl_tail, j); + __CLC_GENTYPE f1 = __CLC_USE_TABLE(two_to_jby64_ep_tbl_head, j); + __CLC_GENTYPE f2 = __CLC_USE_TABLE(two_to_jby64_ep_tbl_tail, j); __CLC_GENTYPE f = f1 + f2; __CLC_GENTYPE r1 = __clc_fma(dn, -lnof2_by_64_head, v); diff --git a/libclc/clc/lib/generic/math/clc_remainder.cl b/libclc/clc/lib/generic/math/clc_remainder.cl index 2b3d185a8bee..488dde73f67a 100644 --- a/libclc/clc/lib/generic/math/clc_remainder.cl +++ b/libclc/clc/lib/generic/math/clc_remainder.cl @@ -74,11 +74,11 @@ _CLC_DEF _CLC_OVERLOAD float __clc_remainder(float x, float y) { return xr; } -#define __FLOAT_ONLY -#define FUNCTION __clc_remainder +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_remainder #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #ifdef cl_khr_fp64 @@ -212,11 +212,11 @@ _CLC_DEF _CLC_OVERLOAD double __clc_remainder(double x, double y) { return ret; } -#define __DOUBLE_ONLY -#define FUNCTION __clc_remainder +#define __CLC_DOUBLE_ONLY +#define __CLC_FUNCTION __clc_remainder #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif @@ -225,8 +225,8 @@ _CLC_DEF _CLC_OVERLOAD double __clc_remainder(double x, double y) { #pragma OPENCL EXTENSION cl_khr_fp16 : enable // Forward the half version of this builtin onto the float one -#define __HALF_ONLY -#define FUNCTION __clc_remainder +#define __CLC_HALF_ONLY +#define __CLC_FUNCTION __clc_remainder #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_remquo.inc b/libclc/clc/lib/generic/math/clc_remquo.inc index 28f51c4e2fc2..3a76ffed7f03 100644 --- a/libclc/clc/lib/generic/math/clc_remquo.inc +++ b/libclc/clc/lib/generic/math/clc_remquo.inc @@ -74,7 +74,7 @@ _CLC_DEF _CLC_OVERLOAD float __clc_remquo(float x, float y, } // remquo signature is special, we don't have macro for this -#define __VEC_REMQUO(TYPE, VEC_SIZE, HALF_VEC_SIZE) \ +#define __CLC_VEC_REMQUO(TYPE, VEC_SIZE, HALF_VEC_SIZE) \ _CLC_DEF _CLC_OVERLOAD TYPE##VEC_SIZE __clc_remquo( \ TYPE##VEC_SIZE x, TYPE##VEC_SIZE y, \ __CLC_ADDRESS_SPACE int##VEC_SIZE *quo) { \ @@ -87,7 +87,7 @@ _CLC_DEF _CLC_OVERLOAD float __clc_remquo(float x, float y, return ret; \ } -#define __VEC3_REMQUO(TYPE) \ +#define __CLC_VEC3_REMQUO(TYPE) \ _CLC_DEF _CLC_OVERLOAD TYPE##3 __clc_remquo( \ TYPE##3 x, TYPE##3 y, __CLC_ADDRESS_SPACE int##3 * quo) { \ int2 lo; \ @@ -99,11 +99,11 @@ _CLC_DEF _CLC_OVERLOAD float __clc_remquo(float x, float y, (*quo).s2 = hi; \ return ret; \ } -__VEC_REMQUO(float, 2, ) -__VEC3_REMQUO(float) -__VEC_REMQUO(float, 4, 2) -__VEC_REMQUO(float, 8, 4) -__VEC_REMQUO(float, 16, 8) +__CLC_VEC_REMQUO(float, 2, ) +__CLC_VEC3_REMQUO(float) +__CLC_VEC_REMQUO(float, 4, 2) +__CLC_VEC_REMQUO(float, 8, 4) +__CLC_VEC_REMQUO(float, 16, 8) #ifdef cl_khr_fp64 @@ -246,11 +246,11 @@ _CLC_DEF _CLC_OVERLOAD double __clc_remquo(double x, double y, *pquo = quo; return ret; } -__VEC_REMQUO(double, 2, ) -__VEC3_REMQUO(double) -__VEC_REMQUO(double, 4, 2) -__VEC_REMQUO(double, 8, 4) -__VEC_REMQUO(double, 16, 8) +__CLC_VEC_REMQUO(double, 2, ) +__CLC_VEC3_REMQUO(double) +__CLC_VEC_REMQUO(double, 4, 2) +__CLC_VEC_REMQUO(double, 8, 4) +__CLC_VEC_REMQUO(double, 16, 8) #endif @@ -262,10 +262,10 @@ _CLC_OVERLOAD _CLC_DEF half __clc_remquo(half x, half y, __CLC_ADDRESS_SPACE int *pquo) { return (half)__clc_remquo((float)x, (float)y, pquo); } -__VEC_REMQUO(half, 2, ) -__VEC3_REMQUO(half) -__VEC_REMQUO(half, 4, 2) -__VEC_REMQUO(half, 8, 4) -__VEC_REMQUO(half, 16, 8) +__CLC_VEC_REMQUO(half, 2, ) +__CLC_VEC3_REMQUO(half) +__CLC_VEC_REMQUO(half, 4, 2) +__CLC_VEC_REMQUO(half, 8, 4) +__CLC_VEC_REMQUO(half, 16, 8) #endif diff --git a/libclc/clc/lib/generic/math/clc_rint.cl b/libclc/clc/lib/generic/math/clc_rint.cl index b3f94490e3b5..e3aaae0ffec6 100644 --- a/libclc/clc/lib/generic/math/clc_rint.cl +++ b/libclc/clc/lib/generic/math/clc_rint.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_rint -#define __IMPL_FUNCTION(x) __builtin_elementwise_rint +#define __CLC_FUNCTION __clc_rint +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_rint #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_rootn.inc b/libclc/clc/lib/generic/math/clc_rootn.inc index 996f88f14535..fd3d0becb0df 100644 --- a/libclc/clc/lib/generic/math/clc_rootn.inc +++ b/libclc/clc/lib/generic/math/clc_rootn.inc @@ -103,8 +103,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_rootn(__CLC_GENTYPE x, __CLC_AS_GENTYPE(0x3f000000 | (ixn & MANTBITS_SP32)); indx = indx >> 16; - __CLC_GENTYPE rh = f * USE_TABLE(log_inv_tbl_ep_head, indx); - __CLC_GENTYPE rt = f * USE_TABLE(log_inv_tbl_ep_tail, indx); + __CLC_GENTYPE rh = f * __CLC_USE_TABLE(log_inv_tbl_ep_head, indx); + __CLC_GENTYPE rt = f * __CLC_USE_TABLE(log_inv_tbl_ep_tail, indx); ; r = rh + rt; @@ -116,9 +116,10 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_rootn(__CLC_GENTYPE x, const __CLC_GENTYPE LOG2_TAIL = 0x1.0bfbe8p-15f; // 0.0000319461833 __CLC_GENTYPE lth = -r; __CLC_GENTYPE ltt = - __clc_mad(mfn, LOG2_TAIL, -poly) + USE_TABLE(loge_tbl_hi, indx); + __clc_mad(mfn, LOG2_TAIL, -poly) + __CLC_USE_TABLE(loge_tbl_hi, indx); __CLC_GENTYPE lt = lth + ltt; - __CLC_GENTYPE lh = __clc_mad(mfn, LOG2_HEAD, USE_TABLE(loge_tbl_lo, indx)); + __CLC_GENTYPE lh = + __clc_mad(mfn, LOG2_HEAD, __CLC_USE_TABLE(loge_tbl_lo, indx)); __CLC_GENTYPE l = lh + lt; // Select near 1 or not @@ -165,8 +166,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_rootn(__CLC_GENTYPE x, 0x1.000000p-1f), r * r, r); - __CLC_GENTYPE exph = USE_TABLE(exp_tbl_ep_head, j); - __CLC_GENTYPE expt = USE_TABLE(exp_tbl_ep_tail, j); + __CLC_GENTYPE exph = __CLC_USE_TABLE(exp_tbl_ep_head, j); + __CLC_GENTYPE expt = __CLC_USE_TABLE(exp_tbl_ep_tail, j); __CLC_GENTYPE expylogx = __clc_mad(exph, poly, __clc_mad(expt, poly, expt)) + exph; @@ -263,8 +264,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_rootn(__CLC_GENTYPE x, __CLC_GENTYPE F = __CLC_AS_GENTYPE(rax | 0x3FE0000000000000L); __CLC_GENTYPE Y = __CLC_AS_GENTYPE(mantissa | 0x3FE0000000000000L); __CLC_GENTYPE f = F - Y; - __CLC_GENTYPE log_h = USE_TABLE(log_f_inv_tbl_head, index); - __CLC_GENTYPE log_t = USE_TABLE(log_f_inv_tbl_tail, index); + __CLC_GENTYPE log_h = __CLC_USE_TABLE(log_f_inv_tbl_head, index); + __CLC_GENTYPE log_t = __CLC_USE_TABLE(log_f_inv_tbl_tail, index); __CLC_GENTYPE f_inv = (log_h + log_t) * f; __CLC_GENTYPE r1 = __CLC_AS_GENTYPE(__CLC_AS_ULONGN(f_inv) & 0xfffffffff8000000L); @@ -284,8 +285,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_rootn(__CLC_GENTYPE x, __CLC_GENTYPE poly0t = r1 - poly0h + hr1r1; poly = __clc_fma(r1, r2, __clc_fma(0.5 * r2, r2, poly)) + r2 + poly0t; - log_h = USE_TABLE(powlog_tbl_head, index); - log_t = USE_TABLE(powlog_tbl_tail, index); + log_h = __CLC_USE_TABLE(powlog_tbl_head, index); + log_t = __CLC_USE_TABLE(powlog_tbl_tail, index); __CLC_GENTYPE resT_t = __clc_fma(xexp, real_log2_tail, +log_t) - poly; __CLC_GENTYPE resT = resT_t - poly0h; @@ -338,8 +339,8 @@ _CLC_DEF _CLC_OVERLOAD __CLC_GENTYPE __clc_rootn(__CLC_GENTYPE x, __CLC_INTN j = n & 0x0000003f; __CLC_INTN m = n >> 6; - __CLC_GENTYPE f1 = USE_TABLE(two_to_jby64_ep_tbl_head, j); - __CLC_GENTYPE f2 = USE_TABLE(two_to_jby64_ep_tbl_tail, j); + __CLC_GENTYPE f1 = __CLC_USE_TABLE(two_to_jby64_ep_tbl_head, j); + __CLC_GENTYPE f2 = __CLC_USE_TABLE(two_to_jby64_ep_tbl_tail, j); __CLC_GENTYPE f = f1 + f2; __CLC_GENTYPE r1 = __clc_fma(dn, -lnof2_by_64_head, v); diff --git a/libclc/clc/lib/generic/math/clc_round.cl b/libclc/clc/lib/generic/math/clc_round.cl index 8c298d8c3483..5ed8d08ba4f4 100644 --- a/libclc/clc/lib/generic/math/clc_round.cl +++ b/libclc/clc/lib/generic/math/clc_round.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_round -#define __IMPL_FUNCTION(x) __builtin_elementwise_round +#define __CLC_FUNCTION __clc_round +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_round #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_sincos_helpers.cl b/libclc/clc/lib/generic/math/clc_sincos_helpers.cl index 0ea1195fffa7..19705c42f6f0 100644 --- a/libclc/clc/lib/generic/math/clc_sincos_helpers.cl +++ b/libclc/clc/lib/generic/math/clc_sincos_helpers.cl @@ -18,16 +18,16 @@ #define bitalign(hi, lo, shift) ((hi) << (32 - (shift))) | ((lo) >> (shift)); -#define FULL_MUL(A, B, HI, LO) \ +#define __CLC_FULL_MUL(A, B, HI, LO) \ LO = A * B; \ HI = __clc_mul_hi(A, B) -#define FULL_MAD(A, B, C, HI, LO) \ +#define __CLC_FULL_MAD(A, B, C, HI, LO) \ LO = ((A) * (B) + (C)); \ HI = __clc_mul_hi(A, B); \ HI += LO < C ? 1U : 0U; -#define __FLOAT_ONLY +#define __CLC_FLOAT_ONLY #define __CLC_BODY #include @@ -45,7 +45,7 @@ ((__CLC_CONVERT_LONGN((src0)) << 32) | __CLC_CONVERT_LONGN((src1))) >> \ (((src2) & 3) * 8))) -#define __DOUBLE_ONLY +#define __CLC_DOUBLE_ONLY #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_sincos_helpers.inc b/libclc/clc/lib/generic/math/clc_sincos_helpers.inc index 29c742136b7e..bddc0998cf95 100644 --- a/libclc/clc/lib/generic/math/clc_sincos_helpers.inc +++ b/libclc/clc/lib/generic/math/clc_sincos_helpers.inc @@ -175,13 +175,13 @@ _CLC_DEF _CLC_OVERLOAD __CLC_INTN __clc_argReductionLargeS( __CLC_UINTN p0, p1, p2, p3, p4, p5, p6, p7, c0, c1; - FULL_MUL(xm, b0, c0, p0); - FULL_MAD(xm, b1, c0, c1, p1); - FULL_MAD(xm, b2, c1, c0, p2); - FULL_MAD(xm, b3, c0, c1, p3); - FULL_MAD(xm, b4, c1, c0, p4); - FULL_MAD(xm, b5, c0, c1, p5); - FULL_MAD(xm, b6, c1, p7, p6); + __CLC_FULL_MUL(xm, b0, c0, p0); + __CLC_FULL_MAD(xm, b1, c0, c1, p1); + __CLC_FULL_MAD(xm, b2, c1, c0, p2); + __CLC_FULL_MAD(xm, b3, c0, c1, p3); + __CLC_FULL_MAD(xm, b4, c1, c0, p4); + __CLC_FULL_MAD(xm, b5, c0, c1, p5); + __CLC_FULL_MAD(xm, b6, c1, p7, p6); __CLC_UINTN fbits = (__CLC_UINTN)224 + (__CLC_UINTN)23 - __CLC_AS_UINTN(xe); diff --git a/libclc/clc/lib/generic/math/clc_sincos_helpers_fp64.inc b/libclc/clc/lib/generic/math/clc_sincos_helpers_fp64.inc index 9b5776d9b05e..8fae90c9cc5a 100644 --- a/libclc/clc/lib/generic/math/clc_sincos_helpers_fp64.inc +++ b/libclc/clc/lib/generic/math/clc_sincos_helpers_fp64.inc @@ -67,11 +67,11 @@ __clc_remainder_piby2_large(__CLC_DOUBLEN x, private __CLC_DOUBLEN *r, // The following extracts 192 consecutive bits of 2/pi aligned on an arbitrary // byte boundary - __CLC_ULONGN q0 = USE_TABLE(pibits_tbl, j16); - __CLC_ULONGN q1 = USE_TABLE(pibits_tbl, (j16 + 8)); - __CLC_ULONGN q2 = USE_TABLE(pibits_tbl, (j16 + 16)); - __CLC_ULONGN q3 = USE_TABLE(pibits_tbl, (j16 + 24)); - __CLC_ULONGN q4 = USE_TABLE(pibits_tbl, (j16 + 32)); + __CLC_ULONGN q0 = __CLC_USE_TABLE(pibits_tbl, j16); + __CLC_ULONGN q1 = __CLC_USE_TABLE(pibits_tbl, (j16 + 8)); + __CLC_ULONGN q2 = __CLC_USE_TABLE(pibits_tbl, (j16 + 16)); + __CLC_ULONGN q3 = __CLC_USE_TABLE(pibits_tbl, (j16 + 24)); + __CLC_ULONGN q4 = __CLC_USE_TABLE(pibits_tbl, (j16 + 32)); __CLC_UINTN q0s0 = __CLC_CONVERT_UINTN(q0); __CLC_UINTN q0s1 = __CLC_CONVERT_UINTN(q0 >> 32); diff --git a/libclc/clc/lib/generic/math/clc_sinh.inc b/libclc/clc/lib/generic/math/clc_sinh.inc index 799cc3210508..d39059166ffb 100644 --- a/libclc/clc/lib/generic/math/clc_sinh.inc +++ b/libclc/clc/lib/generic/math/clc_sinh.inc @@ -69,8 +69,8 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_sinh(__CLC_GENTYPE x) { 0.500000000000000005911074e0f); cdy = __clc_mad(cdy, dy2, 1.0f); - __CLC_GENTYPE sinhcoshh = USE_TABLE(sinhcosh_tbl_head, ind); - __CLC_GENTYPE sinhcosht = USE_TABLE(sinhcosh_tbl_tail, ind); + __CLC_GENTYPE sinhcoshh = __CLC_USE_TABLE(sinhcosh_tbl_head, ind); + __CLC_GENTYPE sinhcosht = __CLC_USE_TABLE(sinhcosh_tbl_tail, ind); __CLC_GENTYPE z = __clc_mad(sinhcosht, sdy, sinhcoshh * cdy); z = __CLC_AS_GENTYPE(xs | __CLC_AS_UINTN(z)); @@ -167,10 +167,10 @@ _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_sinh(__CLC_GENTYPE x) { __CLC_AS_GENTYPE(__CLC_AS_ULONGN(dy) & 0xfffffffff8000000UL); __CLC_GENTYPE sdy2 = sdy + (dy - sdy1); - __CLC_GENTYPE cl = USE_TABLE(cosh_tbl_head, ind); - __CLC_GENTYPE ct = USE_TABLE(cosh_tbl_tail, ind); - __CLC_GENTYPE sl = USE_TABLE(sinh_tbl_head, ind); - __CLC_GENTYPE st = USE_TABLE(sinh_tbl_tail, ind); + __CLC_GENTYPE cl = __CLC_USE_TABLE(cosh_tbl_head, ind); + __CLC_GENTYPE ct = __CLC_USE_TABLE(cosh_tbl_tail, ind); + __CLC_GENTYPE sl = __CLC_USE_TABLE(sinh_tbl_head, ind); + __CLC_GENTYPE st = __CLC_USE_TABLE(sinh_tbl_tail, ind); __CLC_GENTYPE z = __clc_fma(cl, sdy1, diff --git a/libclc/clc/lib/generic/math/clc_sw_fma.cl b/libclc/clc/lib/generic/math/clc_sw_fma.cl index ee4734078d69..550ca5e18f3f 100644 --- a/libclc/clc/lib/generic/math/clc_sw_fma.cl +++ b/libclc/clc/lib/generic/math/clc_sw_fma.cl @@ -160,7 +160,7 @@ _CLC_DEF _CLC_OVERLOAD float __clc_sw_fma(float a, float b, float c) { ((uint)st_fma.mantissa & 0x7fffff)); } -#define __FLOAT_ONLY -#define FUNCTION __clc_sw_fma +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_sw_fma #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_tables.cl b/libclc/clc/lib/generic/math/clc_tables.cl index 7db00532c8be..67a17525014d 100644 --- a/libclc/clc/lib/generic/math/clc_tables.cl +++ b/libclc/clc/lib/generic/math/clc_tables.cl @@ -9,7 +9,7 @@ #include #include -DECLARE_TABLE(float, LOG_INV_TBL_EP_HEAD, 129) = { +__CLC_DECLARE_TABLE(float, LOG_INV_TBL_EP_HEAD, 129) = { 0x1.000000p+1f, 0x1.fc0000p+0f, 0x1.f80000p+0f, 0x1.f40000p+0f, 0x1.f00000p+0f, 0x1.ec0000p+0f, 0x1.e80000p+0f, 0x1.e40000p+0f, 0x1.e00000p+0f, 0x1.de0000p+0f, 0x1.da0000p+0f, 0x1.d60000p+0f, @@ -45,9 +45,9 @@ DECLARE_TABLE(float, LOG_INV_TBL_EP_HEAD, 129) = { 0x1.000000p+0f, }; -CLC_TABLE_FUNCTION(float, LOG_INV_TBL_EP_HEAD, log_inv_tbl_ep_head); +__CLC_TABLE_FUNCTION_VEC(float, LOG_INV_TBL_EP_HEAD, log_inv_tbl_ep_head); -DECLARE_TABLE(float, LOG_INV_TBL_EP_TAIL, 129) = { +__CLC_DECLARE_TABLE(float, LOG_INV_TBL_EP_TAIL, 129) = { 0x0.000000p+0f, 0x1.fc07f0p-14f, 0x1.f81f82p-12f, 0x1.196792p-10f, 0x1.f07c20p-10f, 0x1.80f660p-9f, 0x1.131ac0p-8f, 0x1.73ac90p-8f, 0x1.e1e1e2p-8f, 0x1.75b8fep-10f, 0x1.cc0ed8p-9f, 0x1.7b654cp-8f, @@ -82,9 +82,9 @@ DECLARE_TABLE(float, LOG_INV_TBL_EP_TAIL, 129) = { 0x1.041042p-12f, 0x1.091b52p-8f, 0x1.020408p-14f, 0x1.010102p-8f, 0x0.000000p+0f, }; -CLC_TABLE_FUNCTION(float, LOG_INV_TBL_EP_TAIL, log_inv_tbl_ep_tail); +__CLC_TABLE_FUNCTION_VEC(float, LOG_INV_TBL_EP_TAIL, log_inv_tbl_ep_tail); -DECLARE_TABLE(float, LOGE_TBL_LO, 129) = { +__CLC_DECLARE_TABLE(float, LOGE_TBL_LO, 129) = { 0x0.000000p+0f, 0x1.fe0000p-8f, 0x1.fc0000p-7f, 0x1.7b8000p-6f, 0x1.f82000p-6f, 0x1.39e000p-5f, 0x1.774000p-5f, 0x1.b42000p-5f, 0x1.f0a000p-5f, 0x1.164000p-4f, 0x1.340000p-4f, 0x1.51a000p-4f, @@ -120,7 +120,7 @@ DECLARE_TABLE(float, LOGE_TBL_LO, 129) = { 0x1.62e000p-1f, }; -DECLARE_TABLE(float, LOGE_TBL_HI, 129) = { +__CLC_DECLARE_TABLE(float, LOGE_TBL_HI, 129) = { 0x0.000000p+0f, 0x1.535882p-23f, 0x1.5161f8p-20f, 0x1.1b07d4p-18f, 0x1.361cf0p-19f, 0x1.0f73fcp-18f, 0x1.63d8cap-19f, 0x1.bae232p-18f, 0x1.86008ap-20f, 0x1.36eea2p-16f, 0x1.d7961ap-16f, 0x1.073f06p-16f, @@ -156,10 +156,10 @@ DECLARE_TABLE(float, LOGE_TBL_HI, 129) = { 0x1.0bfbe8p-15f, }; -CLC_TABLE_FUNCTION(float, LOGE_TBL_LO, loge_tbl_lo); -CLC_TABLE_FUNCTION(float, LOGE_TBL_HI, loge_tbl_hi); +__CLC_TABLE_FUNCTION_VEC(float, LOGE_TBL_LO, loge_tbl_lo); +__CLC_TABLE_FUNCTION_VEC(float, LOGE_TBL_HI, loge_tbl_hi); -DECLARE_TABLE(float, LOG_INV_TBL, 129) = { +__CLC_DECLARE_TABLE(float, LOG_INV_TBL, 129) = { 0x1.000000p+1f, 0x1.fc07f0p+0f, 0x1.f81f82p+0f, 0x1.f4465ap+0f, 0x1.f07c20p+0f, 0x1.ecc07cp+0f, 0x1.e9131ap+0f, 0x1.e573acp+0f, 0x1.e1e1e2p+0f, 0x1.de5d6ep+0f, 0x1.dae608p+0f, 0x1.d77b66p+0f, @@ -195,143 +195,142 @@ DECLARE_TABLE(float, LOG_INV_TBL, 129) = { 0x1.000000p+0f, }; -CLC_TABLE_FUNCTION(float, LOG_INV_TBL, log_inv_tbl); +__CLC_TABLE_FUNCTION_VEC(float, LOG_INV_TBL, log_inv_tbl); -DECLARE_TABLE(float2, LOG2_TBL, 129) = { - (float2)(0x0.000000p+0f, 0x0.000000p+0f), - (float2)(0x1.6f8000p-7f, 0x1.942dbap-17f), - (float2)(0x1.6e0000p-6f, 0x1.e5a170p-16f), - (float2)(0x1.118000p-5f, 0x1.347544p-15f), - (float2)(0x1.6b8000p-5f, 0x1.69bac6p-16f), - (float2)(0x1.c48000p-5f, 0x1.7eae42p-15f), - (float2)(0x1.0e8000p-4f, 0x1.9c4fd0p-15f), - (float2)(0x1.3a8000p-4f, 0x1.17ee92p-15f), - (float2)(0x1.660000p-4f, 0x1.fb7d64p-15f), - (float2)(0x1.918000p-4f, 0x1.42dc8cp-17f), - (float2)(0x1.bc8000p-4f, 0x1.0902b6p-18f), - (float2)(0x1.e70000p-4f, 0x1.7608bep-15f), - (float2)(0x1.088000p-3f, 0x1.162336p-13f), - (float2)(0x1.1d8000p-3f, 0x1.3465d4p-13f), - (float2)(0x1.328000p-3f, 0x1.74f13cp-14f), - (float2)(0x1.470000p-3f, 0x1.aa7e60p-13f), - (float2)(0x1.5c0000p-3f, 0x1.a39fbcp-19f), - (float2)(0x1.700000p-3f, 0x1.d0b53ap-13f), - (float2)(0x1.848000p-3f, 0x1.0af40ap-13f), - (float2)(0x1.988000p-3f, 0x1.b741dep-13f), - (float2)(0x1.ac8000p-3f, 0x1.d78b6cp-13f), - (float2)(0x1.c08000p-3f, 0x1.6db376p-13f), - (float2)(0x1.d48000p-3f, 0x1.ee4c32p-15f), - (float2)(0x1.e80000p-3f, 0x1.02f9d2p-13f), - (float2)(0x1.fb8000p-3f, 0x1.05ae40p-13f), - (float2)(0x1.078000p-2f, 0x1.0adbb0p-14f), - (float2)(0x1.110000p-2f, 0x1.83ed68p-13f), - (float2)(0x1.1a8000p-2f, 0x1.016ca4p-12f), - (float2)(0x1.240000p-2f, 0x1.01eac2p-12f), - (float2)(0x1.2d8000p-2f, 0x1.887e26p-13f), - (float2)(0x1.370000p-2f, 0x1.24cea4p-14f), - (float2)(0x1.400000p-2f, 0x1.918ec6p-12f), - (float2)(0x1.498000p-2f, 0x1.3c25e6p-13f), - (float2)(0x1.528000p-2f, 0x1.6f7f12p-12f), - (float2)(0x1.5c0000p-2f, 0x1.a39fbcp-18f), - (float2)(0x1.650000p-2f, 0x1.8fe466p-14f), - (float2)(0x1.6e0000p-2f, 0x1.10e6cep-13f), - (float2)(0x1.770000p-2f, 0x1.d2ba7ep-14f), - (float2)(0x1.800000p-2f, 0x1.4ac62cp-15f), - (float2)(0x1.888000p-2f, 0x1.a71cb8p-12f), - (float2)(0x1.918000p-2f, 0x1.dd448ep-13f), - (float2)(0x1.9a8000p-2f, 0x1.1c8f10p-21f), - (float2)(0x1.a30000p-2f, 0x1.bb053ep-13f), - (float2)(0x1.ab8000p-2f, 0x1.861e5ep-12f), - (float2)(0x1.b40000p-2f, 0x1.fafdcep-12f), - (float2)(0x1.bd0000p-2f, 0x1.e5d3cep-15f), - (float2)(0x1.c58000p-2f, 0x1.2fad28p-14f), - (float2)(0x1.ce0000p-2f, 0x1.492474p-15f), - (float2)(0x1.d60000p-2f, 0x1.d4f80cp-12f), - (float2)(0x1.de8000p-2f, 0x1.4ff510p-12f), - (float2)(0x1.e70000p-2f, 0x1.3550f2p-13f), - (float2)(0x1.ef0000p-2f, 0x1.b59ccap-12f), - (float2)(0x1.f78000p-2f, 0x1.42b464p-13f), - (float2)(0x1.ff8000p-2f, 0x1.5e66a0p-12f), - (float2)(0x1.038000p-1f, 0x1.f6a2e4p-11f), - (float2)(0x1.080000p-1f, 0x1.39e4fep-14f), - (float2)(0x1.0c0000p-1f, 0x1.0500d6p-13f), - (float2)(0x1.100000p-1f, 0x1.13b152p-13f), - (float2)(0x1.140000p-1f, 0x1.93f542p-14f), - (float2)(0x1.180000p-1f, 0x1.467b94p-16f), - (float2)(0x1.1b8000p-1f, 0x1.cc47a4p-11f), - (float2)(0x1.1f8000p-1f, 0x1.78f4c2p-11f), - (float2)(0x1.238000p-1f, 0x1.107508p-11f), - (float2)(0x1.278000p-1f, 0x1.2602c2p-12f), - (float2)(0x1.2b8000p-1f, 0x1.a39fbcp-20f), - (float2)(0x1.2f0000p-1f, 0x1.5a1d7ap-11f), - (float2)(0x1.330000p-1f, 0x1.3e355ap-12f), - (float2)(0x1.368000p-1f, 0x1.cffedap-11f), - (float2)(0x1.3a8000p-1f, 0x1.d9fd50p-12f), - (float2)(0x1.3e0000p-1f, 0x1.f64de6p-11f), - (float2)(0x1.420000p-1f, 0x1.d83f4cp-12f), - (float2)(0x1.458000p-1f, 0x1.cea628p-11f), - (float2)(0x1.498000p-1f, 0x1.3c25e6p-12f), - (float2)(0x1.4d0000p-1f, 0x1.5a96ccp-11f), - (float2)(0x1.510000p-1f, 0x1.18708ap-17f), - (float2)(0x1.548000p-1f, 0x1.374652p-12f), - (float2)(0x1.580000p-1f, 0x1.2089a6p-11f), - (float2)(0x1.5b8000p-1f, 0x1.93432cp-11f), - (float2)(0x1.5f0000p-1f, 0x1.f3fd06p-11f), - (float2)(0x1.630000p-1f, 0x1.0b8f54p-13f), - (float2)(0x1.668000p-1f, 0x1.004722p-12f), - (float2)(0x1.6a0000p-1f, 0x1.57cf2cp-12f), - (float2)(0x1.6d8000p-1f, 0x1.8cb53ap-12f), - (float2)(0x1.710000p-1f, 0x1.9f4d8ap-12f), - (float2)(0x1.748000p-1f, 0x1.8feb26p-12f), - (float2)(0x1.780000p-1f, 0x1.5edfeep-12f), - (float2)(0x1.7b8000p-1f, 0x1.0c7c9ap-12f), - (float2)(0x1.7f0000p-1f, 0x1.322182p-13f), - (float2)(0x1.828000p-1f, 0x1.3ab7cep-18f), - (float2)(0x1.858000p-1f, 0x1.a82c2cp-11f), - (float2)(0x1.890000p-1f, 0x1.3dd2c0p-11f), - (float2)(0x1.8c8000p-1f, 0x1.871da4p-12f), - (float2)(0x1.900000p-1f, 0x1.cc2c00p-14f), - (float2)(0x1.930000p-1f, 0x1.9fdb68p-11f), - (float2)(0x1.968000p-1f, 0x1.ed6956p-12f), - (float2)(0x1.9a0000p-1f, 0x1.f1a760p-14f), - (float2)(0x1.9d0000p-1f, 0x1.767f54p-11f), - (float2)(0x1.a08000p-1f, 0x1.3f6d26p-12f), - (float2)(0x1.a38000p-1f, 0x1.b9fce2p-11f), - (float2)(0x1.a70000p-1f, 0x1.8ae816p-12f), - (float2)(0x1.aa0000p-1f, 0x1.c23d60p-11f), - (float2)(0x1.ad8000p-1f, 0x1.60f388p-12f), - (float2)(0x1.b08000p-1f, 0x1.9049aep-11f), - (float2)(0x1.b40000p-1f, 0x1.8734a8p-13f), - (float2)(0x1.b70000p-1f, 0x1.2523d4p-11f), - (float2)(0x1.ba0000p-1f, 0x1.da6ce6p-11f), - (float2)(0x1.bd8000p-1f, 0x1.038e62p-12f), - (float2)(0x1.c08000p-1f, 0x1.1b511ep-11f), - (float2)(0x1.c38000p-1f, 0x1.a728b8p-11f), - (float2)(0x1.c70000p-1f, 0x1.2b5d22p-14f), - (float2)(0x1.ca0000p-1f, 0x1.2c6e54p-12f), - (float2)(0x1.cd0000p-1f, 0x1.f35064p-12f), - (float2)(0x1.d00000p-1f, 0x1.4fdb48p-11f), - (float2)(0x1.d30000p-1f, 0x1.98ec9ep-11f), - (float2)(0x1.d60000p-1f, 0x1.d4f80cp-11f), - (float2)(0x1.d98000p-1f, 0x1.0643d6p-17f), - (float2)(0x1.dc8000p-1f, 0x1.33567ep-14f), - (float2)(0x1.df8000p-1f, 0x1.e0410cp-14f), - (float2)(0x1.e28000p-1f, 0x1.142e0ep-13f), - (float2)(0x1.e58000p-1f, 0x1.063c88p-13f), - (float2)(0x1.e88000p-1f, 0x1.8d66c4p-14f), - (float2)(0x1.eb8000p-1f, 0x1.57e32ap-15f), - (float2)(0x1.ee0000p-1f, 0x1.ed1c6cp-11f), - (float2)(0x1.f10000p-1f, 0x1.b8a076p-11f), - (float2)(0x1.f40000p-1f, 0x1.7822f2p-11f), - (float2)(0x1.f70000p-1f, 0x1.2bbc3ap-11f), - (float2)(0x1.fa0000p-1f, 0x1.a708bap-12f), - (float2)(0x1.fd0000p-1f, 0x1.be4c7ep-13f), - (float2)(0x1.000000p+0f, 0x0.000000p+0f) -}; +__CLC_DECLARE_TABLE(float2, LOG2_TBL, + 129) = {(float2)(0x0.000000p+0f, 0x0.000000p+0f), + (float2)(0x1.6f8000p-7f, 0x1.942dbap-17f), + (float2)(0x1.6e0000p-6f, 0x1.e5a170p-16f), + (float2)(0x1.118000p-5f, 0x1.347544p-15f), + (float2)(0x1.6b8000p-5f, 0x1.69bac6p-16f), + (float2)(0x1.c48000p-5f, 0x1.7eae42p-15f), + (float2)(0x1.0e8000p-4f, 0x1.9c4fd0p-15f), + (float2)(0x1.3a8000p-4f, 0x1.17ee92p-15f), + (float2)(0x1.660000p-4f, 0x1.fb7d64p-15f), + (float2)(0x1.918000p-4f, 0x1.42dc8cp-17f), + (float2)(0x1.bc8000p-4f, 0x1.0902b6p-18f), + (float2)(0x1.e70000p-4f, 0x1.7608bep-15f), + (float2)(0x1.088000p-3f, 0x1.162336p-13f), + (float2)(0x1.1d8000p-3f, 0x1.3465d4p-13f), + (float2)(0x1.328000p-3f, 0x1.74f13cp-14f), + (float2)(0x1.470000p-3f, 0x1.aa7e60p-13f), + (float2)(0x1.5c0000p-3f, 0x1.a39fbcp-19f), + (float2)(0x1.700000p-3f, 0x1.d0b53ap-13f), + (float2)(0x1.848000p-3f, 0x1.0af40ap-13f), + (float2)(0x1.988000p-3f, 0x1.b741dep-13f), + (float2)(0x1.ac8000p-3f, 0x1.d78b6cp-13f), + (float2)(0x1.c08000p-3f, 0x1.6db376p-13f), + (float2)(0x1.d48000p-3f, 0x1.ee4c32p-15f), + (float2)(0x1.e80000p-3f, 0x1.02f9d2p-13f), + (float2)(0x1.fb8000p-3f, 0x1.05ae40p-13f), + (float2)(0x1.078000p-2f, 0x1.0adbb0p-14f), + (float2)(0x1.110000p-2f, 0x1.83ed68p-13f), + (float2)(0x1.1a8000p-2f, 0x1.016ca4p-12f), + (float2)(0x1.240000p-2f, 0x1.01eac2p-12f), + (float2)(0x1.2d8000p-2f, 0x1.887e26p-13f), + (float2)(0x1.370000p-2f, 0x1.24cea4p-14f), + (float2)(0x1.400000p-2f, 0x1.918ec6p-12f), + (float2)(0x1.498000p-2f, 0x1.3c25e6p-13f), + (float2)(0x1.528000p-2f, 0x1.6f7f12p-12f), + (float2)(0x1.5c0000p-2f, 0x1.a39fbcp-18f), + (float2)(0x1.650000p-2f, 0x1.8fe466p-14f), + (float2)(0x1.6e0000p-2f, 0x1.10e6cep-13f), + (float2)(0x1.770000p-2f, 0x1.d2ba7ep-14f), + (float2)(0x1.800000p-2f, 0x1.4ac62cp-15f), + (float2)(0x1.888000p-2f, 0x1.a71cb8p-12f), + (float2)(0x1.918000p-2f, 0x1.dd448ep-13f), + (float2)(0x1.9a8000p-2f, 0x1.1c8f10p-21f), + (float2)(0x1.a30000p-2f, 0x1.bb053ep-13f), + (float2)(0x1.ab8000p-2f, 0x1.861e5ep-12f), + (float2)(0x1.b40000p-2f, 0x1.fafdcep-12f), + (float2)(0x1.bd0000p-2f, 0x1.e5d3cep-15f), + (float2)(0x1.c58000p-2f, 0x1.2fad28p-14f), + (float2)(0x1.ce0000p-2f, 0x1.492474p-15f), + (float2)(0x1.d60000p-2f, 0x1.d4f80cp-12f), + (float2)(0x1.de8000p-2f, 0x1.4ff510p-12f), + (float2)(0x1.e70000p-2f, 0x1.3550f2p-13f), + (float2)(0x1.ef0000p-2f, 0x1.b59ccap-12f), + (float2)(0x1.f78000p-2f, 0x1.42b464p-13f), + (float2)(0x1.ff8000p-2f, 0x1.5e66a0p-12f), + (float2)(0x1.038000p-1f, 0x1.f6a2e4p-11f), + (float2)(0x1.080000p-1f, 0x1.39e4fep-14f), + (float2)(0x1.0c0000p-1f, 0x1.0500d6p-13f), + (float2)(0x1.100000p-1f, 0x1.13b152p-13f), + (float2)(0x1.140000p-1f, 0x1.93f542p-14f), + (float2)(0x1.180000p-1f, 0x1.467b94p-16f), + (float2)(0x1.1b8000p-1f, 0x1.cc47a4p-11f), + (float2)(0x1.1f8000p-1f, 0x1.78f4c2p-11f), + (float2)(0x1.238000p-1f, 0x1.107508p-11f), + (float2)(0x1.278000p-1f, 0x1.2602c2p-12f), + (float2)(0x1.2b8000p-1f, 0x1.a39fbcp-20f), + (float2)(0x1.2f0000p-1f, 0x1.5a1d7ap-11f), + (float2)(0x1.330000p-1f, 0x1.3e355ap-12f), + (float2)(0x1.368000p-1f, 0x1.cffedap-11f), + (float2)(0x1.3a8000p-1f, 0x1.d9fd50p-12f), + (float2)(0x1.3e0000p-1f, 0x1.f64de6p-11f), + (float2)(0x1.420000p-1f, 0x1.d83f4cp-12f), + (float2)(0x1.458000p-1f, 0x1.cea628p-11f), + (float2)(0x1.498000p-1f, 0x1.3c25e6p-12f), + (float2)(0x1.4d0000p-1f, 0x1.5a96ccp-11f), + (float2)(0x1.510000p-1f, 0x1.18708ap-17f), + (float2)(0x1.548000p-1f, 0x1.374652p-12f), + (float2)(0x1.580000p-1f, 0x1.2089a6p-11f), + (float2)(0x1.5b8000p-1f, 0x1.93432cp-11f), + (float2)(0x1.5f0000p-1f, 0x1.f3fd06p-11f), + (float2)(0x1.630000p-1f, 0x1.0b8f54p-13f), + (float2)(0x1.668000p-1f, 0x1.004722p-12f), + (float2)(0x1.6a0000p-1f, 0x1.57cf2cp-12f), + (float2)(0x1.6d8000p-1f, 0x1.8cb53ap-12f), + (float2)(0x1.710000p-1f, 0x1.9f4d8ap-12f), + (float2)(0x1.748000p-1f, 0x1.8feb26p-12f), + (float2)(0x1.780000p-1f, 0x1.5edfeep-12f), + (float2)(0x1.7b8000p-1f, 0x1.0c7c9ap-12f), + (float2)(0x1.7f0000p-1f, 0x1.322182p-13f), + (float2)(0x1.828000p-1f, 0x1.3ab7cep-18f), + (float2)(0x1.858000p-1f, 0x1.a82c2cp-11f), + (float2)(0x1.890000p-1f, 0x1.3dd2c0p-11f), + (float2)(0x1.8c8000p-1f, 0x1.871da4p-12f), + (float2)(0x1.900000p-1f, 0x1.cc2c00p-14f), + (float2)(0x1.930000p-1f, 0x1.9fdb68p-11f), + (float2)(0x1.968000p-1f, 0x1.ed6956p-12f), + (float2)(0x1.9a0000p-1f, 0x1.f1a760p-14f), + (float2)(0x1.9d0000p-1f, 0x1.767f54p-11f), + (float2)(0x1.a08000p-1f, 0x1.3f6d26p-12f), + (float2)(0x1.a38000p-1f, 0x1.b9fce2p-11f), + (float2)(0x1.a70000p-1f, 0x1.8ae816p-12f), + (float2)(0x1.aa0000p-1f, 0x1.c23d60p-11f), + (float2)(0x1.ad8000p-1f, 0x1.60f388p-12f), + (float2)(0x1.b08000p-1f, 0x1.9049aep-11f), + (float2)(0x1.b40000p-1f, 0x1.8734a8p-13f), + (float2)(0x1.b70000p-1f, 0x1.2523d4p-11f), + (float2)(0x1.ba0000p-1f, 0x1.da6ce6p-11f), + (float2)(0x1.bd8000p-1f, 0x1.038e62p-12f), + (float2)(0x1.c08000p-1f, 0x1.1b511ep-11f), + (float2)(0x1.c38000p-1f, 0x1.a728b8p-11f), + (float2)(0x1.c70000p-1f, 0x1.2b5d22p-14f), + (float2)(0x1.ca0000p-1f, 0x1.2c6e54p-12f), + (float2)(0x1.cd0000p-1f, 0x1.f35064p-12f), + (float2)(0x1.d00000p-1f, 0x1.4fdb48p-11f), + (float2)(0x1.d30000p-1f, 0x1.98ec9ep-11f), + (float2)(0x1.d60000p-1f, 0x1.d4f80cp-11f), + (float2)(0x1.d98000p-1f, 0x1.0643d6p-17f), + (float2)(0x1.dc8000p-1f, 0x1.33567ep-14f), + (float2)(0x1.df8000p-1f, 0x1.e0410cp-14f), + (float2)(0x1.e28000p-1f, 0x1.142e0ep-13f), + (float2)(0x1.e58000p-1f, 0x1.063c88p-13f), + (float2)(0x1.e88000p-1f, 0x1.8d66c4p-14f), + (float2)(0x1.eb8000p-1f, 0x1.57e32ap-15f), + (float2)(0x1.ee0000p-1f, 0x1.ed1c6cp-11f), + (float2)(0x1.f10000p-1f, 0x1.b8a076p-11f), + (float2)(0x1.f40000p-1f, 0x1.7822f2p-11f), + (float2)(0x1.f70000p-1f, 0x1.2bbc3ap-11f), + (float2)(0x1.fa0000p-1f, 0x1.a708bap-12f), + (float2)(0x1.fd0000p-1f, 0x1.be4c7ep-13f), + (float2)(0x1.000000p+0f, 0x0.000000p+0f)}; -TABLE_FUNCTION(float2, LOG2_TBL, log2_tbl); +__CLC_TABLE_FUNCTION(float2, LOG2_TBL, log2_tbl); -DECLARE_TABLE(float2, LOG10_TBL, 129) = { +__CLC_DECLARE_TABLE(float2, LOG10_TBL, 129) = { (float2)(0x0.000000p+0f, 0x0.000000p+0f), (float2)(0x1.ba8000p-9f, 0x1.f51c88p-19f), (float2)(0x1.b90000p-8f, 0x1.1da93ep-18f), @@ -463,10 +462,9 @@ DECLARE_TABLE(float2, LOG10_TBL, 129) = { (float2)(0x1.340000p-2f, 0x1.04d426p-12f), }; -TABLE_FUNCTION(float2, LOG10_TBL, log10_tbl); +__CLC_TABLE_FUNCTION(float2, LOG10_TBL, log10_tbl); - -DECLARE_TABLE(float, EXP_TBL, 65) = { +__CLC_DECLARE_TABLE(float, EXP_TBL, 65) = { 0x1.000000p+0f, 0x1.02c9a4p+0f, 0x1.059b0ep+0f, 0x1.087452p+0f, 0x1.0b5586p+0f, 0x1.0e3ec4p+0f, 0x1.11301ep+0f, 0x1.1429aap+0f, 0x1.172b84p+0f, 0x1.1a35bep+0f, 0x1.1d4874p+0f, 0x1.2063b8p+0f, @@ -486,9 +484,9 @@ DECLARE_TABLE(float, EXP_TBL, 65) = { 0x1.000000p+1f, }; -CLC_TABLE_FUNCTION(float, EXP_TBL, exp_tbl); +__CLC_TABLE_FUNCTION_VEC(float, EXP_TBL, exp_tbl); -DECLARE_TABLE(float, EXP_TBL_EP_HEAD, 65) = { +__CLC_DECLARE_TABLE(float, EXP_TBL_EP_HEAD, 65) = { 0x1.000000p+0f, 0x1.02c000p+0f, 0x1.058000p+0f, 0x1.084000p+0f, 0x1.0b4000p+0f, 0x1.0e0000p+0f, 0x1.110000p+0f, 0x1.140000p+0f, 0x1.170000p+0f, 0x1.1a0000p+0f, 0x1.1d4000p+0f, 0x1.204000p+0f, @@ -508,9 +506,9 @@ DECLARE_TABLE(float, EXP_TBL_EP_HEAD, 65) = { 0x1.000000p+1f, }; -CLC_TABLE_FUNCTION(float, EXP_TBL_EP_HEAD, exp_tbl_ep_head); +__CLC_TABLE_FUNCTION_VEC(float, EXP_TBL_EP_HEAD, exp_tbl_ep_head); -DECLARE_TABLE(float, EXP_TBL_EP_TAIL, 65) = { +__CLC_DECLARE_TABLE(float, EXP_TBL_EP_TAIL, 65) = { 0x0.000000p+0f, 0x1.347ceep-13f, 0x1.b0d314p-12f, 0x1.a28c3ap-11f, 0x1.586cf8p-12f, 0x1.f61968p-11f, 0x1.80e808p-11f, 0x1.4d5754p-11f, 0x1.5c1e3ep-11f, 0x1.adf5b6p-11f, 0x1.0e62d0p-13f, 0x1.1dc430p-11f, @@ -530,9 +528,9 @@ DECLARE_TABLE(float, EXP_TBL_EP_TAIL, 65) = { 0x0.000000p+0f, }; -CLC_TABLE_FUNCTION(float, EXP_TBL_EP_TAIL, exp_tbl_ep_tail); +__CLC_TABLE_FUNCTION_VEC(float, EXP_TBL_EP_TAIL, exp_tbl_ep_tail); -DECLARE_TABLE(float, CBRT_TBL_HEAD, 129) = { +__CLC_DECLARE_TABLE(float, CBRT_TBL_HEAD, 129) = { 0x1.000000p+0f, 0x1.008000p+0f, 0x1.014000p+0f, 0x1.01c000p+0f, 0x1.028000p+0f, 0x1.034000p+0f, 0x1.03c000p+0f, 0x1.048000p+0f, 0x1.050000p+0f, 0x1.05c000p+0f, 0x1.068000p+0f, 0x1.070000p+0f, @@ -568,9 +566,9 @@ DECLARE_TABLE(float, CBRT_TBL_HEAD, 129) = { 0x1.428000p+0f, }; -CLC_TABLE_FUNCTION(float, CBRT_TBL_HEAD, cbrt_tbl_head); +__CLC_TABLE_FUNCTION_VEC(float, CBRT_TBL_HEAD, cbrt_tbl_head); -DECLARE_TABLE(float, CBRT_TBL_TAIL, 129) = { +__CLC_DECLARE_TABLE(float, CBRT_TBL_TAIL, 129) = { 0x0.000000p+0f, 0x1.51cb0ap-11f, 0x1.39221ep-12f, 0x1.e06908p-11f, 0x1.1d6978p-11f, 0x1.4ea1bep-13f, 0x1.833b8ep-11f, 0x1.587002p-12f, 0x1.ceb290p-11f, 0x1.d57f34p-12f, 0x1.cc53acp-21f, 0x1.0fe098p-11f, @@ -606,10 +604,10 @@ DECLARE_TABLE(float, CBRT_TBL_TAIL, 129) = { 0x1.45f31ap-13f, }; -CLC_TABLE_FUNCTION(float, CBRT_TBL_TAIL, cbrt_tbl_tail); +__CLC_TABLE_FUNCTION_VEC(float, CBRT_TBL_TAIL, cbrt_tbl_tail); // Tabulated values of sinh(i) and cosh(i) for i = 0,...,36. -DECLARE_TABLE(float, SINHCOSH_TBL_HEAD, 37) = { +__CLC_DECLARE_TABLE(float, SINHCOSH_TBL_HEAD, 37) = { 0x0.000000p+0f, 0x1.2cd9fcp+0f, 0x1.d03cf6p+1f, 0x1.40926ep+3f, 0x1.b4a380p+4f, 0x1.28d016p+6f, 0x1.936d22p+7f, 0x1.122876p+9f, 0x1.749ea6p+10f, 0x1.fa7158p+11f, 0x1.5829dcp+13f, 0x1.d3c448p+14f, @@ -622,9 +620,9 @@ DECLARE_TABLE(float, SINHCOSH_TBL_HEAD, 37) = { 0x1.ea215ap+50f, }; -CLC_TABLE_FUNCTION(float, SINHCOSH_TBL_HEAD, sinhcosh_tbl_head); +__CLC_TABLE_FUNCTION_VEC(float, SINHCOSH_TBL_HEAD, sinhcosh_tbl_head); -DECLARE_TABLE(float, SINHCOSH_TBL_TAIL, 37) = { +__CLC_DECLARE_TABLE(float, SINHCOSH_TBL_TAIL, 37) = { 0x1.000000p+0f, 0x1.8b0756p+0f, 0x1.e18fa0p+1f, 0x1.422a4ap+3f, 0x1.b4ee86p+4f, 0x1.28d6fcp+6f, 0x1.936e68p+7f, 0x1.122894p+9f, 0x1.749eaap+10f, 0x1.fa7158p+11f, 0x1.5829dep+13f, 0x1.d3c448p+14f, @@ -637,13 +635,13 @@ DECLARE_TABLE(float, SINHCOSH_TBL_TAIL, 37) = { 0x1.ea215ap+50f, }; -CLC_TABLE_FUNCTION(float, SINHCOSH_TBL_TAIL, sinhcosh_tbl_tail); +__CLC_TABLE_FUNCTION_VEC(float, SINHCOSH_TBL_TAIL, sinhcosh_tbl_tail); #ifdef cl_khr_fp64 #pragma OPENCL EXTENSION cl_khr_fp64 : enable -DECLARE_TABLE(double, LN_TBL_LO, 65) = { +__CLC_DECLARE_TABLE(double, LN_TBL_LO, 65) = { 0x0.0000000000000p+0, 0x1.fc0a800000000p-7, 0x1.f829800000000p-6, 0x1.7745800000000p-5, 0x1.f0a3000000000p-5, 0x1.341d700000000p-4, 0x1.6f0d200000000p-4, 0x1.a926d00000000p-4, 0x1.e270700000000p-4, @@ -668,9 +666,9 @@ DECLARE_TABLE(double, LN_TBL_LO, 65) = { 0x1.5ee02a0000000p-1, 0x1.62e42e0000000p-1, }; -CLC_TABLE_FUNCTION(double, LN_TBL_LO, ln_tbl_lo); +__CLC_TABLE_FUNCTION_VEC(double, LN_TBL_LO, ln_tbl_lo); -DECLARE_TABLE(double, LN_TBL_HI, 65) = { +__CLC_DECLARE_TABLE(double, LN_TBL_HI, 65) = { 0x0.0000000000000p+0, 0x1.61f807c79f3dbp-28, 0x1.873c1980267c8p-25, 0x1.ec65b9f88c69ep-26, 0x1.8022c54cc2f99p-26, 0x1.2c37a3a125330p-25, 0x1.15cad69737c93p-25, 0x1.d256ab1b285e9p-27, 0x1.b8abcb97a7aa2p-26, @@ -695,14 +693,14 @@ DECLARE_TABLE(double, LN_TBL_HI, 65) = { 0x1.2482ceae1ac12p-26, 0x1.efa39ef35793cp-25, }; -CLC_TABLE_FUNCTION(double, LN_TBL_HI, ln_tbl_hi); +__CLC_TABLE_FUNCTION_VEC(double, LN_TBL_HI, ln_tbl_hi); // Arrays atan_jby256_head and atan_jby256_tail contain leading and trailing // parts respectively of precomputed values of atan(j/256), for j = 16, 17, ..., // 256. atan_jby256_head contains the first 21 bits of precision, and // atan_jby256_tail contains a further 53 bits precision. -DECLARE_TABLE(double, ATAN_JBY256_TBL_HEAD, 241) = { +__CLC_DECLARE_TABLE(double, ATAN_JBY256_TBL_HEAD, 241) = { 0x1.ff55b00000000p-5, 0x1.0f99e00000000p-4, 0x1.1f86d00000000p-4, 0x1.2f71900000000p-4, 0x1.3f59f00000000p-4, 0x1.4f3fd00000000p-4, 0x1.5f23200000000p-4, 0x1.6f03b00000000p-4, 0x1.7ee1800000000p-4, @@ -786,9 +784,9 @@ DECLARE_TABLE(double, ATAN_JBY256_TBL_HEAD, 241) = { 0x1.921fb00000000p-1, }; -CLC_TABLE_FUNCTION(double, ATAN_JBY256_TBL_HEAD, atan_jby256_tbl_head); +__CLC_TABLE_FUNCTION_VEC(double, ATAN_JBY256_TBL_HEAD, atan_jby256_tbl_head); -DECLARE_TABLE(double, ATAN_JBY256_TBL_TAIL, 241) = { +__CLC_DECLARE_TABLE(double, ATAN_JBY256_TBL_TAIL, 241) = { 0x1.6e59fbd38db2cp-26, 0x1.4e3aa54dedf96p-25, 0x1.7e105ab1bda88p-25, 0x1.8c5254d013fd0p-27, 0x1.cf8ab3ad62670p-29, 0x1.9dca4bec80468p-26, 0x1.3f4b5ec98a8dap-26, 0x1.b9d49619d81fep-25, 0x1.3017887460934p-27, @@ -872,9 +870,9 @@ DECLARE_TABLE(double, ATAN_JBY256_TBL_TAIL, 241) = { 0x1.5110b4611a626p-23, }; -CLC_TABLE_FUNCTION(double, ATAN_JBY256_TBL_TAIL, atan_jby256_tbl_tail); +__CLC_TABLE_FUNCTION_VEC(double, ATAN_JBY256_TBL_TAIL, atan_jby256_tbl_tail); -DECLARE_TABLE(double, LOG_F_INV_TBL_HEAD, 258) = { +__CLC_DECLARE_TABLE(double, LOG_F_INV_TBL_HEAD, 258) = { 0x1.0000000000000p+1, 0x1.fe00000000000p+0, 0x1.fc00000000000p+0, 0x1.fa00000000000p+0, 0x1.f800000000000p+0, 0x1.f600000000000p+0, 0x1.f400000000000p+0, 0x1.f200000000000p+0, 0x1.f000000000000p+0, @@ -963,9 +961,9 @@ DECLARE_TABLE(double, LOG_F_INV_TBL_HEAD, 258) = { 0x1.0000000000000p+0, 0x1.0000000000000p+0, }; -CLC_TABLE_FUNCTION(double, LOG_F_INV_TBL_HEAD, log_f_inv_tbl_head); +__CLC_TABLE_FUNCTION_VEC(double, LOG_F_INV_TBL_HEAD, log_f_inv_tbl_head); -DECLARE_TABLE(double, LOG_F_INV_TBL_TAIL, 258) = { +__CLC_DECLARE_TABLE(double, LOG_F_INV_TBL_TAIL, 258) = { 0x0.0000000000000p+0, 0x1.fe01fe01fe020p-16, 0x1.fc07f01fc07f0p-14, 0x1.1caa01fa11caap-12, 0x1.f81f81f81f820p-12, 0x1.8856506ddaba6p-11, 0x1.196792909c560p-10, 0x1.7d9108c2ad433p-10, 0x1.f07c1f07c1f08p-10, @@ -1054,9 +1052,9 @@ DECLARE_TABLE(double, LOG_F_INV_TBL_TAIL, 258) = { 0x1.0080402010080p-9, 0x0.0000000000000p+0, }; -CLC_TABLE_FUNCTION(double, LOG_F_INV_TBL_TAIL, log_f_inv_tbl_tail); +__CLC_TABLE_FUNCTION_VEC(double, LOG_F_INV_TBL_TAIL, log_f_inv_tbl_tail); -DECLARE_TABLE(double, POWLOG_TBL_HEAD, 258) = { +__CLC_DECLARE_TABLE(double, POWLOG_TBL_HEAD, 258) = { 0x0.0000000000000p+0, 0x1.ff00aa0000000p-9, 0x1.fe02a60000000p-8, 0x1.7dc4750000000p-7, 0x1.fc0a8b0000000p-7, 0x1.3cea440000000p-6, 0x1.7b91b00000000p-6, 0x1.b9fc020000000p-6, 0x1.f829b00000000p-6, @@ -1145,9 +1143,9 @@ DECLARE_TABLE(double, POWLOG_TBL_HEAD, 258) = { 0x1.61e3ef0000000p-1, 0x1.62e42e0000000p-1, 0x0.0000000000000p+0, }; -CLC_TABLE_FUNCTION(double, POWLOG_TBL_HEAD, powlog_tbl_head); +__CLC_TABLE_FUNCTION_VEC(double, POWLOG_TBL_HEAD, powlog_tbl_head); -DECLARE_TABLE(double, POWLOG_TBL_TAIL, 258) = { +__CLC_DECLARE_TABLE(double, POWLOG_TBL_TAIL, 258) = { 0x0.0000000000000p+0, 0x1.5885e0250435ap-36, 0x1.620cf11f86ed2p-33, 0x1.f0214edba4a25p-32, 0x1.f807c79f3db4ep-36, 0x1.a352ba779a52bp-33, 0x1.f56c46aa49fd5p-32, 0x1.ebe465fef5196p-32, 0x1.cf0660099f1f8p-31, @@ -1236,9 +1234,9 @@ DECLARE_TABLE(double, POWLOG_TBL_TAIL, 258) = { 0x1.b48c8cd2f246cp-26, 0x1.efa39ef35793cp-25, 0x0.0000000000000p+0, }; -CLC_TABLE_FUNCTION(double, POWLOG_TBL_TAIL, powlog_tbl_tail); +__CLC_TABLE_FUNCTION_VEC(double, POWLOG_TBL_TAIL, powlog_tbl_tail); -DECLARE_TABLE(double, TWO_TO_JBY64_EP_HEAD, 64) = { +__CLC_DECLARE_TABLE(double, TWO_TO_JBY64_EP_HEAD, 64) = { 0x1.0000000000000p+0, 0x1.02c9a30000000p+0, 0x1.059b0d0000000p+0, 0x1.0874510000000p+0, 0x1.0b55860000000p+0, 0x1.0e3ec30000000p+0, 0x1.11301d0000000p+0, 0x1.1429aa0000000p+0, 0x1.172b830000000p+0, @@ -1263,9 +1261,10 @@ DECLARE_TABLE(double, TWO_TO_JBY64_EP_HEAD, 64) = { 0x1.fa7c180000000p+0, }; -CLC_TABLE_FUNCTION(double, TWO_TO_JBY64_EP_HEAD, two_to_jby64_ep_tbl_head); +__CLC_TABLE_FUNCTION_VEC(double, TWO_TO_JBY64_EP_HEAD, + two_to_jby64_ep_tbl_head); -DECLARE_TABLE(double, TWO_TO_JBY64_EP_TAIL, 64) = { +__CLC_DECLARE_TABLE(double, TWO_TO_JBY64_EP_TAIL, 64) = { 0x0.0000000000000p+0, 0x1.cef00c1dcdef9p-25, 0x1.8ac2ba1d73e2ap-27, 0x1.0eb37901186bep-25, 0x1.9f3121ec53172p-25, 0x1.69e8d10103a17p-27, 0x1.25b50a4ebbf1ap-32, 0x1.d525bbf668203p-25, 0x1.8faa2f5b9bef9p-25, @@ -1290,9 +1289,10 @@ DECLARE_TABLE(double, TWO_TO_JBY64_EP_TAIL, 64) = { 0x1.9e90d82e90a7ep-28, }; -CLC_TABLE_FUNCTION(double, TWO_TO_JBY64_EP_TAIL, two_to_jby64_ep_tbl_tail); +__CLC_TABLE_FUNCTION_VEC(double, TWO_TO_JBY64_EP_TAIL, + two_to_jby64_ep_tbl_tail); -DECLARE_TABLE(double, CBRT_INV_TBL, 257) = { +__CLC_DECLARE_TABLE(double, CBRT_INV_TBL, 257) = { 0x1.0000000000000p+1, 0x1.fe01fe01fe020p+0, 0x1.fc07f01fc07f0p+0, 0x1.fa11caa01fa12p+0, 0x1.f81f81f81f820p+0, 0x1.f6310aca0dbb5p+0, 0x1.f44659e4a4271p+0, 0x1.f25f644230ab5p+0, 0x1.f07c1f07c1f08p+0, @@ -1381,9 +1381,9 @@ DECLARE_TABLE(double, CBRT_INV_TBL, 257) = { 0x1.0080402010080p+0, 0x1.0000000000000p+0, }; -CLC_TABLE_FUNCTION(double, CBRT_INV_TBL, cbrt_inv_tbl); +__CLC_TABLE_FUNCTION_VEC(double, CBRT_INV_TBL, cbrt_inv_tbl); -DECLARE_TABLE(double, CBRT_DBL_TBL_HEAD, 257) = { +__CLC_DECLARE_TABLE(double, CBRT_DBL_TBL_HEAD, 257) = { 0x1.0000000000000p+0, 0x1.0055380000000p+0, 0x1.00aa390000000p+0, 0x1.00ff010000000p+0, 0x1.0153920000000p+0, 0x1.01a7eb0000000p+0, 0x1.01fc0d0000000p+0, 0x1.024ff80000000p+0, 0x1.02a3ad0000000p+0, @@ -1472,9 +1472,9 @@ DECLARE_TABLE(double, CBRT_DBL_TBL_HEAD, 257) = { 0x1.4254640000000p+0, 0x1.428a2f0000000p+0, }; -CLC_TABLE_FUNCTION(double, CBRT_DBL_TBL_HEAD, cbrt_dbl_tbl_head); +__CLC_TABLE_FUNCTION_VEC(double, CBRT_DBL_TBL_HEAD, cbrt_dbl_tbl_head); -DECLARE_TABLE(double, CBRT_DBL_TBL_TAIL, 257) = { +__CLC_DECLARE_TABLE(double, CBRT_DBL_TBL_TAIL, 257) = { 0x0.0000000000000p+0, 0x1.e6a24c81e4294p-25, 0x1.8548511e3a785p-26, 0x1.4eb9336ec07f6p-25, 0x1.0ea64b8b750e1p-27, 0x1.61637cff8a53cp-27, 0x1.0733bf7bd1943p-27, 0x1.666911345ccedp-26, 0x1.77b7a3f592f14p-27, @@ -1563,23 +1563,23 @@ DECLARE_TABLE(double, CBRT_DBL_TBL_TAIL, 257) = { 0x1.dc43f1ed210b4p-25, 0x1.31ae515c447bbp-25, }; -CLC_TABLE_FUNCTION(double, CBRT_DBL_TBL_TAIL, cbrt_dbl_tbl_tail); +__CLC_TABLE_FUNCTION_VEC(double, CBRT_DBL_TBL_TAIL, cbrt_dbl_tbl_tail); -DECLARE_TABLE(double, CBRT_REM_TBL_HEAD, 5) = { +__CLC_DECLARE_TABLE(double, CBRT_REM_TBL_HEAD, 5) = { 0x1.428a2f0000000p-1, 0x1.965fea0000000p-1, 0x1.0000000000000p+0, 0x1.428a2f0000000p+0, 0x1.965fea0000000p+0, }; -CLC_TABLE_FUNCTION(double, CBRT_REM_TBL_HEAD, cbrt_rem_tbl_head); +__CLC_TABLE_FUNCTION_VEC(double, CBRT_REM_TBL_HEAD, cbrt_rem_tbl_head); -DECLARE_TABLE(double, CBRT_REM_TBL_TAIL, 5) = { +__CLC_DECLARE_TABLE(double, CBRT_REM_TBL_TAIL, 5) = { 0x1.31ae515c447bbp-26, 0x1.4f5b8f20ac166p-27, 0x0.0000000000000p+0, 0x1.31ae515c447bbp-25, 0x1.4f5b8f20ac166p-26, }; -CLC_TABLE_FUNCTION(double, CBRT_REM_TBL_TAIL, cbrt_rem_tbl_tail); +__CLC_TABLE_FUNCTION_VEC(double, CBRT_REM_TBL_TAIL, cbrt_rem_tbl_tail); -DECLARE_TABLE(double, SINH_TBL_HEAD, 37) = { +__CLC_DECLARE_TABLE(double, SINH_TBL_HEAD, 37) = { 0x0.0000000000000p+0, 0x1.2cd9fc0000000p+0, 0x1.d03cf60000000p+1, 0x1.40926e0000000p+3, 0x1.b4a3800000000p+4, 0x1.28d0160000000p+6, 0x1.936d228000000p+7, 0x1.1228768000000p+9, 0x1.749ea50000000p+10, @@ -1595,7 +1595,7 @@ DECLARE_TABLE(double, SINH_TBL_HEAD, 37) = { 0x1.ea215a0000000p+50, }; -DECLARE_TABLE(double, SINH_TBL_TAIL, 37) = { +__CLC_DECLARE_TABLE(double, SINH_TBL_TAIL, 37) = { 0x0.0000000000000p+0, 0x1.13ae6096a0092p-26, 0x1.db70cfb79a640p-26, 0x1.c2526b66dc067p-23, 0x1.b81b18647f380p-23, 0x1.bc1cdd1e1eb08p-20, 0x1.d9f201534fb09p-19, 0x1.d1c064a4e9954p-18, 0x1.4eca65d06ea74p-18, @@ -1611,7 +1611,7 @@ DECLARE_TABLE(double, SINH_TBL_TAIL, 37) = { 0x1.d20d76744835cp+22, }; -DECLARE_TABLE(double, COSH_TBL_HEAD, 37) = { +__CLC_DECLARE_TABLE(double, COSH_TBL_HEAD, 37) = { 0x1.0000000000000p+0, 0x1.8b07550000000p+0, 0x1.e18fa08000000p+1, 0x1.422a490000000p+3, 0x1.b4ee858000000p+4, 0x1.28d6fc8000000p+6, 0x1.936e678000000p+7, 0x1.1228948000000p+9, 0x1.749eaa8000000p+10, @@ -1627,7 +1627,7 @@ DECLARE_TABLE(double, COSH_TBL_HEAD, 37) = { 0x1.ea215a0000000p+50, }; -DECLARE_TABLE(double, COSH_TBL_TAIL, 37) = { +__CLC_DECLARE_TABLE(double, COSH_TBL_TAIL, 37) = { 0x0.0000000000000p+0, 0x1.d9f5504c2bd28p-28, 0x1.7cb66f0a4c9fdp-25, 0x1.f58617928e588p-23, 0x1.bc7d000c38d48p-25, 0x1.f7f9d4e329998p-21, 0x1.6e6e464885269p-19, 0x1.ba3a8b946c154p-19, 0x1.3f4e76110d5a4p-18, @@ -1643,12 +1643,12 @@ DECLARE_TABLE(double, COSH_TBL_TAIL, 37) = { 0x1.d20d76744835cp+22, }; -CLC_TABLE_FUNCTION(double, SINH_TBL_HEAD, sinh_tbl_head); -CLC_TABLE_FUNCTION(double, SINH_TBL_TAIL, sinh_tbl_tail); -CLC_TABLE_FUNCTION(double, COSH_TBL_HEAD, cosh_tbl_head); -CLC_TABLE_FUNCTION(double, COSH_TBL_TAIL, cosh_tbl_tail); +__CLC_TABLE_FUNCTION_VEC(double, SINH_TBL_HEAD, sinh_tbl_head); +__CLC_TABLE_FUNCTION_VEC(double, SINH_TBL_TAIL, sinh_tbl_tail); +__CLC_TABLE_FUNCTION_VEC(double, COSH_TBL_HEAD, cosh_tbl_head); +__CLC_TABLE_FUNCTION_VEC(double, COSH_TBL_TAIL, cosh_tbl_tail); -DECLARE_TABLE(uchar, PIBITS_TBL, ) = { +__CLC_DECLARE_TABLE(uchar, PIBITS_TBL, ) = { 224, 241, 27, 193, 12, 88, 33, 116, 53, 126, 196, 126, 237, 175, 169, 75, 74, 41, 222, 231, 28, 244, 236, 197, 151, 175, 31, 235, 158, 212, 181, 168, 127, 121, 154, 253, 24, 61, 221, 38, 44, 159, 60, 251, 217, @@ -1661,25 +1661,25 @@ DECLARE_TABLE(uchar, PIBITS_TBL, ) = { 119, 211, 212, 71, 95, 157, 240, 167, 84, 16, 57, 185, 13, 230, 139, 2, 0, 0, 0, 0, 0, 0, 0}; -_CLC_DEF _CLC_OVERLOAD ulong TABLE_MANGLE(pibits_tbl)(int idx) { +_CLC_DEF _CLC_OVERLOAD ulong __CLC_TABLE_MANGLE(pibits_tbl)(int idx) { return *(__constant ulong *)(PIBITS_TBL + idx); } -_CLC_DEF _CLC_OVERLOAD ulong2 TABLE_MANGLE(pibits_tbl)(int2 idx) { +_CLC_DEF _CLC_OVERLOAD ulong2 __CLC_TABLE_MANGLE(pibits_tbl)(int2 idx) { return (ulong2){*(__constant ulong *)(PIBITS_TBL + idx.s0), *(__constant ulong *)(PIBITS_TBL + idx.s1)}; } -_CLC_DEF _CLC_OVERLOAD ulong3 TABLE_MANGLE(pibits_tbl)(int3 idx) { +_CLC_DEF _CLC_OVERLOAD ulong3 __CLC_TABLE_MANGLE(pibits_tbl)(int3 idx) { return (ulong3){*(__constant ulong *)(PIBITS_TBL + idx.s0), *(__constant ulong *)(PIBITS_TBL + idx.s1), *(__constant ulong *)(PIBITS_TBL + idx.s2)}; } -_CLC_DEF _CLC_OVERLOAD ulong4 TABLE_MANGLE(pibits_tbl)(int4 idx) { +_CLC_DEF _CLC_OVERLOAD ulong4 __CLC_TABLE_MANGLE(pibits_tbl)(int4 idx) { return (ulong4){*(__constant ulong *)(PIBITS_TBL + idx.s0), *(__constant ulong *)(PIBITS_TBL + idx.s1), *(__constant ulong *)(PIBITS_TBL + idx.s2), *(__constant ulong *)(PIBITS_TBL + idx.s3)}; } -_CLC_DEF _CLC_OVERLOAD ulong8 TABLE_MANGLE(pibits_tbl)(int8 idx) { +_CLC_DEF _CLC_OVERLOAD ulong8 __CLC_TABLE_MANGLE(pibits_tbl)(int8 idx) { return (ulong8){*(__constant ulong *)(PIBITS_TBL + idx.s0), *(__constant ulong *)(PIBITS_TBL + idx.s1), *(__constant ulong *)(PIBITS_TBL + idx.s2), @@ -1689,7 +1689,7 @@ _CLC_DEF _CLC_OVERLOAD ulong8 TABLE_MANGLE(pibits_tbl)(int8 idx) { *(__constant ulong *)(PIBITS_TBL + idx.s6), *(__constant ulong *)(PIBITS_TBL + idx.s7)}; } -_CLC_DEF _CLC_OVERLOAD ulong16 TABLE_MANGLE(pibits_tbl)(int16 idx) { +_CLC_DEF _CLC_OVERLOAD ulong16 __CLC_TABLE_MANGLE(pibits_tbl)(int16 idx) { return (ulong16){*(__constant ulong *)(PIBITS_TBL + idx.s0), *(__constant ulong *)(PIBITS_TBL + idx.s1), *(__constant ulong *)(PIBITS_TBL + idx.s2), diff --git a/libclc/clc/lib/generic/math/clc_tgamma.cl b/libclc/clc/lib/generic/math/clc_tgamma.cl index 83b09cc33ecc..c379cd16b5a6 100644 --- a/libclc/clc/lib/generic/math/clc_tgamma.cl +++ b/libclc/clc/lib/generic/math/clc_tgamma.cl @@ -65,6 +65,6 @@ _CLC_OVERLOAD _CLC_DEF half __clc_tgamma(half x) { #endif -#define FUNCTION __clc_tgamma +#define __CLC_FUNCTION __clc_tgamma #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/math/clc_trunc.cl b/libclc/clc/lib/generic/math/clc_trunc.cl index 6261d04cd26d..d9c54a1888d9 100644 --- a/libclc/clc/lib/generic/math/clc_trunc.cl +++ b/libclc/clc/lib/generic/math/clc_trunc.cl @@ -8,8 +8,8 @@ #include -#define FUNCTION __clc_trunc -#define __IMPL_FUNCTION(x) __builtin_elementwise_trunc +#define __CLC_FUNCTION __clc_trunc +#define __CLC_IMPL_FUNCTION(x) __builtin_elementwise_trunc #define __CLC_BODY #include diff --git a/libclc/clc/lib/generic/relational/clc_bitselect.cl b/libclc/clc/lib/generic/relational/clc_bitselect.cl index 2976b8947e54..9c6e82e6be4b 100644 --- a/libclc/clc/lib/generic/relational/clc_bitselect.cl +++ b/libclc/clc/lib/generic/relational/clc_bitselect.cl @@ -12,7 +12,7 @@ #define __CLC_BODY #include -#define FLOAT_BITSELECT(f_type, i_type, width) \ +#define __CLC_FLOAT_BITSELECT(f_type, i_type, width) \ _CLC_OVERLOAD _CLC_DEF f_type##width __clc_bitselect( \ f_type##width x, f_type##width y, f_type##width z) { \ return __clc_as_##f_type##width(__clc_bitselect( \ @@ -20,33 +20,33 @@ __clc_as_##i_type##width(z))); \ } -FLOAT_BITSELECT(float, uint, ) -FLOAT_BITSELECT(float, uint, 2) -FLOAT_BITSELECT(float, uint, 3) -FLOAT_BITSELECT(float, uint, 4) -FLOAT_BITSELECT(float, uint, 8) -FLOAT_BITSELECT(float, uint, 16) +__CLC_FLOAT_BITSELECT(float, uint, ) +__CLC_FLOAT_BITSELECT(float, uint, 2) +__CLC_FLOAT_BITSELECT(float, uint, 3) +__CLC_FLOAT_BITSELECT(float, uint, 4) +__CLC_FLOAT_BITSELECT(float, uint, 8) +__CLC_FLOAT_BITSELECT(float, uint, 16) #ifdef cl_khr_fp64 #pragma OPENCL EXTENSION cl_khr_fp64 : enable -FLOAT_BITSELECT(double, ulong, ) -FLOAT_BITSELECT(double, ulong, 2) -FLOAT_BITSELECT(double, ulong, 3) -FLOAT_BITSELECT(double, ulong, 4) -FLOAT_BITSELECT(double, ulong, 8) -FLOAT_BITSELECT(double, ulong, 16) +__CLC_FLOAT_BITSELECT(double, ulong, ) +__CLC_FLOAT_BITSELECT(double, ulong, 2) +__CLC_FLOAT_BITSELECT(double, ulong, 3) +__CLC_FLOAT_BITSELECT(double, ulong, 4) +__CLC_FLOAT_BITSELECT(double, ulong, 8) +__CLC_FLOAT_BITSELECT(double, ulong, 16) #endif #ifdef cl_khr_fp16 #pragma OPENCL EXTENSION cl_khr_fp16 : enable -FLOAT_BITSELECT(half, ushort, ) -FLOAT_BITSELECT(half, ushort, 2) -FLOAT_BITSELECT(half, ushort, 3) -FLOAT_BITSELECT(half, ushort, 4) -FLOAT_BITSELECT(half, ushort, 8) -FLOAT_BITSELECT(half, ushort, 16) +__CLC_FLOAT_BITSELECT(half, ushort, ) +__CLC_FLOAT_BITSELECT(half, ushort, 2) +__CLC_FLOAT_BITSELECT(half, ushort, 3) +__CLC_FLOAT_BITSELECT(half, ushort, 4) +__CLC_FLOAT_BITSELECT(half, ushort, 8) +__CLC_FLOAT_BITSELECT(half, ushort, 16) #endif diff --git a/libclc/clc/lib/generic/relational/clc_signbit.cl b/libclc/clc/lib/generic/relational/clc_signbit.cl index d8736a72b394..cb7000ddb075 100644 --- a/libclc/clc/lib/generic/relational/clc_signbit.cl +++ b/libclc/clc/lib/generic/relational/clc_signbit.cl @@ -9,50 +9,54 @@ #include #include -#define _CLC_DEFINE_RELATIONAL_UNARY_VEC2(RET_TYPE, FUNCTION, ARG_TYPE) \ - _CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \ - return (RET_TYPE)((RET_TYPE){FUNCTION(x.lo), FUNCTION(x.hi)} != \ - (RET_TYPE)0); \ +#define _CLC_DEFINE_RELATIONAL_UNARY_VEC2(RET_TYPE, __CLC_FUNCTION, ARG_TYPE) \ + _CLC_DEF _CLC_OVERLOAD RET_TYPE __CLC_FUNCTION(ARG_TYPE x) { \ + return (RET_TYPE)((RET_TYPE){__CLC_FUNCTION(x.lo), \ + __CLC_FUNCTION(x.hi)} != (RET_TYPE)0); \ } -#define _CLC_DEFINE_RELATIONAL_UNARY_VEC3(RET_TYPE, FUNCTION, ARG_TYPE) \ - _CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \ - return (RET_TYPE)((RET_TYPE){FUNCTION(x.s0), FUNCTION(x.s1), \ - FUNCTION(x.s2)} != (RET_TYPE)0); \ +#define _CLC_DEFINE_RELATIONAL_UNARY_VEC3(RET_TYPE, __CLC_FUNCTION, ARG_TYPE) \ + _CLC_DEF _CLC_OVERLOAD RET_TYPE __CLC_FUNCTION(ARG_TYPE x) { \ + return (RET_TYPE)((RET_TYPE){__CLC_FUNCTION(x.s0), __CLC_FUNCTION(x.s1), \ + __CLC_FUNCTION(x.s2)} != (RET_TYPE)0); \ } -#define _CLC_DEFINE_RELATIONAL_UNARY_VEC4(RET_TYPE, FUNCTION, ARG_TYPE) \ - _CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \ - return (RET_TYPE)((RET_TYPE){FUNCTION(x.s0), FUNCTION(x.s1), \ - FUNCTION(x.s2), \ - FUNCTION(x.s3)} != (RET_TYPE)0); \ +#define _CLC_DEFINE_RELATIONAL_UNARY_VEC4(RET_TYPE, __CLC_FUNCTION, ARG_TYPE) \ + _CLC_DEF _CLC_OVERLOAD RET_TYPE __CLC_FUNCTION(ARG_TYPE x) { \ + return (RET_TYPE)((RET_TYPE){__CLC_FUNCTION(x.s0), __CLC_FUNCTION(x.s1), \ + __CLC_FUNCTION(x.s2), \ + __CLC_FUNCTION(x.s3)} != (RET_TYPE)0); \ } -#define _CLC_DEFINE_RELATIONAL_UNARY_VEC8(RET_TYPE, FUNCTION, ARG_TYPE) \ - _CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \ - return ( \ - RET_TYPE)((RET_TYPE){FUNCTION(x.s0), FUNCTION(x.s1), FUNCTION(x.s2), \ - FUNCTION(x.s3), FUNCTION(x.s4), FUNCTION(x.s5), \ - FUNCTION(x.s6), FUNCTION(x.s7)} != (RET_TYPE)0); \ +#define _CLC_DEFINE_RELATIONAL_UNARY_VEC8(RET_TYPE, __CLC_FUNCTION, ARG_TYPE) \ + _CLC_DEF _CLC_OVERLOAD RET_TYPE __CLC_FUNCTION(ARG_TYPE x) { \ + return (RET_TYPE)((RET_TYPE){__CLC_FUNCTION(x.s0), __CLC_FUNCTION(x.s1), \ + __CLC_FUNCTION(x.s2), __CLC_FUNCTION(x.s3), \ + __CLC_FUNCTION(x.s4), __CLC_FUNCTION(x.s5), \ + __CLC_FUNCTION(x.s6), \ + __CLC_FUNCTION(x.s7)} != (RET_TYPE)0); \ } -#define _CLC_DEFINE_RELATIONAL_UNARY_VEC16(RET_TYPE, FUNCTION, ARG_TYPE) \ - _CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \ - return ( \ - RET_TYPE)((RET_TYPE){FUNCTION(x.s0), FUNCTION(x.s1), FUNCTION(x.s2), \ - FUNCTION(x.s3), FUNCTION(x.s4), FUNCTION(x.s5), \ - FUNCTION(x.s6), FUNCTION(x.s7), FUNCTION(x.s8), \ - FUNCTION(x.s9), FUNCTION(x.sa), FUNCTION(x.sb), \ - FUNCTION(x.sc), FUNCTION(x.sd), FUNCTION(x.se), \ - FUNCTION(x.sf)} != (RET_TYPE)0); \ +#define _CLC_DEFINE_RELATIONAL_UNARY_VEC16(RET_TYPE, __CLC_FUNCTION, ARG_TYPE) \ + _CLC_DEF _CLC_OVERLOAD RET_TYPE __CLC_FUNCTION(ARG_TYPE x) { \ + return (RET_TYPE)((RET_TYPE){__CLC_FUNCTION(x.s0), __CLC_FUNCTION(x.s1), \ + __CLC_FUNCTION(x.s2), __CLC_FUNCTION(x.s3), \ + __CLC_FUNCTION(x.s4), __CLC_FUNCTION(x.s5), \ + __CLC_FUNCTION(x.s6), __CLC_FUNCTION(x.s7), \ + __CLC_FUNCTION(x.s8), __CLC_FUNCTION(x.s9), \ + __CLC_FUNCTION(x.sa), __CLC_FUNCTION(x.sb), \ + __CLC_FUNCTION(x.sc), __CLC_FUNCTION(x.sd), \ + __CLC_FUNCTION(x.se), \ + __CLC_FUNCTION(x.sf)} != (RET_TYPE)0); \ } -#define _CLC_DEFINE_RELATIONAL_UNARY_VEC_ALL(RET_TYPE, FUNCTION, ARG_TYPE) \ - _CLC_DEFINE_RELATIONAL_UNARY_VEC2(RET_TYPE##2, FUNCTION, ARG_TYPE##2) \ - _CLC_DEFINE_RELATIONAL_UNARY_VEC3(RET_TYPE##3, FUNCTION, ARG_TYPE##3) \ - _CLC_DEFINE_RELATIONAL_UNARY_VEC4(RET_TYPE##4, FUNCTION, ARG_TYPE##4) \ - _CLC_DEFINE_RELATIONAL_UNARY_VEC8(RET_TYPE##8, FUNCTION, ARG_TYPE##8) \ - _CLC_DEFINE_RELATIONAL_UNARY_VEC16(RET_TYPE##16, FUNCTION, ARG_TYPE##16) +#define _CLC_DEFINE_RELATIONAL_UNARY_VEC_ALL(RET_TYPE, __CLC_FUNCTION, \ + ARG_TYPE) \ + _CLC_DEFINE_RELATIONAL_UNARY_VEC2(RET_TYPE##2, __CLC_FUNCTION, ARG_TYPE##2) \ + _CLC_DEFINE_RELATIONAL_UNARY_VEC3(RET_TYPE##3, __CLC_FUNCTION, ARG_TYPE##3) \ + _CLC_DEFINE_RELATIONAL_UNARY_VEC4(RET_TYPE##4, __CLC_FUNCTION, ARG_TYPE##4) \ + _CLC_DEFINE_RELATIONAL_UNARY_VEC8(RET_TYPE##8, __CLC_FUNCTION, ARG_TYPE##8) \ + _CLC_DEFINE_RELATIONAL_UNARY_VEC16(RET_TYPE##16, __CLC_FUNCTION, ARG_TYPE##16) _CLC_DEF _CLC_OVERLOAD int __clc_signbit(float x) { return __builtin_signbitf(x); diff --git a/libclc/clc/lib/generic/shared/clc_vload.cl b/libclc/clc/lib/generic/shared/clc_vload.cl index e4003e4a9673..5942f10d2de5 100644 --- a/libclc/clc/lib/generic/shared/clc_vload.cl +++ b/libclc/clc/lib/generic/shared/clc_vload.cl @@ -9,7 +9,7 @@ #include #include -#define VLOAD_VECTORIZE(PRIM_TYPE, ADDR_SPACE) \ +#define __CLC_VLOAD_VECTORIZE(PRIM_TYPE, ADDR_SPACE) \ _CLC_OVERLOAD _CLC_DEF PRIM_TYPE##2 __clc_vload2( \ size_t offset, const ADDR_SPACE PRIM_TYPE *x) { \ return *( \ @@ -42,89 +42,89 @@ } #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -#define VLOAD_VECTORIZE_GENERIC VLOAD_VECTORIZE +#define __CLC_VLOAD_VECTORIZE_GENERIC __CLC_VLOAD_VECTORIZE #else // The generic address space isn't available, so make the macro do nothing -#define VLOAD_VECTORIZE_GENERIC(X, Y) +#define __CLC_VLOAD_VECTORIZE_GENERIC(X, Y) #endif -#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) \ - VLOAD_VECTORIZE_GENERIC(__CLC_SCALAR_GENTYPE, __generic) +#define __CLC_VLOAD_ADDR_SPACES(__CLC_SCALAR_GENTYPE) \ + __CLC_VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __private) \ + __CLC_VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __local) \ + __CLC_VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __constant) \ + __CLC_VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __global) \ + __CLC_VLOAD_VECTORIZE_GENERIC(__CLC_SCALAR_GENTYPE, __generic) -#define VLOAD_TYPES() \ - VLOAD_ADDR_SPACES(char) \ - VLOAD_ADDR_SPACES(uchar) \ - VLOAD_ADDR_SPACES(short) \ - VLOAD_ADDR_SPACES(ushort) \ - VLOAD_ADDR_SPACES(int) \ - VLOAD_ADDR_SPACES(uint) \ - VLOAD_ADDR_SPACES(long) \ - VLOAD_ADDR_SPACES(ulong) \ - VLOAD_ADDR_SPACES(float) +#define __CLC_VLOAD_TYPES() \ + __CLC_VLOAD_ADDR_SPACES(char) \ + __CLC_VLOAD_ADDR_SPACES(uchar) \ + __CLC_VLOAD_ADDR_SPACES(short) \ + __CLC_VLOAD_ADDR_SPACES(ushort) \ + __CLC_VLOAD_ADDR_SPACES(int) \ + __CLC_VLOAD_ADDR_SPACES(uint) \ + __CLC_VLOAD_ADDR_SPACES(long) \ + __CLC_VLOAD_ADDR_SPACES(ulong) \ + __CLC_VLOAD_ADDR_SPACES(float) -VLOAD_TYPES() +__CLC_VLOAD_TYPES() #ifdef cl_khr_fp64 #pragma OPENCL EXTENSION cl_khr_fp64 : enable -VLOAD_ADDR_SPACES(double) +__CLC_VLOAD_ADDR_SPACES(double) #endif #ifdef cl_khr_fp16 #pragma OPENCL EXTENSION cl_khr_fp16 : enable -VLOAD_ADDR_SPACES(half) +__CLC_VLOAD_ADDR_SPACES(half) #endif /* vload_half are legal even without cl_khr_fp16 */ /* no vload_half for double */ -#define VEC_LOAD1(val, AS) val = __builtin_load_halff(&mem[offset++]); -#define VEC_LOAD2(val, AS) \ - VEC_LOAD1(val.lo, AS) \ - VEC_LOAD1(val.hi, AS) -#define VEC_LOAD3(val, AS) \ - VEC_LOAD1(val.s0, AS) \ - VEC_LOAD1(val.s1, AS) \ - VEC_LOAD1(val.s2, AS) -#define VEC_LOAD4(val, AS) \ - VEC_LOAD2(val.lo, AS) \ - VEC_LOAD2(val.hi, AS) -#define VEC_LOAD8(val, AS) \ - VEC_LOAD4(val.lo, AS) \ - VEC_LOAD4(val.hi, AS) -#define VEC_LOAD16(val, AS) \ - VEC_LOAD8(val.lo, AS) \ - VEC_LOAD8(val.hi, AS) +#define __CLC_VEC_LOAD1(val, AS) val = __builtin_load_halff(&mem[offset++]); +#define __CLC_VEC_LOAD2(val, AS) \ + __CLC_VEC_LOAD1(val.lo, AS) \ + __CLC_VEC_LOAD1(val.hi, AS) +#define __CLC_VEC_LOAD3(val, AS) \ + __CLC_VEC_LOAD1(val.s0, AS) \ + __CLC_VEC_LOAD1(val.s1, AS) \ + __CLC_VEC_LOAD1(val.s2, AS) +#define __CLC_VEC_LOAD4(val, AS) \ + __CLC_VEC_LOAD2(val.lo, AS) \ + __CLC_VEC_LOAD2(val.hi, AS) +#define __CLC_VEC_LOAD8(val, AS) \ + __CLC_VEC_LOAD4(val.lo, AS) \ + __CLC_VEC_LOAD4(val.hi, AS) +#define __CLC_VEC_LOAD16(val, AS) \ + __CLC_VEC_LOAD8(val.lo, AS) \ + __CLC_VEC_LOAD8(val.hi, AS) -#define __FUNC(SUFFIX, VEC_SIZE, OFFSET_SIZE, TYPE, AS) \ +#define __CLC_FUNC_IMPL(SUFFIX, VEC_SIZE, OFFSET_SIZE, TYPE, AS) \ _CLC_OVERLOAD _CLC_DEF TYPE __clc_vload_half##SUFFIX(size_t offset, \ const AS half *mem) { \ offset *= VEC_SIZE; \ TYPE __tmp; \ - VEC_LOAD##VEC_SIZE(__tmp, AS) return __tmp; \ + __CLC_VEC_LOAD##VEC_SIZE(__tmp, AS) return __tmp; \ } \ _CLC_OVERLOAD _CLC_DEF TYPE __clc_vloada_half##SUFFIX(size_t offset, \ const AS half *mem) { \ offset *= OFFSET_SIZE; \ TYPE __tmp; \ - VEC_LOAD##VEC_SIZE(__tmp, AS) return __tmp; \ + __CLC_VEC_LOAD##VEC_SIZE(__tmp, AS) return __tmp; \ } -#define FUNC(SUFFIX, VEC_SIZE, OFFSET_SIZE, TYPE, AS) \ - __FUNC(SUFFIX, VEC_SIZE, OFFSET_SIZE, TYPE, AS) +#define __CLC_FUNC(SUFFIX, VEC_SIZE, OFFSET_SIZE, TYPE, AS) \ + __CLC_FUNC_IMPL(SUFFIX, VEC_SIZE, OFFSET_SIZE, TYPE, AS) #define __CLC_BODY "clc_vload_half.inc" #include -#undef FUNC -#undef __FUNC -#undef VEC_LOAD16 -#undef VEC_LOAD8 -#undef VEC_LOAD4 -#undef VEC_LOAD3 -#undef VEC_LOAD2 -#undef VEC_LOAD1 -#undef VLOAD_TYPES -#undef VLOAD_ADDR_SPACES -#undef VLOAD_VECTORIZE -#undef VLOAD_VECTORIZE_GENERIC +#undef __CLC_FUNC +#undef __CLC_FUNC_IMPL +#undef __CLC_VEC_LOAD16 +#undef __CLC_VEC_LOAD8 +#undef __CLC_VEC_LOAD4 +#undef __CLC_VEC_LOAD3 +#undef __CLC_VEC_LOAD2 +#undef __CLC_VEC_LOAD1 +#undef __CLC_VLOAD_TYPES +#undef __CLC_VLOAD_ADDR_SPACES +#undef __CLC_VLOAD_VECTORIZE +#undef __CLC_VLOAD_VECTORIZE_GENERIC diff --git a/libclc/clc/lib/generic/shared/clc_vload_half.inc b/libclc/clc/lib/generic/shared/clc_vload_half.inc index aaf067d75daa..2d5fdb357b0a 100644 --- a/libclc/clc/lib/generic/shared/clc_vload_half.inc +++ b/libclc/clc/lib/generic/shared/clc_vload_half.inc @@ -16,22 +16,25 @@ #define __CLC_OFFSET __CLC_VECSIZE #endif -FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __private); -FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __local); -FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __global); -FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __constant); +__CLC_FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, + __private); +__CLC_FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __local); +__CLC_FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __global); +__CLC_FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, + __constant); #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __generic); +__CLC_FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, + __generic); #endif #undef __CLC_OFFSET #else -FUNC(, 1, 1, __CLC_GENTYPE, __private); -FUNC(, 1, 1, __CLC_GENTYPE, __local); -FUNC(, 1, 1, __CLC_GENTYPE, __global); -FUNC(, 1, 1, __CLC_GENTYPE, __constant); +__CLC_FUNC(, 1, 1, __CLC_GENTYPE, __private); +__CLC_FUNC(, 1, 1, __CLC_GENTYPE, __local); +__CLC_FUNC(, 1, 1, __CLC_GENTYPE, __global); +__CLC_FUNC(, 1, 1, __CLC_GENTYPE, __constant); #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -FUNC(, 1, 1, __CLC_GENTYPE, __generic); +__CLC_FUNC(, 1, 1, __CLC_GENTYPE, __generic); #endif #endif #endif diff --git a/libclc/clc/lib/generic/shared/clc_vstore.cl b/libclc/clc/lib/generic/shared/clc_vstore.cl index adde58aec915..ac9692739512 100644 --- a/libclc/clc/lib/generic/shared/clc_vstore.cl +++ b/libclc/clc/lib/generic/shared/clc_vstore.cl @@ -17,7 +17,7 @@ #pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable -#define VSTORE_VECTORIZE(PRIM_TYPE, ADDR_SPACE) \ +#define __CLC_VSTORE_VECTORIZE(PRIM_TYPE, ADDR_SPACE) \ typedef PRIM_TYPE##2 less_aligned_##ADDR_SPACE##PRIM_TYPE##2 \ __attribute__((aligned(sizeof(PRIM_TYPE)))); \ _CLC_OVERLOAD _CLC_DEF void __clc_vstore2(PRIM_TYPE##2 vec, size_t offset, \ @@ -58,67 +58,68 @@ } #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -#define VSTORE_VECTORIZE_GENERIC VSTORE_VECTORIZE +#define __CLC_VSTORE_VECTORIZE_GENERIC __CLC_VSTORE_VECTORIZE #else // The generic address space isn't available, so make the macro do nothing -#define VSTORE_VECTORIZE_GENERIC(X, Y) +#define __CLC_VSTORE_VECTORIZE_GENERIC(X, Y) #endif -#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) \ - VSTORE_VECTORIZE_GENERIC(__CLC_SCALAR___CLC_GENTYPE, __generic) +#define __CLC_VSTORE_ADDR_SPACES(__CLC_SCALAR___CLC_GENTYPE) \ + __CLC_VSTORE_VECTORIZE(__CLC_SCALAR___CLC_GENTYPE, __private) \ + __CLC_VSTORE_VECTORIZE(__CLC_SCALAR___CLC_GENTYPE, __local) \ + __CLC_VSTORE_VECTORIZE(__CLC_SCALAR___CLC_GENTYPE, __global) \ + __CLC_VSTORE_VECTORIZE_GENERIC(__CLC_SCALAR___CLC_GENTYPE, __generic) -VSTORE_ADDR_SPACES(char) -VSTORE_ADDR_SPACES(uchar) -VSTORE_ADDR_SPACES(short) -VSTORE_ADDR_SPACES(ushort) -VSTORE_ADDR_SPACES(int) -VSTORE_ADDR_SPACES(uint) -VSTORE_ADDR_SPACES(long) -VSTORE_ADDR_SPACES(ulong) -VSTORE_ADDR_SPACES(float) +__CLC_VSTORE_ADDR_SPACES(char) +__CLC_VSTORE_ADDR_SPACES(uchar) +__CLC_VSTORE_ADDR_SPACES(short) +__CLC_VSTORE_ADDR_SPACES(ushort) +__CLC_VSTORE_ADDR_SPACES(int) +__CLC_VSTORE_ADDR_SPACES(uint) +__CLC_VSTORE_ADDR_SPACES(long) +__CLC_VSTORE_ADDR_SPACES(ulong) +__CLC_VSTORE_ADDR_SPACES(float) #ifdef cl_khr_fp64 #pragma OPENCL EXTENSION cl_khr_fp64 : enable -VSTORE_ADDR_SPACES(double) +__CLC_VSTORE_ADDR_SPACES(double) #endif #ifdef cl_khr_fp16 #pragma OPENCL EXTENSION cl_khr_fp16 : enable -VSTORE_ADDR_SPACES(half) +__CLC_VSTORE_ADDR_SPACES(half) #endif -#define VEC_STORE1(val, ROUNDF, BUILTIN) BUILTIN(ROUNDF(val), &mem[offset++]); +#define __CLC_VEC_STORE1(val, ROUNDF, BUILTIN) \ + BUILTIN(ROUNDF(val), &mem[offset++]); -#define VEC_STORE2(val, ROUNDF, BUILTIN) \ - VEC_STORE1(val.lo, ROUNDF, BUILTIN) \ - VEC_STORE1(val.hi, ROUNDF, BUILTIN) -#define VEC_STORE3(val, ROUNDF, BUILTIN) \ - VEC_STORE1(val.s0, ROUNDF, BUILTIN) \ - VEC_STORE1(val.s1, ROUNDF, BUILTIN) \ - VEC_STORE1(val.s2, ROUNDF, BUILTIN) -#define VEC_STORE4(val, ROUNDF, BUILTIN) \ - VEC_STORE2(val.lo, ROUNDF, BUILTIN) \ - VEC_STORE2(val.hi, ROUNDF, BUILTIN) -#define VEC_STORE8(val, ROUNDF, BUILTIN) \ - VEC_STORE4(val.lo, ROUNDF, BUILTIN) \ - VEC_STORE4(val.hi, ROUNDF, BUILTIN) -#define VEC_STORE16(val, ROUNDF, BUILTIN) \ - VEC_STORE8(val.lo, ROUNDF, BUILTIN) \ - VEC_STORE8(val.hi, ROUNDF, BUILTIN) +#define __CLC_VEC_STORE2(val, ROUNDF, BUILTIN) \ + __CLC_VEC_STORE1(val.lo, ROUNDF, BUILTIN) \ + __CLC_VEC_STORE1(val.hi, ROUNDF, BUILTIN) +#define __CLC_VEC_STORE3(val, ROUNDF, BUILTIN) \ + __CLC_VEC_STORE1(val.s0, ROUNDF, BUILTIN) \ + __CLC_VEC_STORE1(val.s1, ROUNDF, BUILTIN) \ + __CLC_VEC_STORE1(val.s2, ROUNDF, BUILTIN) +#define __CLC_VEC_STORE4(val, ROUNDF, BUILTIN) \ + __CLC_VEC_STORE2(val.lo, ROUNDF, BUILTIN) \ + __CLC_VEC_STORE2(val.hi, ROUNDF, BUILTIN) +#define __CLC_VEC_STORE8(val, ROUNDF, BUILTIN) \ + __CLC_VEC_STORE4(val.lo, ROUNDF, BUILTIN) \ + __CLC_VEC_STORE4(val.hi, ROUNDF, BUILTIN) +#define __CLC_VEC_STORE16(val, ROUNDF, BUILTIN) \ + __CLC_VEC_STORE8(val.lo, ROUNDF, BUILTIN) \ + __CLC_VEC_STORE8(val.hi, ROUNDF, BUILTIN) -#define __FUNC(SUFFIX, VEC_SIZE, OFFSET, TYPE, AS, ROUNDF, BUILTIN) \ +#define __CLC_XFUNC_IMPL(SUFFIX, VEC_SIZE, OFFSET, TYPE, AS, ROUNDF, BUILTIN) \ _CLC_OVERLOAD _CLC_DEF void __clc_vstore_half##SUFFIX( \ TYPE vec, size_t offset, AS half *mem) { \ offset *= VEC_SIZE; \ - VEC_STORE##VEC_SIZE(vec, ROUNDF, BUILTIN) \ + __CLC_VEC_STORE##VEC_SIZE(vec, ROUNDF, BUILTIN) \ } \ _CLC_OVERLOAD _CLC_DEF void __clc_vstorea_half##SUFFIX( \ TYPE vec, size_t offset, AS half *mem) { \ offset *= OFFSET; \ - VEC_STORE##VEC_SIZE(vec, ROUNDF, BUILTIN) \ + __CLC_VEC_STORE##VEC_SIZE(vec, ROUNDF, BUILTIN) \ } _CLC_DEF _CLC_OVERLOAD float __clc_noop(float x) { return x; } @@ -241,28 +242,30 @@ _CLC_DEF _CLC_OVERLOAD double __clc_rte(double x) { } #endif -#define __XFUNC(SUFFIX, VEC_SIZE, OFFSET, TYPE, AS, BUILTIN) \ - __FUNC(SUFFIX, VEC_SIZE, OFFSET, TYPE, AS, __clc_noop, BUILTIN) \ - __FUNC(SUFFIX##_rtz, VEC_SIZE, OFFSET, TYPE, AS, __clc_rtz, BUILTIN) \ - __FUNC(SUFFIX##_rtn, VEC_SIZE, OFFSET, TYPE, AS, __clc_rtn, BUILTIN) \ - __FUNC(SUFFIX##_rtp, VEC_SIZE, OFFSET, TYPE, AS, __clc_rtp, BUILTIN) \ - __FUNC(SUFFIX##_rte, VEC_SIZE, OFFSET, TYPE, AS, __clc_rte, BUILTIN) +#define __CLC_XFUNC(SUFFIX, VEC_SIZE, OFFSET, TYPE, AS, BUILTIN) \ + __CLC_XFUNC_IMPL(SUFFIX, VEC_SIZE, OFFSET, TYPE, AS, __clc_noop, BUILTIN) \ + __CLC_XFUNC_IMPL(SUFFIX##_rtz, VEC_SIZE, OFFSET, TYPE, AS, __clc_rtz, \ + BUILTIN) \ + __CLC_XFUNC_IMPL(SUFFIX##_rtn, VEC_SIZE, OFFSET, TYPE, AS, __clc_rtn, \ + BUILTIN) \ + __CLC_XFUNC_IMPL(SUFFIX##_rtp, VEC_SIZE, OFFSET, TYPE, AS, __clc_rtp, \ + BUILTIN) \ + __CLC_XFUNC_IMPL(SUFFIX##_rte, VEC_SIZE, OFFSET, TYPE, AS, __clc_rte, BUILTIN) -#define FUNC(SUFFIX, VEC_SIZE, OFFSET, TYPE, AS, BUILTIN) \ - __XFUNC(SUFFIX, VEC_SIZE, OFFSET, TYPE, AS, BUILTIN) +#define __CLC_FUNC(SUFFIX, VEC_SIZE, OFFSET, TYPE, AS, BUILTIN) \ + __CLC_XFUNC(SUFFIX, VEC_SIZE, OFFSET, TYPE, AS, BUILTIN) #define __CLC_BODY "clc_vstore_half.inc" #include -#undef FUNC -#undef __XFUNC -#undef __FUNC -#undef VEC_LOAD16 -#undef VEC_LOAD8 -#undef VEC_LOAD4 -#undef VEC_LOAD3 -#undef VEC_LOAD2 -#undef VEC_LOAD1 -#undef DECLARE_HELPER -#undef VSTORE_ADDR_SPACES -#undef VSTORE_VECTORIZE -#undef VSTORE_VECTORIZE_GENERIC +#undef __CLC_FUNC +#undef __CLC_XFUNC +#undef __CLC_XFUNC_IMPL +#undef __CLC_VEC_STORE16 +#undef __CLC_VEC_STORE8 +#undef __CLC_VEC_STORE4 +#undef __CLC_VEC_STORE3 +#undef __CLC_VEC_STORE2 +#undef __CLC_VEC_STORE1 +#undef __CLC_VSTORE_ADDR_SPACES +#undef __CLC_VSTORE_VECTORIZE +#undef __CLC_VSTORE_VECTORIZE_GENERIC diff --git a/libclc/clc/lib/generic/shared/clc_vstore_half.inc b/libclc/clc/lib/generic/shared/clc_vstore_half.inc index 02d645357f85..9188f96e2969 100644 --- a/libclc/clc/lib/generic/shared/clc_vstore_half.inc +++ b/libclc/clc/lib/generic/shared/clc_vstore_half.inc @@ -25,24 +25,24 @@ #define __CLC_OFFSET __CLC_VECSIZE #endif -FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __private, - STORE_HALF_BUILTIN); -FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __local, - STORE_HALF_BUILTIN); -FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __global, - STORE_HALF_BUILTIN); +__CLC_FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __private, + STORE_HALF_BUILTIN); +__CLC_FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __local, + STORE_HALF_BUILTIN); +__CLC_FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __global, + STORE_HALF_BUILTIN); #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __generic, - STORE_HALF_BUILTIN); +__CLC_FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_OFFSET, __CLC_GENTYPE, __generic, + STORE_HALF_BUILTIN); #endif #undef __CLC_OFFSET #else -FUNC(, 1, 1, __CLC_GENTYPE, __private, STORE_HALF_BUILTIN); -FUNC(, 1, 1, __CLC_GENTYPE, __local, STORE_HALF_BUILTIN); -FUNC(, 1, 1, __CLC_GENTYPE, __global, STORE_HALF_BUILTIN); +__CLC_FUNC(, 1, 1, __CLC_GENTYPE, __private, STORE_HALF_BUILTIN); +__CLC_FUNC(, 1, 1, __CLC_GENTYPE, __local, STORE_HALF_BUILTIN); +__CLC_FUNC(, 1, 1, __CLC_GENTYPE, __global, STORE_HALF_BUILTIN); #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -FUNC(, 1, 1, __CLC_GENTYPE, __generic, STORE_HALF_BUILTIN); +__CLC_FUNC(, 1, 1, __CLC_GENTYPE, __generic, STORE_HALF_BUILTIN); #endif #endif diff --git a/libclc/clc/lib/ptx-nvidiacl/math/clc_log.cl b/libclc/clc/lib/ptx-nvidiacl/math/clc_log.cl index 9c2778bfd1a7..4ccdfaf4e3fc 100644 --- a/libclc/clc/lib/ptx-nvidiacl/math/clc_log.cl +++ b/libclc/clc/lib/ptx-nvidiacl/math/clc_log.cl @@ -29,6 +29,6 @@ _CLC_OVERLOAD _CLC_DEF half __clc_log(half x) { #endif -#define FUNCTION __clc_log +#define __CLC_FUNCTION __clc_log #define __CLC_BODY #include diff --git a/libclc/clc/lib/ptx-nvidiacl/math/clc_rsqrt.cl b/libclc/clc/lib/ptx-nvidiacl/math/clc_rsqrt.cl index beea123180c5..786d57046728 100644 --- a/libclc/clc/lib/ptx-nvidiacl/math/clc_rsqrt.cl +++ b/libclc/clc/lib/ptx-nvidiacl/math/clc_rsqrt.cl @@ -29,6 +29,6 @@ _CLC_OVERLOAD _CLC_DEF half __clc_rsqrt(half x) { #endif -#define FUNCTION __clc_rsqrt +#define __CLC_FUNCTION __clc_rsqrt #define __CLC_BODY #include diff --git a/libclc/clc/lib/ptx-nvidiacl/math/clc_sinpi.cl b/libclc/clc/lib/ptx-nvidiacl/math/clc_sinpi.cl index 40903ba58b84..78f7038b2644 100644 --- a/libclc/clc/lib/ptx-nvidiacl/math/clc_sinpi.cl +++ b/libclc/clc/lib/ptx-nvidiacl/math/clc_sinpi.cl @@ -29,6 +29,6 @@ _CLC_OVERLOAD _CLC_DEF half __clc_sinpi(half x) { #endif -#define FUNCTION __clc_sinpi +#define __CLC_FUNCTION __clc_sinpi #define __CLC_BODY #include diff --git a/libclc/clc/lib/ptx-nvidiacl/math/clc_sqrt.cl b/libclc/clc/lib/ptx-nvidiacl/math/clc_sqrt.cl index ea91894b9dcf..ac86a57fca3d 100644 --- a/libclc/clc/lib/ptx-nvidiacl/math/clc_sqrt.cl +++ b/libclc/clc/lib/ptx-nvidiacl/math/clc_sqrt.cl @@ -29,6 +29,6 @@ _CLC_OVERLOAD _CLC_DEF half __clc_sqrt(half x) { #endif -#define FUNCTION __clc_sqrt +#define __CLC_FUNCTION __clc_sqrt #define __CLC_BODY #include diff --git a/libclc/clc/lib/ptx-nvidiacl/relational/clc_isinf.cl b/libclc/clc/lib/ptx-nvidiacl/relational/clc_isinf.cl index d518efad6a04..93f14d79fe6b 100644 --- a/libclc/clc/lib/ptx-nvidiacl/relational/clc_isinf.cl +++ b/libclc/clc/lib/ptx-nvidiacl/relational/clc_isinf.cl @@ -27,7 +27,7 @@ _CLC_OVERLOAD _CLC_DEF int __clc_isinf(half x) { return __clc_isinf((float)x); } #endif -#define FUNCTION __clc_isinf +#define __CLC_FUNCTION __clc_isinf #define __CLC_BODY #define __CLC_RET_TYPE __CLC_BIT_INT #include diff --git a/libclc/clc/lib/r600/math/clc_native_rsqrt.cl b/libclc/clc/lib/r600/math/clc_native_rsqrt.cl index b5966570804c..da001574afc0 100644 --- a/libclc/clc/lib/r600/math/clc_native_rsqrt.cl +++ b/libclc/clc/lib/r600/math/clc_native_rsqrt.cl @@ -13,7 +13,7 @@ _CLC_OVERLOAD _CLC_DEF float __clc_native_rsqrt(float x) { return __builtin_r600_recipsqrt_ieeef(x); } -#define __FLOAT_ONLY -#define FUNCTION __clc_native_rsqrt +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_native_rsqrt #define __CLC_BODY #include diff --git a/libclc/clc/lib/r600/math/clc_rsqrt_override.cl b/libclc/clc/lib/r600/math/clc_rsqrt_override.cl index 75355df56d32..f20046b34117 100644 --- a/libclc/clc/lib/r600/math/clc_rsqrt_override.cl +++ b/libclc/clc/lib/r600/math/clc_rsqrt_override.cl @@ -13,11 +13,11 @@ _CLC_OVERLOAD _CLC_DEF float __clc_rsqrt(float x) { return __builtin_r600_recipsqrt_ieeef(x); } -#define __FLOAT_ONLY -#define FUNCTION __clc_rsqrt +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION __clc_rsqrt #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #ifdef cl_khr_fp64 @@ -27,10 +27,10 @@ _CLC_OVERLOAD _CLC_DEF double __clc_rsqrt(double x) { return __builtin_r600_recipsqrt_ieee(x); } -#define __DOUBLE_ONLY -#define FUNCTION __clc_rsqrt +#define __CLC_DOUBLE_ONLY +#define __CLC_FUNCTION __clc_rsqrt #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif diff --git a/libclc/clc/lib/spirv/math/clc_fmax.cl b/libclc/clc/lib/spirv/math/clc_fmax.cl index be660fe2b29b..f63a9d00c642 100644 --- a/libclc/clc/lib/spirv/math/clc_fmax.cl +++ b/libclc/clc/lib/spirv/math/clc_fmax.cl @@ -27,6 +27,6 @@ _CLC_DEF _CLC_OVERLOAD half __clc_fmax(half x, half y) { } #endif -#define FUNCTION __clc_fmax +#define __CLC_FUNCTION __clc_fmax #define __CLC_BODY #include diff --git a/libclc/clc/lib/spirv/math/clc_fmin.cl b/libclc/clc/lib/spirv/math/clc_fmin.cl index 9f3fa66c0ab7..ddb0126035f8 100644 --- a/libclc/clc/lib/spirv/math/clc_fmin.cl +++ b/libclc/clc/lib/spirv/math/clc_fmin.cl @@ -27,6 +27,6 @@ _CLC_DEF _CLC_OVERLOAD half __clc_fmin(half x, half y) { } #endif -#define FUNCTION __clc_fmin +#define __CLC_FUNCTION __clc_fmin #define __CLC_BODY #include diff --git a/libclc/opencl/include/clc/opencl/atomic/atom_add.h b/libclc/opencl/include/clc/opencl/atomic/atom_add.h index 7f68fca0fc3a..b26a2a5361b6 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atom_add.h +++ b/libclc/opencl/include/clc/opencl/atomic/atom_add.h @@ -12,19 +12,19 @@ #include #ifdef cl_khr_global_int32_base_atomics -#define FUNCTION atom_add +#define __CLC_FUNCTION atom_add #define __CLC_ADDRESS_SPACE global #include #endif // cl_khr_global_int32_base_atomics #ifdef cl_khr_local_int32_base_atomics -#define FUNCTION atom_add +#define __CLC_FUNCTION atom_add #define __CLC_ADDRESS_SPACE local #include #endif // cl_khr_local_int32_base_atomics #ifdef cl_khr_int64_base_atomics -#define FUNCTION atom_add +#define __CLC_FUNCTION atom_add #include #endif // cl_khr_int64_base_atomics diff --git a/libclc/opencl/include/clc/opencl/atomic/atom_and.h b/libclc/opencl/include/clc/opencl/atomic/atom_and.h index 5c40aa4db70a..eacbd7a33b6e 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atom_and.h +++ b/libclc/opencl/include/clc/opencl/atomic/atom_and.h @@ -12,19 +12,19 @@ #include #ifdef cl_khr_global_int32_extended_atomics -#define FUNCTION atom_and +#define __CLC_FUNCTION atom_and #define __CLC_ADDRESS_SPACE global #include #endif // cl_khr_global_int32_extended_atomics #ifdef cl_khr_local_int32_extended_atomics -#define FUNCTION atom_and +#define __CLC_FUNCTION atom_and #define __CLC_ADDRESS_SPACE local #include #endif // cl_khr_local_int32_extended_atomics #ifdef cl_khr_int64_extended_atomics -#define FUNCTION atom_and +#define __CLC_FUNCTION atom_and #include #endif // cl_khr_int64_extended_atomics diff --git a/libclc/opencl/include/clc/opencl/atomic/atom_decl_int32.inc b/libclc/opencl/include/clc/opencl/atomic/atom_decl_int32.inc index b8631ceac3a4..866d8903db81 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atom_decl_int32.inc +++ b/libclc/opencl/include/clc/opencl/atomic/atom_decl_int32.inc @@ -10,12 +10,12 @@ #include #define __CLC_DECLARE_ATOM(ADDRSPACE, TYPE) \ - _CLC_OVERLOAD _CLC_DECL TYPE FUNCTION(volatile ADDRSPACE TYPE *, TYPE); + _CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION(volatile ADDRSPACE TYPE *, TYPE); __CLC_DECLARE_ATOM(__CLC_ADDRESS_SPACE, int) __CLC_DECLARE_ATOM(__CLC_ADDRESS_SPACE, uint) #undef __CLC_DECLARE_ATOM -#undef FUNCTION +#undef __CLC_FUNCTION #undef __CLC_ADDRESS_SPACE diff --git a/libclc/opencl/include/clc/opencl/atomic/atom_decl_int64.inc b/libclc/opencl/include/clc/opencl/atomic/atom_decl_int64.inc index 3918a7cae006..146de3412fc2 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atom_decl_int64.inc +++ b/libclc/opencl/include/clc/opencl/atomic/atom_decl_int64.inc @@ -10,7 +10,7 @@ #include #define __CLC_DECLARE_ATOM(ADDRSPACE, TYPE) \ - _CLC_OVERLOAD _CLC_DECL TYPE FUNCTION(volatile ADDRSPACE TYPE *, TYPE); + _CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION(volatile ADDRSPACE TYPE *, TYPE); __CLC_DECLARE_ATOM(local, long) __CLC_DECLARE_ATOM(local, ulong) @@ -19,4 +19,4 @@ __CLC_DECLARE_ATOM(global, ulong) #undef __CLC_DECLARE_ATOM -#undef FUNCTION +#undef __CLC_FUNCTION diff --git a/libclc/opencl/include/clc/opencl/atomic/atom_max.h b/libclc/opencl/include/clc/opencl/atomic/atom_max.h index 87c70f20058d..35a1e2aa06d4 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atom_max.h +++ b/libclc/opencl/include/clc/opencl/atomic/atom_max.h @@ -12,19 +12,19 @@ #include #ifdef cl_khr_global_int32_extended_atomics -#define FUNCTION atom_max +#define __CLC_FUNCTION atom_max #define __CLC_ADDRESS_SPACE global #include #endif // cl_khr_global_int32_extended_atomics #ifdef cl_khr_local_int32_extended_atomics -#define FUNCTION atom_max +#define __CLC_FUNCTION atom_max #define __CLC_ADDRESS_SPACE local #include #endif // cl_khr_local_int32_extended_atomics #ifdef cl_khr_int64_extended_atomics -#define FUNCTION atom_max +#define __CLC_FUNCTION atom_max #include #endif // cl_khr_int64_extended_atomics diff --git a/libclc/opencl/include/clc/opencl/atomic/atom_min.h b/libclc/opencl/include/clc/opencl/atomic/atom_min.h index 487364c617ab..ded96a5b29a4 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atom_min.h +++ b/libclc/opencl/include/clc/opencl/atomic/atom_min.h @@ -12,19 +12,19 @@ #include #ifdef cl_khr_global_int32_extended_atomics -#define FUNCTION atom_min +#define __CLC_FUNCTION atom_min #define __CLC_ADDRESS_SPACE global #include #endif // cl_khr_global_int32_extended_atomics #ifdef cl_khr_local_int32_extended_atomics -#define FUNCTION atom_min +#define __CLC_FUNCTION atom_min #define __CLC_ADDRESS_SPACE local #include #endif // cl_khr_local_int32_extended_atomics #ifdef cl_khr_int64_extended_atomics -#define FUNCTION atom_min +#define __CLC_FUNCTION atom_min #include #endif // cl_khr_int64_extended_atomics diff --git a/libclc/opencl/include/clc/opencl/atomic/atom_or.h b/libclc/opencl/include/clc/opencl/atomic/atom_or.h index 1c3ae6984eea..42a69bd3f7b4 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atom_or.h +++ b/libclc/opencl/include/clc/opencl/atomic/atom_or.h @@ -12,19 +12,19 @@ #include #ifdef cl_khr_global_int32_extended_atomics -#define FUNCTION atom_or +#define __CLC_FUNCTION atom_or #define __CLC_ADDRESS_SPACE global #include #endif // cl_khr_global_int32_extended_atomics #ifdef cl_khr_local_int32_extended_atomics -#define FUNCTION atom_or +#define __CLC_FUNCTION atom_or #define __CLC_ADDRESS_SPACE local #include #endif // cl_khr_local_int32_extended_atomics #ifdef cl_khr_int64_extended_atomics -#define FUNCTION atom_or +#define __CLC_FUNCTION atom_or #include #endif // cl_khr_int64_extended_atomics diff --git a/libclc/opencl/include/clc/opencl/atomic/atom_sub.h b/libclc/opencl/include/clc/opencl/atomic/atom_sub.h index eb17aa8ce73f..9763ee603341 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atom_sub.h +++ b/libclc/opencl/include/clc/opencl/atomic/atom_sub.h @@ -12,19 +12,19 @@ #include #ifdef cl_khr_global_int32_base_atomics -#define FUNCTION atom_sub +#define __CLC_FUNCTION atom_sub #define __CLC_ADDRESS_SPACE global #include #endif // cl_khr_global_int32_base_atomics #ifdef cl_khr_local_int32_base_atomics -#define FUNCTION atom_sub +#define __CLC_FUNCTION atom_sub #define __CLC_ADDRESS_SPACE local #include #endif // cl_khr_local_int32_base_atomics #ifdef cl_khr_int64_base_atomics -#define FUNCTION atom_sub +#define __CLC_FUNCTION atom_sub #include #endif // cl_khr_int64_base_atomics diff --git a/libclc/opencl/include/clc/opencl/atomic/atom_xchg.h b/libclc/opencl/include/clc/opencl/atomic/atom_xchg.h index df17d31d6e67..ab2c5b5156d6 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atom_xchg.h +++ b/libclc/opencl/include/clc/opencl/atomic/atom_xchg.h @@ -12,19 +12,19 @@ #include #ifdef cl_khr_global_int32_base_atomics -#define FUNCTION atom_xchg +#define __CLC_FUNCTION atom_xchg #define __CLC_ADDRESS_SPACE global #include #endif // cl_khr_global_int32_base_atomics #ifdef cl_khr_local_int32_base_atomics -#define FUNCTION atom_xchg +#define __CLC_FUNCTION atom_xchg #define __CLC_ADDRESS_SPACE local #include #endif // cl_khr_local_int32_base_atomics #ifdef cl_khr_int64_base_atomics -#define FUNCTION atom_xchg +#define __CLC_FUNCTION atom_xchg #include #endif // cl_khr_int64_base_atomics diff --git a/libclc/opencl/include/clc/opencl/atomic/atom_xor.h b/libclc/opencl/include/clc/opencl/atomic/atom_xor.h index 8a9781882158..b33168db72cf 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atom_xor.h +++ b/libclc/opencl/include/clc/opencl/atomic/atom_xor.h @@ -12,19 +12,19 @@ #include #ifdef cl_khr_global_int32_extended_atomics -#define FUNCTION atom_xor +#define __CLC_FUNCTION atom_xor #define __CLC_ADDRESS_SPACE global #include #endif // cl_khr_global_int32_extended_atomics #ifdef cl_khr_local_int32_extended_atomics -#define FUNCTION atom_xor +#define __CLC_FUNCTION atom_xor #define __CLC_ADDRESS_SPACE local #include #endif // cl_khr_local_int32_extended_atomics #ifdef cl_khr_int64_extended_atomics -#define FUNCTION atom_xor +#define __CLC_FUNCTION atom_xor #include #endif // cl_khr_int64_extended_atomics diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_add.h b/libclc/opencl/include/clc/opencl/atomic/atomic_add.h index 50fb99d1362f..edb13bd6bde4 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_add.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_add.h @@ -11,7 +11,7 @@ #include -#define FUNCTION atomic_add +#define __CLC_FUNCTION atomic_add #include #endif // __CLC_OPENCL_ATOMIC_ATOMIC_ADD_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_and.h b/libclc/opencl/include/clc/opencl/atomic/atomic_and.h index 8ce328c9739a..4875f5374c69 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_and.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_and.h @@ -11,7 +11,7 @@ #include -#define FUNCTION atomic_and +#define __CLC_FUNCTION atomic_and #include #endif // __CLC_OPENCL_ATOMIC_ATOMIC_AND_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_compare_exchange_strong.h b/libclc/opencl/include/clc/opencl/atomic/atomic_compare_exchange_strong.h index 76eeda7ba346..59bfa0e87dd8 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_compare_exchange_strong.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_compare_exchange_strong.h @@ -9,7 +9,7 @@ #ifndef __CLC_OPENCL_ATOMIC_ATOMIC_COMPARE_EXCHANGE_STRONG_H__ #define __CLC_OPENCL_ATOMIC_ATOMIC_COMPARE_EXCHANGE_STRONG_H__ -#define FUNCTION atomic_compare_exchange_strong +#define __CLC_FUNCTION atomic_compare_exchange_strong #define __CLC_COMPARE_EXCHANGE #define __CLC_BODY @@ -19,6 +19,6 @@ #include #undef __CLC_COMPARE_EXCHANGE -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_ATOMIC_ATOMIC_COMPARE_EXCHANGE_STRONG_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_compare_exchange_weak.h b/libclc/opencl/include/clc/opencl/atomic/atomic_compare_exchange_weak.h index 12788ad03a2d..7106c3e061d6 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_compare_exchange_weak.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_compare_exchange_weak.h @@ -9,7 +9,7 @@ #ifndef __CLC_OPENCL_ATOMIC_ATOMIC_COMPARE_EXCHANGE_WEAK_H__ #define __CLC_OPENCL_ATOMIC_ATOMIC_COMPARE_EXCHANGE_WEAK_H__ -#define FUNCTION atomic_compare_exchange_weak +#define __CLC_FUNCTION atomic_compare_exchange_weak #define __CLC_COMPARE_EXCHANGE #define __CLC_BODY @@ -19,6 +19,6 @@ #include #undef __CLC_COMPARE_EXCHANGE -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_ATOMIC_ATOMIC_COMPARE_EXCHANGE_WEAK_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_decl.inc b/libclc/opencl/include/clc/opencl/atomic/atomic_decl.inc index 1b2bf17bd6df..38d250f0693f 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_decl.inc +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_decl.inc @@ -10,36 +10,37 @@ #if defined(__opencl_c_fp64) && (defined(cl_khr_int64_base_atomics) && \ defined(cl_khr_int64_extended_atomics)) -#define HAVE_64_ATOMIC +#define __CLC_HAVE_64_ATOMIC #endif -#if defined(__CLC_FPSIZE) && (__CLC_FPSIZE < 64 || defined(HAVE_64_ATOMIC)) -#define HAVE_FP_ATOMIC +#if defined(__CLC_FPSIZE) && \ + (__CLC_FPSIZE < 64 || defined(__CLC_HAVE_64_ATOMIC)) +#define __CLC_HAVE_FP_ATOMIC #endif #if defined(__CLC_GENSIZE) && \ ((__CLC_GENSIZE == 32) || \ - (__CLC_GENSIZE == 64 && defined(HAVE_64_ATOMIC))) -#define HAVE_INT_ATOMIC + (__CLC_GENSIZE == 64 && defined(__CLC_HAVE_64_ATOMIC))) +#define __CLC_HAVE_INT_ATOMIC #endif -#if defined(HAVE_FP_ATOMIC) || defined(HAVE_INT_ATOMIC) +#if defined(__CLC_HAVE_FP_ATOMIC) || defined(__CLC_HAVE_INT_ATOMIC) #define __CLC_ATOMIC_GENTYPE __CLC_XCONCAT(atomic_, __CLC_GENTYPE) #ifdef __CLC_NO_VALUE_ARG #define __CLC_DEFINE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION( \ + _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION( \ volatile ADDRSPACE __CLC_ATOMIC_GENTYPE *Ptr); #elif defined(__CLC_RETURN_VOID) #define __CLC_DEFINE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DECL void FUNCTION( \ + _CLC_OVERLOAD _CLC_DECL void __CLC_FUNCTION( \ volatile ADDRSPACE __CLC_ATOMIC_GENTYPE *Ptr, __CLC_GENTYPE Value); #elif defined(__CLC_COMPARE_EXCHANGE) #define __CLC_DEFINE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION( \ + _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION( \ volatile ADDRSPACE __CLC_ATOMIC_GENTYPE *Ptr, \ ADDRSPACE __CLC_GENTYPE *Expected, __CLC_GENTYPE Desired); #else #define __CLC_DEFINE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE FUNCTION( \ + _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION( \ volatile ADDRSPACE __CLC_ATOMIC_GENTYPE *Ptr, __CLC_GENTYPE Value); #endif @@ -51,10 +52,10 @@ __CLC_DEFINE_ATOMIC() #undef __CLC_DEFINE_ATOMIC -#endif // HAVE_FP_ATOMIC || HAVE_INT_ATOMIC +#endif // __CLC_HAVE_FP_ATOMIC || __CLC_HAVE_INT_ATOMIC -#undef HAVE_INT_ATOMIC -#undef HAVE_FP_ATOMIC -#undef HAVE_64_ATOMIC +#undef __CLC_HAVE_INT_ATOMIC +#undef __CLC_HAVE_FP_ATOMIC +#undef __CLC_HAVE_64_ATOMIC #endif // __CLC_SCALAR diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_decl_legacy.inc b/libclc/opencl/include/clc/opencl/atomic/atomic_decl_legacy.inc index e060e3aaea16..0cfd4c3eab5f 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_decl_legacy.inc +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_decl_legacy.inc @@ -7,7 +7,7 @@ //===----------------------------------------------------------------------===// #define __CLC_DECLARE_ATOMIC(ADDRSPACE, TYPE) \ - _CLC_OVERLOAD _CLC_DECL TYPE FUNCTION(volatile ADDRSPACE TYPE *, TYPE); + _CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION(volatile ADDRSPACE TYPE *, TYPE); #define __CLC_DECLARE_ATOMIC_ADDRSPACE(TYPE) \ __CLC_DECLARE_ATOMIC(global, TYPE) \ @@ -19,4 +19,4 @@ __CLC_DECLARE_ATOMIC_ADDRSPACE(uint) #undef __CLC_DECLARE_ATOMIC_ADDRSPACE #undef __CLC_DECLARE_ATOMIC -#undef FUNCTION +#undef __CLC_FUNCTION diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_exchange.h b/libclc/opencl/include/clc/opencl/atomic/atomic_exchange.h index 3949bc13401f..9d949825b58c 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_exchange.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_exchange.h @@ -9,7 +9,7 @@ #ifndef __CLC_OPENCL_ATOMIC_ATOMIC_EXCHANGE_H__ #define __CLC_OPENCL_ATOMIC_ATOMIC_EXCHANGE_H__ -#define FUNCTION atomic_exchange +#define __CLC_FUNCTION atomic_exchange #define __CLC_BODY #include @@ -17,6 +17,6 @@ #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_ATOMIC_ATOMIC_EXCHANGE_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_add.h b/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_add.h index 972c1fa69fe7..bae5a7a7e19b 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_add.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_add.h @@ -9,7 +9,7 @@ #ifndef __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_ADD_H__ #define __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_ADD_H__ -#define FUNCTION atomic_fetch_add +#define __CLC_FUNCTION atomic_fetch_add #define __CLC_BODY #include @@ -17,6 +17,6 @@ #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_ADD_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_and.h b/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_and.h index fdac049a74d3..9f9d2225f910 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_and.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_and.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_AND_H__ #define __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_AND_H__ -#define FUNCTION atomic_fetch_and +#define __CLC_FUNCTION atomic_fetch_and #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_AND_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_max.h b/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_max.h index 513b60fec272..bef102dc82f4 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_max.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_max.h @@ -9,7 +9,7 @@ #ifndef __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_MAX_H__ #define __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_MAX_H__ -#define FUNCTION atomic_fetch_max +#define __CLC_FUNCTION atomic_fetch_max #define __CLC_BODY #include @@ -17,6 +17,6 @@ #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_MAX_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_min.h b/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_min.h index c961c4a64165..d7e346dc4436 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_min.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_min.h @@ -9,7 +9,7 @@ #ifndef __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_MIN_H__ #define __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_MIN_H__ -#define FUNCTION atomic_fetch_min +#define __CLC_FUNCTION atomic_fetch_min #define __CLC_BODY #include @@ -17,6 +17,6 @@ #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_MIN_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_or.h b/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_or.h index 25923e3647e3..aa00982e15a5 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_or.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_or.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_OR_H__ #define __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_OR_H__ -#define FUNCTION atomic_fetch_or +#define __CLC_FUNCTION atomic_fetch_or #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_OR_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_sub.h b/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_sub.h index b307c30a298b..3d04ed7ba34f 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_sub.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_sub.h @@ -9,7 +9,7 @@ #ifndef __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_SUB_H__ #define __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_SUB_H__ -#define FUNCTION atomic_fetch_sub +#define __CLC_FUNCTION atomic_fetch_sub #define __CLC_BODY #include @@ -17,6 +17,6 @@ #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_SUB_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_xor.h b/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_xor.h index 52510d018574..2cdff0806902 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_xor.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_fetch_xor.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_XOR_H__ #define __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_XOR_H__ -#define FUNCTION atomic_fetch_xor +#define __CLC_FUNCTION atomic_fetch_xor #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_ATOMIC_ATOMIC_FETCH_XOR_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_load.h b/libclc/opencl/include/clc/opencl/atomic/atomic_load.h index 3998a4de9452..7db259b136ec 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_load.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_load.h @@ -9,7 +9,7 @@ #ifndef __CLC_OPENCL_ATOMIC_ATOMIC_LOAD_H__ #define __CLC_OPENCL_ATOMIC_ATOMIC_LOAD_H__ -#define FUNCTION atomic_load +#define __CLC_FUNCTION atomic_load #define __CLC_NO_VALUE_ARG #define __CLC_BODY @@ -19,6 +19,6 @@ #include #undef __CLC_NO_VALUE_ARG -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_ATOMIC_ATOMIC_LOAD_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_max.h b/libclc/opencl/include/clc/opencl/atomic/atomic_max.h index 6b95ad7e68d9..e16f4ba7122d 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_max.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_max.h @@ -11,7 +11,7 @@ #include -#define FUNCTION atomic_max +#define __CLC_FUNCTION atomic_max #include #endif // __CLC_OPENCL_ATOMIC_ATOMIC_MAX_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_min.h b/libclc/opencl/include/clc/opencl/atomic/atomic_min.h index c1dfacb40b74..d422388614c2 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_min.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_min.h @@ -11,7 +11,7 @@ #include -#define FUNCTION atomic_min +#define __CLC_FUNCTION atomic_min #include #endif // __CLC_OPENCL_ATOMIC_ATOMIC_MIN_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_or.h b/libclc/opencl/include/clc/opencl/atomic/atomic_or.h index 30c32fe4889d..53c9b1e3e89b 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_or.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_or.h @@ -11,7 +11,7 @@ #include -#define FUNCTION atomic_or +#define __CLC_FUNCTION atomic_or #include #endif // __CLC_OPENCL_ATOMIC_ATOMIC_OR_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_store.h b/libclc/opencl/include/clc/opencl/atomic/atomic_store.h index 4893a5b88df0..b3cdfc6ffaea 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_store.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_store.h @@ -9,7 +9,7 @@ #ifndef __CLC_OPENCL_ATOMIC_ATOMIC_STORE_H__ #define __CLC_OPENCL_ATOMIC_ATOMIC_STORE_H__ -#define FUNCTION atomic_store +#define __CLC_FUNCTION atomic_store #define __CLC_RETURN_VOID #define __CLC_BODY @@ -19,6 +19,6 @@ #include #undef __CLC_RETURN_VOID -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_ATOMIC_ATOMIC_STORE_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_sub.h b/libclc/opencl/include/clc/opencl/atomic/atomic_sub.h index 1e7ac5505b07..1b77bd7ced46 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_sub.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_sub.h @@ -11,7 +11,7 @@ #include -#define FUNCTION atomic_sub +#define __CLC_FUNCTION atomic_sub #include #endif // __CLC_OPENCL_ATOMIC_ATOMIC_SUB_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_xchg.h b/libclc/opencl/include/clc/opencl/atomic/atomic_xchg.h index 043d7825483e..47d4a4638db3 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_xchg.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_xchg.h @@ -11,10 +11,10 @@ #include -#define FUNCTION atomic_xchg +#define __CLC_FUNCTION atomic_xchg -_CLC_OVERLOAD _CLC_DECL float FUNCTION(volatile local float *, float); -_CLC_OVERLOAD _CLC_DECL float FUNCTION(volatile global float *, float); +_CLC_OVERLOAD _CLC_DECL float __CLC_FUNCTION(volatile local float *, float); +_CLC_OVERLOAD _CLC_DECL float __CLC_FUNCTION(volatile global float *, float); #include #endif // __CLC_OPENCL_ATOMIC_ATOMIC_XCHG_H__ diff --git a/libclc/opencl/include/clc/opencl/atomic/atomic_xor.h b/libclc/opencl/include/clc/opencl/atomic/atomic_xor.h index a9bee007b934..9c808d802594 100644 --- a/libclc/opencl/include/clc/opencl/atomic/atomic_xor.h +++ b/libclc/opencl/include/clc/opencl/atomic/atomic_xor.h @@ -11,7 +11,7 @@ #include -#define FUNCTION atomic_xor +#define __CLC_FUNCTION atomic_xor #include #endif // __CLC_OPENCL_ATOMIC_ATOMIC_XOR_H__ diff --git a/libclc/opencl/include/clc/opencl/common/degrees.h b/libclc/opencl/include/clc/opencl/common/degrees.h index 5bd6f4e8f7fd..8a3e77e559cf 100644 --- a/libclc/opencl/include/clc/opencl/common/degrees.h +++ b/libclc/opencl/include/clc/opencl/common/degrees.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_COMMON_DEGREES_H__ #define __CLC_OPENCL_COMMON_DEGREES_H__ -#define FUNCTION degrees +#define __CLC_FUNCTION degrees #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_COMMON_DEGREES_H__ diff --git a/libclc/opencl/include/clc/opencl/common/radians.h b/libclc/opencl/include/clc/opencl/common/radians.h index 3761a7e875be..accef6eb6260 100644 --- a/libclc/opencl/include/clc/opencl/common/radians.h +++ b/libclc/opencl/include/clc/opencl/common/radians.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_COMMON_RADIANS_H__ #define __CLC_OPENCL_COMMON_RADIANS_H__ -#define FUNCTION radians +#define __CLC_FUNCTION radians #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_COMMON_RADIANS_H__ diff --git a/libclc/opencl/include/clc/opencl/common/sign.h b/libclc/opencl/include/clc/opencl/common/sign.h index 619e68ff1e14..58669b4e1fc9 100644 --- a/libclc/opencl/include/clc/opencl/common/sign.h +++ b/libclc/opencl/include/clc/opencl/common/sign.h @@ -9,9 +9,9 @@ #ifndef __CLC_OPENCL_COMMON_SIGN_H__ #define __CLC_OPENCL_COMMON_SIGN_H__ -#define FUNCTION sign +#define __CLC_FUNCTION sign #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_COMMON_SIGN_H__ diff --git a/libclc/opencl/include/clc/opencl/geometric/distance.h b/libclc/opencl/include/clc/opencl/geometric/distance.h index f9c219c44a49..dc5abf11c10c 100644 --- a/libclc/opencl/include/clc/opencl/geometric/distance.h +++ b/libclc/opencl/include/clc/opencl/geometric/distance.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_GEOMETRIC_DISTANCE_H__ #define __CLC_OPENCL_GEOMETRIC_DISTANCE_H__ -#define FUNCTION distance +#define __CLC_FUNCTION distance #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_GEOMETRIC_DISTANCE_H__ diff --git a/libclc/opencl/include/clc/opencl/geometric/dot.h b/libclc/opencl/include/clc/opencl/geometric/dot.h index 0b391a10aa07..8cd702961fa4 100644 --- a/libclc/opencl/include/clc/opencl/geometric/dot.h +++ b/libclc/opencl/include/clc/opencl/geometric/dot.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_GEOMETRIC_DOT_H__ #define __CLC_OPENCL_GEOMETRIC_DOT_H__ -#define FUNCTION dot +#define __CLC_FUNCTION dot #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_GEOMETRIC_DOT_H__ diff --git a/libclc/opencl/include/clc/opencl/geometric/fast_distance.h b/libclc/opencl/include/clc/opencl/geometric/fast_distance.h index 95b4966dfac1..3eb7d70cdddd 100644 --- a/libclc/opencl/include/clc/opencl/geometric/fast_distance.h +++ b/libclc/opencl/include/clc/opencl/geometric/fast_distance.h @@ -9,12 +9,12 @@ #ifndef __CLC_OPENCL_GEOMETRIC_FAST_DISTANCE_H__ #define __CLC_OPENCL_GEOMETRIC_FAST_DISTANCE_H__ -#define __FLOAT_ONLY -#define FUNCTION fast_distance +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION fast_distance #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_GEOMETRIC_FAST_DISTANCE_H__ diff --git a/libclc/opencl/include/clc/opencl/geometric/fast_length.h b/libclc/opencl/include/clc/opencl/geometric/fast_length.h index 78ad1fea981c..ff383de9ec72 100644 --- a/libclc/opencl/include/clc/opencl/geometric/fast_length.h +++ b/libclc/opencl/include/clc/opencl/geometric/fast_length.h @@ -9,12 +9,12 @@ #ifndef __CLC_OPENCL_GEOMETRIC_FAST_LENGTH_H__ #define __CLC_OPENCL_GEOMETRIC_FAST_LENGTH_H__ -#define __FLOAT_ONLY -#define FUNCTION fast_length +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION fast_length #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_GEOMETRIC_FAST_LENGTH_H__ diff --git a/libclc/opencl/include/clc/opencl/geometric/fast_normalize.h b/libclc/opencl/include/clc/opencl/geometric/fast_normalize.h index 7a70dd5df519..fb677d7d3f79 100644 --- a/libclc/opencl/include/clc/opencl/geometric/fast_normalize.h +++ b/libclc/opencl/include/clc/opencl/geometric/fast_normalize.h @@ -9,14 +9,14 @@ #ifndef __CLC_OPENCL_GEOMETRIC_FAST_NORMALIZE_H__ #define __CLC_OPENCL_GEOMETRIC_FAST_NORMALIZE_H__ -#define __FLOAT_ONLY -#define FUNCTION fast_normalize +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION fast_normalize #define __CLC_GEOMETRIC_RET_GENTYPE #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #undef __CLC_GEOMETRIC_RET_GENTYPE #endif // __CLC_OPENCL_GEOMETRIC_FAST_NORMALIZE_H__ diff --git a/libclc/opencl/include/clc/opencl/geometric/length.h b/libclc/opencl/include/clc/opencl/geometric/length.h index 5dd6ff5a9cad..686d554d6042 100644 --- a/libclc/opencl/include/clc/opencl/geometric/length.h +++ b/libclc/opencl/include/clc/opencl/geometric/length.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_GEOMETRIC_LENGTH_H__ #define __CLC_OPENCL_GEOMETRIC_LENGTH_H__ -#define FUNCTION length +#define __CLC_FUNCTION length #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_GEOMETRIC_LENGTH_H__ diff --git a/libclc/opencl/include/clc/opencl/geometric/normalize.h b/libclc/opencl/include/clc/opencl/geometric/normalize.h index 7d3e8fa98f8e..3ed6dae53269 100644 --- a/libclc/opencl/include/clc/opencl/geometric/normalize.h +++ b/libclc/opencl/include/clc/opencl/geometric/normalize.h @@ -9,13 +9,13 @@ #ifndef __CLC_OPENCL_GEOMETRIC_NORMALIZE_H__ #define __CLC_OPENCL_GEOMETRIC_NORMALIZE_H__ -#define FUNCTION normalize +#define __CLC_FUNCTION normalize #define __CLC_GEOMETRIC_RET_GENTYPE #define __CLC_BODY #include #undef __CLC_GEOMETRIC_RET_GENTYPE -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_GEOMETRIC_NORMALIZE_H__ diff --git a/libclc/opencl/include/clc/opencl/integer/add_sat.h b/libclc/opencl/include/clc/opencl/integer/add_sat.h index cd2c17a09629..e77eee0c0b05 100644 --- a/libclc/opencl/include/clc/opencl/integer/add_sat.h +++ b/libclc/opencl/include/clc/opencl/integer/add_sat.h @@ -11,11 +11,11 @@ #include -#define FUNCTION add_sat +#define __CLC_FUNCTION add_sat #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_INTEGER_ADD_SAT_H__ diff --git a/libclc/opencl/include/clc/opencl/integer/bit_reverse.h b/libclc/opencl/include/clc/opencl/integer/bit_reverse.h index 46b589557631..9c3e45d08519 100644 --- a/libclc/opencl/include/clc/opencl/integer/bit_reverse.h +++ b/libclc/opencl/include/clc/opencl/integer/bit_reverse.h @@ -13,12 +13,12 @@ #include -#define FUNCTION bit_reverse +#define __CLC_FUNCTION bit_reverse #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // cl_khr_extended_bit_ops diff --git a/libclc/opencl/include/clc/opencl/integer/bitfield_extract_signed.h b/libclc/opencl/include/clc/opencl/integer/bitfield_extract_signed.h index 0a902b2a21d6..c6e48d9820db 100644 --- a/libclc/opencl/include/clc/opencl/integer/bitfield_extract_signed.h +++ b/libclc/opencl/include/clc/opencl/integer/bitfield_extract_signed.h @@ -13,14 +13,14 @@ #include -#define FUNCTION bitfield_extract_signed -#define __RETTYPE __CLC_S_GENTYPE +#define __CLC_FUNCTION bitfield_extract_signed +#define __CLC_RETTYPE __CLC_S_GENTYPE #define __CLC_BODY #include -#undef __RETTYPE -#undef FUNCTION +#undef __CLC_RETTYPE +#undef __CLC_FUNCTION #endif // cl_khr_extended_bit_ops diff --git a/libclc/opencl/include/clc/opencl/integer/bitfield_extract_unsigned.h b/libclc/opencl/include/clc/opencl/integer/bitfield_extract_unsigned.h index 28064c08b113..63dd4368f97a 100644 --- a/libclc/opencl/include/clc/opencl/integer/bitfield_extract_unsigned.h +++ b/libclc/opencl/include/clc/opencl/integer/bitfield_extract_unsigned.h @@ -13,14 +13,14 @@ #include -#define FUNCTION bitfield_extract_unsigned -#define __RETTYPE __CLC_U_GENTYPE +#define __CLC_FUNCTION bitfield_extract_unsigned +#define __CLC_RETTYPE __CLC_U_GENTYPE #define __CLC_BODY #include -#undef __RETTYPE -#undef FUNCTION +#undef __CLC_RETTYPE +#undef __CLC_FUNCTION #endif // cl_khr_extended_bit_ops diff --git a/libclc/opencl/include/clc/opencl/integer/bitfield_insert.h b/libclc/opencl/include/clc/opencl/integer/bitfield_insert.h index e77d7a4f0b95..40c7d5982585 100644 --- a/libclc/opencl/include/clc/opencl/integer/bitfield_insert.h +++ b/libclc/opencl/include/clc/opencl/integer/bitfield_insert.h @@ -16,7 +16,7 @@ #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // cl_khr_extended_bit_ops diff --git a/libclc/opencl/include/clc/opencl/integer/clz.h b/libclc/opencl/include/clc/opencl/integer/clz.h index 77032ceeaf0f..1b47e975b52a 100644 --- a/libclc/opencl/include/clc/opencl/integer/clz.h +++ b/libclc/opencl/include/clc/opencl/integer/clz.h @@ -11,11 +11,11 @@ #include -#define FUNCTION clz +#define __CLC_FUNCTION clz #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_INTEGER_CLZ_H__ diff --git a/libclc/opencl/include/clc/opencl/integer/ctz.h b/libclc/opencl/include/clc/opencl/integer/ctz.h index b861225846ee..ba0116140730 100644 --- a/libclc/opencl/include/clc/opencl/integer/ctz.h +++ b/libclc/opencl/include/clc/opencl/integer/ctz.h @@ -13,12 +13,12 @@ #include -#define FUNCTION ctz +#define __CLC_FUNCTION ctz #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __OPENCL_C_VERSION__ >= CL_VERSION_2_0 diff --git a/libclc/opencl/include/clc/opencl/integer/hadd.h b/libclc/opencl/include/clc/opencl/integer/hadd.h index c4c8f7daf401..f200c7019435 100644 --- a/libclc/opencl/include/clc/opencl/integer/hadd.h +++ b/libclc/opencl/include/clc/opencl/integer/hadd.h @@ -11,11 +11,11 @@ #include -#define FUNCTION hadd +#define __CLC_FUNCTION hadd #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_INTEGER_HADD_H__ diff --git a/libclc/opencl/include/clc/opencl/integer/mad24.h b/libclc/opencl/include/clc/opencl/integer/mad24.h index daee9a038347..5bf3d385a432 100644 --- a/libclc/opencl/include/clc/opencl/integer/mad24.h +++ b/libclc/opencl/include/clc/opencl/integer/mad24.h @@ -11,11 +11,11 @@ #include -#define FUNCTION mad24 +#define __CLC_FUNCTION mad24 #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_INTEGER_MAD24_H__ diff --git a/libclc/opencl/include/clc/opencl/integer/mad_hi.h b/libclc/opencl/include/clc/opencl/integer/mad_hi.h index bbcdcd9c82eb..98b525ba8268 100644 --- a/libclc/opencl/include/clc/opencl/integer/mad_hi.h +++ b/libclc/opencl/include/clc/opencl/integer/mad_hi.h @@ -11,11 +11,11 @@ #include -#define FUNCTION mad_hi +#define __CLC_FUNCTION mad_hi #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_INTEGER_MAD_HI_H__ diff --git a/libclc/opencl/include/clc/opencl/integer/mad_sat.h b/libclc/opencl/include/clc/opencl/integer/mad_sat.h index 28045477975e..9e2afe4f1d9f 100644 --- a/libclc/opencl/include/clc/opencl/integer/mad_sat.h +++ b/libclc/opencl/include/clc/opencl/integer/mad_sat.h @@ -11,11 +11,11 @@ #include -#define FUNCTION mad_sat +#define __CLC_FUNCTION mad_sat #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_INTEGER_MAD_SAT_H__ diff --git a/libclc/opencl/include/clc/opencl/integer/mul24.h b/libclc/opencl/include/clc/opencl/integer/mul24.h index 6aa799a28b7e..434da55a7173 100644 --- a/libclc/opencl/include/clc/opencl/integer/mul24.h +++ b/libclc/opencl/include/clc/opencl/integer/mul24.h @@ -11,11 +11,11 @@ #include -#define FUNCTION mul24 +#define __CLC_FUNCTION mul24 #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_INTEGER_MUL24_H__ diff --git a/libclc/opencl/include/clc/opencl/integer/mul_hi.h b/libclc/opencl/include/clc/opencl/integer/mul_hi.h index ed7ac7319cab..7a9317f94cd2 100644 --- a/libclc/opencl/include/clc/opencl/integer/mul_hi.h +++ b/libclc/opencl/include/clc/opencl/integer/mul_hi.h @@ -11,11 +11,11 @@ #include -#define FUNCTION mul_hi +#define __CLC_FUNCTION mul_hi #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_INTEGER_MUL_HI_H__ diff --git a/libclc/opencl/include/clc/opencl/integer/popcount.h b/libclc/opencl/include/clc/opencl/integer/popcount.h index 43d5bc0f0b33..112640c7ce63 100644 --- a/libclc/opencl/include/clc/opencl/integer/popcount.h +++ b/libclc/opencl/include/clc/opencl/integer/popcount.h @@ -11,11 +11,11 @@ #include -#define FUNCTION popcount +#define __CLC_FUNCTION popcount #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_INTEGER_POPCOUNT_H__ diff --git a/libclc/opencl/include/clc/opencl/integer/rhadd.h b/libclc/opencl/include/clc/opencl/integer/rhadd.h index 2c93c100cf02..5ed8b27df8fc 100644 --- a/libclc/opencl/include/clc/opencl/integer/rhadd.h +++ b/libclc/opencl/include/clc/opencl/integer/rhadd.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_INTEGER_RHADD_H__ #define __CLC_OPENCL_INTEGER_RHADD_H__ -#define FUNCTION rhadd +#define __CLC_FUNCTION rhadd #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_INTEGER_RHADD_H__ diff --git a/libclc/opencl/include/clc/opencl/integer/rotate.h b/libclc/opencl/include/clc/opencl/integer/rotate.h index 156155ae0638..cc92a1254fed 100644 --- a/libclc/opencl/include/clc/opencl/integer/rotate.h +++ b/libclc/opencl/include/clc/opencl/integer/rotate.h @@ -11,11 +11,11 @@ #include -#define FUNCTION rotate +#define __CLC_FUNCTION rotate #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_INTEGER_ROTATE_H__ diff --git a/libclc/opencl/include/clc/opencl/integer/sub_sat.h b/libclc/opencl/include/clc/opencl/integer/sub_sat.h index a7861ee1ac4a..1ff26d94778c 100644 --- a/libclc/opencl/include/clc/opencl/integer/sub_sat.h +++ b/libclc/opencl/include/clc/opencl/integer/sub_sat.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_INTEGER_SUB_SAT_H__ #define __CLC_OPENCL_INTEGER_SUB_SAT_H__ -#define FUNCTION sub_sat +#define __CLC_FUNCTION sub_sat #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_INTEGER_SUB_SAT_H__ diff --git a/libclc/opencl/include/clc/opencl/math/acos.h b/libclc/opencl/include/clc/opencl/math/acos.h index f9e9b44bb904..aa0d7af13ee9 100644 --- a/libclc/opencl/include/clc/opencl/math/acos.h +++ b/libclc/opencl/include/clc/opencl/math/acos.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_ACOS_H__ #define __CLC_BODY -#define FUNCTION acos +#define __CLC_FUNCTION acos #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_ACOS_H__ diff --git a/libclc/opencl/include/clc/opencl/math/acosh.h b/libclc/opencl/include/clc/opencl/math/acosh.h index 241b305e6bc8..333ab6986d8c 100644 --- a/libclc/opencl/include/clc/opencl/math/acosh.h +++ b/libclc/opencl/include/clc/opencl/math/acosh.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_ACOSH_H__ #define __CLC_BODY -#define FUNCTION acosh +#define __CLC_FUNCTION acosh #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_ACOSH_H__ diff --git a/libclc/opencl/include/clc/opencl/math/acospi.h b/libclc/opencl/include/clc/opencl/math/acospi.h index 7014889dfb7e..fd838acd5e52 100644 --- a/libclc/opencl/include/clc/opencl/math/acospi.h +++ b/libclc/opencl/include/clc/opencl/math/acospi.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_ACOSPI_H__ #define __CLC_BODY -#define FUNCTION acospi +#define __CLC_FUNCTION acospi #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_ACOSPI_H__ diff --git a/libclc/opencl/include/clc/opencl/math/asin.h b/libclc/opencl/include/clc/opencl/math/asin.h index 1ba1f459a902..de3b8ad219d1 100644 --- a/libclc/opencl/include/clc/opencl/math/asin.h +++ b/libclc/opencl/include/clc/opencl/math/asin.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_ASIN_H__ #define __CLC_BODY -#define FUNCTION asin +#define __CLC_FUNCTION asin #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_ASIN_H__ diff --git a/libclc/opencl/include/clc/opencl/math/asinh.h b/libclc/opencl/include/clc/opencl/math/asinh.h index 9a530a51fa1e..a550ec8dee4c 100644 --- a/libclc/opencl/include/clc/opencl/math/asinh.h +++ b/libclc/opencl/include/clc/opencl/math/asinh.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_ASINH_H__ #define __CLC_BODY -#define FUNCTION asinh +#define __CLC_FUNCTION asinh #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_ASINH_H__ diff --git a/libclc/opencl/include/clc/opencl/math/asinpi.h b/libclc/opencl/include/clc/opencl/math/asinpi.h index 844848fff043..cb6133ddc3f5 100644 --- a/libclc/opencl/include/clc/opencl/math/asinpi.h +++ b/libclc/opencl/include/clc/opencl/math/asinpi.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_ASINPI_H__ #define __CLC_BODY -#define FUNCTION asinpi +#define __CLC_FUNCTION asinpi #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_ASINPI_H__ diff --git a/libclc/opencl/include/clc/opencl/math/atan.h b/libclc/opencl/include/clc/opencl/math/atan.h index f2312b8fb073..165bbc3dfb18 100644 --- a/libclc/opencl/include/clc/opencl/math/atan.h +++ b/libclc/opencl/include/clc/opencl/math/atan.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_ATAN_H__ #define __CLC_BODY -#define FUNCTION atan +#define __CLC_FUNCTION atan #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_ATAN_H__ diff --git a/libclc/opencl/include/clc/opencl/math/atan2.h b/libclc/opencl/include/clc/opencl/math/atan2.h index 72412d44aafb..287487670709 100644 --- a/libclc/opencl/include/clc/opencl/math/atan2.h +++ b/libclc/opencl/include/clc/opencl/math/atan2.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_MATH_ATAN2_H__ #define __CLC_OPENCL_MATH_ATAN2_H__ -#define FUNCTION atan2 +#define __CLC_FUNCTION atan2 #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_ATAN2_H__ diff --git a/libclc/opencl/include/clc/opencl/math/atan2pi.h b/libclc/opencl/include/clc/opencl/math/atan2pi.h index f12a19776ef2..7c09a94fffa8 100644 --- a/libclc/opencl/include/clc/opencl/math/atan2pi.h +++ b/libclc/opencl/include/clc/opencl/math/atan2pi.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_MATH_ATAN2PI_H__ #define __CLC_OPENCL_MATH_ATAN2PI_H__ -#define FUNCTION atan2pi +#define __CLC_FUNCTION atan2pi #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_ATAN2PI_H__ diff --git a/libclc/opencl/include/clc/opencl/math/atanh.h b/libclc/opencl/include/clc/opencl/math/atanh.h index 147a76b543e6..ccfe41fdb2cf 100644 --- a/libclc/opencl/include/clc/opencl/math/atanh.h +++ b/libclc/opencl/include/clc/opencl/math/atanh.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_ATANH_H__ #define __CLC_BODY -#define FUNCTION atanh +#define __CLC_FUNCTION atanh #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_ATANH_H__ diff --git a/libclc/opencl/include/clc/opencl/math/atanpi.h b/libclc/opencl/include/clc/opencl/math/atanpi.h index 12e9ea250170..8041cc3e813e 100644 --- a/libclc/opencl/include/clc/opencl/math/atanpi.h +++ b/libclc/opencl/include/clc/opencl/math/atanpi.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_ATANPI_H__ #define __CLC_BODY -#define FUNCTION atanpi +#define __CLC_FUNCTION atanpi #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_ATANPI_H__ diff --git a/libclc/opencl/include/clc/opencl/math/cbrt.h b/libclc/opencl/include/clc/opencl/math/cbrt.h index fdb408ac9685..3beb5b4b596a 100644 --- a/libclc/opencl/include/clc/opencl/math/cbrt.h +++ b/libclc/opencl/include/clc/opencl/math/cbrt.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_CBRT_H__ #define __CLC_BODY -#define FUNCTION cbrt +#define __CLC_FUNCTION cbrt #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_CBRT_H__ diff --git a/libclc/opencl/include/clc/opencl/math/ceil.h b/libclc/opencl/include/clc/opencl/math/ceil.h index dad2ea4f6980..ab32419225ce 100644 --- a/libclc/opencl/include/clc/opencl/math/ceil.h +++ b/libclc/opencl/include/clc/opencl/math/ceil.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_CEIL_H__ #define __CLC_BODY -#define FUNCTION ceil +#define __CLC_FUNCTION ceil #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_CEIL_H__ diff --git a/libclc/opencl/include/clc/opencl/math/copysign.h b/libclc/opencl/include/clc/opencl/math/copysign.h index 10d6c90edf81..626ce2e01cc3 100644 --- a/libclc/opencl/include/clc/opencl/math/copysign.h +++ b/libclc/opencl/include/clc/opencl/math/copysign.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_MATH_COPYSIGN_H__ #define __CLC_OPENCL_MATH_COPYSIGN_H__ -#define FUNCTION copysign +#define __CLC_FUNCTION copysign #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_COPYSIGN_H__ diff --git a/libclc/opencl/include/clc/opencl/math/cos.h b/libclc/opencl/include/clc/opencl/math/cos.h index 4e3aec6c6962..8d26f0f78d2d 100644 --- a/libclc/opencl/include/clc/opencl/math/cos.h +++ b/libclc/opencl/include/clc/opencl/math/cos.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_COS_H__ #define __CLC_BODY -#define FUNCTION cos +#define __CLC_FUNCTION cos #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_COS_H__ diff --git a/libclc/opencl/include/clc/opencl/math/cosh.h b/libclc/opencl/include/clc/opencl/math/cosh.h index f316433a2351..2afe77fae6c7 100644 --- a/libclc/opencl/include/clc/opencl/math/cosh.h +++ b/libclc/opencl/include/clc/opencl/math/cosh.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_COSH_H__ #define __CLC_BODY -#define FUNCTION cosh +#define __CLC_FUNCTION cosh #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_COSH_H__ diff --git a/libclc/opencl/include/clc/opencl/math/cospi.h b/libclc/opencl/include/clc/opencl/math/cospi.h index b7dfb0dbafb5..8e848ac0f883 100644 --- a/libclc/opencl/include/clc/opencl/math/cospi.h +++ b/libclc/opencl/include/clc/opencl/math/cospi.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_COSPI_H__ #define __CLC_BODY -#define FUNCTION cospi +#define __CLC_FUNCTION cospi #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_COSPI_H__ diff --git a/libclc/opencl/include/clc/opencl/math/erf.h b/libclc/opencl/include/clc/opencl/math/erf.h index 8ce262f276e3..71c211e693bd 100644 --- a/libclc/opencl/include/clc/opencl/math/erf.h +++ b/libclc/opencl/include/clc/opencl/math/erf.h @@ -12,10 +12,10 @@ #undef erfc #define __CLC_BODY -#define FUNCTION erf +#define __CLC_FUNCTION erf #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_ERF_H__ diff --git a/libclc/opencl/include/clc/opencl/math/erfc.h b/libclc/opencl/include/clc/opencl/math/erfc.h index 26afe1315df6..393910882045 100644 --- a/libclc/opencl/include/clc/opencl/math/erfc.h +++ b/libclc/opencl/include/clc/opencl/math/erfc.h @@ -12,10 +12,10 @@ #undef erfc #define __CLC_BODY -#define FUNCTION erfc +#define __CLC_FUNCTION erfc #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_ERFC_H__ diff --git a/libclc/opencl/include/clc/opencl/math/exp.h b/libclc/opencl/include/clc/opencl/math/exp.h index fb8f674a8c7e..acf6d4885dbd 100644 --- a/libclc/opencl/include/clc/opencl/math/exp.h +++ b/libclc/opencl/include/clc/opencl/math/exp.h @@ -12,10 +12,10 @@ #undef exp #define __CLC_BODY -#define FUNCTION exp +#define __CLC_FUNCTION exp #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_EXP_H__ diff --git a/libclc/opencl/include/clc/opencl/math/exp10.h b/libclc/opencl/include/clc/opencl/math/exp10.h index cfd5c6df9d15..11dcae74e061 100644 --- a/libclc/opencl/include/clc/opencl/math/exp10.h +++ b/libclc/opencl/include/clc/opencl/math/exp10.h @@ -12,10 +12,10 @@ #undef exp10 #define __CLC_BODY -#define FUNCTION exp10 +#define __CLC_FUNCTION exp10 #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_EXP10_H__ diff --git a/libclc/opencl/include/clc/opencl/math/exp2.h b/libclc/opencl/include/clc/opencl/math/exp2.h index db0405eb1334..e220654ac72e 100644 --- a/libclc/opencl/include/clc/opencl/math/exp2.h +++ b/libclc/opencl/include/clc/opencl/math/exp2.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_EXP2_H__ #define __CLC_BODY -#define FUNCTION exp2 +#define __CLC_FUNCTION exp2 #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_EXP2_H__ diff --git a/libclc/opencl/include/clc/opencl/math/expm1.h b/libclc/opencl/include/clc/opencl/math/expm1.h index 0b3628d48468..556dbea8fae0 100644 --- a/libclc/opencl/include/clc/opencl/math/expm1.h +++ b/libclc/opencl/include/clc/opencl/math/expm1.h @@ -12,10 +12,10 @@ #undef exp #define __CLC_BODY -#define FUNCTION expm1 +#define __CLC_FUNCTION expm1 #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_EXPM1_H__ diff --git a/libclc/opencl/include/clc/opencl/math/fabs.h b/libclc/opencl/include/clc/opencl/math/fabs.h index f20016f4eb8b..ad8c05198a70 100644 --- a/libclc/opencl/include/clc/opencl/math/fabs.h +++ b/libclc/opencl/include/clc/opencl/math/fabs.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_FABS_H__ #define __CLC_BODY -#define FUNCTION fabs +#define __CLC_FUNCTION fabs #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_FABS_H__ diff --git a/libclc/opencl/include/clc/opencl/math/fdim.h b/libclc/opencl/include/clc/opencl/math/fdim.h index 82f70fd83236..ed30904e3c24 100644 --- a/libclc/opencl/include/clc/opencl/math/fdim.h +++ b/libclc/opencl/include/clc/opencl/math/fdim.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_MATH_FDIM_H__ #define __CLC_OPENCL_MATH_FDIM_H__ -#define FUNCTION fdim +#define __CLC_FUNCTION fdim #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_FDIM_H__ diff --git a/libclc/opencl/include/clc/opencl/math/floor.h b/libclc/opencl/include/clc/opencl/math/floor.h index 1930aeca74ff..8d7a0358c465 100644 --- a/libclc/opencl/include/clc/opencl/math/floor.h +++ b/libclc/opencl/include/clc/opencl/math/floor.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_FLOOR_H__ #define __CLC_BODY -#define FUNCTION floor +#define __CLC_FUNCTION floor #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_FLOOR_H__ diff --git a/libclc/opencl/include/clc/opencl/math/fma.h b/libclc/opencl/include/clc/opencl/math/fma.h index 6fed3fc9b256..7a002318384a 100644 --- a/libclc/opencl/include/clc/opencl/math/fma.h +++ b/libclc/opencl/include/clc/opencl/math/fma.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_FMA_H__ #define __CLC_BODY -#define FUNCTION fma +#define __CLC_FUNCTION fma #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_FMA_H__ diff --git a/libclc/opencl/include/clc/opencl/math/fmax.h b/libclc/opencl/include/clc/opencl/math/fmax.h index 84c754e2c0c7..8ada84403e0a 100644 --- a/libclc/opencl/include/clc/opencl/math/fmax.h +++ b/libclc/opencl/include/clc/opencl/math/fmax.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_FMAX_H__ #define __CLC_BODY -#define FUNCTION fmax +#define __CLC_FUNCTION fmax #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_FMAX_H__ diff --git a/libclc/opencl/include/clc/opencl/math/fmin.h b/libclc/opencl/include/clc/opencl/math/fmin.h index b35573e4f633..3a464a63db73 100644 --- a/libclc/opencl/include/clc/opencl/math/fmin.h +++ b/libclc/opencl/include/clc/opencl/math/fmin.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_FMIN_H__ #define __CLC_BODY -#define FUNCTION fmin +#define __CLC_FUNCTION fmin #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_FMIN_H__ diff --git a/libclc/opencl/include/clc/opencl/math/fmod.h b/libclc/opencl/include/clc/opencl/math/fmod.h index 13515006fd2b..f826c8a6f6c3 100644 --- a/libclc/opencl/include/clc/opencl/math/fmod.h +++ b/libclc/opencl/include/clc/opencl/math/fmod.h @@ -9,9 +9,9 @@ #ifndef __CLC_OPENCL_MATH_FMOD_H__ #define __CLC_OPENCL_MATH_FMOD_H__ -#define FUNCTION fmod +#define __CLC_FUNCTION fmod #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_FMOD_H__ diff --git a/libclc/opencl/include/clc/opencl/math/fract.h b/libclc/opencl/include/clc/opencl/math/fract.h index de953f78c594..342280f70ed6 100644 --- a/libclc/opencl/include/clc/opencl/math/fract.h +++ b/libclc/opencl/include/clc/opencl/math/fract.h @@ -9,9 +9,9 @@ #ifndef __CLC_OPENCL_MATH_FRACT_H__ #define __CLC_OPENCL_MATH_FRACT_H__ -#define FUNCTION fract +#define __CLC_FUNCTION fract #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_FRACT_H__ diff --git a/libclc/opencl/include/clc/opencl/math/frexp.h b/libclc/opencl/include/clc/opencl/math/frexp.h index c7ed7cbd1cbc..9f0701aff10a 100644 --- a/libclc/opencl/include/clc/opencl/math/frexp.h +++ b/libclc/opencl/include/clc/opencl/math/frexp.h @@ -9,10 +9,10 @@ #ifndef __CLC_OPENCL_MATH_FREXP_H__ #define __CLC_OPENCL_MATH_FREXP_H__ -#define FUNCTION frexp +#define __CLC_FUNCTION frexp #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_FREXP_H__ diff --git a/libclc/opencl/include/clc/opencl/math/half_cos.h b/libclc/opencl/include/clc/opencl/math/half_cos.h index 5ab0b69ca422..9f95f5d7e277 100644 --- a/libclc/opencl/include/clc/opencl/math/half_cos.h +++ b/libclc/opencl/include/clc/opencl/math/half_cos.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_HALF_COS_H__ #define __CLC_BODY -#define FUNCTION half_cos -#define __FLOAT_ONLY +#define __CLC_FUNCTION half_cos +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_HALF_COS_H__ diff --git a/libclc/opencl/include/clc/opencl/math/half_divide.h b/libclc/opencl/include/clc/opencl/math/half_divide.h index ff506d0c9fd6..c61fb08e2119 100644 --- a/libclc/opencl/include/clc/opencl/math/half_divide.h +++ b/libclc/opencl/include/clc/opencl/math/half_divide.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_HALF_DIVIDE_H__ #define __CLC_BODY -#define FUNCTION half_divide +#define __CLC_FUNCTION half_divide #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_HALF_DIVIDE_H__ diff --git a/libclc/opencl/include/clc/opencl/math/half_exp.h b/libclc/opencl/include/clc/opencl/math/half_exp.h index 22780c144923..53b75a62f4df 100644 --- a/libclc/opencl/include/clc/opencl/math/half_exp.h +++ b/libclc/opencl/include/clc/opencl/math/half_exp.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_HALF_EXP_H__ #define __CLC_BODY -#define FUNCTION half_exp -#define __FLOAT_ONLY +#define __CLC_FUNCTION half_exp +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_HALF_EXP_H__ diff --git a/libclc/opencl/include/clc/opencl/math/half_exp10.h b/libclc/opencl/include/clc/opencl/math/half_exp10.h index 1a8195e67eee..88b05a4df081 100644 --- a/libclc/opencl/include/clc/opencl/math/half_exp10.h +++ b/libclc/opencl/include/clc/opencl/math/half_exp10.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_HALF_EXP10_H__ #define __CLC_BODY -#define FUNCTION half_exp10 -#define __FLOAT_ONLY +#define __CLC_FUNCTION half_exp10 +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_HALF_EXP10_H__ diff --git a/libclc/opencl/include/clc/opencl/math/half_exp2.h b/libclc/opencl/include/clc/opencl/math/half_exp2.h index 2ca69aa1ea07..e440b996e58a 100644 --- a/libclc/opencl/include/clc/opencl/math/half_exp2.h +++ b/libclc/opencl/include/clc/opencl/math/half_exp2.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_HALF_EXP2_H__ #define __CLC_BODY -#define FUNCTION half_exp2 -#define __FLOAT_ONLY +#define __CLC_FUNCTION half_exp2 +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_HALF_EXP2_H__ diff --git a/libclc/opencl/include/clc/opencl/math/half_log.h b/libclc/opencl/include/clc/opencl/math/half_log.h index d2eef868790f..d4432312c6af 100644 --- a/libclc/opencl/include/clc/opencl/math/half_log.h +++ b/libclc/opencl/include/clc/opencl/math/half_log.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_HALF_LOG_H__ #define __CLC_BODY -#define FUNCTION half_log -#define __FLOAT_ONLY +#define __CLC_FUNCTION half_log +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_HALF_LOG_H__ diff --git a/libclc/opencl/include/clc/opencl/math/half_log10.h b/libclc/opencl/include/clc/opencl/math/half_log10.h index e0f85fff3f3e..f219f950f949 100644 --- a/libclc/opencl/include/clc/opencl/math/half_log10.h +++ b/libclc/opencl/include/clc/opencl/math/half_log10.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_HALF_LOG10_H__ #define __CLC_BODY -#define FUNCTION half_log10 -#define __FLOAT_ONLY +#define __CLC_FUNCTION half_log10 +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_HALF_LOG10_H__ diff --git a/libclc/opencl/include/clc/opencl/math/half_log2.h b/libclc/opencl/include/clc/opencl/math/half_log2.h index ba0105d88356..932f546e8761 100644 --- a/libclc/opencl/include/clc/opencl/math/half_log2.h +++ b/libclc/opencl/include/clc/opencl/math/half_log2.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_HALF_LOG2_H__ #define __CLC_BODY -#define FUNCTION half_log2 -#define __FLOAT_ONLY +#define __CLC_FUNCTION half_log2 +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_HALF_LOG2_H__ diff --git a/libclc/opencl/include/clc/opencl/math/half_powr.h b/libclc/opencl/include/clc/opencl/math/half_powr.h index 4b792c0c6cba..e9af720aa5ac 100644 --- a/libclc/opencl/include/clc/opencl/math/half_powr.h +++ b/libclc/opencl/include/clc/opencl/math/half_powr.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_HALF_POWR_H__ #define __CLC_BODY -#define FUNCTION half_powr +#define __CLC_FUNCTION half_powr #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_HALF_POWR_H__ diff --git a/libclc/opencl/include/clc/opencl/math/half_recip.h b/libclc/opencl/include/clc/opencl/math/half_recip.h index 3425df4e476d..6fb7f02138a6 100644 --- a/libclc/opencl/include/clc/opencl/math/half_recip.h +++ b/libclc/opencl/include/clc/opencl/math/half_recip.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_HALF_RECIP_H__ #define __CLC_BODY -#define FUNCTION half_recip -#define __FLOAT_ONLY +#define __CLC_FUNCTION half_recip +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_HALF_RECIP_H__ diff --git a/libclc/opencl/include/clc/opencl/math/half_rsqrt.h b/libclc/opencl/include/clc/opencl/math/half_rsqrt.h index e22a7375cacd..a130d3bb080a 100644 --- a/libclc/opencl/include/clc/opencl/math/half_rsqrt.h +++ b/libclc/opencl/include/clc/opencl/math/half_rsqrt.h @@ -10,9 +10,9 @@ #define __CLC_OPENCL_MATH_HALF_RSQRT_H__ #define __CLC_BODY -#define FUNCTION half_rsqrt -#define __FLOAT_ONLY +#define __CLC_FUNCTION half_rsqrt +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_HALF_RSQRT_H__ diff --git a/libclc/opencl/include/clc/opencl/math/half_sin.h b/libclc/opencl/include/clc/opencl/math/half_sin.h index cb0462c45436..cde9549bd3b3 100644 --- a/libclc/opencl/include/clc/opencl/math/half_sin.h +++ b/libclc/opencl/include/clc/opencl/math/half_sin.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_HALF_SIN_H__ #define __CLC_BODY -#define FUNCTION half_sin -#define __FLOAT_ONLY +#define __CLC_FUNCTION half_sin +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_HALF_SIN_H__ diff --git a/libclc/opencl/include/clc/opencl/math/half_sqrt.h b/libclc/opencl/include/clc/opencl/math/half_sqrt.h index f755fee7b4be..017bed1c066e 100644 --- a/libclc/opencl/include/clc/opencl/math/half_sqrt.h +++ b/libclc/opencl/include/clc/opencl/math/half_sqrt.h @@ -10,9 +10,9 @@ #define __CLC_OPENCL_MATH_HALF_SQRT_H__ #define __CLC_BODY -#define FUNCTION half_sqrt -#define __FLOAT_ONLY +#define __CLC_FUNCTION half_sqrt +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_HALF_SQRT_H__ diff --git a/libclc/opencl/include/clc/opencl/math/half_tan.h b/libclc/opencl/include/clc/opencl/math/half_tan.h index 91b5b11ae178..b8e71fcba43d 100644 --- a/libclc/opencl/include/clc/opencl/math/half_tan.h +++ b/libclc/opencl/include/clc/opencl/math/half_tan.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_HALF_TAN_H__ #define __CLC_BODY -#define FUNCTION half_tan -#define __FLOAT_ONLY +#define __CLC_FUNCTION half_tan +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_HALF_TAN_H__ diff --git a/libclc/opencl/include/clc/opencl/math/hypot.h b/libclc/opencl/include/clc/opencl/math/hypot.h index 76ff6ef0655a..53bef98772e4 100644 --- a/libclc/opencl/include/clc/opencl/math/hypot.h +++ b/libclc/opencl/include/clc/opencl/math/hypot.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_MATH_HYPOT_H__ #define __CLC_OPENCL_MATH_HYPOT_H__ -#define FUNCTION hypot +#define __CLC_FUNCTION hypot #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_HYPOT_H__ diff --git a/libclc/opencl/include/clc/opencl/math/ilogb.h b/libclc/opencl/include/clc/opencl/math/ilogb.h index d9752a644bee..29d92632f7f5 100644 --- a/libclc/opencl/include/clc/opencl/math/ilogb.h +++ b/libclc/opencl/include/clc/opencl/math/ilogb.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_MATH_ILOGB_H__ #define __CLC_OPENCL_MATH_ILOGB_H__ -#define FUNCTION ilogb +#define __CLC_FUNCTION ilogb #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_ILOGB_H__ diff --git a/libclc/opencl/include/clc/opencl/math/ldexp.h b/libclc/opencl/include/clc/opencl/math/ldexp.h index b0194d9c9ada..cbbd030d7340 100644 --- a/libclc/opencl/include/clc/opencl/math/ldexp.h +++ b/libclc/opencl/include/clc/opencl/math/ldexp.h @@ -9,10 +9,10 @@ #ifndef __CLC_OPENCL_MATH_LDEXP_H__ #define __CLC_OPENCL_MATH_LDEXP_H__ -#define FUNCTION ldexp +#define __CLC_FUNCTION ldexp #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #define __CLC_BODY #include diff --git a/libclc/opencl/include/clc/opencl/math/lgamma.h b/libclc/opencl/include/clc/opencl/math/lgamma.h index 95ed07c3531e..42c260f65942 100644 --- a/libclc/opencl/include/clc/opencl/math/lgamma.h +++ b/libclc/opencl/include/clc/opencl/math/lgamma.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_LGAMMA_H__ #define __CLC_BODY -#define FUNCTION lgamma +#define __CLC_FUNCTION lgamma #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_LGAMMA_H__ diff --git a/libclc/opencl/include/clc/opencl/math/lgamma_r.h b/libclc/opencl/include/clc/opencl/math/lgamma_r.h index 4853d2dd5c28..03f47b30fb71 100644 --- a/libclc/opencl/include/clc/opencl/math/lgamma_r.h +++ b/libclc/opencl/include/clc/opencl/math/lgamma_r.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_MATH_LGAMMA_R_H__ #define __CLC_OPENCL_MATH_LGAMMA_R_H__ -#define FUNCTION lgamma_r +#define __CLC_FUNCTION lgamma_r #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_LGAMMA_R_H__ diff --git a/libclc/opencl/include/clc/opencl/math/log.h b/libclc/opencl/include/clc/opencl/math/log.h index 2d536d6b0926..f863dee3e8f2 100644 --- a/libclc/opencl/include/clc/opencl/math/log.h +++ b/libclc/opencl/include/clc/opencl/math/log.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_LOG_H__ #define __CLC_BODY -#define FUNCTION log +#define __CLC_FUNCTION log #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_LOG_H__ diff --git a/libclc/opencl/include/clc/opencl/math/log10.h b/libclc/opencl/include/clc/opencl/math/log10.h index 0f83b8c2a03e..d328057ecf5e 100644 --- a/libclc/opencl/include/clc/opencl/math/log10.h +++ b/libclc/opencl/include/clc/opencl/math/log10.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_LOG10_H__ #define __CLC_BODY -#define FUNCTION log10 +#define __CLC_FUNCTION log10 #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_LOG10_H__ diff --git a/libclc/opencl/include/clc/opencl/math/log1p.h b/libclc/opencl/include/clc/opencl/math/log1p.h index bd8adeda88d4..0dba062aa9fd 100644 --- a/libclc/opencl/include/clc/opencl/math/log1p.h +++ b/libclc/opencl/include/clc/opencl/math/log1p.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_LOG1P_H__ #define __CLC_BODY -#define FUNCTION log1p +#define __CLC_FUNCTION log1p #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_LOG1P_H__ diff --git a/libclc/opencl/include/clc/opencl/math/log2.h b/libclc/opencl/include/clc/opencl/math/log2.h index e4f6cb619acf..3903b2730e29 100644 --- a/libclc/opencl/include/clc/opencl/math/log2.h +++ b/libclc/opencl/include/clc/opencl/math/log2.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_LOG2_H__ #define __CLC_BODY -#define FUNCTION log2 +#define __CLC_FUNCTION log2 #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_LOG2_H__ diff --git a/libclc/opencl/include/clc/opencl/math/logb.h b/libclc/opencl/include/clc/opencl/math/logb.h index 3bbc8476d2ff..ef4f7b763c59 100644 --- a/libclc/opencl/include/clc/opencl/math/logb.h +++ b/libclc/opencl/include/clc/opencl/math/logb.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_LOGB_H__ #define __CLC_BODY -#define FUNCTION logb +#define __CLC_FUNCTION logb #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_LOGB_H__ diff --git a/libclc/opencl/include/clc/opencl/math/mad.h b/libclc/opencl/include/clc/opencl/math/mad.h index 18732eb7be66..440892cfbb17 100644 --- a/libclc/opencl/include/clc/opencl/math/mad.h +++ b/libclc/opencl/include/clc/opencl/math/mad.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_MAD_H__ #define __CLC_BODY -#define FUNCTION mad +#define __CLC_FUNCTION mad #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_MAD_H__ diff --git a/libclc/opencl/include/clc/opencl/math/maxmag.h b/libclc/opencl/include/clc/opencl/math/maxmag.h index c8f3d5700fa2..1f3df1034d8e 100644 --- a/libclc/opencl/include/clc/opencl/math/maxmag.h +++ b/libclc/opencl/include/clc/opencl/math/maxmag.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_MAXMAG_H__ #define __CLC_BODY -#define FUNCTION maxmag +#define __CLC_FUNCTION maxmag #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_MAXMAG_H__ diff --git a/libclc/opencl/include/clc/opencl/math/minmag.h b/libclc/opencl/include/clc/opencl/math/minmag.h index c90a9d9bdbeb..c87fc1a20e40 100644 --- a/libclc/opencl/include/clc/opencl/math/minmag.h +++ b/libclc/opencl/include/clc/opencl/math/minmag.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_MINMAG_H__ #define __CLC_BODY -#define FUNCTION minmag +#define __CLC_FUNCTION minmag #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_MINMAG_H__ diff --git a/libclc/opencl/include/clc/opencl/math/modf.h b/libclc/opencl/include/clc/opencl/math/modf.h index a336c9e242c1..df07f7f5948d 100644 --- a/libclc/opencl/include/clc/opencl/math/modf.h +++ b/libclc/opencl/include/clc/opencl/math/modf.h @@ -9,10 +9,10 @@ #ifndef __CLC_OPENCL_MATH_MODF_H__ #define __CLC_OPENCL_MATH_MODF_H__ -#define FUNCTION modf +#define __CLC_FUNCTION modf #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_MODF_H__ diff --git a/libclc/opencl/include/clc/opencl/math/native_cos.h b/libclc/opencl/include/clc/opencl/math/native_cos.h index 566c32e95b32..9c6728103adc 100644 --- a/libclc/opencl/include/clc/opencl/math/native_cos.h +++ b/libclc/opencl/include/clc/opencl/math/native_cos.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_NATIVE_COS_H__ #define __CLC_BODY -#define FUNCTION native_cos -#define __FLOAT_ONLY +#define __CLC_FUNCTION native_cos +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_NATIVE_COS_H__ diff --git a/libclc/opencl/include/clc/opencl/math/native_divide.h b/libclc/opencl/include/clc/opencl/math/native_divide.h index 23360b4bdeb9..66c42f20d222 100644 --- a/libclc/opencl/include/clc/opencl/math/native_divide.h +++ b/libclc/opencl/include/clc/opencl/math/native_divide.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_NATIVE_DIVIDE_H__ #define __CLC_BODY -#define FUNCTION native_divide +#define __CLC_FUNCTION native_divide #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_NATIVE_DIVIDE_H__ diff --git a/libclc/opencl/include/clc/opencl/math/native_exp.h b/libclc/opencl/include/clc/opencl/math/native_exp.h index 5133469509ff..d8c6f70d3f2c 100644 --- a/libclc/opencl/include/clc/opencl/math/native_exp.h +++ b/libclc/opencl/include/clc/opencl/math/native_exp.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_NATIVE_EXP_H__ #define __CLC_BODY -#define FUNCTION native_exp -#define __FLOAT_ONLY +#define __CLC_FUNCTION native_exp +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_NATIVE_EXP_H__ diff --git a/libclc/opencl/include/clc/opencl/math/native_exp10.h b/libclc/opencl/include/clc/opencl/math/native_exp10.h index 8a2788cd3bca..484eeb5de0a5 100644 --- a/libclc/opencl/include/clc/opencl/math/native_exp10.h +++ b/libclc/opencl/include/clc/opencl/math/native_exp10.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_NATIVE_EXP10_H__ #define __CLC_BODY -#define FUNCTION native_exp10 -#define __FLOAT_ONLY +#define __CLC_FUNCTION native_exp10 +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_NATIVE_EXP10_H__ diff --git a/libclc/opencl/include/clc/opencl/math/native_exp2.h b/libclc/opencl/include/clc/opencl/math/native_exp2.h index 5a6aed09a838..bc1e6babc62b 100644 --- a/libclc/opencl/include/clc/opencl/math/native_exp2.h +++ b/libclc/opencl/include/clc/opencl/math/native_exp2.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_NATIVE_EXP2_H__ #define __CLC_BODY -#define FUNCTION native_exp2 -#define __FLOAT_ONLY +#define __CLC_FUNCTION native_exp2 +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_NATIVE_EXP2_H__ diff --git a/libclc/opencl/include/clc/opencl/math/native_log.h b/libclc/opencl/include/clc/opencl/math/native_log.h index 58164960644f..c4bf498738f4 100644 --- a/libclc/opencl/include/clc/opencl/math/native_log.h +++ b/libclc/opencl/include/clc/opencl/math/native_log.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_NATIVE_LOG_H__ #define __CLC_BODY -#define FUNCTION native_log -#define __FLOAT_ONLY +#define __CLC_FUNCTION native_log +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_NATIVE_LOG_H__ diff --git a/libclc/opencl/include/clc/opencl/math/native_log10.h b/libclc/opencl/include/clc/opencl/math/native_log10.h index c215c733c042..ab61ee3df5c0 100644 --- a/libclc/opencl/include/clc/opencl/math/native_log10.h +++ b/libclc/opencl/include/clc/opencl/math/native_log10.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_NATIVE_LOG10_H__ #define __CLC_BODY -#define FUNCTION native_log10 -#define __FLOAT_ONLY +#define __CLC_FUNCTION native_log10 +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_NATIVE_LOG10_H__ diff --git a/libclc/opencl/include/clc/opencl/math/native_log2.h b/libclc/opencl/include/clc/opencl/math/native_log2.h index 783abe6cd8e4..6ba0d3bf490f 100644 --- a/libclc/opencl/include/clc/opencl/math/native_log2.h +++ b/libclc/opencl/include/clc/opencl/math/native_log2.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_NATIVE_LOG2_H__ #define __CLC_BODY -#define FUNCTION native_log2 -#define __FLOAT_ONLY +#define __CLC_FUNCTION native_log2 +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_NATIVE_LOG2_H__ diff --git a/libclc/opencl/include/clc/opencl/math/native_powr.h b/libclc/opencl/include/clc/opencl/math/native_powr.h index 9c8e171afc21..6b63138aa782 100644 --- a/libclc/opencl/include/clc/opencl/math/native_powr.h +++ b/libclc/opencl/include/clc/opencl/math/native_powr.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_NATIVE_POWR_H__ #define __CLC_BODY -#define FUNCTION native_powr +#define __CLC_FUNCTION native_powr #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_NATIVE_POWR_H__ diff --git a/libclc/opencl/include/clc/opencl/math/native_recip.h b/libclc/opencl/include/clc/opencl/math/native_recip.h index 1c88c076e03c..967eea38d80d 100644 --- a/libclc/opencl/include/clc/opencl/math/native_recip.h +++ b/libclc/opencl/include/clc/opencl/math/native_recip.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_NATIVE_RECIP_H__ #define __CLC_BODY -#define FUNCTION native_recip -#define __FLOAT_ONLY +#define __CLC_FUNCTION native_recip +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_NATIVE_RECIP_H__ diff --git a/libclc/opencl/include/clc/opencl/math/native_rsqrt.h b/libclc/opencl/include/clc/opencl/math/native_rsqrt.h index 2806f9128d94..9146df891372 100644 --- a/libclc/opencl/include/clc/opencl/math/native_rsqrt.h +++ b/libclc/opencl/include/clc/opencl/math/native_rsqrt.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_NATIVE_RSQRT_H__ #define __CLC_BODY -#define FUNCTION native_rsqrt -#define __FLOAT_ONLY +#define __CLC_FUNCTION native_rsqrt +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_NATIVE_RSQRT_H__ diff --git a/libclc/opencl/include/clc/opencl/math/native_sin.h b/libclc/opencl/include/clc/opencl/math/native_sin.h index 81f664153cee..766b76781a9b 100644 --- a/libclc/opencl/include/clc/opencl/math/native_sin.h +++ b/libclc/opencl/include/clc/opencl/math/native_sin.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_NATIVE_SIN_H__ #define __CLC_BODY -#define FUNCTION native_sin -#define __FLOAT_ONLY +#define __CLC_FUNCTION native_sin +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_NATIVE_SIN_H__ diff --git a/libclc/opencl/include/clc/opencl/math/native_sqrt.h b/libclc/opencl/include/clc/opencl/math/native_sqrt.h index dca0e542e0ac..5d44f28db928 100644 --- a/libclc/opencl/include/clc/opencl/math/native_sqrt.h +++ b/libclc/opencl/include/clc/opencl/math/native_sqrt.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_NATIVE_SQRT_H__ #define __CLC_BODY -#define FUNCTION native_sqrt -#define __FLOAT_ONLY +#define __CLC_FUNCTION native_sqrt +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_NATIVE_SQRT_H__ diff --git a/libclc/opencl/include/clc/opencl/math/native_tan.h b/libclc/opencl/include/clc/opencl/math/native_tan.h index cf942110e312..075aa59757b4 100644 --- a/libclc/opencl/include/clc/opencl/math/native_tan.h +++ b/libclc/opencl/include/clc/opencl/math/native_tan.h @@ -10,11 +10,11 @@ #define __CLC_OPENCL_MATH_NATIVE_TAN_H__ #define __CLC_BODY -#define FUNCTION native_tan -#define __FLOAT_ONLY +#define __CLC_FUNCTION native_tan +#define __CLC_FLOAT_ONLY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_NATIVE_TAN_H__ diff --git a/libclc/opencl/include/clc/opencl/math/nextafter.h b/libclc/opencl/include/clc/opencl/math/nextafter.h index e338f5bf6c2a..6843f2977025 100644 --- a/libclc/opencl/include/clc/opencl/math/nextafter.h +++ b/libclc/opencl/include/clc/opencl/math/nextafter.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_MATH_NEXTAFTER_H__ #define __CLC_OPENCL_MATH_NEXTAFTER_H__ -#define FUNCTION nextafter +#define __CLC_FUNCTION nextafter #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_NEXTAFTER_H__ diff --git a/libclc/opencl/include/clc/opencl/math/pow.h b/libclc/opencl/include/clc/opencl/math/pow.h index 3f4c1746faa9..ce17b66b541d 100644 --- a/libclc/opencl/include/clc/opencl/math/pow.h +++ b/libclc/opencl/include/clc/opencl/math/pow.h @@ -9,9 +9,9 @@ #ifndef __CLC_OPENCL_MATH_POW_H__ #define __CLC_OPENCL_MATH_POW_H__ -#define FUNCTION pow +#define __CLC_FUNCTION pow #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_POW_H__ diff --git a/libclc/opencl/include/clc/opencl/math/pown.h b/libclc/opencl/include/clc/opencl/math/pown.h index fd97a705c8c8..24fc298da4f1 100644 --- a/libclc/opencl/include/clc/opencl/math/pown.h +++ b/libclc/opencl/include/clc/opencl/math/pown.h @@ -9,11 +9,11 @@ #ifndef __CLC_OPENCL_MATH_POWN_H__ #define __CLC_OPENCL_MATH_POWN_H__ -#define FUNCTION pown +#define __CLC_FUNCTION pown #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_POWN_H__ diff --git a/libclc/opencl/include/clc/opencl/math/powr.h b/libclc/opencl/include/clc/opencl/math/powr.h index 47f653a73afa..6aebc346080f 100644 --- a/libclc/opencl/include/clc/opencl/math/powr.h +++ b/libclc/opencl/include/clc/opencl/math/powr.h @@ -9,9 +9,9 @@ #ifndef __CLC_OPENCL_MATH_POWR_H__ #define __CLC_OPENCL_MATH_POWR_H__ -#define FUNCTION powr +#define __CLC_FUNCTION powr #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_POWR_H__ diff --git a/libclc/opencl/include/clc/opencl/math/remainder.h b/libclc/opencl/include/clc/opencl/math/remainder.h index 416a0422c9a6..d30a315a4ce3 100644 --- a/libclc/opencl/include/clc/opencl/math/remainder.h +++ b/libclc/opencl/include/clc/opencl/math/remainder.h @@ -9,9 +9,9 @@ #ifndef __CLC_OPENCL_MATH_REMAINDER_H__ #define __CLC_OPENCL_MATH_REMAINDER_H__ -#define FUNCTION remainder +#define __CLC_FUNCTION remainder #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_REMAINDER_H__ diff --git a/libclc/opencl/include/clc/opencl/math/remquo.h b/libclc/opencl/include/clc/opencl/math/remquo.h index 3525c6bd0f68..28fc74c00fd9 100644 --- a/libclc/opencl/include/clc/opencl/math/remquo.h +++ b/libclc/opencl/include/clc/opencl/math/remquo.h @@ -9,7 +9,7 @@ #ifndef __CLC_OPENCL_MATH_REMQUO_H__ #define __CLC_OPENCL_MATH_REMQUO_H__ -#define FUNCTION remquo +#define __CLC_FUNCTION remquo #define __CLC_BODY #include @@ -21,6 +21,6 @@ #undef __CLC_ADDRESS_SPACE #endif -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_REMQUO_H__ diff --git a/libclc/opencl/include/clc/opencl/math/rint.h b/libclc/opencl/include/clc/opencl/math/rint.h index 8f08fd20c3c9..ceca56535a86 100644 --- a/libclc/opencl/include/clc/opencl/math/rint.h +++ b/libclc/opencl/include/clc/opencl/math/rint.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_RINT_H__ #define __CLC_BODY -#define FUNCTION rint +#define __CLC_FUNCTION rint #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_RINT_H__ diff --git a/libclc/opencl/include/clc/opencl/math/rootn.h b/libclc/opencl/include/clc/opencl/math/rootn.h index 20b52e7c01dc..9dce895a3f2d 100644 --- a/libclc/opencl/include/clc/opencl/math/rootn.h +++ b/libclc/opencl/include/clc/opencl/math/rootn.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_ROOTN_H__ #define __CLC_BODY -#define FUNCTION rootn +#define __CLC_FUNCTION rootn #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_ROOTN_H__ diff --git a/libclc/opencl/include/clc/opencl/math/round.h b/libclc/opencl/include/clc/opencl/math/round.h index 65bfc265ced0..740ae9241f69 100644 --- a/libclc/opencl/include/clc/opencl/math/round.h +++ b/libclc/opencl/include/clc/opencl/math/round.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_ROUND_H__ #define __CLC_BODY -#define FUNCTION round +#define __CLC_FUNCTION round #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_ROUND_H__ diff --git a/libclc/opencl/include/clc/opencl/math/rsqrt.h b/libclc/opencl/include/clc/opencl/math/rsqrt.h index 41fb54ea9bb5..ea141d4bc45b 100644 --- a/libclc/opencl/include/clc/opencl/math/rsqrt.h +++ b/libclc/opencl/include/clc/opencl/math/rsqrt.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_RSQRT_H__ #define __CLC_BODY -#define FUNCTION rsqrt +#define __CLC_FUNCTION rsqrt #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_RSQRT_H__ diff --git a/libclc/opencl/include/clc/opencl/math/sin.h b/libclc/opencl/include/clc/opencl/math/sin.h index fc7741e164fd..60de98de0958 100644 --- a/libclc/opencl/include/clc/opencl/math/sin.h +++ b/libclc/opencl/include/clc/opencl/math/sin.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_SIN_H__ #define __CLC_BODY -#define FUNCTION sin +#define __CLC_FUNCTION sin #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_SIN_H__ diff --git a/libclc/opencl/include/clc/opencl/math/sincos.h b/libclc/opencl/include/clc/opencl/math/sincos.h index 0231560a6b9d..4989bcf21c03 100644 --- a/libclc/opencl/include/clc/opencl/math/sincos.h +++ b/libclc/opencl/include/clc/opencl/math/sincos.h @@ -10,8 +10,8 @@ #define __CLC_OPENCL_MATH_SINCOS_H__ #define __CLC_BODY -#define FUNCTION sincos +#define __CLC_FUNCTION sincos #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_SINCOS_H__ diff --git a/libclc/opencl/include/clc/opencl/math/sinh.h b/libclc/opencl/include/clc/opencl/math/sinh.h index cbe30551ec64..0c9f0985be52 100644 --- a/libclc/opencl/include/clc/opencl/math/sinh.h +++ b/libclc/opencl/include/clc/opencl/math/sinh.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_SINH_H__ #define __CLC_BODY -#define FUNCTION sinh +#define __CLC_FUNCTION sinh #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_SINH_H__ diff --git a/libclc/opencl/include/clc/opencl/math/sinpi.h b/libclc/opencl/include/clc/opencl/math/sinpi.h index 3ef55a1cd42d..a24339f8cf03 100644 --- a/libclc/opencl/include/clc/opencl/math/sinpi.h +++ b/libclc/opencl/include/clc/opencl/math/sinpi.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_SINPI_H__ #define __CLC_BODY -#define FUNCTION sinpi +#define __CLC_FUNCTION sinpi #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_SINPI_H__ diff --git a/libclc/opencl/include/clc/opencl/math/sqrt.h b/libclc/opencl/include/clc/opencl/math/sqrt.h index 8da37e94e756..41f604f9652d 100644 --- a/libclc/opencl/include/clc/opencl/math/sqrt.h +++ b/libclc/opencl/include/clc/opencl/math/sqrt.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_SQRT_H__ #define __CLC_BODY -#define FUNCTION sqrt +#define __CLC_FUNCTION sqrt #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_SQRT_H__ diff --git a/libclc/opencl/include/clc/opencl/math/tan.h b/libclc/opencl/include/clc/opencl/math/tan.h index b7bab825c935..5c3f5f6a3a41 100644 --- a/libclc/opencl/include/clc/opencl/math/tan.h +++ b/libclc/opencl/include/clc/opencl/math/tan.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_TAN_H__ #define __CLC_BODY -#define FUNCTION tan +#define __CLC_FUNCTION tan #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_TAN_H__ diff --git a/libclc/opencl/include/clc/opencl/math/tanh.h b/libclc/opencl/include/clc/opencl/math/tanh.h index 168c06d50cb2..dce89867f25e 100644 --- a/libclc/opencl/include/clc/opencl/math/tanh.h +++ b/libclc/opencl/include/clc/opencl/math/tanh.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_TANH_H__ #define __CLC_BODY -#define FUNCTION tanh +#define __CLC_FUNCTION tanh #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_TANH_H__ diff --git a/libclc/opencl/include/clc/opencl/math/tanpi.h b/libclc/opencl/include/clc/opencl/math/tanpi.h index 0475027086f6..2a903b9a1fe7 100644 --- a/libclc/opencl/include/clc/opencl/math/tanpi.h +++ b/libclc/opencl/include/clc/opencl/math/tanpi.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_TANPI_H__ #define __CLC_BODY -#define FUNCTION tanpi +#define __CLC_FUNCTION tanpi #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_TANPI_H__ diff --git a/libclc/opencl/include/clc/opencl/math/tgamma.h b/libclc/opencl/include/clc/opencl/math/tgamma.h index 6629c0200245..5cb0a7fd48f9 100644 --- a/libclc/opencl/include/clc/opencl/math/tgamma.h +++ b/libclc/opencl/include/clc/opencl/math/tgamma.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_TGAMMA_H__ #define __CLC_BODY -#define FUNCTION tgamma +#define __CLC_FUNCTION tgamma #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_TGAMMA_H__ diff --git a/libclc/opencl/include/clc/opencl/math/trunc.h b/libclc/opencl/include/clc/opencl/math/trunc.h index 0e61f6e1679f..ccb60a6a54d6 100644 --- a/libclc/opencl/include/clc/opencl/math/trunc.h +++ b/libclc/opencl/include/clc/opencl/math/trunc.h @@ -10,10 +10,10 @@ #define __CLC_OPENCL_MATH_TRUNC_H__ #define __CLC_BODY -#define FUNCTION trunc +#define __CLC_FUNCTION trunc #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MATH_TRUNC_H__ diff --git a/libclc/opencl/include/clc/opencl/misc/shuffle.h b/libclc/opencl/include/clc/opencl/misc/shuffle.h index 03c2718b0c4f..a1d4b6aa3824 100644 --- a/libclc/opencl/include/clc/opencl/misc/shuffle.h +++ b/libclc/opencl/include/clc/opencl/misc/shuffle.h @@ -9,7 +9,7 @@ #ifndef __CLC_OPENCL_MISC_SHUFFLE_H__ #define __CLC_OPENCL_MISC_SHUFFLE_H__ -#define FUNCTION shuffle +#define __CLC_FUNCTION shuffle // Integer-type decls #define __CLC_BODY @@ -19,6 +19,6 @@ #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MISC_SHUFFLE_H__ diff --git a/libclc/opencl/include/clc/opencl/misc/shuffle2.h b/libclc/opencl/include/clc/opencl/misc/shuffle2.h index 5b6ba9968651..0f93a802b3f3 100644 --- a/libclc/opencl/include/clc/opencl/misc/shuffle2.h +++ b/libclc/opencl/include/clc/opencl/misc/shuffle2.h @@ -9,7 +9,7 @@ #ifndef __CLC_OPENCL_MISC_SHUFFLE2_H__ #define __CLC_OPENCL_MISC_SHUFFLE2_H__ -#define FUNCTION shuffle2 +#define __CLC_FUNCTION shuffle2 // Integer-type decls #define __CLC_BODY @@ -19,6 +19,6 @@ #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_MISC_SHUFFLE2_H__ diff --git a/libclc/opencl/include/clc/opencl/relational/isfinite.h b/libclc/opencl/include/clc/opencl/relational/isfinite.h index ac3db6764073..ff996befa937 100644 --- a/libclc/opencl/include/clc/opencl/relational/isfinite.h +++ b/libclc/opencl/include/clc/opencl/relational/isfinite.h @@ -11,11 +11,11 @@ #include -#define FUNCTION isfinite +#define __CLC_FUNCTION isfinite #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_RELATIONAL_ISFINITE_H__ diff --git a/libclc/opencl/include/clc/opencl/relational/isgreater.h b/libclc/opencl/include/clc/opencl/relational/isgreater.h index 2230055115bc..1885faac0d6d 100644 --- a/libclc/opencl/include/clc/opencl/relational/isgreater.h +++ b/libclc/opencl/include/clc/opencl/relational/isgreater.h @@ -11,11 +11,11 @@ #include -#define FUNCTION isgreater +#define __CLC_FUNCTION isgreater #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_RELATIONAL_ISGREATER_H__ diff --git a/libclc/opencl/include/clc/opencl/relational/isgreaterequal.h b/libclc/opencl/include/clc/opencl/relational/isgreaterequal.h index f99a620dabd7..36def480081b 100644 --- a/libclc/opencl/include/clc/opencl/relational/isgreaterequal.h +++ b/libclc/opencl/include/clc/opencl/relational/isgreaterequal.h @@ -11,11 +11,11 @@ #include -#define FUNCTION isgreaterequal +#define __CLC_FUNCTION isgreaterequal #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_RELATIONAL_ISGREATEREQUAL_H__ diff --git a/libclc/opencl/include/clc/opencl/relational/isless.h b/libclc/opencl/include/clc/opencl/relational/isless.h index 74280e543e0b..ce516890f19e 100644 --- a/libclc/opencl/include/clc/opencl/relational/isless.h +++ b/libclc/opencl/include/clc/opencl/relational/isless.h @@ -11,11 +11,11 @@ #include -#define FUNCTION isless +#define __CLC_FUNCTION isless #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_RELATIONAL_ISLESS_H__ diff --git a/libclc/opencl/include/clc/opencl/relational/islessequal.h b/libclc/opencl/include/clc/opencl/relational/islessequal.h index dcc26c37b73c..571ed13c0ab8 100644 --- a/libclc/opencl/include/clc/opencl/relational/islessequal.h +++ b/libclc/opencl/include/clc/opencl/relational/islessequal.h @@ -11,11 +11,11 @@ #include -#define FUNCTION islessequal +#define __CLC_FUNCTION islessequal #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_RELATIONAL_ISLESSEQUAL_H__ diff --git a/libclc/opencl/include/clc/opencl/relational/islessgreater.h b/libclc/opencl/include/clc/opencl/relational/islessgreater.h index 15a1eb557753..eefd2c41b346 100644 --- a/libclc/opencl/include/clc/opencl/relational/islessgreater.h +++ b/libclc/opencl/include/clc/opencl/relational/islessgreater.h @@ -11,11 +11,11 @@ #include -#define FUNCTION islessgreater +#define __CLC_FUNCTION islessgreater #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_RELATIONAL_ISLESSGREATER_H__ diff --git a/libclc/opencl/include/clc/opencl/relational/isnormal.h b/libclc/opencl/include/clc/opencl/relational/isnormal.h index bbb06aad0df2..29ef762174f0 100644 --- a/libclc/opencl/include/clc/opencl/relational/isnormal.h +++ b/libclc/opencl/include/clc/opencl/relational/isnormal.h @@ -11,11 +11,11 @@ #include -#define FUNCTION isnormal +#define __CLC_FUNCTION isnormal #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_RELATIONAL_ISNORMAL_H__ diff --git a/libclc/opencl/include/clc/opencl/relational/isnotequal.h b/libclc/opencl/include/clc/opencl/relational/isnotequal.h index c13aca8ef4be..6670b9946d18 100644 --- a/libclc/opencl/include/clc/opencl/relational/isnotequal.h +++ b/libclc/opencl/include/clc/opencl/relational/isnotequal.h @@ -11,11 +11,11 @@ #include -#define FUNCTION isnotequal +#define __CLC_FUNCTION isnotequal #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_RELATIONAL_ISNOTEQUAL_H__ diff --git a/libclc/opencl/include/clc/opencl/relational/isordered.h b/libclc/opencl/include/clc/opencl/relational/isordered.h index ea4ba3fa6fe8..09531ed86721 100644 --- a/libclc/opencl/include/clc/opencl/relational/isordered.h +++ b/libclc/opencl/include/clc/opencl/relational/isordered.h @@ -11,11 +11,11 @@ #include -#define FUNCTION isordered +#define __CLC_FUNCTION isordered #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_RELATIONAL_ISORDERED_H__ diff --git a/libclc/opencl/include/clc/opencl/relational/isunordered.h b/libclc/opencl/include/clc/opencl/relational/isunordered.h index 76bf85604d1c..d1f6dabbe20c 100644 --- a/libclc/opencl/include/clc/opencl/relational/isunordered.h +++ b/libclc/opencl/include/clc/opencl/relational/isunordered.h @@ -11,11 +11,11 @@ #include -#define FUNCTION isunordered +#define __CLC_FUNCTION isunordered #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_RELATIONAL_ISUNORDERED_H__ diff --git a/libclc/opencl/include/clc/opencl/relational/signbit.h b/libclc/opencl/include/clc/opencl/relational/signbit.h index 6ad6595c7e29..fff6f33508fa 100644 --- a/libclc/opencl/include/clc/opencl/relational/signbit.h +++ b/libclc/opencl/include/clc/opencl/relational/signbit.h @@ -11,11 +11,11 @@ #include -#define FUNCTION signbit +#define __CLC_FUNCTION signbit #define __CLC_BODY #include -#undef FUNCTION +#undef __CLC_FUNCTION #endif // __CLC_OPENCL_RELATIONAL_SIGNBIT_H__ diff --git a/libclc/opencl/lib/clspv/math/fma.cl b/libclc/opencl/lib/clspv/math/fma.cl index 83504f63772c..0e328903ba26 100644 --- a/libclc/opencl/lib/clspv/math/fma.cl +++ b/libclc/opencl/lib/clspv/math/fma.cl @@ -9,9 +9,9 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION fma -#define __IMPL_FUNCTION(x) __clc_sw_fma +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION fma +#define __CLC_IMPL_FUNCTION(x) __clc_sw_fma #define __CLC_BODY #include diff --git a/libclc/opencl/lib/clspv/shared/vstore_half.cl b/libclc/opencl/lib/clspv/shared/vstore_half.cl index df5f30a711df..66973eb9ac4d 100644 --- a/libclc/opencl/lib/clspv/shared/vstore_half.cl +++ b/libclc/opencl/lib/clspv/shared/vstore_half.cl @@ -18,37 +18,37 @@ #pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable -#define ROUND_VEC1(out, in, ROUNDF) out = ROUNDF(in); -#define ROUND_VEC2(out, in, ROUNDF) \ - ROUND_VEC1(out.lo, in.lo, ROUNDF); \ - ROUND_VEC1(out.hi, in.hi, ROUNDF); -#define ROUND_VEC3(out, in, ROUNDF) \ - ROUND_VEC1(out.s0, in.s0, ROUNDF); \ - ROUND_VEC1(out.s1, in.s1, ROUNDF); \ - ROUND_VEC1(out.s2, in.s2, ROUNDF); -#define ROUND_VEC4(out, in, ROUNDF) \ - ROUND_VEC2(out.lo, in.lo, ROUNDF); \ - ROUND_VEC2(out.hi, in.hi, ROUNDF); -#define ROUND_VEC8(out, in, ROUNDF) \ - ROUND_VEC4(out.lo, in.lo, ROUNDF); \ - ROUND_VEC4(out.hi, in.hi, ROUNDF); -#define ROUND_VEC16(out, in, ROUNDF) \ - ROUND_VEC8(out.lo, in.lo, ROUNDF); \ - ROUND_VEC8(out.hi, in.hi, ROUNDF); +#define __CLC_ROUND_VEC1(out, in, ROUNDF) out = ROUNDF(in); +#define __CLC_ROUND_VEC2(out, in, ROUNDF) \ + __CLC_ROUND_VEC1(out.lo, in.lo, ROUNDF); \ + __CLC_ROUND_VEC1(out.hi, in.hi, ROUNDF); +#define __CLC_ROUND_VEC3(out, in, ROUNDF) \ + __CLC_ROUND_VEC1(out.s0, in.s0, ROUNDF); \ + __CLC_ROUND_VEC1(out.s1, in.s1, ROUNDF); \ + __CLC_ROUND_VEC1(out.s2, in.s2, ROUNDF); +#define __CLC_ROUND_VEC4(out, in, ROUNDF) \ + __CLC_ROUND_VEC2(out.lo, in.lo, ROUNDF); \ + __CLC_ROUND_VEC2(out.hi, in.hi, ROUNDF); +#define __CLC_ROUND_VEC8(out, in, ROUNDF) \ + __CLC_ROUND_VEC4(out.lo, in.lo, ROUNDF); \ + __CLC_ROUND_VEC4(out.hi, in.hi, ROUNDF); +#define __CLC_ROUND_VEC16(out, in, ROUNDF) \ + __CLC_ROUND_VEC8(out.lo, in.lo, ROUNDF); \ + __CLC_ROUND_VEC8(out.hi, in.hi, ROUNDF); -#define __FUNC(SUFFIX, VEC_SIZE, TYPE, AS, ROUNDF) \ +#define __CLC_XFUNC_IMPL(SUFFIX, VEC_SIZE, TYPE, AS, ROUNDF) \ void _CLC_OVERLOAD vstore_half_##VEC_SIZE(TYPE, size_t, AS half *); \ _CLC_OVERLOAD _CLC_DEF void vstore_half##SUFFIX(TYPE vec, size_t offset, \ AS half *mem) { \ TYPE rounded_vec; \ - ROUND_VEC##VEC_SIZE(rounded_vec, vec, ROUNDF); \ + __CLC_ROUND_VEC##VEC_SIZE(rounded_vec, vec, ROUNDF); \ vstore_half_##VEC_SIZE(rounded_vec, offset, mem); \ } \ void _CLC_OVERLOAD vstorea_half_##VEC_SIZE(TYPE, size_t, AS half *); \ _CLC_OVERLOAD _CLC_DEF void vstorea_half##SUFFIX(TYPE vec, size_t offset, \ AS half *mem) { \ TYPE rounded_vec; \ - ROUND_VEC##VEC_SIZE(rounded_vec, vec, ROUNDF); \ + __CLC_ROUND_VEC##VEC_SIZE(rounded_vec, vec, ROUNDF); \ vstorea_half_##VEC_SIZE(rounded_vec, offset, mem); \ } @@ -134,17 +134,18 @@ _CLC_DEF _CLC_OVERLOAD float __clc_rte(float x) { return roundup ? __clc_rti(x) : __clc_rtz(x); } -#define __XFUNC(SUFFIX, VEC_SIZE, TYPE, AS) \ - __FUNC(SUFFIX, VEC_SIZE, TYPE, AS, __clc_rte) \ - __FUNC(SUFFIX##_rtz, VEC_SIZE, TYPE, AS, __clc_rtz) \ - __FUNC(SUFFIX##_rtn, VEC_SIZE, TYPE, AS, __clc_rtn) \ - __FUNC(SUFFIX##_rtp, VEC_SIZE, TYPE, AS, __clc_rtp) \ - __FUNC(SUFFIX##_rte, VEC_SIZE, TYPE, AS, __clc_rte) +#define __CLC_XFUNC(SUFFIX, VEC_SIZE, TYPE, AS) \ + __CLC_XFUNC_IMPL(SUFFIX, VEC_SIZE, TYPE, AS, __clc_rte) \ + __CLC_XFUNC_IMPL(SUFFIX##_rtz, VEC_SIZE, TYPE, AS, __clc_rtz) \ + __CLC_XFUNC_IMPL(SUFFIX##_rtn, VEC_SIZE, TYPE, AS, __clc_rtn) \ + __CLC_XFUNC_IMPL(SUFFIX##_rtp, VEC_SIZE, TYPE, AS, __clc_rtp) \ + __CLC_XFUNC_IMPL(SUFFIX##_rte, VEC_SIZE, TYPE, AS, __clc_rte) -#define FUNC(SUFFIX, VEC_SIZE, TYPE, AS) __XFUNC(SUFFIX, VEC_SIZE, TYPE, AS) +#define __CLC_FUNC(SUFFIX, VEC_SIZE, TYPE, AS) \ + __CLC_XFUNC(SUFFIX, VEC_SIZE, TYPE, AS) #define __CLC_BODY "vstore_half.inc" #include -#undef FUNC -#undef __XFUNC -#undef __FUNC +#undef __CLC_FUNC +#undef __CLC_XFUNC +#undef __CLC_XFUNC_IMPL diff --git a/libclc/opencl/lib/clspv/shared/vstore_half.inc b/libclc/opencl/lib/clspv/shared/vstore_half.inc index f2c02748246a..d78fbb80976b 100644 --- a/libclc/opencl/lib/clspv/shared/vstore_half.inc +++ b/libclc/opencl/lib/clspv/shared/vstore_half.inc @@ -10,20 +10,20 @@ #if __CLC_FPSIZE == 32 #ifndef __CLC_SCALAR -FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_GENTYPE, __private); -FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_GENTYPE, __local); -FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_GENTYPE, __global); +__CLC_FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_GENTYPE, __private); +__CLC_FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_GENTYPE, __local); +__CLC_FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_GENTYPE, __global); #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_GENTYPE, __generic); +__CLC_FUNC(__CLC_VECSIZE, __CLC_VECSIZE, __CLC_GENTYPE, __generic); #endif #undef __CLC_OFFSET #else -FUNC(, 1, __CLC_GENTYPE, __private); -FUNC(, 1, __CLC_GENTYPE, __local); -FUNC(, 1, __CLC_GENTYPE, __global); +__CLC_FUNC(, 1, __CLC_GENTYPE, __private); +__CLC_FUNC(, 1, __CLC_GENTYPE, __local); +__CLC_FUNC(, 1, __CLC_GENTYPE, __global); #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -FUNC(, 1, __CLC_GENTYPE, __generic); +__CLC_FUNC(, 1, __CLC_GENTYPE, __generic); #endif #endif #endif diff --git a/libclc/opencl/lib/generic/async/async_work_group_strided_copy.inc b/libclc/opencl/lib/generic/async/async_work_group_strided_copy.inc index c9c32a7d9431..f421298e2ca0 100644 --- a/libclc/opencl/lib/generic/async/async_work_group_strided_copy.inc +++ b/libclc/opencl/lib/generic/async/async_work_group_strided_copy.inc @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#define STRIDED_COPY(dst, src, num_gentypes, dst_stride, src_stride) \ +#define __CLC_STRIDED_COPY(dst, src, num_gentypes, dst_stride, src_stride) \ size_t size = get_local_size(0) * get_local_size(1) * get_local_size(2); \ size_t id = (get_local_size(0) * get_local_size(1) * get_local_id(2)) + \ (get_local_size(0) * get_local_id(1)) + get_local_id(0); \ @@ -20,7 +20,7 @@ _CLC_OVERLOAD _CLC_DEF event_t async_work_group_strided_copy( local __CLC_GENTYPE *dst, const global __CLC_GENTYPE *src, size_t num_gentypes, size_t src_stride, event_t event) { - STRIDED_COPY(dst, src, num_gentypes, 1, src_stride); + __CLC_STRIDED_COPY(dst, src, num_gentypes, 1, src_stride); return event; } @@ -28,6 +28,6 @@ _CLC_OVERLOAD _CLC_DEF event_t async_work_group_strided_copy( global __CLC_GENTYPE *dst, const local __CLC_GENTYPE *src, size_t num_gentypes, size_t dst_stride, event_t event) { - STRIDED_COPY(dst, src, num_gentypes, dst_stride, 1); + __CLC_STRIDED_COPY(dst, src, num_gentypes, dst_stride, 1); return event; } diff --git a/libclc/opencl/lib/generic/atomic/atom_add.cl b/libclc/opencl/lib/generic/atomic/atom_add.cl index 65d7ad595ace..08fb3fecd5bc 100644 --- a/libclc/opencl/lib/generic/atomic/atom_add.cl +++ b/libclc/opencl/lib/generic/atomic/atom_add.cl @@ -23,15 +23,15 @@ #ifdef cl_khr_int64_base_atomics -#define IMPL(AS, TYPE) \ +#define __CLC_IMPL(AS, TYPE) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_add(volatile AS TYPE *p, TYPE val) { \ return __sync_fetch_and_add_8(p, val); \ } -IMPL(global, long) -IMPL(global, unsigned long) -IMPL(local, long) -IMPL(local, unsigned long) -#undef IMPL +__CLC_IMPL(global, long) +__CLC_IMPL(global, unsigned long) +__CLC_IMPL(local, long) +__CLC_IMPL(local, unsigned long) +#undef __CLC_IMPL #endif // cl_khr_int64_base_atomics diff --git a/libclc/opencl/lib/generic/atomic/atom_and.cl b/libclc/opencl/lib/generic/atomic/atom_and.cl index 371e5f0aa4d0..1dddd8e72f30 100644 --- a/libclc/opencl/lib/generic/atomic/atom_and.cl +++ b/libclc/opencl/lib/generic/atomic/atom_and.cl @@ -23,15 +23,15 @@ #ifdef cl_khr_int64_extended_atomics -#define IMPL(AS, TYPE) \ +#define __CLC_IMPL(AS, TYPE) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_and(volatile AS TYPE *p, TYPE val) { \ return __sync_fetch_and_and_8(p, val); \ } -IMPL(global, long) -IMPL(global, unsigned long) -IMPL(local, long) -IMPL(local, unsigned long) -#undef IMPL +__CLC_IMPL(global, long) +__CLC_IMPL(global, unsigned long) +__CLC_IMPL(local, long) +__CLC_IMPL(local, unsigned long) +#undef __CLC_IMPL #endif // cl_khr_int64_extended_atomics diff --git a/libclc/opencl/lib/generic/atomic/atom_cmpxchg.cl b/libclc/opencl/lib/generic/atomic/atom_cmpxchg.cl index f129be9809e5..5ae6aa30a835 100644 --- a/libclc/opencl/lib/generic/atomic/atom_cmpxchg.cl +++ b/libclc/opencl/lib/generic/atomic/atom_cmpxchg.cl @@ -9,35 +9,35 @@ #include #include -#define IMPL(AS, TYPE) \ +#define __CLC_IMPL(AS, TYPE) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_cmpxchg(volatile AS TYPE *p, TYPE cmp, \ TYPE val) { \ return atomic_cmpxchg(p, cmp, val); \ } #ifdef cl_khr_global_int32_base_atomics -IMPL(global, int) -IMPL(global, unsigned int) +__CLC_IMPL(global, int) +__CLC_IMPL(global, unsigned int) #endif // cl_khr_global_int32_base_atomics #ifdef cl_khr_local_int32_base_atomics -IMPL(local, int) -IMPL(local, unsigned int) +__CLC_IMPL(local, int) +__CLC_IMPL(local, unsigned int) #endif // cl_khr_local_int32_base_atomics -#undef IMPL +#undef __CLC_IMPL #ifdef cl_khr_int64_base_atomics -#define IMPL(AS, TYPE) \ +#define __CLC_IMPL(AS, TYPE) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_cmpxchg(volatile AS TYPE *p, TYPE cmp, \ TYPE val) { \ return __sync_val_compare_and_swap_8(p, cmp, val); \ } -IMPL(global, long) -IMPL(global, unsigned long) -IMPL(local, long) -IMPL(local, unsigned long) -#undef IMPL +__CLC_IMPL(global, long) +__CLC_IMPL(global, unsigned long) +__CLC_IMPL(local, long) +__CLC_IMPL(local, unsigned long) +#undef __CLC_IMPL #endif // cl_khr_int64_base_atomics diff --git a/libclc/opencl/lib/generic/atomic/atom_dec.cl b/libclc/opencl/lib/generic/atomic/atom_dec.cl index 2df721cae365..af811042d307 100644 --- a/libclc/opencl/lib/generic/atomic/atom_dec.cl +++ b/libclc/opencl/lib/generic/atomic/atom_dec.cl @@ -10,33 +10,33 @@ #include #include -#define IMPL(AS, TYPE) \ +#define __CLC_IMPL(AS, TYPE) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_dec(volatile AS TYPE *p) { \ return atomic_dec(p); \ } #ifdef cl_khr_global_int32_base_atomics -IMPL(global, int) -IMPL(global, unsigned int) +__CLC_IMPL(global, int) +__CLC_IMPL(global, unsigned int) #endif // cl_khr_global_int32_base_atomics #ifdef cl_khr_local_int32_base_atomics -IMPL(local, int) -IMPL(local, unsigned int) +__CLC_IMPL(local, int) +__CLC_IMPL(local, unsigned int) #endif // cl_khr_local_int32_base_atomics -#undef IMPL +#undef __CLC_IMPL #ifdef cl_khr_int64_base_atomics -#define IMPL(AS, TYPE) \ +#define __CLC_IMPL(AS, TYPE) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_dec(volatile AS TYPE *p) { \ return atom_sub(p, (TYPE)1); \ } -IMPL(global, long) -IMPL(global, unsigned long) -IMPL(local, long) -IMPL(local, unsigned long) -#undef IMPL +__CLC_IMPL(global, long) +__CLC_IMPL(global, unsigned long) +__CLC_IMPL(local, long) +__CLC_IMPL(local, unsigned long) +#undef __CLC_IMPL #endif // cl_khr_int64_base_atomics diff --git a/libclc/opencl/lib/generic/atomic/atom_inc.cl b/libclc/opencl/lib/generic/atomic/atom_inc.cl index dc7699a47802..f881b3a3caa6 100644 --- a/libclc/opencl/lib/generic/atomic/atom_inc.cl +++ b/libclc/opencl/lib/generic/atomic/atom_inc.cl @@ -10,33 +10,33 @@ #include #include -#define IMPL(AS, TYPE) \ +#define __CLC_IMPL(AS, TYPE) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_inc(volatile AS TYPE *p) { \ return atomic_inc(p); \ } #ifdef cl_khr_global_int32_base_atomics -IMPL(global, int) -IMPL(global, unsigned int) +__CLC_IMPL(global, int) +__CLC_IMPL(global, unsigned int) #endif // cl_khr_global_int32_base_atomics #ifdef cl_khr_local_int32_base_atomics -IMPL(local, int) -IMPL(local, unsigned int) +__CLC_IMPL(local, int) +__CLC_IMPL(local, unsigned int) #endif // cl_khr_local_int32_base_atomics -#undef IMPL +#undef __CLC_IMPL #ifdef cl_khr_int64_base_atomics -#define IMPL(AS, TYPE) \ +#define __CLC_IMPL(AS, TYPE) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_inc(volatile AS TYPE *p) { \ return atom_add(p, (TYPE)1); \ } -IMPL(global, long) -IMPL(global, unsigned long) -IMPL(local, long) -IMPL(local, unsigned long) -#undef IMPL +__CLC_IMPL(global, long) +__CLC_IMPL(global, unsigned long) +__CLC_IMPL(local, long) +__CLC_IMPL(local, unsigned long) +#undef __CLC_IMPL #endif // cl_khr_int64_base_atomics diff --git a/libclc/opencl/lib/generic/atomic/atom_max.cl b/libclc/opencl/lib/generic/atomic/atom_max.cl index 2542191d04f5..83b532ac19a1 100644 --- a/libclc/opencl/lib/generic/atomic/atom_max.cl +++ b/libclc/opencl/lib/generic/atomic/atom_max.cl @@ -31,15 +31,15 @@ unsigned long __clc__sync_fetch_and_umax_global_8(volatile global unsigned long *, unsigned long); -#define IMPL(AS, TYPE, OP) \ +#define __CLC_IMPL(AS, TYPE, OP) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_max(volatile AS TYPE *p, TYPE val) { \ return __clc__sync_fetch_and_##OP##_##AS##_8(p, val); \ } -IMPL(global, long, max) -IMPL(global, unsigned long, umax) -IMPL(local, long, max) -IMPL(local, unsigned long, umax) -#undef IMPL +__CLC_IMPL(global, long, max) +__CLC_IMPL(global, unsigned long, umax) +__CLC_IMPL(local, long, max) +__CLC_IMPL(local, unsigned long, umax) +#undef __CLC_IMPL #endif // cl_khr_int64_extended_atomics diff --git a/libclc/opencl/lib/generic/atomic/atom_min.cl b/libclc/opencl/lib/generic/atomic/atom_min.cl index 4e62804824d8..b52e34769cdd 100644 --- a/libclc/opencl/lib/generic/atomic/atom_min.cl +++ b/libclc/opencl/lib/generic/atomic/atom_min.cl @@ -31,15 +31,15 @@ unsigned long __clc__sync_fetch_and_umin_global_8(volatile global unsigned long *, unsigned long); -#define IMPL(AS, TYPE, OP) \ +#define __CLC_IMPL(AS, TYPE, OP) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_min(volatile AS TYPE *p, TYPE val) { \ return __clc__sync_fetch_and_##OP##_##AS##_8(p, val); \ } -IMPL(global, long, min) -IMPL(global, unsigned long, umin) -IMPL(local, long, min) -IMPL(local, unsigned long, umin) -#undef IMPL +__CLC_IMPL(global, long, min) +__CLC_IMPL(global, unsigned long, umin) +__CLC_IMPL(local, long, min) +__CLC_IMPL(local, unsigned long, umin) +#undef __CLC_IMPL #endif // cl_khr_int64_extended_atomics diff --git a/libclc/opencl/lib/generic/atomic/atom_or.cl b/libclc/opencl/lib/generic/atomic/atom_or.cl index 30ad8e52ca23..fa9737f5f28e 100644 --- a/libclc/opencl/lib/generic/atomic/atom_or.cl +++ b/libclc/opencl/lib/generic/atomic/atom_or.cl @@ -23,15 +23,15 @@ #ifdef cl_khr_int64_extended_atomics -#define IMPL(AS, TYPE) \ +#define __CLC_IMPL(AS, TYPE) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_or(volatile AS TYPE *p, TYPE val) { \ return __sync_fetch_and_or_8(p, val); \ } -IMPL(global, long) -IMPL(global, unsigned long) -IMPL(local, long) -IMPL(local, unsigned long) -#undef IMPL +__CLC_IMPL(global, long) +__CLC_IMPL(global, unsigned long) +__CLC_IMPL(local, long) +__CLC_IMPL(local, unsigned long) +#undef __CLC_IMPL #endif // cl_khr_int64_extended_atomics diff --git a/libclc/opencl/lib/generic/atomic/atom_sub.cl b/libclc/opencl/lib/generic/atomic/atom_sub.cl index f6ee94db7469..9a8acfa9116b 100644 --- a/libclc/opencl/lib/generic/atomic/atom_sub.cl +++ b/libclc/opencl/lib/generic/atomic/atom_sub.cl @@ -23,15 +23,15 @@ #ifdef cl_khr_int64_base_atomics -#define IMPL(AS, TYPE) \ +#define __CLC_IMPL(AS, TYPE) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_sub(volatile AS TYPE *p, TYPE val) { \ return __sync_fetch_and_sub_8(p, val); \ } -IMPL(global, long) -IMPL(global, unsigned long) -IMPL(local, long) -IMPL(local, unsigned long) -#undef IMPL +__CLC_IMPL(global, long) +__CLC_IMPL(global, unsigned long) +__CLC_IMPL(local, long) +__CLC_IMPL(local, unsigned long) +#undef __CLC_IMPL #endif // cl_khr_int64_base_atomics diff --git a/libclc/opencl/lib/generic/atomic/atom_xchg.cl b/libclc/opencl/lib/generic/atomic/atom_xchg.cl index 3fa17c950a82..03f8a9c466c5 100644 --- a/libclc/opencl/lib/generic/atomic/atom_xchg.cl +++ b/libclc/opencl/lib/generic/atomic/atom_xchg.cl @@ -23,15 +23,15 @@ #ifdef cl_khr_int64_base_atomics -#define IMPL(AS, TYPE) \ +#define __CLC_IMPL(AS, TYPE) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_xchg(volatile AS TYPE *p, TYPE val) { \ return __sync_swap_8(p, val); \ } -IMPL(global, long) -IMPL(global, unsigned long) -IMPL(local, long) -IMPL(local, unsigned long) -#undef IMPL +__CLC_IMPL(global, long) +__CLC_IMPL(global, unsigned long) +__CLC_IMPL(local, long) +__CLC_IMPL(local, unsigned long) +#undef __CLC_IMPL #endif // cl_khr_int64_base_atomics diff --git a/libclc/opencl/lib/generic/atomic/atom_xor.cl b/libclc/opencl/lib/generic/atomic/atom_xor.cl index ac08ef63b1a4..392a4b794c69 100644 --- a/libclc/opencl/lib/generic/atomic/atom_xor.cl +++ b/libclc/opencl/lib/generic/atomic/atom_xor.cl @@ -23,15 +23,15 @@ #ifdef cl_khr_int64_extended_atomics -#define IMPL(AS, TYPE) \ +#define __CLC_IMPL(AS, TYPE) \ _CLC_OVERLOAD _CLC_DEF TYPE atom_xor(volatile AS TYPE *p, TYPE val) { \ return __sync_fetch_and_xor_8(p, val); \ } -IMPL(global, long) -IMPL(global, unsigned long) -IMPL(local, long) -IMPL(local, unsigned long) -#undef IMPL +__CLC_IMPL(global, long) +__CLC_IMPL(global, unsigned long) +__CLC_IMPL(local, long) +__CLC_IMPL(local, unsigned long) +#undef __CLC_IMPL #endif // cl_khr_int64_extended_atomics diff --git a/libclc/opencl/lib/generic/atomic/atomic_add.cl b/libclc/opencl/lib/generic/atomic/atomic_add.cl index a0effced7dc6..d005c1dd6ac5 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_add.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_add.cl @@ -8,13 +8,13 @@ #include -#define IMPL(TYPE, AS) \ +#define __CLC_IMPL(TYPE, AS) \ _CLC_OVERLOAD _CLC_DEF TYPE atomic_add(volatile AS TYPE *p, TYPE val) { \ return __sync_fetch_and_add(p, val); \ } -IMPL(int, global) -IMPL(unsigned int, global) -IMPL(int, local) -IMPL(unsigned int, local) -#undef IMPL +__CLC_IMPL(int, global) +__CLC_IMPL(unsigned int, global) +__CLC_IMPL(int, local) +__CLC_IMPL(unsigned int, local) +#undef __CLC_IMPL diff --git a/libclc/opencl/lib/generic/atomic/atomic_and.cl b/libclc/opencl/lib/generic/atomic/atomic_and.cl index 629e6638d3bc..12558568b0e4 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_and.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_and.cl @@ -8,13 +8,13 @@ #include -#define IMPL(TYPE, AS) \ +#define __CLC_IMPL(TYPE, AS) \ _CLC_OVERLOAD _CLC_DEF TYPE atomic_and(volatile AS TYPE *p, TYPE val) { \ return __sync_fetch_and_and(p, val); \ } -IMPL(int, global) -IMPL(unsigned int, global) -IMPL(int, local) -IMPL(unsigned int, local) -#undef IMPL +__CLC_IMPL(int, global) +__CLC_IMPL(unsigned int, global) +__CLC_IMPL(int, local) +__CLC_IMPL(unsigned int, local) +#undef __CLC_IMPL diff --git a/libclc/opencl/lib/generic/atomic/atomic_cmpxchg.cl b/libclc/opencl/lib/generic/atomic/atomic_cmpxchg.cl index db0495b004c1..1045020a553f 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_cmpxchg.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_cmpxchg.cl @@ -8,14 +8,14 @@ #include -#define IMPL(TYPE, AS) \ +#define __CLC_IMPL(TYPE, AS) \ _CLC_OVERLOAD _CLC_DEF TYPE atomic_cmpxchg(volatile AS TYPE *p, TYPE cmp, \ TYPE val) { \ return __sync_val_compare_and_swap(p, cmp, val); \ } -IMPL(int, global) -IMPL(unsigned int, global) -IMPL(int, local) -IMPL(unsigned int, local) -#undef IMPL +__CLC_IMPL(int, global) +__CLC_IMPL(unsigned int, global) +__CLC_IMPL(int, local) +__CLC_IMPL(unsigned int, local) +#undef __CLC_IMPL diff --git a/libclc/opencl/lib/generic/atomic/atomic_compare_exchange_strong.cl b/libclc/opencl/lib/generic/atomic/atomic_compare_exchange_strong.cl index 422c03f29207..2c1f07d8ca48 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_compare_exchange_strong.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_compare_exchange_strong.cl @@ -12,7 +12,7 @@ #include #include -#define FUNCTION atomic_compare_exchange_strong +#define __CLC_FUNCTION atomic_compare_exchange_strong #define __CLC_COMPARE_EXCHANGE #define __CLC_BODY diff --git a/libclc/opencl/lib/generic/atomic/atomic_compare_exchange_weak.cl b/libclc/opencl/lib/generic/atomic/atomic_compare_exchange_weak.cl index 8a6b3c4f0110..69bdf37250f7 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_compare_exchange_weak.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_compare_exchange_weak.cl @@ -12,7 +12,7 @@ #include #include -#define FUNCTION atomic_compare_exchange_weak +#define __CLC_FUNCTION atomic_compare_exchange_weak #define __CLC_COMPARE_EXCHANGE #define __CLC_BODY diff --git a/libclc/opencl/lib/generic/atomic/atomic_dec.cl b/libclc/opencl/lib/generic/atomic/atomic_dec.cl index 6de55bc0b984..ee3826772336 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_dec.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_dec.cl @@ -9,8 +9,8 @@ #include #include -#define FUNCTION atomic_dec -#define __IMPL_FUNCTION __clc_atomic_dec +#define __CLC_FUNCTION atomic_dec +#define __CLC_IMPL_FUNCTION __clc_atomic_dec #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/atomic/atomic_def.inc b/libclc/opencl/lib/generic/atomic/atomic_def.inc index ce192bf84493..a4ccab599088 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_def.inc +++ b/libclc/opencl/lib/generic/atomic/atomic_def.inc @@ -10,37 +10,37 @@ #if defined(__opencl_c_fp64) && (defined(cl_khr_int64_base_atomics) && \ defined(cl_khr_int64_extended_atomics)) -#define HAVE_64_ATOMIC +#define __CLC_HAVE_64_ATOMIC #endif -#if defined(__CLC_FPSIZE) && (__CLC_FPSIZE < 64 || defined(HAVE_64_ATOMIC) -#define HAVE_FP_ATOMIC +#if defined(__CLC_FPSIZE) && (__CLC_FPSIZE < 64 || defined(__CLC_HAVE_64_ATOMIC) +#define __CLC_HAVE_FP_ATOMIC #endif #if defined(__CLC_GENSIZE) && \ ((__CLC_GENSIZE == 32) || \ - (__CLC_GENSIZE == 64 && defined(HAVE_64_ATOMIC))) -#define HAVE_INT_ATOMIC + (__CLC_GENSIZE == 64 && defined(__CLC_HAVE_64_ATOMIC))) +#define __CLC_HAVE_INT_ATOMIC #endif -#if defined(HAVE_FP_ATOMIC) || defined(HAVE_INT_ATOMIC) +#if defined(__CLC_HAVE_FP_ATOMIC) || defined(__CLC_HAVE_INT_ATOMIC) #define __CLC_ATOMIC_GENTYPE __CLC_XCONCAT(atomic_, __CLC_GENTYPE) #ifdef __CLC_NO_VALUE_ARG #define __CLC_DEFINE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION( \ + _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNCTION( \ volatile ADDRSPACE __CLC_ATOMIC_GENTYPE *Ptr) { \ - return __IMPL_FUNCTION((volatile ADDRSPACE __CLC_GENTYPE *)Ptr, \ - __ATOMIC_SEQ_CST, __MEMORY_SCOPE_DEVICE); \ + return __CLC_IMPL_FUNCTION((volatile ADDRSPACE __CLC_GENTYPE *)Ptr, \ + __ATOMIC_SEQ_CST, __MEMORY_SCOPE_DEVICE); \ } #elif defined(__CLC_RETURN_VOID) #define __CLC_DEFINE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DEF void FUNCTION( \ + _CLC_OVERLOAD _CLC_DEF void __CLC_FUNCTION( \ volatile ADDRSPACE __CLC_ATOMIC_GENTYPE *Ptr, __CLC_GENTYPE Value) { \ - __IMPL_FUNCTION((volatile ADDRSPACE __CLC_GENTYPE *)Ptr, Value, \ - __ATOMIC_SEQ_CST, __MEMORY_SCOPE_DEVICE); \ + __CLC_IMPL_FUNCTION((volatile ADDRSPACE __CLC_GENTYPE *)Ptr, Value, \ + __ATOMIC_SEQ_CST, __MEMORY_SCOPE_DEVICE); \ } #elif defined(__CLC_COMPARE_EXCHANGE) #define __CLC_DEFINE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION( \ + _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNCTION( \ volatile ADDRSPACE __CLC_ATOMIC_GENTYPE *Ptr, \ ADDRSPACE __CLC_GENTYPE *Expected, __CLC_GENTYPE Desired) { \ __CLC_GENTYPE Comparator = *Expected; \ @@ -55,10 +55,10 @@ } #else #define __CLC_DEFINE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION( \ + _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNCTION( \ volatile ADDRSPACE __CLC_ATOMIC_GENTYPE *Ptr, __CLC_GENTYPE Value) { \ - return __IMPL_FUNCTION((volatile ADDRSPACE __CLC_GENTYPE *)Ptr, Value, \ - __ATOMIC_SEQ_CST, __MEMORY_SCOPE_DEVICE); \ + return __CLC_IMPL_FUNCTION((volatile ADDRSPACE __CLC_GENTYPE *)Ptr, Value, \ + __ATOMIC_SEQ_CST, __MEMORY_SCOPE_DEVICE); \ } #endif @@ -70,10 +70,10 @@ __CLC_DEFINE_ATOMIC() #undef __CLC_DEFINE_ATOMIC -#endif // HAVE_FP_ATOMIC || HAVE_INT_ATOMIC +#endif // __CLC_HAVE_FP_ATOMIC || __CLC_HAVE_INT_ATOMIC -#undef HAVE_INT_ATOMIC -#undef HAVE_FP_ATOMIC -#undef HAVE_64_ATOMIC +#undef __CLC_HAVE_INT_ATOMIC +#undef __CLC_HAVE_FP_ATOMIC +#undef __CLC_HAVE_64_ATOMIC #endif // __CLC_SCALAR diff --git a/libclc/opencl/lib/generic/atomic/atomic_exchange.cl b/libclc/opencl/lib/generic/atomic/atomic_exchange.cl index 6dae6c0a7759..5f7e2fa593e3 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_exchange.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_exchange.cl @@ -12,8 +12,8 @@ #include #include -#define FUNCTION atomic_exchange -#define __IMPL_FUNCTION __clc_atomic_exchange +#define __CLC_FUNCTION atomic_exchange +#define __CLC_IMPL_FUNCTION __clc_atomic_exchange #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/atomic/atomic_fetch_add.cl b/libclc/opencl/lib/generic/atomic/atomic_fetch_add.cl index bbaa1c2b0dac..0362ff89d1d7 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_fetch_add.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_fetch_add.cl @@ -12,8 +12,8 @@ #include #include -#define FUNCTION atomic_fetch_add -#define __IMPL_FUNCTION __clc_atomic_fetch_add +#define __CLC_FUNCTION atomic_fetch_add +#define __CLC_IMPL_FUNCTION __clc_atomic_fetch_add #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/atomic/atomic_fetch_and.cl b/libclc/opencl/lib/generic/atomic/atomic_fetch_and.cl index 73925844c935..a1796f20c6e4 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_fetch_and.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_fetch_and.cl @@ -12,8 +12,8 @@ #include #include -#define FUNCTION atomic_fetch_and -#define __IMPL_FUNCTION __clc_atomic_fetch_and +#define __CLC_FUNCTION atomic_fetch_and +#define __CLC_IMPL_FUNCTION __clc_atomic_fetch_and #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/atomic/atomic_fetch_max.cl b/libclc/opencl/lib/generic/atomic/atomic_fetch_max.cl index 8c8ce11cc575..03b5d1d8ae7b 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_fetch_max.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_fetch_max.cl @@ -12,8 +12,8 @@ #include #include -#define FUNCTION atomic_fetch_max -#define __IMPL_FUNCTION __clc_atomic_fetch_max +#define __CLC_FUNCTION atomic_fetch_max +#define __CLC_IMPL_FUNCTION __clc_atomic_fetch_max #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/atomic/atomic_fetch_min.cl b/libclc/opencl/lib/generic/atomic/atomic_fetch_min.cl index 550459cee32d..60ffeff04cc6 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_fetch_min.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_fetch_min.cl @@ -12,8 +12,8 @@ #include #include -#define FUNCTION atomic_fetch_min -#define __IMPL_FUNCTION __clc_atomic_fetch_min +#define __CLC_FUNCTION atomic_fetch_min +#define __CLC_IMPL_FUNCTION __clc_atomic_fetch_min #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/atomic/atomic_fetch_or.cl b/libclc/opencl/lib/generic/atomic/atomic_fetch_or.cl index 2606ff3c9967..8f4100bb150e 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_fetch_or.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_fetch_or.cl @@ -12,8 +12,8 @@ #include #include -#define FUNCTION atomic_fetch_or -#define __IMPL_FUNCTION __clc_atomic_fetch_or +#define __CLC_FUNCTION atomic_fetch_or +#define __CLC_IMPL_FUNCTION __clc_atomic_fetch_or #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/atomic/atomic_fetch_sub.cl b/libclc/opencl/lib/generic/atomic/atomic_fetch_sub.cl index 33772233bebe..ecb5b4315ee8 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_fetch_sub.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_fetch_sub.cl @@ -12,8 +12,8 @@ #include #include -#define FUNCTION atomic_fetch_sub -#define __IMPL_FUNCTION __clc_atomic_fetch_sub +#define __CLC_FUNCTION atomic_fetch_sub +#define __CLC_IMPL_FUNCTION __clc_atomic_fetch_sub #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/atomic/atomic_fetch_xor.cl b/libclc/opencl/lib/generic/atomic/atomic_fetch_xor.cl index 6f6503e588b6..c49a55820c8d 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_fetch_xor.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_fetch_xor.cl @@ -12,8 +12,8 @@ #include #include -#define FUNCTION atomic_fetch_xor -#define __IMPL_FUNCTION __clc_atomic_fetch_xor +#define __CLC_FUNCTION atomic_fetch_xor +#define __CLC_IMPL_FUNCTION __clc_atomic_fetch_xor #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/atomic/atomic_inc.cl b/libclc/opencl/lib/generic/atomic/atomic_inc.cl index a160b2e2370f..7cf82b25a0d4 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_inc.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_inc.cl @@ -9,8 +9,8 @@ #include #include -#define FUNCTION atomic_inc -#define __IMPL_FUNCTION __clc_atomic_inc +#define __CLC_FUNCTION atomic_inc +#define __CLC_IMPL_FUNCTION __clc_atomic_inc #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/atomic/atomic_inc_dec.inc b/libclc/opencl/lib/generic/atomic/atomic_inc_dec.inc index 0bcf300dd284..03eb5d1b3305 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_inc_dec.inc +++ b/libclc/opencl/lib/generic/atomic/atomic_inc_dec.inc @@ -11,9 +11,9 @@ #if __CLC_GENSIZE == 32 #define __CLC_DEFINE_ATOMIC(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION( \ + _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNCTION( \ volatile ADDRSPACE __CLC_GENTYPE *Ptr) { \ - return __IMPL_FUNCTION(Ptr, __ATOMIC_SEQ_CST, __MEMORY_SCOPE_DEVICE); \ + return __CLC_IMPL_FUNCTION(Ptr, __ATOMIC_SEQ_CST, __MEMORY_SCOPE_DEVICE); \ } __CLC_DEFINE_ATOMIC(global) diff --git a/libclc/opencl/lib/generic/atomic/atomic_load.cl b/libclc/opencl/lib/generic/atomic/atomic_load.cl index 459265473a8c..e904330be006 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_load.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_load.cl @@ -12,8 +12,8 @@ #include #include -#define FUNCTION atomic_load -#define __IMPL_FUNCTION __clc_atomic_load +#define __CLC_FUNCTION atomic_load +#define __CLC_IMPL_FUNCTION __clc_atomic_load #define __CLC_NO_VALUE_ARG #define __CLC_BODY diff --git a/libclc/opencl/lib/generic/atomic/atomic_max.cl b/libclc/opencl/lib/generic/atomic/atomic_max.cl index ae929f0523dc..aa482a8f4639 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_max.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_max.cl @@ -8,13 +8,13 @@ #include -#define IMPL(TYPE, AS, OP) \ +#define __CLC_IMPL(TYPE, AS, OP) \ _CLC_OVERLOAD _CLC_DEF TYPE atomic_max(volatile AS TYPE *p, TYPE val) { \ return __sync_fetch_and_##OP(p, val); \ } -IMPL(int, global, max) -IMPL(unsigned int, global, umax) -IMPL(int, local, max) -IMPL(unsigned int, local, umax) -#undef IMPL +__CLC_IMPL(int, global, max) +__CLC_IMPL(unsigned int, global, umax) +__CLC_IMPL(int, local, max) +__CLC_IMPL(unsigned int, local, umax) +#undef __CLC_IMPL diff --git a/libclc/opencl/lib/generic/atomic/atomic_min.cl b/libclc/opencl/lib/generic/atomic/atomic_min.cl index c7ebe71ee829..7f39e9431684 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_min.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_min.cl @@ -8,13 +8,13 @@ #include -#define IMPL(TYPE, AS, OP) \ +#define __CLC_IMPL(TYPE, AS, OP) \ _CLC_OVERLOAD _CLC_DEF TYPE atomic_min(volatile AS TYPE *p, TYPE val) { \ return __sync_fetch_and_##OP(p, val); \ } -IMPL(int, global, min) -IMPL(unsigned int, global, umin) -IMPL(int, local, min) -IMPL(unsigned int, local, umin) -#undef IMPL +__CLC_IMPL(int, global, min) +__CLC_IMPL(unsigned int, global, umin) +__CLC_IMPL(int, local, min) +__CLC_IMPL(unsigned int, local, umin) +#undef __CLC_IMPL diff --git a/libclc/opencl/lib/generic/atomic/atomic_or.cl b/libclc/opencl/lib/generic/atomic/atomic_or.cl index 45fb86568965..ad14cd217855 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_or.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_or.cl @@ -8,13 +8,13 @@ #include -#define IMPL(TYPE, AS) \ +#define __CLC_IMPL(TYPE, AS) \ _CLC_OVERLOAD _CLC_DEF TYPE atomic_or(volatile AS TYPE *p, TYPE val) { \ return __sync_fetch_and_or(p, val); \ } -IMPL(int, global) -IMPL(unsigned int, global) -IMPL(int, local) -IMPL(unsigned int, local) -#undef IMPL +__CLC_IMPL(int, global) +__CLC_IMPL(unsigned int, global) +__CLC_IMPL(int, local) +__CLC_IMPL(unsigned int, local) +#undef __CLC_IMPL diff --git a/libclc/opencl/lib/generic/atomic/atomic_store.cl b/libclc/opencl/lib/generic/atomic/atomic_store.cl index 67f2c8457fc1..584e29ef99a5 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_store.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_store.cl @@ -12,8 +12,8 @@ #include #include -#define FUNCTION atomic_store -#define __IMPL_FUNCTION __clc_atomic_store +#define __CLC_FUNCTION atomic_store +#define __CLC_IMPL_FUNCTION __clc_atomic_store #define __CLC_RETURN_VOID #define __CLC_BODY diff --git a/libclc/opencl/lib/generic/atomic/atomic_sub.cl b/libclc/opencl/lib/generic/atomic/atomic_sub.cl index 74977f15155f..2e51c4c2ce02 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_sub.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_sub.cl @@ -8,13 +8,13 @@ #include -#define IMPL(TYPE, AS) \ +#define __CLC_IMPL(TYPE, AS) \ _CLC_OVERLOAD _CLC_DEF TYPE atomic_sub(volatile AS TYPE *p, TYPE val) { \ return __sync_fetch_and_sub(p, val); \ } -IMPL(int, global) -IMPL(unsigned int, global) -IMPL(int, local) -IMPL(unsigned int, local) -#undef IMPL +__CLC_IMPL(int, global) +__CLC_IMPL(unsigned int, global) +__CLC_IMPL(int, local) +__CLC_IMPL(unsigned int, local) +#undef __CLC_IMPL diff --git a/libclc/opencl/lib/generic/atomic/atomic_xchg.cl b/libclc/opencl/lib/generic/atomic/atomic_xchg.cl index 883132caf9fb..2585a5427392 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_xchg.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_xchg.cl @@ -17,13 +17,13 @@ _CLC_OVERLOAD _CLC_DEF float atomic_xchg(volatile local float *p, float val) { return as_float(atomic_xchg((volatile local uint *)p, as_uint(val))); } -#define IMPL(TYPE, AS) \ +#define __CLC_IMPL(TYPE, AS) \ _CLC_OVERLOAD _CLC_DEF TYPE atomic_xchg(volatile AS TYPE *p, TYPE val) { \ return __sync_swap_4(p, val); \ } -IMPL(int, global) -IMPL(unsigned int, global) -IMPL(int, local) -IMPL(unsigned int, local) -#undef IMPL +__CLC_IMPL(int, global) +__CLC_IMPL(unsigned int, global) +__CLC_IMPL(int, local) +__CLC_IMPL(unsigned int, local) +#undef __CLC_IMPL diff --git a/libclc/opencl/lib/generic/atomic/atomic_xor.cl b/libclc/opencl/lib/generic/atomic/atomic_xor.cl index 246752c25837..022813439746 100644 --- a/libclc/opencl/lib/generic/atomic/atomic_xor.cl +++ b/libclc/opencl/lib/generic/atomic/atomic_xor.cl @@ -8,13 +8,13 @@ #include -#define IMPL(TYPE, AS) \ +#define __CLC_IMPL(TYPE, AS) \ _CLC_OVERLOAD _CLC_DEF TYPE atomic_xor(volatile AS TYPE *p, TYPE val) { \ return __sync_fetch_and_xor(p, val); \ } -IMPL(int, global) -IMPL(unsigned int, global) -IMPL(int, local) -IMPL(unsigned int, local) -#undef IMPL +__CLC_IMPL(int, global) +__CLC_IMPL(unsigned int, global) +__CLC_IMPL(int, local) +__CLC_IMPL(unsigned int, local) +#undef __CLC_IMPL diff --git a/libclc/opencl/lib/generic/common/degrees.cl b/libclc/opencl/lib/generic/common/degrees.cl index d989fa6382ed..15b85af997b4 100644 --- a/libclc/opencl/lib/generic/common/degrees.cl +++ b/libclc/opencl/lib/generic/common/degrees.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION degrees +#define __CLC_FUNCTION degrees #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/common/radians.cl b/libclc/opencl/lib/generic/common/radians.cl index 1da38920d43f..6550cf458a7a 100644 --- a/libclc/opencl/lib/generic/common/radians.cl +++ b/libclc/opencl/lib/generic/common/radians.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION radians +#define __CLC_FUNCTION radians #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/common/sign.cl b/libclc/opencl/lib/generic/common/sign.cl index 9afcb7375e96..7add739be6a9 100644 --- a/libclc/opencl/lib/generic/common/sign.cl +++ b/libclc/opencl/lib/generic/common/sign.cl @@ -10,7 +10,7 @@ #include #include -#define FUNCTION sign +#define __CLC_FUNCTION sign #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/geometric/distance.cl b/libclc/opencl/lib/generic/geometric/distance.cl index 54c78d3609ba..4d9f5403f8c2 100644 --- a/libclc/opencl/lib/generic/geometric/distance.cl +++ b/libclc/opencl/lib/generic/geometric/distance.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION distance +#define __CLC_FUNCTION distance #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/geometric/dot.cl b/libclc/opencl/lib/generic/geometric/dot.cl index 05425aafb040..fc207c8fc155 100644 --- a/libclc/opencl/lib/generic/geometric/dot.cl +++ b/libclc/opencl/lib/generic/geometric/dot.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION dot +#define __CLC_FUNCTION dot #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/geometric/fast_distance.cl b/libclc/opencl/lib/generic/geometric/fast_distance.cl index bc30c298a2b9..a9c2c66dc9a1 100644 --- a/libclc/opencl/lib/generic/geometric/fast_distance.cl +++ b/libclc/opencl/lib/generic/geometric/fast_distance.cl @@ -9,7 +9,7 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION fast_distance +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION fast_distance #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/geometric/fast_length.cl b/libclc/opencl/lib/generic/geometric/fast_length.cl index 407080900cce..8e6ce1aa5c56 100644 --- a/libclc/opencl/lib/generic/geometric/fast_length.cl +++ b/libclc/opencl/lib/generic/geometric/fast_length.cl @@ -9,7 +9,7 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION fast_length +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION fast_length #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/geometric/fast_normalize.cl b/libclc/opencl/lib/generic/geometric/fast_normalize.cl index 195081371a5b..d2f7111516f4 100644 --- a/libclc/opencl/lib/generic/geometric/fast_normalize.cl +++ b/libclc/opencl/lib/generic/geometric/fast_normalize.cl @@ -9,8 +9,8 @@ #include #include -#define FUNCTION fast_normalize -#define __FLOAT_ONLY +#define __CLC_FUNCTION fast_normalize +#define __CLC_FLOAT_ONLY #define __CLC_GEOMETRIC_RET_GENTYPE #define __CLC_BODY diff --git a/libclc/opencl/lib/generic/geometric/length.cl b/libclc/opencl/lib/generic/geometric/length.cl index 0b0ebaa74d95..59e2055020d8 100644 --- a/libclc/opencl/lib/generic/geometric/length.cl +++ b/libclc/opencl/lib/generic/geometric/length.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION length +#define __CLC_FUNCTION length #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/geometric/normalize.cl b/libclc/opencl/lib/generic/geometric/normalize.cl index eb84ffd38212..968d4001ae99 100644 --- a/libclc/opencl/lib/generic/geometric/normalize.cl +++ b/libclc/opencl/lib/generic/geometric/normalize.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION normalize +#define __CLC_FUNCTION normalize #define __CLC_GEOMETRIC_RET_GENTYPE #define __CLC_BODY diff --git a/libclc/opencl/lib/generic/integer/add_sat.cl b/libclc/opencl/lib/generic/integer/add_sat.cl index 50d989a47211..6cde612e5fb0 100644 --- a/libclc/opencl/lib/generic/integer/add_sat.cl +++ b/libclc/opencl/lib/generic/integer/add_sat.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION add_sat +#define __CLC_FUNCTION add_sat #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/integer/bit_reverse.cl b/libclc/opencl/lib/generic/integer/bit_reverse.cl index 23181b6b3eba..b35a5c473a1e 100644 --- a/libclc/opencl/lib/generic/integer/bit_reverse.cl +++ b/libclc/opencl/lib/generic/integer/bit_reverse.cl @@ -11,7 +11,7 @@ #include #include -#define FUNCTION bit_reverse +#define __CLC_FUNCTION bit_reverse #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/integer/bitfield_extract_def.inc b/libclc/opencl/lib/generic/integer/bitfield_extract_def.inc index 0262f67732af..d3b8badcc8c9 100644 --- a/libclc/opencl/lib/generic/integer/bitfield_extract_def.inc +++ b/libclc/opencl/lib/generic/integer/bitfield_extract_def.inc @@ -6,11 +6,11 @@ // //===----------------------------------------------------------------------===// -#ifndef __IMPL_FUNCTION -#define __IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) +#ifndef __CLC_IMPL_FUNCTION +#define __CLC_IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) #endif -_CLC_OVERLOAD _CLC_DEF __RETTYPE FUNCTION(__CLC_GENTYPE base, uint offset, - uint count) { - return __IMPL_FUNCTION(FUNCTION)(base, offset, count); +_CLC_OVERLOAD _CLC_DEF __CLC_RETTYPE __CLC_FUNCTION(__CLC_GENTYPE base, + uint offset, uint count) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(base, offset, count); } diff --git a/libclc/opencl/lib/generic/integer/bitfield_extract_signed.cl b/libclc/opencl/lib/generic/integer/bitfield_extract_signed.cl index eaa4ac779cfd..ad49cd36b766 100644 --- a/libclc/opencl/lib/generic/integer/bitfield_extract_signed.cl +++ b/libclc/opencl/lib/generic/integer/bitfield_extract_signed.cl @@ -11,8 +11,8 @@ #include #include -#define FUNCTION bitfield_extract_signed -#define __RETTYPE __CLC_S_GENTYPE +#define __CLC_FUNCTION bitfield_extract_signed +#define __CLC_RETTYPE __CLC_S_GENTYPE #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/integer/bitfield_extract_unsigned.cl b/libclc/opencl/lib/generic/integer/bitfield_extract_unsigned.cl index fd63d5d6dee3..e2fe92cfcce8 100644 --- a/libclc/opencl/lib/generic/integer/bitfield_extract_unsigned.cl +++ b/libclc/opencl/lib/generic/integer/bitfield_extract_unsigned.cl @@ -11,8 +11,8 @@ #include #include -#define FUNCTION bitfield_extract_unsigned -#define __RETTYPE __CLC_U_GENTYPE +#define __CLC_FUNCTION bitfield_extract_unsigned +#define __CLC_RETTYPE __CLC_U_GENTYPE #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/integer/bitfield_insert.cl b/libclc/opencl/lib/generic/integer/bitfield_insert.cl index 6b441155f393..c165bd756ffe 100644 --- a/libclc/opencl/lib/generic/integer/bitfield_insert.cl +++ b/libclc/opencl/lib/generic/integer/bitfield_insert.cl @@ -11,7 +11,7 @@ #include #include -#define FUNCTION bitfield_insert +#define __CLC_FUNCTION bitfield_insert #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/integer/clz.cl b/libclc/opencl/lib/generic/integer/clz.cl index 58110df1eec2..d0509cba5913 100644 --- a/libclc/opencl/lib/generic/integer/clz.cl +++ b/libclc/opencl/lib/generic/integer/clz.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION clz +#define __CLC_FUNCTION clz #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/integer/ctz.cl b/libclc/opencl/lib/generic/integer/ctz.cl index cbb167275a4a..640ccfa5f311 100644 --- a/libclc/opencl/lib/generic/integer/ctz.cl +++ b/libclc/opencl/lib/generic/integer/ctz.cl @@ -11,7 +11,7 @@ #include #include -#define FUNCTION ctz +#define __CLC_FUNCTION ctz #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/integer/hadd.cl b/libclc/opencl/lib/generic/integer/hadd.cl index e9edc88bce02..0082524b55af 100644 --- a/libclc/opencl/lib/generic/integer/hadd.cl +++ b/libclc/opencl/lib/generic/integer/hadd.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION hadd +#define __CLC_FUNCTION hadd #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/integer/mad24.cl b/libclc/opencl/lib/generic/integer/mad24.cl index 5e9dfb3b3031..fc8e0e317133 100644 --- a/libclc/opencl/lib/generic/integer/mad24.cl +++ b/libclc/opencl/lib/generic/integer/mad24.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION mad24 +#define __CLC_FUNCTION mad24 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/integer/mad_hi.cl b/libclc/opencl/lib/generic/integer/mad_hi.cl index 786614e42bc8..20d096c59650 100644 --- a/libclc/opencl/lib/generic/integer/mad_hi.cl +++ b/libclc/opencl/lib/generic/integer/mad_hi.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION mad_hi +#define __CLC_FUNCTION mad_hi #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/integer/mad_sat.cl b/libclc/opencl/lib/generic/integer/mad_sat.cl index 54ddc0eed2d1..310b31a0ca23 100644 --- a/libclc/opencl/lib/generic/integer/mad_sat.cl +++ b/libclc/opencl/lib/generic/integer/mad_sat.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION mad_sat +#define __CLC_FUNCTION mad_sat #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/integer/mul24.cl b/libclc/opencl/lib/generic/integer/mul24.cl index e6db6b89c5d9..243bff77da91 100644 --- a/libclc/opencl/lib/generic/integer/mul24.cl +++ b/libclc/opencl/lib/generic/integer/mul24.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION mul24 +#define __CLC_FUNCTION mul24 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/integer/mul_hi.cl b/libclc/opencl/lib/generic/integer/mul_hi.cl index 4c7b8c2caa99..99d3051a0df9 100644 --- a/libclc/opencl/lib/generic/integer/mul_hi.cl +++ b/libclc/opencl/lib/generic/integer/mul_hi.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION mul_hi +#define __CLC_FUNCTION mul_hi #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/integer/popcount.cl b/libclc/opencl/lib/generic/integer/popcount.cl index 3c33c82302c3..e4219b4ff9c3 100644 --- a/libclc/opencl/lib/generic/integer/popcount.cl +++ b/libclc/opencl/lib/generic/integer/popcount.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION popcount +#define __CLC_FUNCTION popcount #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/integer/rhadd.cl b/libclc/opencl/lib/generic/integer/rhadd.cl index f83551189942..df9f1eff3e2d 100644 --- a/libclc/opencl/lib/generic/integer/rhadd.cl +++ b/libclc/opencl/lib/generic/integer/rhadd.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION rhadd +#define __CLC_FUNCTION rhadd #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/integer/rotate.cl b/libclc/opencl/lib/generic/integer/rotate.cl index 282270f3b3ff..f5b6195275de 100644 --- a/libclc/opencl/lib/generic/integer/rotate.cl +++ b/libclc/opencl/lib/generic/integer/rotate.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION rotate +#define __CLC_FUNCTION rotate #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/integer/sub_sat.cl b/libclc/opencl/lib/generic/integer/sub_sat.cl index 0b45df1118f1..81517022160a 100644 --- a/libclc/opencl/lib/generic/integer/sub_sat.cl +++ b/libclc/opencl/lib/generic/integer/sub_sat.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION sub_sat +#define __CLC_FUNCTION sub_sat #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/acos.cl b/libclc/opencl/lib/generic/math/acos.cl index 040b2b82f6f9..bdaeedf02e90 100644 --- a/libclc/opencl/lib/generic/math/acos.cl +++ b/libclc/opencl/lib/generic/math/acos.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION acos +#define __CLC_FUNCTION acos #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/acosh.cl b/libclc/opencl/lib/generic/math/acosh.cl index 55b60bc99614..c46532dbcbd9 100644 --- a/libclc/opencl/lib/generic/math/acosh.cl +++ b/libclc/opencl/lib/generic/math/acosh.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION acosh +#define __CLC_FUNCTION acosh #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/acospi.cl b/libclc/opencl/lib/generic/math/acospi.cl index 2537c992e2ad..b6b0fb91250d 100644 --- a/libclc/opencl/lib/generic/math/acospi.cl +++ b/libclc/opencl/lib/generic/math/acospi.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION acospi +#define __CLC_FUNCTION acospi #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/asin.cl b/libclc/opencl/lib/generic/math/asin.cl index 08dde1201392..31fc36d74601 100644 --- a/libclc/opencl/lib/generic/math/asin.cl +++ b/libclc/opencl/lib/generic/math/asin.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION asin +#define __CLC_FUNCTION asin #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/asinh.cl b/libclc/opencl/lib/generic/math/asinh.cl index 189392f50b5e..3bdd8099f079 100644 --- a/libclc/opencl/lib/generic/math/asinh.cl +++ b/libclc/opencl/lib/generic/math/asinh.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION asinh +#define __CLC_FUNCTION asinh #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/asinpi.cl b/libclc/opencl/lib/generic/math/asinpi.cl index b9327faaccba..6df9047ced3c 100644 --- a/libclc/opencl/lib/generic/math/asinpi.cl +++ b/libclc/opencl/lib/generic/math/asinpi.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION asinpi +#define __CLC_FUNCTION asinpi #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/atan.cl b/libclc/opencl/lib/generic/math/atan.cl index e2b1530f9e4c..157e50dd0e07 100644 --- a/libclc/opencl/lib/generic/math/atan.cl +++ b/libclc/opencl/lib/generic/math/atan.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION atan +#define __CLC_FUNCTION atan #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/atan2.cl b/libclc/opencl/lib/generic/math/atan2.cl index 9f3d4a965e58..7db630608867 100644 --- a/libclc/opencl/lib/generic/math/atan2.cl +++ b/libclc/opencl/lib/generic/math/atan2.cl @@ -10,7 +10,7 @@ #include #include -#define FUNCTION atan2 +#define __CLC_FUNCTION atan2 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/atan2pi.cl b/libclc/opencl/lib/generic/math/atan2pi.cl index 9b3fea163f68..ed57c920f1b2 100644 --- a/libclc/opencl/lib/generic/math/atan2pi.cl +++ b/libclc/opencl/lib/generic/math/atan2pi.cl @@ -10,7 +10,7 @@ #include #include -#define FUNCTION atan2pi +#define __CLC_FUNCTION atan2pi #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/atanh.cl b/libclc/opencl/lib/generic/math/atanh.cl index 5e4564d34702..d0337ff1ffac 100644 --- a/libclc/opencl/lib/generic/math/atanh.cl +++ b/libclc/opencl/lib/generic/math/atanh.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION atanh +#define __CLC_FUNCTION atanh #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/atanpi.cl b/libclc/opencl/lib/generic/math/atanpi.cl index ddeb38e64e99..11630db430c7 100644 --- a/libclc/opencl/lib/generic/math/atanpi.cl +++ b/libclc/opencl/lib/generic/math/atanpi.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION atanpi +#define __CLC_FUNCTION atanpi #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/cbrt.cl b/libclc/opencl/lib/generic/math/cbrt.cl index dccb49a47dc0..0d670150ed4c 100644 --- a/libclc/opencl/lib/generic/math/cbrt.cl +++ b/libclc/opencl/lib/generic/math/cbrt.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION cbrt +#define __CLC_FUNCTION cbrt #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/ceil.cl b/libclc/opencl/lib/generic/math/ceil.cl index e312281b98a2..e1bffbcb6860 100644 --- a/libclc/opencl/lib/generic/math/ceil.cl +++ b/libclc/opencl/lib/generic/math/ceil.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION ceil +#define __CLC_FUNCTION ceil #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/copysign.cl b/libclc/opencl/lib/generic/math/copysign.cl index 7aa4cb2da0ee..5234b534631c 100644 --- a/libclc/opencl/lib/generic/math/copysign.cl +++ b/libclc/opencl/lib/generic/math/copysign.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION copysign +#define __CLC_FUNCTION copysign #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/cos.cl b/libclc/opencl/lib/generic/math/cos.cl index fb40b6c00e3c..69c9c37cf3e8 100644 --- a/libclc/opencl/lib/generic/math/cos.cl +++ b/libclc/opencl/lib/generic/math/cos.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION cos +#define __CLC_FUNCTION cos #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/cosh.cl b/libclc/opencl/lib/generic/math/cosh.cl index 7106fc9f18fa..de9e750c1a7f 100644 --- a/libclc/opencl/lib/generic/math/cosh.cl +++ b/libclc/opencl/lib/generic/math/cosh.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION cosh +#define __CLC_FUNCTION cosh #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/cospi.cl b/libclc/opencl/lib/generic/math/cospi.cl index 0e242ad0d477..d9afd05bbabf 100644 --- a/libclc/opencl/lib/generic/math/cospi.cl +++ b/libclc/opencl/lib/generic/math/cospi.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION cospi +#define __CLC_FUNCTION cospi #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/erf.cl b/libclc/opencl/lib/generic/math/erf.cl index 83c38867e046..8d5a80ba10e4 100644 --- a/libclc/opencl/lib/generic/math/erf.cl +++ b/libclc/opencl/lib/generic/math/erf.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION erf +#define __CLC_FUNCTION erf #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/erfc.cl b/libclc/opencl/lib/generic/math/erfc.cl index 1c473999bba9..a3fda46237d9 100644 --- a/libclc/opencl/lib/generic/math/erfc.cl +++ b/libclc/opencl/lib/generic/math/erfc.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION erfc +#define __CLC_FUNCTION erfc #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/exp.cl b/libclc/opencl/lib/generic/math/exp.cl index 8125ce314e8e..a9fd07a26d0e 100644 --- a/libclc/opencl/lib/generic/math/exp.cl +++ b/libclc/opencl/lib/generic/math/exp.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION exp +#define __CLC_FUNCTION exp #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/exp10.cl b/libclc/opencl/lib/generic/math/exp10.cl index f8c0f94a990b..7db7bafd226f 100644 --- a/libclc/opencl/lib/generic/math/exp10.cl +++ b/libclc/opencl/lib/generic/math/exp10.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION exp10 +#define __CLC_FUNCTION exp10 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/exp2.cl b/libclc/opencl/lib/generic/math/exp2.cl index dc75c2201a46..1ffc34ae13ce 100644 --- a/libclc/opencl/lib/generic/math/exp2.cl +++ b/libclc/opencl/lib/generic/math/exp2.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION exp2 +#define __CLC_FUNCTION exp2 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/expm1.cl b/libclc/opencl/lib/generic/math/expm1.cl index 7507786c2ad0..69c852fc7e79 100644 --- a/libclc/opencl/lib/generic/math/expm1.cl +++ b/libclc/opencl/lib/generic/math/expm1.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION expm1 +#define __CLC_FUNCTION expm1 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/fabs.cl b/libclc/opencl/lib/generic/math/fabs.cl index 0d3128f3b2a1..d88c6c84be6d 100644 --- a/libclc/opencl/lib/generic/math/fabs.cl +++ b/libclc/opencl/lib/generic/math/fabs.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION fabs +#define __CLC_FUNCTION fabs #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/fdim.cl b/libclc/opencl/lib/generic/math/fdim.cl index ecdcd3aef3a7..edaa8a3daef4 100644 --- a/libclc/opencl/lib/generic/math/fdim.cl +++ b/libclc/opencl/lib/generic/math/fdim.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION fdim +#define __CLC_FUNCTION fdim #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/floor.cl b/libclc/opencl/lib/generic/math/floor.cl index cda8363f9136..2edc1df21bc5 100644 --- a/libclc/opencl/lib/generic/math/floor.cl +++ b/libclc/opencl/lib/generic/math/floor.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION floor +#define __CLC_FUNCTION floor #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/fma.cl b/libclc/opencl/lib/generic/math/fma.cl index 867b97506901..199d2683a898 100644 --- a/libclc/opencl/lib/generic/math/fma.cl +++ b/libclc/opencl/lib/generic/math/fma.cl @@ -10,7 +10,7 @@ #include #include -#define FUNCTION fma +#define __CLC_FUNCTION fma #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/fmax.cl b/libclc/opencl/lib/generic/math/fmax.cl index 7dbd6fe0bd7f..ae7a70a69fe3 100644 --- a/libclc/opencl/lib/generic/math/fmax.cl +++ b/libclc/opencl/lib/generic/math/fmax.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION fmax +#define __CLC_FUNCTION fmax #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/fmin.cl b/libclc/opencl/lib/generic/math/fmin.cl index ee0dca480073..4b55a93bb70f 100644 --- a/libclc/opencl/lib/generic/math/fmin.cl +++ b/libclc/opencl/lib/generic/math/fmin.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION fmin +#define __CLC_FUNCTION fmin #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/fmod.cl b/libclc/opencl/lib/generic/math/fmod.cl index ec1904d213d8..338b80334721 100644 --- a/libclc/opencl/lib/generic/math/fmod.cl +++ b/libclc/opencl/lib/generic/math/fmod.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION fmod +#define __CLC_FUNCTION fmod #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/fract.cl b/libclc/opencl/lib/generic/math/fract.cl index 9567072bf4c3..00e8eb456cf6 100644 --- a/libclc/opencl/lib/generic/math/fract.cl +++ b/libclc/opencl/lib/generic/math/fract.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION fract +#define __CLC_FUNCTION fract #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/frexp.cl b/libclc/opencl/lib/generic/math/frexp.cl index 3ac9be792ae6..207f9de1c99e 100644 --- a/libclc/opencl/lib/generic/math/frexp.cl +++ b/libclc/opencl/lib/generic/math/frexp.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION frexp +#define __CLC_FUNCTION frexp #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/half_cos.cl b/libclc/opencl/lib/generic/math/half_cos.cl index 377c4d164259..d1a5352b5267 100644 --- a/libclc/opencl/lib/generic/math/half_cos.cl +++ b/libclc/opencl/lib/generic/math/half_cos.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION half_cos +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION half_cos #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/half_divide.cl b/libclc/opencl/lib/generic/math/half_divide.cl index 730617ba67fb..10c418b9312d 100644 --- a/libclc/opencl/lib/generic/math/half_divide.cl +++ b/libclc/opencl/lib/generic/math/half_divide.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION half_divide +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION half_divide #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/half_exp.cl b/libclc/opencl/lib/generic/math/half_exp.cl index 05b8753b2faf..fbbf564cb697 100644 --- a/libclc/opencl/lib/generic/math/half_exp.cl +++ b/libclc/opencl/lib/generic/math/half_exp.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION half_exp +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION half_exp #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/half_exp10.cl b/libclc/opencl/lib/generic/math/half_exp10.cl index b4e46aaa771c..e655f5f89ff6 100644 --- a/libclc/opencl/lib/generic/math/half_exp10.cl +++ b/libclc/opencl/lib/generic/math/half_exp10.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION half_exp10 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION half_exp10 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/half_exp2.cl b/libclc/opencl/lib/generic/math/half_exp2.cl index 51fe9f72477a..417d8b978e7d 100644 --- a/libclc/opencl/lib/generic/math/half_exp2.cl +++ b/libclc/opencl/lib/generic/math/half_exp2.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION half_exp2 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION half_exp2 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/half_log.cl b/libclc/opencl/lib/generic/math/half_log.cl index b21835204a17..89482c263f83 100644 --- a/libclc/opencl/lib/generic/math/half_log.cl +++ b/libclc/opencl/lib/generic/math/half_log.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION half_log +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION half_log #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/half_log10.cl b/libclc/opencl/lib/generic/math/half_log10.cl index acb50f99af19..b5ffe7edd363 100644 --- a/libclc/opencl/lib/generic/math/half_log10.cl +++ b/libclc/opencl/lib/generic/math/half_log10.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION half_log10 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION half_log10 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/half_log2.cl b/libclc/opencl/lib/generic/math/half_log2.cl index c97e9e093878..cf13cf927c9c 100644 --- a/libclc/opencl/lib/generic/math/half_log2.cl +++ b/libclc/opencl/lib/generic/math/half_log2.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION half_log2 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION half_log2 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/half_powr.cl b/libclc/opencl/lib/generic/math/half_powr.cl index d61a18ab9132..d676f353f864 100644 --- a/libclc/opencl/lib/generic/math/half_powr.cl +++ b/libclc/opencl/lib/generic/math/half_powr.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION half_powr +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION half_powr #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/half_recip.cl b/libclc/opencl/lib/generic/math/half_recip.cl index 1917448c4e69..40a6c587dbaf 100644 --- a/libclc/opencl/lib/generic/math/half_recip.cl +++ b/libclc/opencl/lib/generic/math/half_recip.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION half_recip +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION half_recip #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/half_rsqrt.cl b/libclc/opencl/lib/generic/math/half_rsqrt.cl index d6ffa651fbe6..944976855dac 100644 --- a/libclc/opencl/lib/generic/math/half_rsqrt.cl +++ b/libclc/opencl/lib/generic/math/half_rsqrt.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION half_rsqrt +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION half_rsqrt #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/half_sin.cl b/libclc/opencl/lib/generic/math/half_sin.cl index baba0cca4984..3376f8344f39 100644 --- a/libclc/opencl/lib/generic/math/half_sin.cl +++ b/libclc/opencl/lib/generic/math/half_sin.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION half_sin +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION half_sin #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/half_sqrt.cl b/libclc/opencl/lib/generic/math/half_sqrt.cl index 7a59744ab11d..4939d6bd199d 100644 --- a/libclc/opencl/lib/generic/math/half_sqrt.cl +++ b/libclc/opencl/lib/generic/math/half_sqrt.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION half_sqrt +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION half_sqrt #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/half_tan.cl b/libclc/opencl/lib/generic/math/half_tan.cl index acd4b011173d..2b77b3ae0c62 100644 --- a/libclc/opencl/lib/generic/math/half_tan.cl +++ b/libclc/opencl/lib/generic/math/half_tan.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION half_tan +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION half_tan #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/hypot.cl b/libclc/opencl/lib/generic/math/hypot.cl index 4c59e4696e5a..41aff6906987 100644 --- a/libclc/opencl/lib/generic/math/hypot.cl +++ b/libclc/opencl/lib/generic/math/hypot.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION hypot +#define __CLC_FUNCTION hypot #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/ilogb.cl b/libclc/opencl/lib/generic/math/ilogb.cl index 3829ce68fb57..027d587a4d46 100644 --- a/libclc/opencl/lib/generic/math/ilogb.cl +++ b/libclc/opencl/lib/generic/math/ilogb.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION ilogb +#define __CLC_FUNCTION ilogb #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/ldexp.cl b/libclc/opencl/lib/generic/math/ldexp.cl index 88c60716d782..3cdb9e1a760a 100644 --- a/libclc/opencl/lib/generic/math/ldexp.cl +++ b/libclc/opencl/lib/generic/math/ldexp.cl @@ -9,8 +9,8 @@ #include #include -#define FUNCTION ldexp -#define __IMPL_FUNCTION(x) __clc_ldexp +#define __CLC_FUNCTION ldexp +#define __CLC_IMPL_FUNCTION(x) __clc_ldexp #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/lgamma.cl b/libclc/opencl/lib/generic/math/lgamma.cl index 253ce31c1577..da8ceac986e4 100644 --- a/libclc/opencl/lib/generic/math/lgamma.cl +++ b/libclc/opencl/lib/generic/math/lgamma.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION lgamma +#define __CLC_FUNCTION lgamma #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/lgamma_r.cl b/libclc/opencl/lib/generic/math/lgamma_r.cl index 8753f6c75d8b..bb2d9bd283df 100644 --- a/libclc/opencl/lib/generic/math/lgamma_r.cl +++ b/libclc/opencl/lib/generic/math/lgamma_r.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION lgamma_r +#define __CLC_FUNCTION lgamma_r #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/log.cl b/libclc/opencl/lib/generic/math/log.cl index dbe3e3572703..06209999bf2f 100644 --- a/libclc/opencl/lib/generic/math/log.cl +++ b/libclc/opencl/lib/generic/math/log.cl @@ -10,7 +10,7 @@ #include #include -#define FUNCTION log +#define __CLC_FUNCTION log #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/log10.cl b/libclc/opencl/lib/generic/math/log10.cl index d5137a7cab7a..466b602e1896 100644 --- a/libclc/opencl/lib/generic/math/log10.cl +++ b/libclc/opencl/lib/generic/math/log10.cl @@ -10,7 +10,7 @@ #include #include -#define FUNCTION log10 +#define __CLC_FUNCTION log10 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/log1p.cl b/libclc/opencl/lib/generic/math/log1p.cl index d389ab72908c..c1a8711e1185 100644 --- a/libclc/opencl/lib/generic/math/log1p.cl +++ b/libclc/opencl/lib/generic/math/log1p.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION log1p +#define __CLC_FUNCTION log1p #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/log2.cl b/libclc/opencl/lib/generic/math/log2.cl index d1433bc82581..a52a52e28f63 100644 --- a/libclc/opencl/lib/generic/math/log2.cl +++ b/libclc/opencl/lib/generic/math/log2.cl @@ -10,7 +10,7 @@ #include #include -#define FUNCTION log2 +#define __CLC_FUNCTION log2 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/logb.cl b/libclc/opencl/lib/generic/math/logb.cl index 037380a26a72..09d43fac3ad2 100644 --- a/libclc/opencl/lib/generic/math/logb.cl +++ b/libclc/opencl/lib/generic/math/logb.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION logb +#define __CLC_FUNCTION logb #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/mad.cl b/libclc/opencl/lib/generic/math/mad.cl index 3fe2dd9bed5f..05bd228251c1 100644 --- a/libclc/opencl/lib/generic/math/mad.cl +++ b/libclc/opencl/lib/generic/math/mad.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION mad +#define __CLC_FUNCTION mad #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/maxmag.cl b/libclc/opencl/lib/generic/math/maxmag.cl index 4f9dbeb8d27e..30e7bb21302d 100644 --- a/libclc/opencl/lib/generic/math/maxmag.cl +++ b/libclc/opencl/lib/generic/math/maxmag.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION maxmag +#define __CLC_FUNCTION maxmag #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/minmag.cl b/libclc/opencl/lib/generic/math/minmag.cl index efe72b6f545c..3732dbfe7af4 100644 --- a/libclc/opencl/lib/generic/math/minmag.cl +++ b/libclc/opencl/lib/generic/math/minmag.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION minmag +#define __CLC_FUNCTION minmag #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/modf.cl b/libclc/opencl/lib/generic/math/modf.cl index de6524e02f73..306070bf8923 100644 --- a/libclc/opencl/lib/generic/math/modf.cl +++ b/libclc/opencl/lib/generic/math/modf.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION modf +#define __CLC_FUNCTION modf #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/native_cos.cl b/libclc/opencl/lib/generic/math/native_cos.cl index 85944a03c546..8508df37a9b6 100644 --- a/libclc/opencl/lib/generic/math/native_cos.cl +++ b/libclc/opencl/lib/generic/math/native_cos.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION native_cos +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION native_cos #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/native_divide.cl b/libclc/opencl/lib/generic/math/native_divide.cl index 8efd8cc21b5d..ea28bf6e195c 100644 --- a/libclc/opencl/lib/generic/math/native_divide.cl +++ b/libclc/opencl/lib/generic/math/native_divide.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION native_divide +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION native_divide #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/native_exp.cl b/libclc/opencl/lib/generic/math/native_exp.cl index 42208371e195..aedb0953c534 100644 --- a/libclc/opencl/lib/generic/math/native_exp.cl +++ b/libclc/opencl/lib/generic/math/native_exp.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION native_exp +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION native_exp #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/native_exp10.cl b/libclc/opencl/lib/generic/math/native_exp10.cl index aa2585ff4311..eb184647639f 100644 --- a/libclc/opencl/lib/generic/math/native_exp10.cl +++ b/libclc/opencl/lib/generic/math/native_exp10.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION native_exp10 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION native_exp10 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/native_exp2.cl b/libclc/opencl/lib/generic/math/native_exp2.cl index 8955b28b367c..52e814f5ee53 100644 --- a/libclc/opencl/lib/generic/math/native_exp2.cl +++ b/libclc/opencl/lib/generic/math/native_exp2.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION native_exp2 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION native_exp2 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/native_log.cl b/libclc/opencl/lib/generic/math/native_log.cl index 334f7c04e389..d1d4ae2f15f1 100644 --- a/libclc/opencl/lib/generic/math/native_log.cl +++ b/libclc/opencl/lib/generic/math/native_log.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION native_log +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION native_log #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/native_log10.cl b/libclc/opencl/lib/generic/math/native_log10.cl index a65938ee4c6c..680b9cb341bf 100644 --- a/libclc/opencl/lib/generic/math/native_log10.cl +++ b/libclc/opencl/lib/generic/math/native_log10.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION native_log10 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION native_log10 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/native_log2.cl b/libclc/opencl/lib/generic/math/native_log2.cl index f10b533f91f4..3a104357afa8 100644 --- a/libclc/opencl/lib/generic/math/native_log2.cl +++ b/libclc/opencl/lib/generic/math/native_log2.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION native_log2 +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION native_log2 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/native_powr.cl b/libclc/opencl/lib/generic/math/native_powr.cl index 8301443cfbcf..f325d53321b1 100644 --- a/libclc/opencl/lib/generic/math/native_powr.cl +++ b/libclc/opencl/lib/generic/math/native_powr.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION native_powr +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION native_powr #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/native_recip.cl b/libclc/opencl/lib/generic/math/native_recip.cl index 145845b45514..20d81ed9f1b7 100644 --- a/libclc/opencl/lib/generic/math/native_recip.cl +++ b/libclc/opencl/lib/generic/math/native_recip.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION native_recip +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION native_recip #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/native_rsqrt.cl b/libclc/opencl/lib/generic/math/native_rsqrt.cl index cbb5a754fc96..8f308e74f334 100644 --- a/libclc/opencl/lib/generic/math/native_rsqrt.cl +++ b/libclc/opencl/lib/generic/math/native_rsqrt.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION native_rsqrt +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION native_rsqrt #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/native_sin.cl b/libclc/opencl/lib/generic/math/native_sin.cl index dfcc882614a6..ea7167822a81 100644 --- a/libclc/opencl/lib/generic/math/native_sin.cl +++ b/libclc/opencl/lib/generic/math/native_sin.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION native_sin +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION native_sin #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/native_sqrt.cl b/libclc/opencl/lib/generic/math/native_sqrt.cl index a0be41d33fa4..fa38bdb3301d 100644 --- a/libclc/opencl/lib/generic/math/native_sqrt.cl +++ b/libclc/opencl/lib/generic/math/native_sqrt.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION native_sqrt +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION native_sqrt #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/native_tan.cl b/libclc/opencl/lib/generic/math/native_tan.cl index 86eee4f5913f..8cebf93bae91 100644 --- a/libclc/opencl/lib/generic/math/native_tan.cl +++ b/libclc/opencl/lib/generic/math/native_tan.cl @@ -9,8 +9,8 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION native_tan +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION native_tan #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/nextafter.cl b/libclc/opencl/lib/generic/math/nextafter.cl index 9c30e5668a56..256f06bf5855 100644 --- a/libclc/opencl/lib/generic/math/nextafter.cl +++ b/libclc/opencl/lib/generic/math/nextafter.cl @@ -9,8 +9,8 @@ #include #include -#define FUNCTION nextafter -#define __IMPL_FUNCTION(x) __clc_nextafter +#define __CLC_FUNCTION nextafter +#define __CLC_IMPL_FUNCTION(x) __clc_nextafter #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/pow.cl b/libclc/opencl/lib/generic/math/pow.cl index 2fddb7e88964..bf4351926573 100644 --- a/libclc/opencl/lib/generic/math/pow.cl +++ b/libclc/opencl/lib/generic/math/pow.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION pow +#define __CLC_FUNCTION pow #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/pown.cl b/libclc/opencl/lib/generic/math/pown.cl index 0a5ee893a45a..8c03be6bee16 100644 --- a/libclc/opencl/lib/generic/math/pown.cl +++ b/libclc/opencl/lib/generic/math/pown.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION pown +#define __CLC_FUNCTION pown #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/powr.cl b/libclc/opencl/lib/generic/math/powr.cl index 13af03ff1327..680f9be894ab 100644 --- a/libclc/opencl/lib/generic/math/powr.cl +++ b/libclc/opencl/lib/generic/math/powr.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION powr +#define __CLC_FUNCTION powr #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/remainder.cl b/libclc/opencl/lib/generic/math/remainder.cl index 224a66bc9b27..42b37f847f6d 100644 --- a/libclc/opencl/lib/generic/math/remainder.cl +++ b/libclc/opencl/lib/generic/math/remainder.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION remainder +#define __CLC_FUNCTION remainder #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/rint.cl b/libclc/opencl/lib/generic/math/rint.cl index 489883c97c14..8beaa7ae064c 100644 --- a/libclc/opencl/lib/generic/math/rint.cl +++ b/libclc/opencl/lib/generic/math/rint.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION rint +#define __CLC_FUNCTION rint #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/rootn.cl b/libclc/opencl/lib/generic/math/rootn.cl index e8dba17b9395..8f25ee1d31b4 100644 --- a/libclc/opencl/lib/generic/math/rootn.cl +++ b/libclc/opencl/lib/generic/math/rootn.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION rootn +#define __CLC_FUNCTION rootn #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/round.cl b/libclc/opencl/lib/generic/math/round.cl index c45e681b1c22..79b04752e9de 100644 --- a/libclc/opencl/lib/generic/math/round.cl +++ b/libclc/opencl/lib/generic/math/round.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION round +#define __CLC_FUNCTION round #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/rsqrt.cl b/libclc/opencl/lib/generic/math/rsqrt.cl index 47e4f450ed1a..f7137f5a007d 100644 --- a/libclc/opencl/lib/generic/math/rsqrt.cl +++ b/libclc/opencl/lib/generic/math/rsqrt.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION rsqrt +#define __CLC_FUNCTION rsqrt #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/sin.cl b/libclc/opencl/lib/generic/math/sin.cl index ff7db2a5b3cb..e198198bcbe8 100644 --- a/libclc/opencl/lib/generic/math/sin.cl +++ b/libclc/opencl/lib/generic/math/sin.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION sin +#define __CLC_FUNCTION sin #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/sincos.cl b/libclc/opencl/lib/generic/math/sincos.cl index c8871fd2b002..845e966966c5 100644 --- a/libclc/opencl/lib/generic/math/sincos.cl +++ b/libclc/opencl/lib/generic/math/sincos.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION sincos +#define __CLC_FUNCTION sincos #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/sinh.cl b/libclc/opencl/lib/generic/math/sinh.cl index bd6ea20e7e89..6d5f1b1c269c 100644 --- a/libclc/opencl/lib/generic/math/sinh.cl +++ b/libclc/opencl/lib/generic/math/sinh.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION sinh +#define __CLC_FUNCTION sinh #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/sinpi.cl b/libclc/opencl/lib/generic/math/sinpi.cl index badecd090985..33b04532e776 100644 --- a/libclc/opencl/lib/generic/math/sinpi.cl +++ b/libclc/opencl/lib/generic/math/sinpi.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION sinpi +#define __CLC_FUNCTION sinpi #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/sqrt.cl b/libclc/opencl/lib/generic/math/sqrt.cl index 3b05b2586448..9984ddb9d5a4 100644 --- a/libclc/opencl/lib/generic/math/sqrt.cl +++ b/libclc/opencl/lib/generic/math/sqrt.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION sqrt +#define __CLC_FUNCTION sqrt #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/tan.cl b/libclc/opencl/lib/generic/math/tan.cl index 95409fc5b092..89a525111167 100644 --- a/libclc/opencl/lib/generic/math/tan.cl +++ b/libclc/opencl/lib/generic/math/tan.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION tan +#define __CLC_FUNCTION tan #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/tanh.cl b/libclc/opencl/lib/generic/math/tanh.cl index a77878bb7966..92307eafdd05 100644 --- a/libclc/opencl/lib/generic/math/tanh.cl +++ b/libclc/opencl/lib/generic/math/tanh.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION tanh +#define __CLC_FUNCTION tanh #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/tanpi.cl b/libclc/opencl/lib/generic/math/tanpi.cl index 6b5805ec3cd0..47e943ba7741 100644 --- a/libclc/opencl/lib/generic/math/tanpi.cl +++ b/libclc/opencl/lib/generic/math/tanpi.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION tanpi +#define __CLC_FUNCTION tanpi #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/tgamma.cl b/libclc/opencl/lib/generic/math/tgamma.cl index 8f35d22426a7..2749cf3dfc0f 100644 --- a/libclc/opencl/lib/generic/math/tgamma.cl +++ b/libclc/opencl/lib/generic/math/tgamma.cl @@ -9,6 +9,6 @@ #include #include -#define FUNCTION tgamma +#define __CLC_FUNCTION tgamma #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/math/trunc.cl b/libclc/opencl/lib/generic/math/trunc.cl index ea56329bc8de..b27699699534 100644 --- a/libclc/opencl/lib/generic/math/trunc.cl +++ b/libclc/opencl/lib/generic/math/trunc.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION trunc +#define __CLC_FUNCTION trunc #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/misc/shuffle.cl b/libclc/opencl/lib/generic/misc/shuffle.cl index 15295bf7d907..f9187be453e6 100644 --- a/libclc/opencl/lib/generic/misc/shuffle.cl +++ b/libclc/opencl/lib/generic/misc/shuffle.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION shuffle +#define __CLC_FUNCTION shuffle #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/misc/shuffle2.cl b/libclc/opencl/lib/generic/misc/shuffle2.cl index 7e4c5f092268..0008340b622d 100644 --- a/libclc/opencl/lib/generic/misc/shuffle2.cl +++ b/libclc/opencl/lib/generic/misc/shuffle2.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION shuffle2 +#define __CLC_FUNCTION shuffle2 #define __CLC_BODY #include diff --git a/libclc/opencl/lib/generic/relational/all.cl b/libclc/opencl/lib/generic/relational/all.cl index 5ac4a465365a..f72da2cb622c 100644 --- a/libclc/opencl/lib/generic/relational/all.cl +++ b/libclc/opencl/lib/generic/relational/all.cl @@ -9,17 +9,17 @@ #include #include -#define ALL_ID(TYPE) _CLC_OVERLOAD _CLC_DEF int all(TYPE v) +#define __CLC_ALL_ID(TYPE) _CLC_OVERLOAD _CLC_DEF int all(TYPE v) -#define ALL_VECTORIZE(TYPE) \ - ALL_ID(TYPE) { return __clc_all(v); } \ - ALL_ID(TYPE##2) { return __clc_all(v); } \ - ALL_ID(TYPE##3) { return __clc_all(v); } \ - ALL_ID(TYPE##4) { return __clc_all(v); } \ - ALL_ID(TYPE##8) { return __clc_all(v); } \ - ALL_ID(TYPE##16) { return __clc_all(v); } +#define __CLC_ALL_VECTORIZE(TYPE) \ + __CLC_ALL_ID(TYPE) { return __clc_all(v); } \ + __CLC_ALL_ID(TYPE##2) { return __clc_all(v); } \ + __CLC_ALL_ID(TYPE##3) { return __clc_all(v); } \ + __CLC_ALL_ID(TYPE##4) { return __clc_all(v); } \ + __CLC_ALL_ID(TYPE##8) { return __clc_all(v); } \ + __CLC_ALL_ID(TYPE##16) { return __clc_all(v); } -ALL_VECTORIZE(char) -ALL_VECTORIZE(short) -ALL_VECTORIZE(int) -ALL_VECTORIZE(long) +__CLC_ALL_VECTORIZE(char) +__CLC_ALL_VECTORIZE(short) +__CLC_ALL_VECTORIZE(int) +__CLC_ALL_VECTORIZE(long) diff --git a/libclc/opencl/lib/generic/relational/any.cl b/libclc/opencl/lib/generic/relational/any.cl index 507f2b170693..b2b48dbf1ab0 100644 --- a/libclc/opencl/lib/generic/relational/any.cl +++ b/libclc/opencl/lib/generic/relational/any.cl @@ -9,17 +9,17 @@ #include #include -#define ANY_ID(TYPE) _CLC_OVERLOAD _CLC_DEF int any(TYPE v) +#define __CLC_ANY_ID(TYPE) _CLC_OVERLOAD _CLC_DEF int any(TYPE v) -#define ANY_VECTORIZE(TYPE) \ - ANY_ID(TYPE) { return __clc_any(v); } \ - ANY_ID(TYPE##2) { return __clc_any(v); } \ - ANY_ID(TYPE##3) { return __clc_any(v); } \ - ANY_ID(TYPE##4) { return __clc_any(v); } \ - ANY_ID(TYPE##8) { return __clc_any(v); } \ - ANY_ID(TYPE##16) { return __clc_any(v); } +#define __CLC_ANY_VECTORIZE(TYPE) \ + __CLC_ANY_ID(TYPE) { return __clc_any(v); } \ + __CLC_ANY_ID(TYPE##2) { return __clc_any(v); } \ + __CLC_ANY_ID(TYPE##3) { return __clc_any(v); } \ + __CLC_ANY_ID(TYPE##4) { return __clc_any(v); } \ + __CLC_ANY_ID(TYPE##8) { return __clc_any(v); } \ + __CLC_ANY_ID(TYPE##16) { return __clc_any(v); } -ANY_VECTORIZE(char) -ANY_VECTORIZE(short) -ANY_VECTORIZE(int) -ANY_VECTORIZE(long) +__CLC_ANY_VECTORIZE(char) +__CLC_ANY_VECTORIZE(short) +__CLC_ANY_VECTORIZE(int) +__CLC_ANY_VECTORIZE(long) diff --git a/libclc/opencl/lib/generic/relational/binary_def.inc b/libclc/opencl/lib/generic/relational/binary_def.inc index 8416da0475a2..b60d9bbe45e1 100644 --- a/libclc/opencl/lib/generic/relational/binary_def.inc +++ b/libclc/opencl/lib/generic/relational/binary_def.inc @@ -8,16 +8,17 @@ #include -#define __IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) +#define __CLC_IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) #if __CLC_VECSIZE_OR_1 == 1 -#define __RETTYPE __CLC_INTN +#define __CLC_RETTYPE __CLC_INTN #else -#define __RETTYPE __CLC_BIT_INTN +#define __CLC_RETTYPE __CLC_BIT_INTN #endif -_CLC_OVERLOAD _CLC_DEF __RETTYPE FUNCTION(__CLC_GENTYPE a, __CLC_GENTYPE b) { - return __IMPL_FUNCTION(FUNCTION)(a, b); +_CLC_OVERLOAD _CLC_DEF __CLC_RETTYPE __CLC_FUNCTION(__CLC_GENTYPE a, + __CLC_GENTYPE b) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(a, b); } -#undef __RETTYPE +#undef __CLC_RETTYPE diff --git a/libclc/opencl/lib/generic/relational/isequal.cl b/libclc/opencl/lib/generic/relational/isequal.cl index 83002c28ceab..40718dbca9d0 100644 --- a/libclc/opencl/lib/generic/relational/isequal.cl +++ b/libclc/opencl/lib/generic/relational/isequal.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION isequal +#define __CLC_FUNCTION isequal #define __CLC_BODY "binary_def.inc" #include diff --git a/libclc/opencl/lib/generic/relational/isfinite.cl b/libclc/opencl/lib/generic/relational/isfinite.cl index a2017133cead..f055e295416c 100644 --- a/libclc/opencl/lib/generic/relational/isfinite.cl +++ b/libclc/opencl/lib/generic/relational/isfinite.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION isfinite +#define __CLC_FUNCTION isfinite #define __CLC_BODY "unary_def.inc" #include diff --git a/libclc/opencl/lib/generic/relational/isgreater.cl b/libclc/opencl/lib/generic/relational/isgreater.cl index 6eeb2b21c049..ae73769267dc 100644 --- a/libclc/opencl/lib/generic/relational/isgreater.cl +++ b/libclc/opencl/lib/generic/relational/isgreater.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION isgreater +#define __CLC_FUNCTION isgreater #define __CLC_BODY "binary_def.inc" #include diff --git a/libclc/opencl/lib/generic/relational/isgreaterequal.cl b/libclc/opencl/lib/generic/relational/isgreaterequal.cl index e4e4535fd30d..725c3289bb05 100644 --- a/libclc/opencl/lib/generic/relational/isgreaterequal.cl +++ b/libclc/opencl/lib/generic/relational/isgreaterequal.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION isgreaterequal +#define __CLC_FUNCTION isgreaterequal #define __CLC_BODY "binary_def.inc" #include diff --git a/libclc/opencl/lib/generic/relational/isinf.cl b/libclc/opencl/lib/generic/relational/isinf.cl index 2ab8c182e02a..9558b0f9eb5e 100644 --- a/libclc/opencl/lib/generic/relational/isinf.cl +++ b/libclc/opencl/lib/generic/relational/isinf.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION isinf +#define __CLC_FUNCTION isinf #define __CLC_BODY "unary_def.inc" #include diff --git a/libclc/opencl/lib/generic/relational/isless.cl b/libclc/opencl/lib/generic/relational/isless.cl index 4212970e7671..6ed0857d354a 100644 --- a/libclc/opencl/lib/generic/relational/isless.cl +++ b/libclc/opencl/lib/generic/relational/isless.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION isless +#define __CLC_FUNCTION isless #define __CLC_BODY "binary_def.inc" #include diff --git a/libclc/opencl/lib/generic/relational/islessequal.cl b/libclc/opencl/lib/generic/relational/islessequal.cl index e7aec262fc76..c4697ca56f98 100644 --- a/libclc/opencl/lib/generic/relational/islessequal.cl +++ b/libclc/opencl/lib/generic/relational/islessequal.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION islessequal +#define __CLC_FUNCTION islessequal #define __CLC_BODY "binary_def.inc" #include diff --git a/libclc/opencl/lib/generic/relational/islessgreater.cl b/libclc/opencl/lib/generic/relational/islessgreater.cl index b775d2484550..eb4cdc24c067 100644 --- a/libclc/opencl/lib/generic/relational/islessgreater.cl +++ b/libclc/opencl/lib/generic/relational/islessgreater.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION islessgreater +#define __CLC_FUNCTION islessgreater #define __CLC_BODY "binary_def.inc" #include diff --git a/libclc/opencl/lib/generic/relational/isnan.cl b/libclc/opencl/lib/generic/relational/isnan.cl index 4b7eeb5b919b..4bae2ae077c1 100644 --- a/libclc/opencl/lib/generic/relational/isnan.cl +++ b/libclc/opencl/lib/generic/relational/isnan.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION isnan +#define __CLC_FUNCTION isnan #define __CLC_BODY "unary_def.inc" #include diff --git a/libclc/opencl/lib/generic/relational/isnormal.cl b/libclc/opencl/lib/generic/relational/isnormal.cl index 60ce9dccaeaf..d4ea20a27cdb 100644 --- a/libclc/opencl/lib/generic/relational/isnormal.cl +++ b/libclc/opencl/lib/generic/relational/isnormal.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION isnormal +#define __CLC_FUNCTION isnormal #define __CLC_BODY "unary_def.inc" #include diff --git a/libclc/opencl/lib/generic/relational/isnotequal.cl b/libclc/opencl/lib/generic/relational/isnotequal.cl index abb4d3a85966..e24d57564cb8 100644 --- a/libclc/opencl/lib/generic/relational/isnotequal.cl +++ b/libclc/opencl/lib/generic/relational/isnotequal.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION isnotequal +#define __CLC_FUNCTION isnotequal #define __CLC_BODY "binary_def.inc" #include diff --git a/libclc/opencl/lib/generic/relational/isordered.cl b/libclc/opencl/lib/generic/relational/isordered.cl index 684ee425e120..773cf1947e68 100644 --- a/libclc/opencl/lib/generic/relational/isordered.cl +++ b/libclc/opencl/lib/generic/relational/isordered.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION isordered +#define __CLC_FUNCTION isordered #define __CLC_BODY "binary_def.inc" #include diff --git a/libclc/opencl/lib/generic/relational/isunordered.cl b/libclc/opencl/lib/generic/relational/isunordered.cl index 84aa8cafb111..44427ea5e604 100644 --- a/libclc/opencl/lib/generic/relational/isunordered.cl +++ b/libclc/opencl/lib/generic/relational/isunordered.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION isunordered +#define __CLC_FUNCTION isunordered #define __CLC_BODY "binary_def.inc" #include diff --git a/libclc/opencl/lib/generic/relational/signbit.cl b/libclc/opencl/lib/generic/relational/signbit.cl index d30fea7b9f6f..b1f3ac89933f 100644 --- a/libclc/opencl/lib/generic/relational/signbit.cl +++ b/libclc/opencl/lib/generic/relational/signbit.cl @@ -9,7 +9,7 @@ #include #include -#define FUNCTION signbit +#define __CLC_FUNCTION signbit #define __CLC_BODY "unary_def.inc" #include diff --git a/libclc/opencl/lib/generic/relational/unary_def.inc b/libclc/opencl/lib/generic/relational/unary_def.inc index f184e3cf0be5..1655ace114aa 100644 --- a/libclc/opencl/lib/generic/relational/unary_def.inc +++ b/libclc/opencl/lib/generic/relational/unary_def.inc @@ -8,16 +8,16 @@ #include -#define __IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) +#define __CLC_IMPL_FUNCTION(x) __CLC_CONCAT(__clc_, x) #if __CLC_VECSIZE_OR_1 == 1 -#define __RETTYPE __CLC_INTN +#define __CLC_RETTYPE __CLC_INTN #else -#define __RETTYPE __CLC_BIT_INTN +#define __CLC_RETTYPE __CLC_BIT_INTN #endif -_CLC_OVERLOAD _CLC_DEF __RETTYPE FUNCTION(__CLC_GENTYPE a) { - return __IMPL_FUNCTION(FUNCTION)(a); +_CLC_OVERLOAD _CLC_DEF __CLC_RETTYPE __CLC_FUNCTION(__CLC_GENTYPE a) { + return __CLC_IMPL_FUNCTION(__CLC_FUNCTION)(a); } -#undef __RETTYPE +#undef __CLC_RETTYPE diff --git a/libclc/opencl/lib/generic/shared/vload.inc b/libclc/opencl/lib/generic/shared/vload.inc index 62cb040aad18..955b77b48ec3 100644 --- a/libclc/opencl/lib/generic/shared/vload.inc +++ b/libclc/opencl/lib/generic/shared/vload.inc @@ -6,33 +6,34 @@ // //===----------------------------------------------------------------------===// -#define CLC_VLOAD_NAME(x) __CLC_XCONCAT(__CLC_XCONCAT(x, vload), __CLC_VECSIZE) -#define CLC_VLOAD_HALF_NAME(x) \ +#define __CLC_VLOAD_NAME(x) \ + __CLC_XCONCAT(__CLC_XCONCAT(x, vload), __CLC_VECSIZE) +#define __CLC_VLOAD_HALF_NAME(x) \ __CLC_XCONCAT(__CLC_XCONCAT(x, vload_half), __CLC_VECSIZE) -#define CLC_VLOADA_HALF_NAME(x) \ +#define __CLC_VLOADA_HALF_NAME(x) \ __CLC_XCONCAT(__CLC_XCONCAT(x, vloada_half), __CLC_VECSIZE) #ifndef __CLC_SCALAR -#define CLC_VLOAD_TY __CLC_XCONCAT(less_aligned_, __CLC_GENTYPE) +#define __CLC_VLOAD_TY __CLC_XCONCAT(less_aligned_, __CLC_GENTYPE) -#define VLOAD_DEF(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DEF CLC_VLOAD_TY CLC_VLOAD_NAME()( \ +#define __CLC_VLOAD_DEF(ADDRSPACE) \ + _CLC_OVERLOAD _CLC_DEF __CLC_VLOAD_TY __CLC_VLOAD_NAME()( \ size_t offset, const ADDRSPACE __CLC_SCALAR_GENTYPE *x) { \ - return CLC_VLOAD_NAME(__clc_)(offset, x); \ + return __CLC_VLOAD_NAME(__clc_)(offset, x); \ } -VLOAD_DEF(__private) -VLOAD_DEF(__local) -VLOAD_DEF(__constant) -VLOAD_DEF(__global) +__CLC_VLOAD_DEF(__private) +__CLC_VLOAD_DEF(__local) +__CLC_VLOAD_DEF(__constant) +__CLC_VLOAD_DEF(__global) #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -VLOAD_DEF(__generic) +__CLC_VLOAD_DEF(__generic) #endif -#undef VLOAD_DEF -#undef CLC_VLOAD_TY +#undef __CLC_VLOAD_DEF +#undef __CLC_VLOAD_TY #endif @@ -42,30 +43,30 @@ VLOAD_DEF(__generic) #ifdef __CLC_FPSIZE #if __CLC_FPSIZE == 32 -#define VLOAD_HALF_DEF(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE CLC_VLOAD_HALF_NAME()( \ +#define __CLC_VLOAD_HALF_DEF(ADDRSPACE) \ + _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_VLOAD_HALF_NAME()( \ size_t offset, const ADDRSPACE half *mem) { \ - return CLC_VLOAD_HALF_NAME(__clc_)(offset, mem); \ + return __CLC_VLOAD_HALF_NAME(__clc_)(offset, mem); \ } \ \ - _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE CLC_VLOADA_HALF_NAME()( \ + _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_VLOADA_HALF_NAME()( \ size_t offset, const ADDRSPACE half *mem) { \ - return CLC_VLOADA_HALF_NAME(__clc_)(offset, mem); \ + return __CLC_VLOADA_HALF_NAME(__clc_)(offset, mem); \ } -VLOAD_HALF_DEF(__private) -VLOAD_HALF_DEF(__local) -VLOAD_HALF_DEF(__constant) -VLOAD_HALF_DEF(__global) +__CLC_VLOAD_HALF_DEF(__private) +__CLC_VLOAD_HALF_DEF(__local) +__CLC_VLOAD_HALF_DEF(__constant) +__CLC_VLOAD_HALF_DEF(__global) #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -VLOAD_HALF_DEF(__generic) +__CLC_VLOAD_HALF_DEF(__generic) #endif -#undef VLOAD_HALF_DEF +#undef __CLC_VLOAD_HALF_DEF #endif #endif -#undef CLC_VLOAD_NAME -#undef CLC_VLOAD_HALF_NAME -#undef CLC_VLOADA_HALF_NAME +#undef __CLC_VLOAD_NAME +#undef __CLC_VLOAD_HALF_NAME +#undef __CLC_VLOADA_HALF_NAME diff --git a/libclc/opencl/lib/generic/shared/vstore.inc b/libclc/opencl/lib/generic/shared/vstore.inc index 4bdce0719912..79ae9f9c9df2 100644 --- a/libclc/opencl/lib/generic/shared/vstore.inc +++ b/libclc/opencl/lib/generic/shared/vstore.inc @@ -6,31 +6,32 @@ // //===----------------------------------------------------------------------===// -#define CLC_VSTORE_TY __CLC_XCONCAT(less_aligned_, __CLC_GENTYPE) -#define CLC_VSTORE_NAME(x) \ +#define __CLC_VSTORE_TY __CLC_XCONCAT(less_aligned_, __CLC_GENTYPE) +#define __CLC_VSTORE_NAME(x) \ __CLC_XCONCAT(__CLC_XCONCAT(x, vstore), __CLC_VECSIZE) -#define CLC_VSTORE_HALF_NAME(x, y) \ +#define __CLC_VSTORE_HALF_NAME(x, y) \ __CLC_XCONCAT(__CLC_XCONCAT(__CLC_XCONCAT(x, vstore_half), __CLC_VECSIZE), y) -#define CLC_VSTOREA_HALF_NAME(x, y) \ +#define __CLC_VSTOREA_HALF_NAME(x, y) \ __CLC_XCONCAT(__CLC_XCONCAT(__CLC_XCONCAT(x, vstorea_half), __CLC_VECSIZE), y) #ifndef __CLC_SCALAR -#define CLC_VSTORE_DEF(ADDRSPACE) \ - _CLC_OVERLOAD _CLC_DEF void CLC_VSTORE_NAME()( \ - CLC_VSTORE_TY data, size_t offset, ADDRSPACE __CLC_SCALAR_GENTYPE *p) { \ - return CLC_VSTORE_NAME(__clc_)(data, offset, p); \ +#define __CLC_VSTORE_DEF(ADDRSPACE) \ + _CLC_OVERLOAD _CLC_DEF void __CLC_VSTORE_NAME()( \ + __CLC_VSTORE_TY data, size_t offset, \ + ADDRSPACE __CLC_SCALAR_GENTYPE *p) { \ + return __CLC_VSTORE_NAME(__clc_)(data, offset, p); \ } -CLC_VSTORE_DEF(__private) -CLC_VSTORE_DEF(__local) -CLC_VSTORE_DEF(__global) +__CLC_VSTORE_DEF(__private) +__CLC_VSTORE_DEF(__local) +__CLC_VSTORE_DEF(__global) #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -CLC_VSTORE_DEF(__generic) +__CLC_VSTORE_DEF(__generic) #endif -#undef CLC_VSTORE_DEF +#undef __CLC_VSTORE_DEF #endif // __CLC_SCALAR @@ -39,39 +40,39 @@ CLC_VSTORE_DEF(__generic) #ifdef __CLC_FPSIZE #if __CLC_FPSIZE == 32 || __CLC_FPSIZE == 64 -#define CLC_VSTORE_HALF_DEF(ADDRSPACE, SUFFIX) \ - _CLC_OVERLOAD _CLC_DEF void CLC_VSTORE_HALF_NAME(, SUFFIX)( \ - CLC_VSTORE_TY data, size_t offset, ADDRSPACE half *p) { \ - CLC_VSTORE_HALF_NAME(__clc_, SUFFIX)(data, offset, p); \ +#define __CLC_VSTORE_HALF_DEF(ADDRSPACE, SUFFIX) \ + _CLC_OVERLOAD _CLC_DEF void __CLC_VSTORE_HALF_NAME(, SUFFIX)( \ + __CLC_VSTORE_TY data, size_t offset, ADDRSPACE half *p) { \ + __CLC_VSTORE_HALF_NAME(__clc_, SUFFIX)(data, offset, p); \ } \ \ - _CLC_OVERLOAD _CLC_DEF void CLC_VSTOREA_HALF_NAME(, SUFFIX)( \ - CLC_VSTORE_TY data, size_t offset, ADDRSPACE half *p) { \ - CLC_VSTOREA_HALF_NAME(__clc_, SUFFIX)(data, offset, p); \ + _CLC_OVERLOAD _CLC_DEF void __CLC_VSTOREA_HALF_NAME(, SUFFIX)( \ + __CLC_VSTORE_TY data, size_t offset, ADDRSPACE half *p) { \ + __CLC_VSTOREA_HALF_NAME(__clc_, SUFFIX)(data, offset, p); \ } -#define CLC_VSTORE_HALF_DEF_ALL_MODES(ADDRSPACE) \ - CLC_VSTORE_HALF_DEF(ADDRSPACE, ) \ - CLC_VSTORE_HALF_DEF(ADDRSPACE, _rtz) \ - CLC_VSTORE_HALF_DEF(ADDRSPACE, _rtn) \ - CLC_VSTORE_HALF_DEF(ADDRSPACE, _rtp) \ - CLC_VSTORE_HALF_DEF(ADDRSPACE, _rte) +#define __CLC_VSTORE_HALF_DEF_ALL_MODES(ADDRSPACE) \ + __CLC_VSTORE_HALF_DEF(ADDRSPACE, ) \ + __CLC_VSTORE_HALF_DEF(ADDRSPACE, _rtz) \ + __CLC_VSTORE_HALF_DEF(ADDRSPACE, _rtn) \ + __CLC_VSTORE_HALF_DEF(ADDRSPACE, _rtp) \ + __CLC_VSTORE_HALF_DEF(ADDRSPACE, _rte) -CLC_VSTORE_HALF_DEF_ALL_MODES(__private) -CLC_VSTORE_HALF_DEF_ALL_MODES(__local) -CLC_VSTORE_HALF_DEF_ALL_MODES(__global) +__CLC_VSTORE_HALF_DEF_ALL_MODES(__private) +__CLC_VSTORE_HALF_DEF_ALL_MODES(__local) +__CLC_VSTORE_HALF_DEF_ALL_MODES(__global) #if _CLC_DISTINCT_GENERIC_AS_SUPPORTED -CLC_VSTORE_HALF_DEF_ALL_MODES(__generic) +__CLC_VSTORE_HALF_DEF_ALL_MODES(__generic) #endif -#undef CLC_VSTORE_HALF_DEF -#undef CLC_VSTORE_HALF_DEF_ALL_MODES +#undef __CLC_VSTORE_HALF_DEF +#undef __CLC_VSTORE_HALF_DEF_ALL_MODES #endif #endif -#undef CLC_VSTORE_TY -#undef CLC_VSTORE_NAME -#undef CLC_VSTORE_HALF_NAME -#undef CLC_VSTOREA_HALF_NAME +#undef __CLC_VSTORE_TY +#undef __CLC_VSTORE_NAME +#undef __CLC_VSTORE_HALF_NAME +#undef __CLC_VSTOREA_HALF_NAME diff --git a/libclc/opencl/lib/spirv/math/fma.cl b/libclc/opencl/lib/spirv/math/fma.cl index 83504f63772c..0e328903ba26 100644 --- a/libclc/opencl/lib/spirv/math/fma.cl +++ b/libclc/opencl/lib/spirv/math/fma.cl @@ -9,9 +9,9 @@ #include #include -#define __FLOAT_ONLY -#define FUNCTION fma -#define __IMPL_FUNCTION(x) __clc_sw_fma +#define __CLC_FLOAT_ONLY +#define __CLC_FUNCTION fma +#define __CLC_IMPL_FUNCTION(x) __clc_sw_fma #define __CLC_BODY #include