00001
00007 #ifndef TBCI_PLAIN_DEF_H
00008 #define TBCI_PLAIN_DEF_H
00009
00010
00011
00013 #define LCTYPE(T) register typename tbci_traits<T>::loop_const_refval_type
00014 #define LCTYPED(T) register tbci_traits<T>::loop_const_refval_type
00015
00020
00021 #define VKERN_TEMPL_3V(FNAME,OP3) \
00022 INST(template <typename T> class Vector<T> friend VEC_INLINE void FNAME \
00023 (const unsigned long, T* RESTRICT const, const T* RESTRICT const, \
00024 const T* RESTRICT const);) \
00025 template <typename T> \
00026 VEC_INLINE void FNAME (const unsigned long sz, \
00027 T* RESTRICT const res, \
00028 const T* RESTRICT const v1, \
00029 const T* RESTRICT const v2) \
00030 { \
00031 register unsigned long i; \
00032 for (i = 0; i < sz; ++i) \
00033 OP3(res[i], v1[i], v2[i], f1, f2); \
00034 }
00035
00037 #define VKERN_TEMPL_3V_C(FNAME,OP3) \
00038 INST(template <typename T> class Vector<T> friend VEC_INLINE void FNAME \
00039 (const unsigned long, T* RESTRICT const, const T* RESTRICT const, \
00040 const T* RESTRICT const, LCTYPED(T));) \
00041 template <typename T> \
00042 VEC_INLINE void FNAME (const unsigned long sz, \
00043 T* RESTRICT const res, \
00044 const T* RESTRICT const v1, \
00045 const T* RESTRICT const v2, \
00046 LCTYPE(T) f2) \
00047 { \
00048 register unsigned long i; \
00049 for (i = 0; i < sz; ++i) \
00050 OP3(res[i], v1[i], v2[i], f1, f2); \
00051 }
00052
00054 #define VKERN_TEMPL_3V_CC(FNAME,OP3) \
00055 INST(template <typename T> class Vector<T> friend VEC_INLINE void FNAME \
00056 (const unsigned long, T* RESTRICT const, const T* RESTRICT const, \
00057 const T* RESTRICT const, LCTYPED(T), LCTYPED(T));) \
00058 template <typename T> \
00059 VEC_INLINE void FNAME (const unsigned long sz, \
00060 T* RESTRICT const res, \
00061 const T* RESTRICT const v1, \
00062 const T* RESTRICT const v2, \
00063 LCTYPE(T) f1, \
00064 LCTYPE(T) f2) \
00065 { \
00066 register unsigned long i; \
00067 for (i = 0; i < sz; ++i) \
00068 OP3(res[i], v1[i], v2[i], f1, f2); \
00069 }
00070
00072 #define VKERN_TEMPL_2V(FNAME,OP2) \
00073 INST(template <typename T> class Vector<T> friend VEC_INLINE void FNAME \
00074 (const unsigned long, T* RESTRICT const, const T* RESTRICT const);) \
00075 template <typename T> \
00076 VEC_INLINE void FNAME (const unsigned long sz, \
00077 T* RESTRICT const res, \
00078 const T* RESTRICT const v1) \
00079 { \
00080 register unsigned long i; \
00081 for (i = 0; i < sz; ++i) \
00082 OP2(res[i], v1[i], f1, f2); \
00083 }
00084
00086 #define VKERN_TEMPL_2V_C(FNAME,OP2) \
00087 INST(template <typename T> class Vector<T> friend VEC_INLINE void FNAME \
00088 (const unsigned long, T* RESTRICT const, const T* RESTRICT const, \
00089 LCTYPED(T));) \
00090 template <typename T> \
00091 VEC_INLINE void FNAME (const unsigned long sz, \
00092 T* RESTRICT const res, \
00093 const T* RESTRICT const v1, \
00094 LCTYPE(T) f2) \
00095 { \
00096 register unsigned long i; \
00097 for (i = 0; i < sz; ++i) \
00098 OP2(res[i], v1[i], f1, f2); \
00099 }
00100
00102 #define VKERN_TEMPL_2V_CC(FNAME,OP2) \
00103 INST(template <typename T> class Vector<T> friend VEC_INLINE void FNAME \
00104 (const unsigned long, T* RESTRICT const, const T* RESTRICT const, \
00105 LCTYPED(T), LCTYPED(T));) \
00106 template <typename T> \
00107 VEC_INLINE void FNAME (const unsigned long sz, \
00108 T* RESTRICT const res, \
00109 const T* RESTRICT const v1, \
00110 LCTYPE(T) f1, \
00111 LCTYPE(T) f2) \
00112 { \
00113 register unsigned long i; \
00114 for (i = 0; i < sz; ++i) \
00115 OP2(res[i], v1[i], f1, f2); \
00116 }
00117
00119 #define VKERN_TEMPL_2V_T(FNAME,OP2,TYPE) \
00120 INST(template <typename T> class Vector<T> friend VEC_INLINE void FNAME \
00121 (const unsigned long, const T* RESTRICT const, \
00122 const T* RESTRICT const, TYPE&);) \
00123 template <typename T> \
00124 VEC_INLINE void FNAME (const unsigned long sz, \
00125 const T* RESTRICT const v1, \
00126 const T* RESTRICT const v2, \
00127 TYPE &_f2) \
00128 { \
00129 register typename tbci_traits<TYPE>::loop_refval_type f2(_f2); \
00130 register unsigned long i; \
00131 for (i = 0; i < sz; ++i) \
00132 OP2(v1[i], v2[i], f1, f2); \
00133 _f2 = f2; \
00134 }
00135
00137 #define VKERN_TEMPL_1V(FNAME,OP1) \
00138 INST(template <typename T> class Vector<T> friend VEC_INLINE void FNAME \
00139 (const unsigned long, T* RESTRICT const);) \
00140 template <typename T> \
00141 VEC_INLINE void FNAME (const unsigned long sz, \
00142 T* RESTRICT const res) \
00143 { \
00144 register unsigned long i; \
00145 for (i = 0; i < sz; ++i) \
00146 OP1(res[i], f1, f2); \
00147 }
00148
00150 #define VKERN_TEMPL_1V_C(FNAME,OP1) \
00151 INST(template <typename T> class Vector<T> friend VEC_INLINE void FNAME \
00152 (const unsigned long, T* RESTRICT const, LCTYPED(T));) \
00153 template <typename T> \
00154 VEC_INLINE void FNAME (const unsigned long sz, \
00155 T* RESTRICT const res, \
00156 LCTYPE(T) f2) \
00157 { \
00158 register unsigned long i; \
00159 for (i = 0; i < sz; ++i) \
00160 OP1(res[i], f1, f2); \
00161 }
00162
00164 #define VKERN_TEMPL_1V_CC(FNAME,OP1) \
00165 INST(template <typename T> class Vector<T> friend VEC_INLINE void FNAME \
00166 (const unsigned long, T* RESTRICT const, \
00167 LCTYPED(T), LCTYPED(T));) \
00168 template <typename T> \
00169 VEC_INLINE void FNAME (const unsigned long sz, \
00170 T* RESTRICT const res, \
00171 LCTYPE(T) f1, \
00172 LCTYPE(T) f2) \
00173 { \
00174 register unsigned long i; \
00175 for (i = 0; i < sz; ++i) \
00176 OP1(res[i], f1, f2); \
00177 }
00178
00180 #define VKERN_TEMPL_1V_T(FNAME,OP1,TYPE) \
00181 INST(template <typename T> class Vector<T> friend VEC_INLINE void FNAME \
00182 (const unsigned long, const T*, TYPE&);) \
00183 template <typename T> \
00184 VEC_INLINE void FNAME (const unsigned long sz, \
00185 const T* res, \
00186 TYPE &_f2) \
00187 { \
00188 register typename tbci_traits<TYPE>::loop_refval_type f2(_f2); \
00189 register unsigned long i; \
00190 for (i = 0; i < sz; ++i) \
00191 OP1(res[i], f1, f2); \
00192 _f2 = f2; \
00193 }
00194
00195
00196 #endif