Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1 | /*===---- altivec.h - Standard header for type generic math ---------------===*\ |
| 2 | * |
| 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 4 | * of this software and associated documentation files (the "Software"), to deal |
| 5 | * in the Software without restriction, including without limitation the rights |
| 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 7 | * copies of the Software, and to permit persons to whom the Software is |
| 8 | * furnished to do so, subject to the following conditions: |
| 9 | * |
| 10 | * The above copyright notice and this permission notice shall be included in |
| 11 | * all copies or substantial portions of the Software. |
| 12 | * |
| 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 19 | * THE SOFTWARE. |
| 20 | * |
| 21 | \*===----------------------------------------------------------------------===*/ |
| 22 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 23 | // TODO: add functions for 'vector bool ..' and 'vector pixel' argument types according to |
| 24 | // the 'AltiVec Technology Programming Interface Manual' |
| 25 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 26 | #ifndef __ALTIVEC_H |
| 27 | #define __ALTIVEC_H |
| 28 | |
| 29 | #ifndef __ALTIVEC__ |
| 30 | #error "AltiVec support not enabled" |
| 31 | #endif |
| 32 | |
| 33 | /* constants for mapping CR6 bits to predicate result. */ |
| 34 | |
| 35 | #define __CR6_EQ 0 |
| 36 | #define __CR6_EQ_REV 1 |
| 37 | #define __CR6_LT 2 |
| 38 | #define __CR6_LT_REV 3 |
| 39 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 40 | #define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__)) |
| 41 | |
| 42 | static vector signed char __ATTRS_o_ai |
| 43 | vec_perm(vector signed char a, vector signed char b, vector unsigned char c); |
| 44 | |
| 45 | static vector unsigned char __ATTRS_o_ai |
| 46 | vec_perm(vector unsigned char a, vector unsigned char b, vector unsigned char c); |
| 47 | |
| 48 | static vector short __ATTRS_o_ai |
| 49 | vec_perm(vector short a, vector short b, vector unsigned char c); |
| 50 | |
| 51 | static vector unsigned short __ATTRS_o_ai |
| 52 | vec_perm(vector unsigned short a, vector unsigned short b, vector unsigned char c); |
| 53 | |
| 54 | static vector int __ATTRS_o_ai |
| 55 | vec_perm(vector int a, vector int b, vector unsigned char c); |
| 56 | |
| 57 | static vector unsigned int __ATTRS_o_ai |
| 58 | vec_perm(vector unsigned int a, vector unsigned int b, vector unsigned char c); |
| 59 | |
| 60 | static vector float __ATTRS_o_ai |
| 61 | vec_perm(vector float a, vector float b, vector unsigned char c); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 62 | |
| 63 | /* vec_abs */ |
| 64 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 65 | #define __builtin_altivec_abs_v16qi vec_abs |
| 66 | #define __builtin_altivec_abs_v8hi vec_abs |
| 67 | #define __builtin_altivec_abs_v4si vec_abs |
| 68 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 69 | static vector signed char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 70 | vec_abs(vector signed char a) |
| 71 | { |
| 72 | return __builtin_altivec_vmaxsb(a, -a); |
| 73 | } |
| 74 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 75 | static vector signed short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 76 | vec_abs(vector signed short a) |
| 77 | { |
| 78 | return __builtin_altivec_vmaxsh(a, -a); |
| 79 | } |
| 80 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 81 | static vector signed int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 82 | vec_abs(vector signed int a) |
| 83 | { |
| 84 | return __builtin_altivec_vmaxsw(a, -a); |
| 85 | } |
| 86 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 87 | static vector float __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 88 | vec_abs(vector float a) |
| 89 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 90 | vector unsigned int res = (vector unsigned int)a & (vector unsigned int)(0x7FFFFFFF); |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 91 | return (vector float)res; |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | /* vec_abss */ |
| 95 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 96 | #define __builtin_altivec_abss_v16qi vec_abss |
| 97 | #define __builtin_altivec_abss_v8hi vec_abss |
| 98 | #define __builtin_altivec_abss_v4si vec_abss |
| 99 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 100 | static vector signed char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 101 | vec_abss(vector signed char a) |
| 102 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 103 | return __builtin_altivec_vmaxsb(a, __builtin_altivec_vsubsbs((vector signed char)(0), a)); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 104 | } |
| 105 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 106 | static vector signed short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 107 | vec_abss(vector signed short a) |
| 108 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 109 | return __builtin_altivec_vmaxsh(a, __builtin_altivec_vsubshs((vector signed short)(0), a)); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 110 | } |
| 111 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 112 | static vector signed int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 113 | vec_abss(vector signed int a) |
| 114 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 115 | return __builtin_altivec_vmaxsw(a, __builtin_altivec_vsubsws((vector signed int)(0), a)); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 116 | } |
| 117 | |
| 118 | /* vec_add */ |
| 119 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 120 | static vector signed char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 121 | vec_add(vector signed char a, vector signed char b) |
| 122 | { |
| 123 | return a + b; |
| 124 | } |
| 125 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 126 | static vector unsigned char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 127 | vec_add(vector unsigned char a, vector unsigned char b) |
| 128 | { |
| 129 | return a + b; |
| 130 | } |
| 131 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 132 | static vector short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 133 | vec_add(vector short a, vector short b) |
| 134 | { |
| 135 | return a + b; |
| 136 | } |
| 137 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 138 | static vector unsigned short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 139 | vec_add(vector unsigned short a, vector unsigned short b) |
| 140 | { |
| 141 | return a + b; |
| 142 | } |
| 143 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 144 | static vector int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 145 | vec_add(vector int a, vector int b) |
| 146 | { |
| 147 | return a + b; |
| 148 | } |
| 149 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 150 | static vector unsigned int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 151 | vec_add(vector unsigned int a, vector unsigned int b) |
| 152 | { |
| 153 | return a + b; |
| 154 | } |
| 155 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 156 | static vector float __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 157 | vec_add(vector float a, vector float b) |
| 158 | { |
| 159 | return a + b; |
| 160 | } |
| 161 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 162 | /* vec_vaddubm */ |
| 163 | |
| 164 | #define __builtin_altivec_vaddubm vec_vaddubm |
| 165 | |
| 166 | static vector signed char __ATTRS_o_ai |
| 167 | vec_vaddubm(vector signed char a, vector signed char b) |
| 168 | { |
| 169 | return a + b; |
| 170 | } |
| 171 | |
| 172 | static vector unsigned char __ATTRS_o_ai |
| 173 | vec_vaddubm(vector unsigned char a, vector unsigned char b) |
| 174 | { |
| 175 | return a + b; |
| 176 | } |
| 177 | |
| 178 | /* vec_vadduhm */ |
| 179 | |
| 180 | #define __builtin_altivec_vadduhm vec_vadduhm |
| 181 | |
| 182 | static vector short __ATTRS_o_ai |
| 183 | vec_vadduhm(vector short a, vector short b) |
| 184 | { |
| 185 | return a + b; |
| 186 | } |
| 187 | |
| 188 | static vector unsigned short __ATTRS_o_ai |
| 189 | vec_vadduhm(vector unsigned short a, vector unsigned short b) |
| 190 | { |
| 191 | return a + b; |
| 192 | } |
| 193 | |
| 194 | /* vec_vadduwm */ |
| 195 | |
| 196 | #define __builtin_altivec_vadduwm vec_vadduwm |
| 197 | |
| 198 | static vector int __ATTRS_o_ai |
| 199 | vec_vadduwm(vector int a, vector int b) |
| 200 | { |
| 201 | return a + b; |
| 202 | } |
| 203 | |
| 204 | static vector unsigned int __ATTRS_o_ai |
| 205 | vec_vadduwm(vector unsigned int a, vector unsigned int b) |
| 206 | { |
| 207 | return a + b; |
| 208 | } |
| 209 | |
| 210 | /* vec_vaddfp */ |
| 211 | |
| 212 | #define __builtin_altivec_vaddfp vec_vaddfp |
| 213 | |
| 214 | static vector float __attribute__((__always_inline__)) |
| 215 | vec_vaddfp(vector float a, vector float b) |
| 216 | { |
| 217 | return a + b; |
| 218 | } |
| 219 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 220 | /* vec_addc */ |
| 221 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 222 | static vector unsigned int __attribute__((__always_inline__)) |
| 223 | vec_addc(vector unsigned int a, vector unsigned int b) |
| 224 | { |
| 225 | return __builtin_altivec_vaddcuw(a, b); |
| 226 | } |
| 227 | |
| 228 | /* vec_vaddcuw */ |
| 229 | |
| 230 | static vector unsigned int __attribute__((__always_inline__)) |
| 231 | vec_vaddcuw(vector unsigned int a, vector unsigned int b) |
| 232 | { |
| 233 | return __builtin_altivec_vaddcuw(a, b); |
| 234 | } |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 235 | |
| 236 | /* vec_adds */ |
| 237 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 238 | static vector signed char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 239 | vec_adds(vector signed char a, vector signed char b) |
| 240 | { |
| 241 | return __builtin_altivec_vaddsbs(a, b); |
| 242 | } |
| 243 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 244 | static vector unsigned char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 245 | vec_adds(vector unsigned char a, vector unsigned char b) |
| 246 | { |
| 247 | return __builtin_altivec_vaddubs(a, b); |
| 248 | } |
| 249 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 250 | static vector short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 251 | vec_adds(vector short a, vector short b) |
| 252 | { |
| 253 | return __builtin_altivec_vaddshs(a, b); |
| 254 | } |
| 255 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 256 | static vector unsigned short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 257 | vec_adds(vector unsigned short a, vector unsigned short b) |
| 258 | { |
| 259 | return __builtin_altivec_vadduhs(a, b); |
| 260 | } |
| 261 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 262 | static vector int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 263 | vec_adds(vector int a, vector int b) |
| 264 | { |
| 265 | return __builtin_altivec_vaddsws(a, b); |
| 266 | } |
| 267 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 268 | static vector unsigned int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 269 | vec_adds(vector unsigned int a, vector unsigned int b) |
| 270 | { |
| 271 | return __builtin_altivec_vadduws(a, b); |
| 272 | } |
| 273 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 274 | /* vec_vaddsbs */ |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 275 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 276 | static vector signed char __attribute__((__always_inline__)) |
| 277 | vec_vaddsbs(vector signed char a, vector signed char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 278 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 279 | return __builtin_altivec_vaddsbs(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 280 | } |
| 281 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 282 | /* vec_vaddubs */ |
| 283 | |
| 284 | static vector unsigned char __attribute__((__always_inline__)) |
| 285 | vec_vaddubs(vector unsigned char a, vector unsigned char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 286 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 287 | return __builtin_altivec_vaddubs(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 288 | } |
| 289 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 290 | /* vec_vaddshs */ |
| 291 | |
| 292 | static vector short __attribute__((__always_inline__)) |
| 293 | vec_vaddshs(vector short a, vector short b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 294 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 295 | return __builtin_altivec_vaddshs(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 296 | } |
| 297 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 298 | /* vec_vadduhs */ |
| 299 | |
| 300 | static vector unsigned short __attribute__((__always_inline__)) |
| 301 | vec_vadduhs(vector unsigned short a, vector unsigned short b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 302 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 303 | return __builtin_altivec_vadduhs(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 304 | } |
| 305 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 306 | /* vec_vaddsws */ |
| 307 | |
| 308 | static vector int __attribute__((__always_inline__)) |
| 309 | vec_vaddsws(vector int a, vector int b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 310 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 311 | return __builtin_altivec_vaddsws(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 312 | } |
| 313 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 314 | /* vec_vadduws */ |
| 315 | |
| 316 | static vector unsigned int __attribute__((__always_inline__)) |
| 317 | vec_vadduws(vector unsigned int a, vector unsigned int b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 318 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 319 | return __builtin_altivec_vadduws(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 320 | } |
| 321 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 322 | /* vec_and */ |
| 323 | |
| 324 | #define __builtin_altivec_vand vec_and |
| 325 | |
| 326 | static vector signed char __ATTRS_o_ai |
| 327 | vec_and(vector signed char a, vector signed char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 328 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 329 | return a & b; |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 330 | } |
| 331 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 332 | static vector unsigned char __ATTRS_o_ai |
| 333 | vec_and(vector unsigned char a, vector unsigned char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 334 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 335 | return a & b; |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 336 | } |
| 337 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 338 | static vector short __ATTRS_o_ai |
| 339 | vec_and(vector short a, vector short b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 340 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 341 | return a & b; |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 342 | } |
| 343 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 344 | static vector unsigned short __ATTRS_o_ai |
| 345 | vec_and(vector unsigned short a, vector unsigned short b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 346 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 347 | return a & b; |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 348 | } |
| 349 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 350 | static vector int __ATTRS_o_ai |
| 351 | vec_and(vector int a, vector int b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 352 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 353 | return a & b; |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 354 | } |
| 355 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 356 | static vector unsigned int __ATTRS_o_ai |
| 357 | vec_and(vector unsigned int a, vector unsigned int b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 358 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 359 | return a & b; |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 360 | } |
| 361 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 362 | static vector float __ATTRS_o_ai |
| 363 | vec_and(vector float a, vector float b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 364 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 365 | vector unsigned int res = (vector unsigned int)a & (vector unsigned int)b; |
| 366 | return (vector float)res; |
| 367 | } |
| 368 | |
| 369 | /* vec_vand */ |
| 370 | |
| 371 | static vector signed char __ATTRS_o_ai |
| 372 | vec_vand(vector signed char a, vector signed char b) |
| 373 | { |
| 374 | return a & b; |
| 375 | } |
| 376 | |
| 377 | static vector unsigned char __ATTRS_o_ai |
| 378 | vec_vand(vector unsigned char a, vector unsigned char b) |
| 379 | { |
| 380 | return a & b; |
| 381 | } |
| 382 | |
| 383 | static vector short __ATTRS_o_ai |
| 384 | vec_vand(vector short a, vector short b) |
| 385 | { |
| 386 | return a & b; |
| 387 | } |
| 388 | |
| 389 | static vector unsigned short __ATTRS_o_ai |
| 390 | vec_vand(vector unsigned short a, vector unsigned short b) |
| 391 | { |
| 392 | return a & b; |
| 393 | } |
| 394 | |
| 395 | static vector int __ATTRS_o_ai |
| 396 | vec_vand(vector int a, vector int b) |
| 397 | { |
| 398 | return a & b; |
| 399 | } |
| 400 | |
| 401 | static vector unsigned int __ATTRS_o_ai |
| 402 | vec_vand(vector unsigned int a, vector unsigned int b) |
| 403 | { |
| 404 | return a & b; |
| 405 | } |
| 406 | |
| 407 | static vector float __ATTRS_o_ai |
| 408 | vec_vand(vector float a, vector float b) |
| 409 | { |
| 410 | vector unsigned int res = (vector unsigned int)a & (vector unsigned int)b; |
| 411 | return (vector float)res; |
| 412 | } |
| 413 | |
| 414 | /* vec_andc */ |
| 415 | |
| 416 | #define __builtin_altivec_vandc vec_andc |
| 417 | |
| 418 | static vector signed char __ATTRS_o_ai |
| 419 | vec_andc(vector signed char a, vector signed char b) |
| 420 | { |
| 421 | return a & ~b; |
| 422 | } |
| 423 | |
| 424 | static vector unsigned char __ATTRS_o_ai |
| 425 | vec_andc(vector unsigned char a, vector unsigned char b) |
| 426 | { |
| 427 | return a & ~b; |
| 428 | } |
| 429 | |
| 430 | static vector short __ATTRS_o_ai |
| 431 | vec_andc(vector short a, vector short b) |
| 432 | { |
| 433 | return a & ~b; |
| 434 | } |
| 435 | |
| 436 | static vector unsigned short __ATTRS_o_ai |
| 437 | vec_andc(vector unsigned short a, vector unsigned short b) |
| 438 | { |
| 439 | return a & ~b; |
| 440 | } |
| 441 | |
| 442 | static vector int __ATTRS_o_ai |
| 443 | vec_andc(vector int a, vector int b) |
| 444 | { |
| 445 | return a & ~b; |
| 446 | } |
| 447 | |
| 448 | static vector unsigned int __ATTRS_o_ai |
| 449 | vec_andc(vector unsigned int a, vector unsigned int b) |
| 450 | { |
| 451 | return a & ~b; |
| 452 | } |
| 453 | |
| 454 | static vector float __ATTRS_o_ai |
| 455 | vec_andc(vector float a, vector float b) |
| 456 | { |
| 457 | vector unsigned int res = (vector unsigned int)a & ~(vector unsigned int)b; |
| 458 | return (vector float)res; |
| 459 | } |
| 460 | |
| 461 | /* vec_vandc */ |
| 462 | |
| 463 | static vector signed char __ATTRS_o_ai |
| 464 | vec_vandc(vector signed char a, vector signed char b) |
| 465 | { |
| 466 | return a & ~b; |
| 467 | } |
| 468 | |
| 469 | static vector unsigned char __ATTRS_o_ai |
| 470 | vec_vandc(vector unsigned char a, vector unsigned char b) |
| 471 | { |
| 472 | return a & ~b; |
| 473 | } |
| 474 | |
| 475 | static vector short __ATTRS_o_ai |
| 476 | vec_vandc(vector short a, vector short b) |
| 477 | { |
| 478 | return a & ~b; |
| 479 | } |
| 480 | |
| 481 | static vector unsigned short __ATTRS_o_ai |
| 482 | vec_vandc(vector unsigned short a, vector unsigned short b) |
| 483 | { |
| 484 | return a & ~b; |
| 485 | } |
| 486 | |
| 487 | static vector int __ATTRS_o_ai |
| 488 | vec_vandc(vector int a, vector int b) |
| 489 | { |
| 490 | return a & ~b; |
| 491 | } |
| 492 | |
| 493 | static vector unsigned int __ATTRS_o_ai |
| 494 | vec_vandc(vector unsigned int a, vector unsigned int b) |
| 495 | { |
| 496 | return a & ~b; |
| 497 | } |
| 498 | |
| 499 | static vector float __ATTRS_o_ai |
| 500 | vec_vandc(vector float a, vector float b) |
| 501 | { |
| 502 | vector unsigned int res = (vector unsigned int)a & ~(vector unsigned int)b; |
| 503 | return (vector float)res; |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 504 | } |
| 505 | |
| 506 | /* vec_avg */ |
| 507 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 508 | static vector signed char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 509 | vec_avg(vector signed char a, vector signed char b) |
| 510 | { |
| 511 | return __builtin_altivec_vavgsb(a, b); |
| 512 | } |
| 513 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 514 | static vector unsigned char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 515 | vec_avg(vector unsigned char a, vector unsigned char b) |
| 516 | { |
| 517 | return __builtin_altivec_vavgub(a, b); |
| 518 | } |
| 519 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 520 | static vector short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 521 | vec_avg(vector short a, vector short b) |
| 522 | { |
| 523 | return __builtin_altivec_vavgsh(a, b); |
| 524 | } |
| 525 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 526 | static vector unsigned short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 527 | vec_avg(vector unsigned short a, vector unsigned short b) |
| 528 | { |
| 529 | return __builtin_altivec_vavguh(a, b); |
| 530 | } |
| 531 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 532 | static vector int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 533 | vec_avg(vector int a, vector int b) |
| 534 | { |
| 535 | return __builtin_altivec_vavgsw(a, b); |
| 536 | } |
| 537 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 538 | static vector unsigned int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 539 | vec_avg(vector unsigned int a, vector unsigned int b) |
| 540 | { |
| 541 | return __builtin_altivec_vavguw(a, b); |
| 542 | } |
| 543 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 544 | /* vec_vavgsb */ |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 545 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 546 | static vector signed char __attribute__((__always_inline__)) |
| 547 | vec_vavgsb(vector signed char a, vector signed char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 548 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 549 | return __builtin_altivec_vavgsb(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 550 | } |
| 551 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 552 | /* vec_vavgub */ |
| 553 | |
| 554 | static vector unsigned char __attribute__((__always_inline__)) |
| 555 | vec_vavgub(vector unsigned char a, vector unsigned char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 556 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 557 | return __builtin_altivec_vavgub(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 558 | } |
| 559 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 560 | /* vec_vavgsh */ |
| 561 | |
| 562 | static vector short __attribute__((__always_inline__)) |
| 563 | vec_vavgsh(vector short a, vector short b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 564 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 565 | return __builtin_altivec_vavgsh(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 566 | } |
| 567 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 568 | /* vec_vavguh */ |
| 569 | |
| 570 | static vector unsigned short __attribute__((__always_inline__)) |
| 571 | vec_vavguh(vector unsigned short a, vector unsigned short b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 572 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 573 | return __builtin_altivec_vavguh(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 574 | } |
| 575 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 576 | /* vec_vavgsw */ |
| 577 | |
| 578 | static vector int __attribute__((__always_inline__)) |
| 579 | vec_vavgsw(vector int a, vector int b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 580 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 581 | return __builtin_altivec_vavgsw(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 582 | } |
| 583 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 584 | /* vec_vavguw */ |
| 585 | |
| 586 | static vector unsigned int __attribute__((__always_inline__)) |
| 587 | vec_vavguw(vector unsigned int a, vector unsigned int b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 588 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 589 | return __builtin_altivec_vavguw(a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 590 | } |
| 591 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 592 | /* vec_ceil */ |
| 593 | |
| 594 | static vector float __attribute__((__always_inline__)) |
| 595 | vec_ceil(vector float a) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 596 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 597 | return __builtin_altivec_vrfip(a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 598 | } |
| 599 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 600 | /* vec_vrfip */ |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 601 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 602 | static vector float __attribute__((__always_inline__)) |
| 603 | vec_vrfip(vector float a) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 604 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 605 | return __builtin_altivec_vrfip(a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 606 | } |
| 607 | |
| 608 | /* vec_cmpb */ |
| 609 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 610 | static vector int __attribute__((__always_inline__)) |
| 611 | vec_cmpb(vector float a, vector float b) |
| 612 | { |
| 613 | return __builtin_altivec_vcmpbfp(a, b); |
| 614 | } |
| 615 | |
| 616 | /* vec_vcmpbfp */ |
| 617 | |
| 618 | static vector int __attribute__((__always_inline__)) |
| 619 | vec_vcmpbfp(vector float a, vector float b) |
| 620 | { |
| 621 | return __builtin_altivec_vcmpbfp(a, b); |
| 622 | } |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 623 | |
| 624 | /* vec_cmpeq */ |
| 625 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 626 | static vector /*bool*/ char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 627 | vec_cmpeq(vector signed char a, vector signed char b) |
| 628 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 629 | return __builtin_altivec_vcmpequb((vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 630 | } |
| 631 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 632 | static vector /*bool*/ char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 633 | vec_cmpeq(vector unsigned char a, vector unsigned char b) |
| 634 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 635 | return __builtin_altivec_vcmpequb((vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 636 | } |
| 637 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 638 | static vector /*bool*/ short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 639 | vec_cmpeq(vector short a, vector short b) |
| 640 | { |
| 641 | return __builtin_altivec_vcmpequh(a, b); |
| 642 | } |
| 643 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 644 | static vector /*bool*/ short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 645 | vec_cmpeq(vector unsigned short a, vector unsigned short b) |
| 646 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 647 | return __builtin_altivec_vcmpequh((vector short)a, (vector short)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 648 | } |
| 649 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 650 | static vector /*bool*/ int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 651 | vec_cmpeq(vector int a, vector int b) |
| 652 | { |
| 653 | return __builtin_altivec_vcmpequw(a, b); |
| 654 | } |
| 655 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 656 | static vector /*bool*/ int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 657 | vec_cmpeq(vector unsigned int a, vector unsigned int b) |
| 658 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 659 | return __builtin_altivec_vcmpequw((vector int)a, (vector int)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 660 | } |
| 661 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 662 | static vector /*bool*/ int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 663 | vec_cmpeq(vector float a, vector float b) |
| 664 | { |
| 665 | return __builtin_altivec_vcmpeqfp(a, b); |
| 666 | } |
| 667 | |
| 668 | /* vec_cmpge */ |
| 669 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 670 | static vector /*bool*/ int __attribute__((__always_inline__)) |
| 671 | vec_cmpge(vector float a, vector float b) |
| 672 | { |
| 673 | return __builtin_altivec_vcmpgefp(a, b); |
| 674 | } |
| 675 | |
| 676 | /* vec_vcmpgefp */ |
| 677 | |
| 678 | static vector /*bool*/ int __attribute__((__always_inline__)) |
| 679 | vec_vcmpgefp(vector float a, vector float b) |
| 680 | { |
| 681 | return __builtin_altivec_vcmpgefp(a, b); |
| 682 | } |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 683 | |
| 684 | /* vec_cmpgt */ |
| 685 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 686 | static vector /*bool*/ char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 687 | vec_cmpgt(vector signed char a, vector signed char b) |
| 688 | { |
| 689 | return __builtin_altivec_vcmpgtsb(a, b); |
| 690 | } |
| 691 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 692 | static vector /*bool*/ char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 693 | vec_cmpgt(vector unsigned char a, vector unsigned char b) |
| 694 | { |
| 695 | return __builtin_altivec_vcmpgtub(a, b); |
| 696 | } |
| 697 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 698 | static vector /*bool*/ short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 699 | vec_cmpgt(vector short a, vector short b) |
| 700 | { |
| 701 | return __builtin_altivec_vcmpgtsh(a, b); |
| 702 | } |
| 703 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 704 | static vector /*bool*/ short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 705 | vec_cmpgt(vector unsigned short a, vector unsigned short b) |
| 706 | { |
| 707 | return __builtin_altivec_vcmpgtuh(a, b); |
| 708 | } |
| 709 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 710 | static vector /*bool*/ int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 711 | vec_cmpgt(vector int a, vector int b) |
| 712 | { |
| 713 | return __builtin_altivec_vcmpgtsw(a, b); |
| 714 | } |
| 715 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 716 | static vector /*bool*/ int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 717 | vec_cmpgt(vector unsigned int a, vector unsigned int b) |
| 718 | { |
| 719 | return __builtin_altivec_vcmpgtuw(a, b); |
| 720 | } |
| 721 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 722 | static vector /*bool*/ int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 723 | vec_cmpgt(vector float a, vector float b) |
| 724 | { |
| 725 | return __builtin_altivec_vcmpgtfp(a, b); |
| 726 | } |
| 727 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 728 | /* vec_vcmpgtsb */ |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 729 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 730 | static vector /*bool*/ char __attribute__((__always_inline__)) |
| 731 | vec_vcmpgtsb(vector signed char a, vector signed char b) |
| 732 | { |
| 733 | return __builtin_altivec_vcmpgtsb(a, b); |
| 734 | } |
| 735 | |
| 736 | /* vec_vcmpgtub */ |
| 737 | |
| 738 | static vector /*bool*/ char __attribute__((__always_inline__)) |
| 739 | vec_vcmpgtub(vector unsigned char a, vector unsigned char b) |
| 740 | { |
| 741 | return __builtin_altivec_vcmpgtub(a, b); |
| 742 | } |
| 743 | |
| 744 | /* vec_vcmpgtsh */ |
| 745 | |
| 746 | static vector /*bool*/ short __attribute__((__always_inline__)) |
| 747 | vec_vcmpgtsh(vector short a, vector short b) |
| 748 | { |
| 749 | return __builtin_altivec_vcmpgtsh(a, b); |
| 750 | } |
| 751 | |
| 752 | /* vec_vcmpgtuh */ |
| 753 | |
| 754 | static vector /*bool*/ short __attribute__((__always_inline__)) |
| 755 | vec_vcmpgtuh(vector unsigned short a, vector unsigned short b) |
| 756 | { |
| 757 | return __builtin_altivec_vcmpgtuh(a, b); |
| 758 | } |
| 759 | |
| 760 | /* vec_vcmpgtsw */ |
| 761 | |
| 762 | static vector /*bool*/ int __attribute__((__always_inline__)) |
| 763 | vec_vcmpgtsw(vector int a, vector int b) |
| 764 | { |
| 765 | return __builtin_altivec_vcmpgtsw(a, b); |
| 766 | } |
| 767 | |
| 768 | /* vec_vcmpgtuw */ |
| 769 | |
| 770 | static vector /*bool*/ int __attribute__((__always_inline__)) |
| 771 | vec_vcmpgtuw(vector unsigned int a, vector unsigned int b) |
| 772 | { |
| 773 | return __builtin_altivec_vcmpgtuw(a, b); |
| 774 | } |
| 775 | |
| 776 | /* vec_vcmpgtfp */ |
| 777 | |
| 778 | static vector /*bool*/ int __attribute__((__always_inline__)) |
| 779 | vec_vcmpgtfp(vector float a, vector float b) |
| 780 | { |
| 781 | return __builtin_altivec_vcmpgtfp(a, b); |
| 782 | } |
| 783 | |
| 784 | /* vec_cmple */ |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 785 | |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 786 | static vector /*bool*/ int __attribute__((__always_inline__)) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 787 | vec_cmple(vector float a, vector float b) |
| 788 | { |
| 789 | return __builtin_altivec_vcmpgefp(b, a); |
| 790 | } |
| 791 | |
| 792 | /* vec_cmplt */ |
| 793 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 794 | static vector /*bool*/ char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 795 | vec_cmplt(vector signed char a, vector signed char b) |
| 796 | { |
| 797 | return __builtin_altivec_vcmpgtsb(b, a); |
| 798 | } |
| 799 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 800 | static vector /*bool*/ char __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 801 | vec_cmplt(vector unsigned char a, vector unsigned char b) |
| 802 | { |
| 803 | return __builtin_altivec_vcmpgtub(b, a); |
| 804 | } |
| 805 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 806 | static vector /*bool*/ short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 807 | vec_cmplt(vector short a, vector short b) |
| 808 | { |
| 809 | return __builtin_altivec_vcmpgtsh(b, a); |
| 810 | } |
| 811 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 812 | static vector /*bool*/ short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 813 | vec_cmplt(vector unsigned short a, vector unsigned short b) |
| 814 | { |
| 815 | return __builtin_altivec_vcmpgtuh(b, a); |
| 816 | } |
| 817 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 818 | static vector /*bool*/ int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 819 | vec_cmplt(vector int a, vector int b) |
| 820 | { |
| 821 | return __builtin_altivec_vcmpgtsw(b, a); |
| 822 | } |
| 823 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 824 | static vector /*bool*/ int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 825 | vec_cmplt(vector unsigned int a, vector unsigned int b) |
| 826 | { |
| 827 | return __builtin_altivec_vcmpgtuw(b, a); |
| 828 | } |
| 829 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 830 | static vector /*bool*/ int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 831 | vec_cmplt(vector float a, vector float b) |
| 832 | { |
| 833 | return __builtin_altivec_vcmpgtfp(b, a); |
| 834 | } |
| 835 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 836 | /* vec_ctf */ |
| 837 | |
| 838 | static vector float __ATTRS_o_ai |
| 839 | vec_ctf(vector int a, int b) |
| 840 | { |
| 841 | return __builtin_altivec_vcfsx(a, b); |
| 842 | } |
| 843 | |
| 844 | static vector float __ATTRS_o_ai |
| 845 | vec_ctf(vector unsigned int a, int b) |
| 846 | { |
| 847 | return __builtin_altivec_vcfux((vector int)a, b); |
| 848 | } |
| 849 | |
| 850 | /* vec_vcfsx */ |
| 851 | |
| 852 | static vector float __attribute__((__always_inline__)) |
| 853 | vec_vcfsx(vector int a, int b) |
| 854 | { |
| 855 | return __builtin_altivec_vcfsx(a, b); |
| 856 | } |
| 857 | |
| 858 | /* vec_vcfux */ |
| 859 | |
| 860 | static vector float __attribute__((__always_inline__)) |
| 861 | vec_vcfux(vector unsigned int a, int b) |
| 862 | { |
| 863 | return __builtin_altivec_vcfux((vector int)a, b); |
| 864 | } |
| 865 | |
| 866 | /* vec_cts */ |
| 867 | |
| 868 | static vector int __attribute__((__always_inline__)) |
| 869 | vec_cts(vector float a, int b) |
| 870 | { |
| 871 | return __builtin_altivec_vctsxs(a, b); |
| 872 | } |
| 873 | |
| 874 | /* vec_vctsxs */ |
| 875 | |
| 876 | static vector int __attribute__((__always_inline__)) |
| 877 | vec_vctsxs(vector float a, int b) |
| 878 | { |
| 879 | return __builtin_altivec_vctsxs(a, b); |
| 880 | } |
| 881 | |
| 882 | /* vec_ctu */ |
| 883 | |
| 884 | static vector unsigned int __attribute__((__always_inline__)) |
| 885 | vec_ctu(vector float a, int b) |
| 886 | { |
| 887 | return __builtin_altivec_vctuxs(a, b); |
| 888 | } |
| 889 | |
| 890 | /* vec_vctuxs */ |
| 891 | |
| 892 | static vector unsigned int __attribute__((__always_inline__)) |
| 893 | vec_vctuxs(vector float a, int b) |
| 894 | { |
| 895 | return __builtin_altivec_vctuxs(a, b); |
| 896 | } |
| 897 | |
| 898 | /* vec_dss */ |
| 899 | |
| 900 | static void __attribute__((__always_inline__)) |
| 901 | vec_dss(int a) |
| 902 | { |
| 903 | __builtin_altivec_dss(a); |
| 904 | } |
| 905 | |
| 906 | /* vec_dssall */ |
| 907 | |
| 908 | static void __attribute__((__always_inline__)) |
| 909 | vec_dssall(void) |
| 910 | { |
| 911 | __builtin_altivec_dssall(); |
| 912 | } |
| 913 | |
| 914 | /* vec_dst */ |
| 915 | |
| 916 | static void __attribute__((__always_inline__)) |
| 917 | vec_dst(void *a, int b, int c) |
| 918 | { |
| 919 | __builtin_altivec_dst(a, b, c); |
| 920 | } |
| 921 | |
| 922 | /* vec_dstst */ |
| 923 | |
| 924 | static void __attribute__((__always_inline__)) |
| 925 | vec_dstst(void *a, int b, int c) |
| 926 | { |
| 927 | __builtin_altivec_dstst(a, b, c); |
| 928 | } |
| 929 | |
| 930 | /* vec_dststt */ |
| 931 | |
| 932 | static void __attribute__((__always_inline__)) |
| 933 | vec_dststt(void *a, int b, int c) |
| 934 | { |
| 935 | __builtin_altivec_dststt(a, b, c); |
| 936 | } |
| 937 | |
| 938 | /* vec_dstt */ |
| 939 | |
| 940 | static void __attribute__((__always_inline__)) |
| 941 | vec_dstt(void *a, int b, int c) |
| 942 | { |
| 943 | __builtin_altivec_dstt(a, b, c); |
| 944 | } |
| 945 | |
| 946 | /* vec_expte */ |
| 947 | |
| 948 | static vector float __attribute__((__always_inline__)) |
| 949 | vec_expte(vector float a) |
| 950 | { |
| 951 | return __builtin_altivec_vexptefp(a); |
| 952 | } |
| 953 | |
| 954 | /* vec_vexptefp */ |
| 955 | |
| 956 | static vector float __attribute__((__always_inline__)) |
| 957 | vec_vexptefp(vector float a) |
| 958 | { |
| 959 | return __builtin_altivec_vexptefp(a); |
| 960 | } |
| 961 | |
| 962 | /* vec_floor */ |
| 963 | |
| 964 | static vector float __attribute__((__always_inline__)) |
| 965 | vec_floor(vector float a) |
| 966 | { |
| 967 | return __builtin_altivec_vrfim(a); |
| 968 | } |
| 969 | |
| 970 | /* vec_vrfim */ |
| 971 | |
| 972 | static vector float __attribute__((__always_inline__)) |
| 973 | vec_vrfim(vector float a) |
| 974 | { |
| 975 | return __builtin_altivec_vrfim(a); |
| 976 | } |
| 977 | |
| 978 | /* vec_ld */ |
| 979 | |
| 980 | static vector signed char __ATTRS_o_ai |
| 981 | vec_ld(int a, vector signed char *b) |
| 982 | { |
| 983 | return (vector signed char)__builtin_altivec_lvx(a, b); |
| 984 | } |
| 985 | |
| 986 | static vector signed char __ATTRS_o_ai |
| 987 | vec_ld(int a, signed char *b) |
| 988 | { |
| 989 | return (vector signed char)__builtin_altivec_lvx(a, b); |
| 990 | } |
| 991 | |
| 992 | static vector unsigned char __ATTRS_o_ai |
| 993 | vec_ld(int a, vector unsigned char *b) |
| 994 | { |
| 995 | return (vector unsigned char)__builtin_altivec_lvx(a, b); |
| 996 | } |
| 997 | |
| 998 | static vector unsigned char __ATTRS_o_ai |
| 999 | vec_ld(int a, unsigned char *b) |
| 1000 | { |
| 1001 | return (vector unsigned char)__builtin_altivec_lvx(a, b); |
| 1002 | } |
| 1003 | |
| 1004 | static vector short __ATTRS_o_ai |
| 1005 | vec_ld(int a, vector short *b) |
| 1006 | { |
| 1007 | return (vector short)__builtin_altivec_lvx(a, b); |
| 1008 | } |
| 1009 | |
| 1010 | static vector short __ATTRS_o_ai |
| 1011 | vec_ld(int a, short *b) |
| 1012 | { |
| 1013 | return (vector short)__builtin_altivec_lvx(a, b); |
| 1014 | } |
| 1015 | |
| 1016 | static vector unsigned short __ATTRS_o_ai |
| 1017 | vec_ld(int a, vector unsigned short *b) |
| 1018 | { |
| 1019 | return (vector unsigned short)__builtin_altivec_lvx(a, b); |
| 1020 | } |
| 1021 | |
| 1022 | static vector unsigned short __ATTRS_o_ai |
| 1023 | vec_ld(int a, unsigned short *b) |
| 1024 | { |
| 1025 | return (vector unsigned short)__builtin_altivec_lvx(a, b); |
| 1026 | } |
| 1027 | |
| 1028 | static vector int __ATTRS_o_ai |
| 1029 | vec_ld(int a, vector int *b) |
| 1030 | { |
| 1031 | return (vector int)__builtin_altivec_lvx(a, b); |
| 1032 | } |
| 1033 | |
| 1034 | static vector int __ATTRS_o_ai |
| 1035 | vec_ld(int a, int *b) |
| 1036 | { |
| 1037 | return (vector int)__builtin_altivec_lvx(a, b); |
| 1038 | } |
| 1039 | |
| 1040 | static vector unsigned int __ATTRS_o_ai |
| 1041 | vec_ld(int a, vector unsigned int *b) |
| 1042 | { |
| 1043 | return (vector unsigned int)__builtin_altivec_lvx(a, b); |
| 1044 | } |
| 1045 | |
| 1046 | static vector unsigned int __ATTRS_o_ai |
| 1047 | vec_ld(int a, unsigned int *b) |
| 1048 | { |
| 1049 | return (vector unsigned int)__builtin_altivec_lvx(a, b); |
| 1050 | } |
| 1051 | |
| 1052 | static vector float __ATTRS_o_ai |
| 1053 | vec_ld(int a, vector float *b) |
| 1054 | { |
| 1055 | return (vector float)__builtin_altivec_lvx(a, b); |
| 1056 | } |
| 1057 | |
| 1058 | static vector float __ATTRS_o_ai |
| 1059 | vec_ld(int a, float *b) |
| 1060 | { |
| 1061 | return (vector float)__builtin_altivec_lvx(a, b); |
| 1062 | } |
| 1063 | |
| 1064 | /* vec_lvx */ |
| 1065 | |
| 1066 | static vector signed char __ATTRS_o_ai |
| 1067 | vec_lvx(int a, vector signed char *b) |
| 1068 | { |
| 1069 | return (vector signed char)__builtin_altivec_lvx(a, b); |
| 1070 | } |
| 1071 | |
| 1072 | static vector signed char __ATTRS_o_ai |
| 1073 | vec_lvx(int a, signed char *b) |
| 1074 | { |
| 1075 | return (vector signed char)__builtin_altivec_lvx(a, b); |
| 1076 | } |
| 1077 | |
| 1078 | static vector unsigned char __ATTRS_o_ai |
| 1079 | vec_lvx(int a, vector unsigned char *b) |
| 1080 | { |
| 1081 | return (vector unsigned char)__builtin_altivec_lvx(a, b); |
| 1082 | } |
| 1083 | |
| 1084 | static vector unsigned char __ATTRS_o_ai |
| 1085 | vec_lvx(int a, unsigned char *b) |
| 1086 | { |
| 1087 | return (vector unsigned char)__builtin_altivec_lvx(a, b); |
| 1088 | } |
| 1089 | |
| 1090 | static vector short __ATTRS_o_ai |
| 1091 | vec_lvx(int a, vector short *b) |
| 1092 | { |
| 1093 | return (vector short)__builtin_altivec_lvx(a, b); |
| 1094 | } |
| 1095 | |
| 1096 | static vector short __ATTRS_o_ai |
| 1097 | vec_lvx(int a, short *b) |
| 1098 | { |
| 1099 | return (vector short)__builtin_altivec_lvx(a, b); |
| 1100 | } |
| 1101 | |
| 1102 | static vector unsigned short __ATTRS_o_ai |
| 1103 | vec_lvx(int a, vector unsigned short *b) |
| 1104 | { |
| 1105 | return (vector unsigned short)__builtin_altivec_lvx(a, b); |
| 1106 | } |
| 1107 | |
| 1108 | static vector unsigned short __ATTRS_o_ai |
| 1109 | vec_lvx(int a, unsigned short *b) |
| 1110 | { |
| 1111 | return (vector unsigned short)__builtin_altivec_lvx(a, b); |
| 1112 | } |
| 1113 | |
| 1114 | static vector int __ATTRS_o_ai |
| 1115 | vec_lvx(int a, vector int *b) |
| 1116 | { |
| 1117 | return (vector int)__builtin_altivec_lvx(a, b); |
| 1118 | } |
| 1119 | |
| 1120 | static vector int __ATTRS_o_ai |
| 1121 | vec_lvx(int a, int *b) |
| 1122 | { |
| 1123 | return (vector int)__builtin_altivec_lvx(a, b); |
| 1124 | } |
| 1125 | |
| 1126 | static vector unsigned int __ATTRS_o_ai |
| 1127 | vec_lvx(int a, vector unsigned int *b) |
| 1128 | { |
| 1129 | return (vector unsigned int)__builtin_altivec_lvx(a, b); |
| 1130 | } |
| 1131 | |
| 1132 | static vector unsigned int __ATTRS_o_ai |
| 1133 | vec_lvx(int a, unsigned int *b) |
| 1134 | { |
| 1135 | return (vector unsigned int)__builtin_altivec_lvx(a, b); |
| 1136 | } |
| 1137 | |
| 1138 | static vector float __ATTRS_o_ai |
| 1139 | vec_lvx(int a, vector float *b) |
| 1140 | { |
| 1141 | return (vector float)__builtin_altivec_lvx(a, b); |
| 1142 | } |
| 1143 | |
| 1144 | static vector float __ATTRS_o_ai |
| 1145 | vec_lvx(int a, float *b) |
| 1146 | { |
| 1147 | return (vector float)__builtin_altivec_lvx(a, b); |
| 1148 | } |
| 1149 | |
| 1150 | /* vec_lde */ |
| 1151 | |
| 1152 | static vector signed char __ATTRS_o_ai |
| 1153 | vec_lde(int a, vector signed char *b) |
| 1154 | { |
| 1155 | return (vector signed char)__builtin_altivec_lvebx(a, b); |
| 1156 | } |
| 1157 | |
| 1158 | static vector unsigned char __ATTRS_o_ai |
| 1159 | vec_lde(int a, vector unsigned char *b) |
| 1160 | { |
| 1161 | return (vector unsigned char)__builtin_altivec_lvebx(a, b); |
| 1162 | } |
| 1163 | |
| 1164 | static vector short __ATTRS_o_ai |
| 1165 | vec_lde(int a, vector short *b) |
| 1166 | { |
| 1167 | return (vector short)__builtin_altivec_lvehx(a, b); |
| 1168 | } |
| 1169 | |
| 1170 | static vector unsigned short __ATTRS_o_ai |
| 1171 | vec_lde(int a, vector unsigned short *b) |
| 1172 | { |
| 1173 | return (vector unsigned short)__builtin_altivec_lvehx(a, b); |
| 1174 | } |
| 1175 | |
| 1176 | static vector int __ATTRS_o_ai |
| 1177 | vec_lde(int a, vector int *b) |
| 1178 | { |
| 1179 | return (vector int)__builtin_altivec_lvewx(a, b); |
| 1180 | } |
| 1181 | |
| 1182 | static vector unsigned int __ATTRS_o_ai |
| 1183 | vec_lde(int a, vector unsigned int *b) |
| 1184 | { |
| 1185 | return (vector unsigned int)__builtin_altivec_lvewx(a, b); |
| 1186 | } |
| 1187 | |
| 1188 | static vector float __ATTRS_o_ai |
| 1189 | vec_lde(int a, vector float *b) |
| 1190 | { |
| 1191 | return (vector float)__builtin_altivec_lvewx(a, b); |
| 1192 | } |
| 1193 | |
| 1194 | /* vec_lvebx */ |
| 1195 | |
| 1196 | static vector signed char __ATTRS_o_ai |
| 1197 | vec_lvebx(int a, vector signed char *b) |
| 1198 | { |
| 1199 | return (vector signed char)__builtin_altivec_lvebx(a, b); |
| 1200 | } |
| 1201 | |
| 1202 | static vector unsigned char __ATTRS_o_ai |
| 1203 | vec_lvebx(int a, vector unsigned char *b) |
| 1204 | { |
| 1205 | return (vector unsigned char)__builtin_altivec_lvebx(a, b); |
| 1206 | } |
| 1207 | |
| 1208 | /* vec_lvehx */ |
| 1209 | |
| 1210 | static vector short __ATTRS_o_ai |
| 1211 | vec_lvehx(int a, vector short *b) |
| 1212 | { |
| 1213 | return (vector short)__builtin_altivec_lvehx(a, b); |
| 1214 | } |
| 1215 | |
| 1216 | static vector unsigned short __ATTRS_o_ai |
| 1217 | vec_lvehx(int a, vector unsigned short *b) |
| 1218 | { |
| 1219 | return (vector unsigned short)__builtin_altivec_lvehx(a, b); |
| 1220 | } |
| 1221 | |
| 1222 | /* vec_lvewx */ |
| 1223 | |
| 1224 | static vector int __ATTRS_o_ai |
| 1225 | vec_lvewx(int a, vector int *b) |
| 1226 | { |
| 1227 | return (vector int)__builtin_altivec_lvewx(a, b); |
| 1228 | } |
| 1229 | |
| 1230 | static vector unsigned int __ATTRS_o_ai |
| 1231 | vec_lvewx(int a, vector unsigned int *b) |
| 1232 | { |
| 1233 | return (vector unsigned int)__builtin_altivec_lvewx(a, b); |
| 1234 | } |
| 1235 | |
| 1236 | static vector float __ATTRS_o_ai |
| 1237 | vec_lvewx(int a, vector float *b) |
| 1238 | { |
| 1239 | return (vector float)__builtin_altivec_lvewx(a, b); |
| 1240 | } |
| 1241 | |
| 1242 | /* vec_ldl */ |
| 1243 | |
| 1244 | static vector signed char __ATTRS_o_ai |
| 1245 | vec_ldl(int a, vector signed char *b) |
| 1246 | { |
| 1247 | return (vector signed char)__builtin_altivec_lvxl(a, b); |
| 1248 | } |
| 1249 | |
| 1250 | static vector signed char __ATTRS_o_ai |
| 1251 | vec_ldl(int a, signed char *b) |
| 1252 | { |
| 1253 | return (vector signed char)__builtin_altivec_lvxl(a, b); |
| 1254 | } |
| 1255 | |
| 1256 | static vector unsigned char __ATTRS_o_ai |
| 1257 | vec_ldl(int a, vector unsigned char *b) |
| 1258 | { |
| 1259 | return (vector unsigned char)__builtin_altivec_lvxl(a, b); |
| 1260 | } |
| 1261 | |
| 1262 | static vector unsigned char __ATTRS_o_ai |
| 1263 | vec_ldl(int a, unsigned char *b) |
| 1264 | { |
| 1265 | return (vector unsigned char)__builtin_altivec_lvxl(a, b); |
| 1266 | } |
| 1267 | |
| 1268 | static vector short __ATTRS_o_ai |
| 1269 | vec_ldl(int a, vector short *b) |
| 1270 | { |
| 1271 | return (vector short)__builtin_altivec_lvxl(a, b); |
| 1272 | } |
| 1273 | |
| 1274 | static vector short __ATTRS_o_ai |
| 1275 | vec_ldl(int a, short *b) |
| 1276 | { |
| 1277 | return (vector short)__builtin_altivec_lvxl(a, b); |
| 1278 | } |
| 1279 | |
| 1280 | static vector unsigned short __ATTRS_o_ai |
| 1281 | vec_ldl(int a, vector unsigned short *b) |
| 1282 | { |
| 1283 | return (vector unsigned short)__builtin_altivec_lvxl(a, b); |
| 1284 | } |
| 1285 | |
| 1286 | static vector unsigned short __ATTRS_o_ai |
| 1287 | vec_ldl(int a, unsigned short *b) |
| 1288 | { |
| 1289 | return (vector unsigned short)__builtin_altivec_lvxl(a, b); |
| 1290 | } |
| 1291 | |
| 1292 | static vector int __ATTRS_o_ai |
| 1293 | vec_ldl(int a, vector int *b) |
| 1294 | { |
| 1295 | return (vector int)__builtin_altivec_lvxl(a, b); |
| 1296 | } |
| 1297 | |
| 1298 | static vector int __ATTRS_o_ai |
| 1299 | vec_ldl(int a, int *b) |
| 1300 | { |
| 1301 | return (vector int)__builtin_altivec_lvxl(a, b); |
| 1302 | } |
| 1303 | |
| 1304 | static vector unsigned int __ATTRS_o_ai |
| 1305 | vec_ldl(int a, vector unsigned int *b) |
| 1306 | { |
| 1307 | return (vector unsigned int)__builtin_altivec_lvxl(a, b); |
| 1308 | } |
| 1309 | |
| 1310 | static vector unsigned int __ATTRS_o_ai |
| 1311 | vec_ldl(int a, unsigned int *b) |
| 1312 | { |
| 1313 | return (vector unsigned int)__builtin_altivec_lvxl(a, b); |
| 1314 | } |
| 1315 | |
| 1316 | static vector float __ATTRS_o_ai |
| 1317 | vec_ldl(int a, vector float *b) |
| 1318 | { |
| 1319 | return (vector float)__builtin_altivec_lvxl(a, b); |
| 1320 | } |
| 1321 | |
| 1322 | static vector float __ATTRS_o_ai |
| 1323 | vec_ldl(int a, float *b) |
| 1324 | { |
| 1325 | return (vector float)__builtin_altivec_lvxl(a, b); |
| 1326 | } |
| 1327 | |
| 1328 | /* vec_lvxl */ |
| 1329 | |
| 1330 | static vector signed char __ATTRS_o_ai |
| 1331 | vec_lvxl(int a, vector signed char *b) |
| 1332 | { |
| 1333 | return (vector signed char)__builtin_altivec_lvxl(a, b); |
| 1334 | } |
| 1335 | |
| 1336 | static vector signed char __ATTRS_o_ai |
| 1337 | vec_lvxl(int a, signed char *b) |
| 1338 | { |
| 1339 | return (vector signed char)__builtin_altivec_lvxl(a, b); |
| 1340 | } |
| 1341 | |
| 1342 | static vector unsigned char __ATTRS_o_ai |
| 1343 | vec_lvxl(int a, vector unsigned char *b) |
| 1344 | { |
| 1345 | return (vector unsigned char)__builtin_altivec_lvxl(a, b); |
| 1346 | } |
| 1347 | |
| 1348 | static vector unsigned char __ATTRS_o_ai |
| 1349 | vec_lvxl(int a, unsigned char *b) |
| 1350 | { |
| 1351 | return (vector unsigned char)__builtin_altivec_lvxl(a, b); |
| 1352 | } |
| 1353 | |
| 1354 | static vector short __ATTRS_o_ai |
| 1355 | vec_lvxl(int a, vector short *b) |
| 1356 | { |
| 1357 | return (vector short)__builtin_altivec_lvxl(a, b); |
| 1358 | } |
| 1359 | |
| 1360 | static vector short __ATTRS_o_ai |
| 1361 | vec_lvxl(int a, short *b) |
| 1362 | { |
| 1363 | return (vector short)__builtin_altivec_lvxl(a, b); |
| 1364 | } |
| 1365 | |
| 1366 | static vector unsigned short __ATTRS_o_ai |
| 1367 | vec_lvxl(int a, vector unsigned short *b) |
| 1368 | { |
| 1369 | return (vector unsigned short)__builtin_altivec_lvxl(a, b); |
| 1370 | } |
| 1371 | |
| 1372 | static vector unsigned short __ATTRS_o_ai |
| 1373 | vec_lvxl(int a, unsigned short *b) |
| 1374 | { |
| 1375 | return (vector unsigned short)__builtin_altivec_lvxl(a, b); |
| 1376 | } |
| 1377 | |
| 1378 | static vector int __ATTRS_o_ai |
| 1379 | vec_lvxl(int a, vector int *b) |
| 1380 | { |
| 1381 | return (vector int)__builtin_altivec_lvxl(a, b); |
| 1382 | } |
| 1383 | |
| 1384 | static vector int __ATTRS_o_ai |
| 1385 | vec_lvxl(int a, int *b) |
| 1386 | { |
| 1387 | return (vector int)__builtin_altivec_lvxl(a, b); |
| 1388 | } |
| 1389 | |
| 1390 | static vector unsigned int __ATTRS_o_ai |
| 1391 | vec_lvxl(int a, vector unsigned int *b) |
| 1392 | { |
| 1393 | return (vector unsigned int)__builtin_altivec_lvxl(a, b); |
| 1394 | } |
| 1395 | |
| 1396 | static vector unsigned int __ATTRS_o_ai |
| 1397 | vec_lvxl(int a, unsigned int *b) |
| 1398 | { |
| 1399 | return (vector unsigned int)__builtin_altivec_lvxl(a, b); |
| 1400 | } |
| 1401 | |
| 1402 | static vector float __ATTRS_o_ai |
| 1403 | vec_lvxl(int a, vector float *b) |
| 1404 | { |
| 1405 | return (vector float)__builtin_altivec_lvxl(a, b); |
| 1406 | } |
| 1407 | |
| 1408 | static vector float __ATTRS_o_ai |
| 1409 | vec_lvxl(int a, float *b) |
| 1410 | { |
| 1411 | return (vector float)__builtin_altivec_lvxl(a, b); |
| 1412 | } |
| 1413 | |
| 1414 | /* vec_loge */ |
| 1415 | |
| 1416 | static vector float __attribute__((__always_inline__)) |
| 1417 | vec_loge(vector float a) |
| 1418 | { |
| 1419 | return __builtin_altivec_vlogefp(a); |
| 1420 | } |
| 1421 | |
| 1422 | /* vec_vlogefp */ |
| 1423 | |
| 1424 | static vector float __attribute__((__always_inline__)) |
| 1425 | vec_vlogefp(vector float a) |
| 1426 | { |
| 1427 | return __builtin_altivec_vlogefp(a); |
| 1428 | } |
| 1429 | |
| 1430 | /* vec_lvsl */ |
| 1431 | |
| 1432 | static vector unsigned char __ATTRS_o_ai |
| 1433 | vec_lvsl(int a, signed char *b) |
| 1434 | { |
| 1435 | return (vector unsigned char)__builtin_altivec_lvsl(a, b); |
| 1436 | } |
| 1437 | |
| 1438 | static vector unsigned char __ATTRS_o_ai |
| 1439 | vec_lvsl(int a, unsigned char *b) |
| 1440 | { |
| 1441 | return (vector unsigned char)__builtin_altivec_lvsl(a, b); |
| 1442 | } |
| 1443 | |
| 1444 | static vector unsigned char __ATTRS_o_ai |
| 1445 | vec_lvsl(int a, short *b) |
| 1446 | { |
| 1447 | return (vector unsigned char)__builtin_altivec_lvsl(a, b); |
| 1448 | } |
| 1449 | |
| 1450 | static vector unsigned char __ATTRS_o_ai |
| 1451 | vec_lvsl(int a, unsigned short *b) |
| 1452 | { |
| 1453 | return (vector unsigned char)__builtin_altivec_lvsl(a, b); |
| 1454 | } |
| 1455 | |
| 1456 | static vector unsigned char __ATTRS_o_ai |
| 1457 | vec_lvsl(int a, int *b) |
| 1458 | { |
| 1459 | return (vector unsigned char)__builtin_altivec_lvsl(a, b); |
| 1460 | } |
| 1461 | |
| 1462 | static vector unsigned char __ATTRS_o_ai |
| 1463 | vec_lvsl(int a, unsigned int *b) |
| 1464 | { |
| 1465 | return (vector unsigned char)__builtin_altivec_lvsl(a, b); |
| 1466 | } |
| 1467 | |
| 1468 | static vector unsigned char __ATTRS_o_ai |
| 1469 | vec_lvsl(int a, float *b) |
| 1470 | { |
| 1471 | return (vector unsigned char)__builtin_altivec_lvsl(a, b); |
| 1472 | } |
| 1473 | |
| 1474 | /* vec_lvsr */ |
| 1475 | |
| 1476 | static vector unsigned char __ATTRS_o_ai |
| 1477 | vec_lvsr(int a, signed char *b) |
| 1478 | { |
| 1479 | return (vector unsigned char)__builtin_altivec_lvsr(a, b); |
| 1480 | } |
| 1481 | |
| 1482 | static vector unsigned char __ATTRS_o_ai |
| 1483 | vec_lvsr(int a, unsigned char *b) |
| 1484 | { |
| 1485 | return (vector unsigned char)__builtin_altivec_lvsr(a, b); |
| 1486 | } |
| 1487 | |
| 1488 | static vector unsigned char __ATTRS_o_ai |
| 1489 | vec_lvsr(int a, short *b) |
| 1490 | { |
| 1491 | return (vector unsigned char)__builtin_altivec_lvsr(a, b); |
| 1492 | } |
| 1493 | |
| 1494 | static vector unsigned char __ATTRS_o_ai |
| 1495 | vec_lvsr(int a, unsigned short *b) |
| 1496 | { |
| 1497 | return (vector unsigned char)__builtin_altivec_lvsr(a, b); |
| 1498 | } |
| 1499 | |
| 1500 | static vector unsigned char __ATTRS_o_ai |
| 1501 | vec_lvsr(int a, int *b) |
| 1502 | { |
| 1503 | return (vector unsigned char)__builtin_altivec_lvsr(a, b); |
| 1504 | } |
| 1505 | |
| 1506 | static vector unsigned char __ATTRS_o_ai |
| 1507 | vec_lvsr(int a, unsigned int *b) |
| 1508 | { |
| 1509 | return (vector unsigned char)__builtin_altivec_lvsr(a, b); |
| 1510 | } |
| 1511 | |
| 1512 | static vector unsigned char __ATTRS_o_ai |
| 1513 | vec_lvsr(int a, float *b) |
| 1514 | { |
| 1515 | return (vector unsigned char)__builtin_altivec_lvsr(a, b); |
| 1516 | } |
| 1517 | |
| 1518 | /* vec_madd */ |
| 1519 | |
| 1520 | static vector float __attribute__((__always_inline__)) |
| 1521 | vec_madd(vector float a, vector float b, vector float c) |
| 1522 | { |
| 1523 | return __builtin_altivec_vmaddfp(a, b, c); |
| 1524 | } |
| 1525 | |
| 1526 | /* vec_vmaddfp */ |
| 1527 | |
| 1528 | static vector float __attribute__((__always_inline__)) |
| 1529 | vec_vmaddfp(vector float a, vector float b, vector float c) |
| 1530 | { |
| 1531 | return __builtin_altivec_vmaddfp(a, b, c); |
| 1532 | } |
| 1533 | |
| 1534 | /* vec_madds */ |
| 1535 | |
| 1536 | static vector signed short __attribute__((__always_inline__)) |
| 1537 | vec_madds(vector signed short a, vector signed short b, vector signed short c) |
| 1538 | { |
| 1539 | return __builtin_altivec_vmhaddshs(a, b, c); |
| 1540 | } |
| 1541 | |
| 1542 | /* vec_vmhaddshs */ |
| 1543 | static vector signed short __attribute__((__always_inline__)) |
| 1544 | vec_vmhaddshs(vector signed short a, vector signed short b, vector signed short c) |
| 1545 | { |
| 1546 | return __builtin_altivec_vmhaddshs(a, b, c); |
| 1547 | } |
| 1548 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1549 | /* vec_max */ |
| 1550 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1551 | static vector signed char __ATTRS_o_ai |
Anton Yartsev | a816ec8 | 2010-08-12 18:51:55 +0000 | [diff] [blame] | 1552 | vec_max(vector signed char a, vector signed char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1553 | { |
| 1554 | return __builtin_altivec_vmaxsb(a, b); |
| 1555 | } |
| 1556 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1557 | static vector unsigned char __ATTRS_o_ai |
Anton Yartsev | a816ec8 | 2010-08-12 18:51:55 +0000 | [diff] [blame] | 1558 | vec_max(vector unsigned char a, vector unsigned char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1559 | { |
| 1560 | return __builtin_altivec_vmaxub(a, b); |
| 1561 | } |
| 1562 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1563 | static vector short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1564 | vec_max(vector short a, vector short b) |
| 1565 | { |
| 1566 | return __builtin_altivec_vmaxsh(a, b); |
| 1567 | } |
| 1568 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1569 | static vector unsigned short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1570 | vec_max(vector unsigned short a, vector unsigned short b) |
| 1571 | { |
| 1572 | return __builtin_altivec_vmaxuh(a, b); |
| 1573 | } |
| 1574 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1575 | static vector int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1576 | vec_max(vector int a, vector int b) |
| 1577 | { |
| 1578 | return __builtin_altivec_vmaxsw(a, b); |
| 1579 | } |
| 1580 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1581 | static vector unsigned int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1582 | vec_max(vector unsigned int a, vector unsigned int b) |
| 1583 | { |
| 1584 | return __builtin_altivec_vmaxuw(a, b); |
| 1585 | } |
| 1586 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1587 | static vector float __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1588 | vec_max(vector float a, vector float b) |
| 1589 | { |
| 1590 | return __builtin_altivec_vmaxfp(a, b); |
| 1591 | } |
| 1592 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1593 | /* vec_vmaxsb */ |
| 1594 | |
| 1595 | static vector signed char __attribute__((__always_inline__)) |
Anton Yartsev | a816ec8 | 2010-08-12 18:51:55 +0000 | [diff] [blame] | 1596 | vec_vmaxsb(vector signed char a, vector signed char b) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1597 | { |
| 1598 | return __builtin_altivec_vmaxsb(a, b); |
| 1599 | } |
| 1600 | |
| 1601 | /* vec_vmaxub */ |
| 1602 | |
| 1603 | static vector unsigned char __attribute__((__always_inline__)) |
Anton Yartsev | a816ec8 | 2010-08-12 18:51:55 +0000 | [diff] [blame] | 1604 | vec_vmaxub(vector unsigned char a, vector unsigned char b) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1605 | { |
| 1606 | return __builtin_altivec_vmaxub(a, b); |
| 1607 | } |
| 1608 | |
| 1609 | /* vec_vmaxsh */ |
| 1610 | |
| 1611 | static vector short __attribute__((__always_inline__)) |
| 1612 | vec_vmaxsh(vector short a, vector short b) |
| 1613 | { |
| 1614 | return __builtin_altivec_vmaxsh(a, b); |
| 1615 | } |
| 1616 | |
| 1617 | /* vec_vmaxuh */ |
| 1618 | |
| 1619 | static vector unsigned short __attribute__((__always_inline__)) |
| 1620 | vec_vmaxuh(vector unsigned short a, vector unsigned short b) |
| 1621 | { |
| 1622 | return __builtin_altivec_vmaxuh(a, b); |
| 1623 | } |
| 1624 | |
| 1625 | /* vec_vmaxsw */ |
| 1626 | |
| 1627 | static vector int __attribute__((__always_inline__)) |
| 1628 | vec_vmaxsw(vector int a, vector int b) |
| 1629 | { |
| 1630 | return __builtin_altivec_vmaxsw(a, b); |
| 1631 | } |
| 1632 | |
| 1633 | /* vec_vmaxuw */ |
| 1634 | |
| 1635 | static vector unsigned int __attribute__((__always_inline__)) |
| 1636 | vec_vmaxuw(vector unsigned int a, vector unsigned int b) |
| 1637 | { |
| 1638 | return __builtin_altivec_vmaxuw(a, b); |
| 1639 | } |
| 1640 | |
| 1641 | /* vec_vmaxfp */ |
| 1642 | |
| 1643 | static vector float __attribute__((__always_inline__)) |
| 1644 | vec_vmaxfp(vector float a, vector float b) |
| 1645 | { |
| 1646 | return __builtin_altivec_vmaxfp(a, b); |
| 1647 | } |
| 1648 | |
| 1649 | /* vec_mergeh */ |
| 1650 | |
| 1651 | static vector signed char __ATTRS_o_ai |
| 1652 | vec_mergeh(vector signed char a, vector signed char b) |
| 1653 | { |
| 1654 | return vec_perm(a, b, (vector unsigned char) |
| 1655 | (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, |
| 1656 | 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17)); |
| 1657 | } |
| 1658 | |
| 1659 | static vector unsigned char __ATTRS_o_ai |
| 1660 | vec_mergeh(vector unsigned char a, vector unsigned char b) |
| 1661 | { |
| 1662 | return vec_perm(a, b, (vector unsigned char) |
| 1663 | (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, |
| 1664 | 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17)); |
| 1665 | } |
| 1666 | |
| 1667 | static vector short __ATTRS_o_ai |
| 1668 | vec_mergeh(vector short a, vector short b) |
| 1669 | { |
| 1670 | return vec_perm(a, b, (vector unsigned char) |
| 1671 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 1672 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 1673 | } |
| 1674 | |
| 1675 | static vector unsigned short __ATTRS_o_ai |
| 1676 | vec_mergeh(vector unsigned short a, vector unsigned short b) |
| 1677 | { |
| 1678 | return vec_perm(a, b, (vector unsigned char) |
| 1679 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 1680 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 1681 | } |
| 1682 | |
| 1683 | static vector int __ATTRS_o_ai |
| 1684 | vec_mergeh(vector int a, vector int b) |
| 1685 | { |
| 1686 | return vec_perm(a, b, (vector unsigned char) |
| 1687 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 1688 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 1689 | } |
| 1690 | |
| 1691 | static vector unsigned int __ATTRS_o_ai |
| 1692 | vec_mergeh(vector unsigned int a, vector unsigned int b) |
| 1693 | { |
| 1694 | return vec_perm(a, b, (vector unsigned char) |
| 1695 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 1696 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 1697 | } |
| 1698 | |
| 1699 | static vector float __ATTRS_o_ai |
| 1700 | vec_mergeh(vector float a, vector float b) |
| 1701 | { |
| 1702 | return vec_perm(a, b, (vector unsigned char) |
| 1703 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 1704 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 1705 | } |
| 1706 | |
| 1707 | /* vec_vmrghb */ |
| 1708 | |
| 1709 | #define __builtin_altivec_vmrghb vec_vmrghb |
| 1710 | |
| 1711 | static vector signed char __ATTRS_o_ai |
| 1712 | vec_vmrghb(vector signed char a, vector signed char b) |
| 1713 | { |
| 1714 | return vec_perm(a, b, (vector unsigned char) |
| 1715 | (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, |
| 1716 | 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17)); |
| 1717 | } |
| 1718 | |
| 1719 | static vector unsigned char __ATTRS_o_ai |
| 1720 | vec_vmrghb(vector unsigned char a, vector unsigned char b) |
| 1721 | { |
| 1722 | return vec_perm(a, b, (vector unsigned char) |
| 1723 | (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, |
| 1724 | 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17)); |
| 1725 | } |
| 1726 | |
| 1727 | /* vec_vmrghh */ |
| 1728 | |
| 1729 | #define __builtin_altivec_vmrghh vec_vmrghh |
| 1730 | |
| 1731 | static vector short __ATTRS_o_ai |
| 1732 | vec_vmrghh(vector short a, vector short b) |
| 1733 | { |
| 1734 | return vec_perm(a, b, (vector unsigned char) |
| 1735 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 1736 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 1737 | } |
| 1738 | |
| 1739 | static vector unsigned short __ATTRS_o_ai |
| 1740 | vec_vmrghh(vector unsigned short a, vector unsigned short b) |
| 1741 | { |
| 1742 | return vec_perm(a, b, (vector unsigned char) |
| 1743 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 1744 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 1745 | } |
| 1746 | |
| 1747 | /* vec_vmrghw */ |
| 1748 | |
| 1749 | #define __builtin_altivec_vmrghw vec_vmrghw |
| 1750 | |
| 1751 | static vector int __ATTRS_o_ai |
| 1752 | vec_vmrghw(vector int a, vector int b) |
| 1753 | { |
| 1754 | return vec_perm(a, b, (vector unsigned char) |
| 1755 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 1756 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 1757 | } |
| 1758 | |
| 1759 | static vector unsigned int __ATTRS_o_ai |
| 1760 | vec_vmrghw(vector unsigned int a, vector unsigned int b) |
| 1761 | { |
| 1762 | return vec_perm(a, b, (vector unsigned char) |
| 1763 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 1764 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 1765 | } |
| 1766 | |
| 1767 | static vector float __ATTRS_o_ai |
| 1768 | vec_vmrghw(vector float a, vector float b) |
| 1769 | { |
| 1770 | return vec_perm(a, b, (vector unsigned char) |
| 1771 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 1772 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 1773 | } |
| 1774 | |
| 1775 | /* vec_mergel */ |
| 1776 | |
| 1777 | static vector signed char __ATTRS_o_ai |
| 1778 | vec_mergel(vector signed char a, vector signed char b) |
| 1779 | { |
| 1780 | return vec_perm(a, b, (vector unsigned char) |
| 1781 | (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, |
| 1782 | 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F)); |
| 1783 | } |
| 1784 | |
| 1785 | static vector unsigned char __ATTRS_o_ai |
| 1786 | vec_mergel(vector unsigned char a, vector unsigned char b) |
| 1787 | { |
| 1788 | return vec_perm(a, b, (vector unsigned char) |
| 1789 | (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, |
| 1790 | 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F)); |
| 1791 | } |
| 1792 | |
| 1793 | static vector short __ATTRS_o_ai |
| 1794 | vec_mergel(vector short a, vector short b) |
| 1795 | { |
| 1796 | return vec_perm(a, b, (vector unsigned char) |
| 1797 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 1798 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 1799 | } |
| 1800 | |
| 1801 | static vector unsigned short __ATTRS_o_ai |
| 1802 | vec_mergel(vector unsigned short a, vector unsigned short b) |
| 1803 | { |
| 1804 | return vec_perm(a, b, (vector unsigned char) |
| 1805 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 1806 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 1807 | } |
| 1808 | |
| 1809 | static vector int __ATTRS_o_ai |
| 1810 | vec_mergel(vector int a, vector int b) |
| 1811 | { |
| 1812 | return vec_perm(a, b, (vector unsigned char) |
| 1813 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 1814 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 1815 | } |
| 1816 | |
| 1817 | static vector unsigned int __ATTRS_o_ai |
| 1818 | vec_mergel(vector unsigned int a, vector unsigned int b) |
| 1819 | { |
| 1820 | return vec_perm(a, b, (vector unsigned char) |
| 1821 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 1822 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 1823 | } |
| 1824 | |
| 1825 | static vector float __ATTRS_o_ai |
| 1826 | vec_mergel(vector float a, vector float b) |
| 1827 | { |
| 1828 | return vec_perm(a, b, (vector unsigned char) |
| 1829 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 1830 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 1831 | } |
| 1832 | |
| 1833 | /* vec_vmrglb */ |
| 1834 | |
| 1835 | #define __builtin_altivec_vmrglb vec_vmrglb |
| 1836 | |
| 1837 | static vector signed char __ATTRS_o_ai |
| 1838 | vec_vmrglb(vector signed char a, vector signed char b) |
| 1839 | { |
| 1840 | return vec_perm(a, b, (vector unsigned char) |
| 1841 | (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, |
| 1842 | 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F)); |
| 1843 | } |
| 1844 | |
| 1845 | static vector unsigned char __ATTRS_o_ai |
| 1846 | vec_vmrglb(vector unsigned char a, vector unsigned char b) |
| 1847 | { |
| 1848 | return vec_perm(a, b, (vector unsigned char) |
| 1849 | (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, |
| 1850 | 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F)); |
| 1851 | } |
| 1852 | |
| 1853 | /* vec_vmrglh */ |
| 1854 | |
| 1855 | #define __builtin_altivec_vmrglh vec_vmrglh |
| 1856 | |
| 1857 | static vector short __ATTRS_o_ai |
| 1858 | vec_vmrglh(vector short a, vector short b) |
| 1859 | { |
| 1860 | return vec_perm(a, b, (vector unsigned char) |
| 1861 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 1862 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 1863 | } |
| 1864 | |
| 1865 | static vector unsigned short __ATTRS_o_ai |
| 1866 | vec_vmrglh(vector unsigned short a, vector unsigned short b) |
| 1867 | { |
| 1868 | return vec_perm(a, b, (vector unsigned char) |
| 1869 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 1870 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 1871 | } |
| 1872 | |
| 1873 | /* vec_vmrglw */ |
| 1874 | |
| 1875 | #define __builtin_altivec_vmrglw vec_vmrglw |
| 1876 | |
| 1877 | static vector int __ATTRS_o_ai |
| 1878 | vec_vmrglw(vector int a, vector int b) |
| 1879 | { |
| 1880 | return vec_perm(a, b, (vector unsigned char) |
| 1881 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 1882 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 1883 | } |
| 1884 | |
| 1885 | static vector unsigned int __ATTRS_o_ai |
| 1886 | vec_vmrglw(vector unsigned int a, vector unsigned int b) |
| 1887 | { |
| 1888 | return vec_perm(a, b, (vector unsigned char) |
| 1889 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 1890 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 1891 | } |
| 1892 | |
| 1893 | static vector float __ATTRS_o_ai |
| 1894 | vec_vmrglw(vector float a, vector float b) |
| 1895 | { |
| 1896 | return vec_perm(a, b, (vector unsigned char) |
| 1897 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 1898 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 1899 | } |
| 1900 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1901 | /* vec_mfvscr */ |
| 1902 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1903 | static vector unsigned short __attribute__((__always_inline__)) |
| 1904 | vec_mfvscr(void) |
| 1905 | { |
| 1906 | return __builtin_altivec_mfvscr(); |
| 1907 | } |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1908 | |
| 1909 | /* vec_min */ |
| 1910 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1911 | static vector signed char __ATTRS_o_ai |
Anton Yartsev | a816ec8 | 2010-08-12 18:51:55 +0000 | [diff] [blame] | 1912 | vec_min(vector signed char a, vector signed char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1913 | { |
| 1914 | return __builtin_altivec_vminsb(a, b); |
| 1915 | } |
| 1916 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1917 | static vector unsigned char __ATTRS_o_ai |
Anton Yartsev | a816ec8 | 2010-08-12 18:51:55 +0000 | [diff] [blame] | 1918 | vec_min(vector unsigned char a, vector unsigned char b) |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1919 | { |
| 1920 | return __builtin_altivec_vminub(a, b); |
| 1921 | } |
| 1922 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1923 | static vector short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1924 | vec_min(vector short a, vector short b) |
| 1925 | { |
| 1926 | return __builtin_altivec_vminsh(a, b); |
| 1927 | } |
| 1928 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1929 | static vector unsigned short __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1930 | vec_min(vector unsigned short a, vector unsigned short b) |
| 1931 | { |
| 1932 | return __builtin_altivec_vminuh(a, b); |
| 1933 | } |
| 1934 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1935 | static vector int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1936 | vec_min(vector int a, vector int b) |
| 1937 | { |
| 1938 | return __builtin_altivec_vminsw(a, b); |
| 1939 | } |
| 1940 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1941 | static vector unsigned int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1942 | vec_min(vector unsigned int a, vector unsigned int b) |
| 1943 | { |
| 1944 | return __builtin_altivec_vminuw(a, b); |
| 1945 | } |
| 1946 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1947 | static vector float __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 1948 | vec_min(vector float a, vector float b) |
| 1949 | { |
| 1950 | return __builtin_altivec_vminfp(a, b); |
| 1951 | } |
| 1952 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1953 | /* vec_vminsb */ |
| 1954 | |
| 1955 | static vector signed char __attribute__((__always_inline__)) |
Anton Yartsev | a816ec8 | 2010-08-12 18:51:55 +0000 | [diff] [blame] | 1956 | vec_vminsb(vector signed char a, vector signed char b) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1957 | { |
| 1958 | return __builtin_altivec_vminsb(a, b); |
| 1959 | } |
| 1960 | |
| 1961 | /* vec_vminub */ |
| 1962 | |
| 1963 | static vector unsigned char __attribute__((__always_inline__)) |
Anton Yartsev | a816ec8 | 2010-08-12 18:51:55 +0000 | [diff] [blame] | 1964 | vec_vminub(vector unsigned char a, vector unsigned char b) |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 1965 | { |
| 1966 | return __builtin_altivec_vminub(a, b); |
| 1967 | } |
| 1968 | |
| 1969 | /* vec_vminsh */ |
| 1970 | |
| 1971 | static vector short __attribute__((__always_inline__)) |
| 1972 | vec_vminsh(vector short a, vector short b) |
| 1973 | { |
| 1974 | return __builtin_altivec_vminsh(a, b); |
| 1975 | } |
| 1976 | |
| 1977 | /* vec_vminuh */ |
| 1978 | |
| 1979 | static vector unsigned short __attribute__((__always_inline__)) |
| 1980 | vec_vminuh(vector unsigned short a, vector unsigned short b) |
| 1981 | { |
| 1982 | return __builtin_altivec_vminuh(a, b); |
| 1983 | } |
| 1984 | |
| 1985 | /* vec_vminsw */ |
| 1986 | |
| 1987 | static vector int __attribute__((__always_inline__)) |
| 1988 | vec_vminsw(vector int a, vector int b) |
| 1989 | { |
| 1990 | return __builtin_altivec_vminsw(a, b); |
| 1991 | } |
| 1992 | |
| 1993 | /* vec_vminuw */ |
| 1994 | |
| 1995 | static vector unsigned int __attribute__((__always_inline__)) |
| 1996 | vec_vminuw(vector unsigned int a, vector unsigned int b) |
| 1997 | { |
| 1998 | return __builtin_altivec_vminuw(a, b); |
| 1999 | } |
| 2000 | |
| 2001 | /* vec_vminfp */ |
| 2002 | |
| 2003 | static vector float __attribute__((__always_inline__)) |
| 2004 | vec_vminfp(vector float a, vector float b) |
| 2005 | { |
| 2006 | return __builtin_altivec_vminfp(a, b); |
| 2007 | } |
| 2008 | |
| 2009 | /* vec_mladd */ |
| 2010 | |
| 2011 | #define __builtin_altivec_vmladduhm vec_mladd |
| 2012 | |
| 2013 | static vector short __ATTRS_o_ai |
| 2014 | vec_mladd(vector short a, vector short b, vector short c) |
| 2015 | { |
| 2016 | return a * b + c; |
| 2017 | } |
| 2018 | |
| 2019 | static vector short __ATTRS_o_ai |
| 2020 | vec_mladd(vector short a, vector unsigned short b, vector unsigned short c) |
| 2021 | { |
| 2022 | return a * (vector short)b + (vector short)c; |
| 2023 | } |
| 2024 | |
| 2025 | static vector short __ATTRS_o_ai |
| 2026 | vec_mladd(vector unsigned short a, vector short b, vector short c) |
| 2027 | { |
| 2028 | return (vector short)a * b + c; |
| 2029 | } |
| 2030 | |
| 2031 | static vector unsigned short __ATTRS_o_ai |
| 2032 | vec_mladd(vector unsigned short a, vector unsigned short b, vector unsigned short c) |
| 2033 | { |
| 2034 | return a * b + c; |
| 2035 | } |
| 2036 | |
| 2037 | /* vec_vmladduhm */ |
| 2038 | |
| 2039 | static vector short __ATTRS_o_ai |
| 2040 | vec_vmladduhm(vector short a, vector short b, vector short c) |
| 2041 | { |
| 2042 | return a * b + c; |
| 2043 | } |
| 2044 | |
| 2045 | static vector short __ATTRS_o_ai |
| 2046 | vec_vmladduhm(vector short a, vector unsigned short b, vector unsigned short c) |
| 2047 | { |
| 2048 | return a * (vector short)b + (vector short)c; |
| 2049 | } |
| 2050 | |
| 2051 | static vector short __ATTRS_o_ai |
| 2052 | vec_vmladduhm(vector unsigned short a, vector short b, vector short c) |
| 2053 | { |
| 2054 | return (vector short)a * b + c; |
| 2055 | } |
| 2056 | |
| 2057 | static vector unsigned short __ATTRS_o_ai |
| 2058 | vec_vmladduhm(vector unsigned short a, vector unsigned short b, vector unsigned short c) |
| 2059 | { |
| 2060 | return a * b + c; |
| 2061 | } |
| 2062 | |
| 2063 | /* vec_mradds */ |
| 2064 | |
| 2065 | static vector short __attribute__((__always_inline__)) |
| 2066 | vec_mradds(vector short a, vector short b, vector short c) |
| 2067 | { |
| 2068 | return __builtin_altivec_vmhraddshs(a, b, c); |
| 2069 | } |
| 2070 | |
| 2071 | /* vec_vmhraddshs */ |
| 2072 | |
| 2073 | static vector short __attribute__((__always_inline__)) |
| 2074 | vec_vmhraddshs(vector short a, vector short b, vector short c) |
| 2075 | { |
| 2076 | return __builtin_altivec_vmhraddshs(a, b, c); |
| 2077 | } |
| 2078 | |
| 2079 | /* vec_msum */ |
| 2080 | |
| 2081 | static vector int __ATTRS_o_ai |
| 2082 | vec_msum(vector signed char a, vector unsigned char b, vector int c) |
| 2083 | { |
| 2084 | return __builtin_altivec_vmsummbm(a, b, c); |
| 2085 | } |
| 2086 | |
| 2087 | static vector unsigned int __ATTRS_o_ai |
| 2088 | vec_msum(vector unsigned char a, vector unsigned char b, vector unsigned int c) |
| 2089 | { |
| 2090 | return __builtin_altivec_vmsumubm(a, b, c); |
| 2091 | } |
| 2092 | |
| 2093 | static vector int __ATTRS_o_ai |
| 2094 | vec_msum(vector short a, vector short b, vector int c) |
| 2095 | { |
| 2096 | return __builtin_altivec_vmsumshm(a, b, c); |
| 2097 | } |
| 2098 | |
| 2099 | static vector unsigned int __ATTRS_o_ai |
| 2100 | vec_msum(vector unsigned short a, vector unsigned short b, vector unsigned int c) |
| 2101 | { |
| 2102 | return __builtin_altivec_vmsumuhm(a, b, c); |
| 2103 | } |
| 2104 | |
| 2105 | /* vec_vmsummbm */ |
| 2106 | |
| 2107 | static vector int __attribute__((__always_inline__)) |
| 2108 | vec_vmsummbm(vector signed char a, vector unsigned char b, vector int c) |
| 2109 | { |
| 2110 | return __builtin_altivec_vmsummbm(a, b, c); |
| 2111 | } |
| 2112 | |
| 2113 | /* vec_vmsumubm */ |
| 2114 | |
| 2115 | static vector unsigned int __attribute__((__always_inline__)) |
| 2116 | vec_vmsumubm(vector unsigned char a, vector unsigned char b, vector unsigned int c) |
| 2117 | { |
| 2118 | return __builtin_altivec_vmsumubm(a, b, c); |
| 2119 | } |
| 2120 | |
| 2121 | /* vec_vmsumshm */ |
| 2122 | |
| 2123 | static vector int __attribute__((__always_inline__)) |
| 2124 | vec_vmsumshm(vector short a, vector short b, vector int c) |
| 2125 | { |
| 2126 | return __builtin_altivec_vmsumshm(a, b, c); |
| 2127 | } |
| 2128 | |
| 2129 | /* vec_vmsumuhm */ |
| 2130 | |
| 2131 | static vector unsigned int __attribute__((__always_inline__)) |
| 2132 | vec_vmsumuhm(vector unsigned short a, vector unsigned short b, vector unsigned int c) |
| 2133 | { |
| 2134 | return __builtin_altivec_vmsumuhm(a, b, c); |
| 2135 | } |
| 2136 | |
| 2137 | /* vec_msums */ |
| 2138 | |
| 2139 | static vector int __ATTRS_o_ai |
| 2140 | vec_msums(vector short a, vector short b, vector int c) |
| 2141 | { |
| 2142 | return __builtin_altivec_vmsumshs(a, b, c); |
| 2143 | } |
| 2144 | |
| 2145 | static vector unsigned int __ATTRS_o_ai |
| 2146 | vec_msums(vector unsigned short a, vector unsigned short b, vector unsigned int c) |
| 2147 | { |
| 2148 | return __builtin_altivec_vmsumuhs(a, b, c); |
| 2149 | } |
| 2150 | |
| 2151 | /* vec_vmsumshs */ |
| 2152 | |
| 2153 | static vector int __attribute__((__always_inline__)) |
| 2154 | vec_vmsumshs(vector short a, vector short b, vector int c) |
| 2155 | { |
| 2156 | return __builtin_altivec_vmsumshs(a, b, c); |
| 2157 | } |
| 2158 | |
| 2159 | /* vec_vmsumuhs */ |
| 2160 | |
| 2161 | static vector unsigned int __attribute__((__always_inline__)) |
| 2162 | vec_vmsumuhs(vector unsigned short a, vector unsigned short b, vector unsigned int c) |
| 2163 | { |
| 2164 | return __builtin_altivec_vmsumuhs(a, b, c); |
| 2165 | } |
| 2166 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 2167 | /* vec_mtvscr */ |
| 2168 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 2169 | static void __ATTRS_o_ai |
| 2170 | vec_mtvscr(vector signed char a) |
| 2171 | { |
| 2172 | __builtin_altivec_mtvscr((vector int)a); |
| 2173 | } |
| 2174 | |
| 2175 | static void __ATTRS_o_ai |
| 2176 | vec_mtvscr(vector unsigned char a) |
| 2177 | { |
| 2178 | __builtin_altivec_mtvscr((vector int)a); |
| 2179 | } |
| 2180 | |
| 2181 | static void __ATTRS_o_ai |
| 2182 | vec_mtvscr(vector short a) |
| 2183 | { |
| 2184 | __builtin_altivec_mtvscr((vector int)a); |
| 2185 | } |
| 2186 | |
| 2187 | static void __ATTRS_o_ai |
| 2188 | vec_mtvscr(vector unsigned short a) |
| 2189 | { |
| 2190 | __builtin_altivec_mtvscr((vector int)a); |
| 2191 | } |
| 2192 | |
| 2193 | static void __ATTRS_o_ai |
| 2194 | vec_mtvscr(vector int a) |
| 2195 | { |
| 2196 | __builtin_altivec_mtvscr((vector int)a); |
| 2197 | } |
| 2198 | |
| 2199 | static void __ATTRS_o_ai |
| 2200 | vec_mtvscr(vector unsigned int a) |
| 2201 | { |
| 2202 | __builtin_altivec_mtvscr((vector int)a); |
| 2203 | } |
| 2204 | |
| 2205 | static void __ATTRS_o_ai |
| 2206 | vec_mtvscr(vector float a) |
| 2207 | { |
| 2208 | __builtin_altivec_mtvscr((vector int)a); |
| 2209 | } |
| 2210 | |
| 2211 | /* vec_mule */ |
| 2212 | |
| 2213 | static vector short __ATTRS_o_ai |
| 2214 | vec_mule(vector signed char a, vector signed char b) |
| 2215 | { |
| 2216 | return __builtin_altivec_vmulesb(a, b); |
| 2217 | } |
| 2218 | |
| 2219 | static vector unsigned short __ATTRS_o_ai |
| 2220 | vec_mule(vector unsigned char a, vector unsigned char b) |
| 2221 | { |
| 2222 | return __builtin_altivec_vmuleub(a, b); |
| 2223 | } |
| 2224 | |
| 2225 | static vector int __ATTRS_o_ai |
| 2226 | vec_mule(vector short a, vector short b) |
| 2227 | { |
| 2228 | return __builtin_altivec_vmulesh(a, b); |
| 2229 | } |
| 2230 | |
| 2231 | static vector unsigned int __ATTRS_o_ai |
| 2232 | vec_mule(vector unsigned short a, vector unsigned short b) |
| 2233 | { |
| 2234 | return __builtin_altivec_vmuleuh(a, b); |
| 2235 | } |
| 2236 | |
| 2237 | /* vec_vmulesb */ |
| 2238 | |
| 2239 | static vector short __attribute__((__always_inline__)) |
| 2240 | vec_vmulesb(vector signed char a, vector signed char b) |
| 2241 | { |
| 2242 | return __builtin_altivec_vmulesb(a, b); |
| 2243 | } |
| 2244 | |
| 2245 | /* vec_vmuleub */ |
| 2246 | |
| 2247 | static vector unsigned short __attribute__((__always_inline__)) |
| 2248 | vec_vmuleub(vector unsigned char a, vector unsigned char b) |
| 2249 | { |
| 2250 | return __builtin_altivec_vmuleub(a, b); |
| 2251 | } |
| 2252 | |
| 2253 | /* vec_vmulesh */ |
| 2254 | |
| 2255 | static vector int __attribute__((__always_inline__)) |
| 2256 | vec_vmulesh(vector short a, vector short b) |
| 2257 | { |
| 2258 | return __builtin_altivec_vmulesh(a, b); |
| 2259 | } |
| 2260 | |
| 2261 | /* vec_vmuleuh */ |
| 2262 | |
| 2263 | static vector unsigned int __attribute__((__always_inline__)) |
| 2264 | vec_vmuleuh(vector unsigned short a, vector unsigned short b) |
| 2265 | { |
| 2266 | return __builtin_altivec_vmuleuh(a, b); |
| 2267 | } |
| 2268 | |
| 2269 | /* vec_mulo */ |
| 2270 | |
| 2271 | static vector short __ATTRS_o_ai |
| 2272 | vec_mulo(vector signed char a, vector signed char b) |
| 2273 | { |
| 2274 | return __builtin_altivec_vmulosb(a, b); |
| 2275 | } |
| 2276 | |
| 2277 | static vector unsigned short __ATTRS_o_ai |
| 2278 | vec_mulo(vector unsigned char a, vector unsigned char b) |
| 2279 | { |
| 2280 | return __builtin_altivec_vmuloub(a, b); |
| 2281 | } |
| 2282 | |
| 2283 | static vector int __ATTRS_o_ai |
| 2284 | vec_mulo(vector short a, vector short b) |
| 2285 | { |
| 2286 | return __builtin_altivec_vmulosh(a, b); |
| 2287 | } |
| 2288 | |
| 2289 | static vector unsigned int __ATTRS_o_ai |
| 2290 | vec_mulo(vector unsigned short a, vector unsigned short b) |
| 2291 | { |
| 2292 | return __builtin_altivec_vmulouh(a, b); |
| 2293 | } |
| 2294 | |
| 2295 | /* vec_vmulosb */ |
| 2296 | |
| 2297 | static vector short __attribute__((__always_inline__)) |
| 2298 | vec_vmulosb(vector signed char a, vector signed char b) |
| 2299 | { |
| 2300 | return __builtin_altivec_vmulosb(a, b); |
| 2301 | } |
| 2302 | |
| 2303 | /* vec_vmuloub */ |
| 2304 | |
| 2305 | static vector unsigned short __attribute__((__always_inline__)) |
| 2306 | vec_vmuloub(vector unsigned char a, vector unsigned char b) |
| 2307 | { |
| 2308 | return __builtin_altivec_vmuloub(a, b); |
| 2309 | } |
| 2310 | |
| 2311 | /* vec_vmulosh */ |
| 2312 | |
| 2313 | static vector int __attribute__((__always_inline__)) |
| 2314 | vec_vmulosh(vector short a, vector short b) |
| 2315 | { |
| 2316 | return __builtin_altivec_vmulosh(a, b); |
| 2317 | } |
| 2318 | |
| 2319 | /* vec_vmulouh */ |
| 2320 | |
| 2321 | static vector unsigned int __attribute__((__always_inline__)) |
| 2322 | vec_vmulouh(vector unsigned short a, vector unsigned short b) |
| 2323 | { |
| 2324 | return __builtin_altivec_vmulouh(a, b); |
| 2325 | } |
| 2326 | |
| 2327 | /* vec_nmsub */ |
| 2328 | |
| 2329 | static vector float __attribute__((__always_inline__)) |
| 2330 | vec_nmsub(vector float a, vector float b, vector float c) |
| 2331 | { |
| 2332 | return __builtin_altivec_vnmsubfp(a, b, c); |
| 2333 | } |
| 2334 | |
| 2335 | /* vec_vnmsubfp */ |
| 2336 | |
| 2337 | static vector float __attribute__((__always_inline__)) |
| 2338 | vec_vnmsubfp(vector float a, vector float b, vector float c) |
| 2339 | { |
| 2340 | return __builtin_altivec_vnmsubfp(a, b, c); |
| 2341 | } |
| 2342 | |
| 2343 | /* vec_nor */ |
| 2344 | |
| 2345 | #define __builtin_altivec_vnor vec_nor |
| 2346 | |
| 2347 | static vector signed char __ATTRS_o_ai |
| 2348 | vec_nor(vector signed char a, vector signed char b) |
| 2349 | { |
| 2350 | return ~(a | b); |
| 2351 | } |
| 2352 | |
| 2353 | static vector unsigned char __ATTRS_o_ai |
| 2354 | vec_nor(vector unsigned char a, vector unsigned char b) |
| 2355 | { |
| 2356 | return ~(a | b); |
| 2357 | } |
| 2358 | |
| 2359 | static vector short __ATTRS_o_ai |
| 2360 | vec_nor(vector short a, vector short b) |
| 2361 | { |
| 2362 | return ~(a | b); |
| 2363 | } |
| 2364 | |
| 2365 | static vector unsigned short __ATTRS_o_ai |
| 2366 | vec_nor(vector unsigned short a, vector unsigned short b) |
| 2367 | { |
| 2368 | return ~(a | b); |
| 2369 | } |
| 2370 | |
| 2371 | static vector int __ATTRS_o_ai |
| 2372 | vec_nor(vector int a, vector int b) |
| 2373 | { |
| 2374 | return ~(a | b); |
| 2375 | } |
| 2376 | |
| 2377 | static vector unsigned int __ATTRS_o_ai |
| 2378 | vec_nor(vector unsigned int a, vector unsigned int b) |
| 2379 | { |
| 2380 | return ~(a | b); |
| 2381 | } |
| 2382 | |
| 2383 | static vector float __ATTRS_o_ai |
| 2384 | vec_nor(vector float a, vector float b) |
| 2385 | { |
| 2386 | vector unsigned int res = ~((vector unsigned int)a | (vector unsigned int)b); |
| 2387 | return (vector float)res; |
| 2388 | } |
| 2389 | |
| 2390 | /* vec_vnor */ |
| 2391 | |
| 2392 | static vector signed char __ATTRS_o_ai |
| 2393 | vec_vnor(vector signed char a, vector signed char b) |
| 2394 | { |
| 2395 | return ~(a | b); |
| 2396 | } |
| 2397 | |
| 2398 | static vector unsigned char __ATTRS_o_ai |
| 2399 | vec_vnor(vector unsigned char a, vector unsigned char b) |
| 2400 | { |
| 2401 | return ~(a | b); |
| 2402 | } |
| 2403 | |
| 2404 | static vector short __ATTRS_o_ai |
| 2405 | vec_vnor(vector short a, vector short b) |
| 2406 | { |
| 2407 | return ~(a | b); |
| 2408 | } |
| 2409 | |
| 2410 | static vector unsigned short __ATTRS_o_ai |
| 2411 | vec_vnor(vector unsigned short a, vector unsigned short b) |
| 2412 | { |
| 2413 | return ~(a | b); |
| 2414 | } |
| 2415 | |
| 2416 | static vector int __ATTRS_o_ai |
| 2417 | vec_vnor(vector int a, vector int b) |
| 2418 | { |
| 2419 | return ~(a | b); |
| 2420 | } |
| 2421 | |
| 2422 | static vector unsigned int __ATTRS_o_ai |
| 2423 | vec_vnor(vector unsigned int a, vector unsigned int b) |
| 2424 | { |
| 2425 | return ~(a | b); |
| 2426 | } |
| 2427 | |
| 2428 | static vector float __ATTRS_o_ai |
| 2429 | vec_vnor(vector float a, vector float b) |
| 2430 | { |
| 2431 | vector unsigned int res = ~((vector unsigned int)a | (vector unsigned int)b); |
| 2432 | return (vector float)res; |
| 2433 | } |
| 2434 | |
| 2435 | /* vec_or */ |
| 2436 | |
| 2437 | #define __builtin_altivec_vor vec_or |
| 2438 | |
| 2439 | static vector signed char __ATTRS_o_ai |
| 2440 | vec_or(vector signed char a, vector signed char b) |
| 2441 | { |
| 2442 | return a | b; |
| 2443 | } |
| 2444 | |
| 2445 | static vector unsigned char __ATTRS_o_ai |
| 2446 | vec_or(vector unsigned char a, vector unsigned char b) |
| 2447 | { |
| 2448 | return a | b; |
| 2449 | } |
| 2450 | |
| 2451 | static vector short __ATTRS_o_ai |
| 2452 | vec_or(vector short a, vector short b) |
| 2453 | { |
| 2454 | return a | b; |
| 2455 | } |
| 2456 | |
| 2457 | static vector unsigned short __ATTRS_o_ai |
| 2458 | vec_or(vector unsigned short a, vector unsigned short b) |
| 2459 | { |
| 2460 | return a | b; |
| 2461 | } |
| 2462 | |
| 2463 | static vector int __ATTRS_o_ai |
| 2464 | vec_or(vector int a, vector int b) |
| 2465 | { |
| 2466 | return a | b; |
| 2467 | } |
| 2468 | |
| 2469 | static vector unsigned int __ATTRS_o_ai |
| 2470 | vec_or(vector unsigned int a, vector unsigned int b) |
| 2471 | { |
| 2472 | return a | b; |
| 2473 | } |
| 2474 | |
| 2475 | static vector float __ATTRS_o_ai |
| 2476 | vec_or(vector float a, vector float b) |
| 2477 | { |
| 2478 | vector unsigned int res = (vector unsigned int)a | (vector unsigned int)b; |
| 2479 | return (vector float)res; |
| 2480 | } |
| 2481 | |
| 2482 | /* vec_vor */ |
| 2483 | |
| 2484 | static vector signed char __ATTRS_o_ai |
| 2485 | vec_vor(vector signed char a, vector signed char b) |
| 2486 | { |
| 2487 | return a | b; |
| 2488 | } |
| 2489 | |
| 2490 | static vector unsigned char __ATTRS_o_ai |
| 2491 | vec_vor(vector unsigned char a, vector unsigned char b) |
| 2492 | { |
| 2493 | return a | b; |
| 2494 | } |
| 2495 | |
| 2496 | static vector short __ATTRS_o_ai |
| 2497 | vec_vor(vector short a, vector short b) |
| 2498 | { |
| 2499 | return a | b; |
| 2500 | } |
| 2501 | |
| 2502 | static vector unsigned short __ATTRS_o_ai |
| 2503 | vec_vor(vector unsigned short a, vector unsigned short b) |
| 2504 | { |
| 2505 | return a | b; |
| 2506 | } |
| 2507 | |
| 2508 | static vector int __ATTRS_o_ai |
| 2509 | vec_vor(vector int a, vector int b) |
| 2510 | { |
| 2511 | return a | b; |
| 2512 | } |
| 2513 | |
| 2514 | static vector unsigned int __ATTRS_o_ai |
| 2515 | vec_vor(vector unsigned int a, vector unsigned int b) |
| 2516 | { |
| 2517 | return a | b; |
| 2518 | } |
| 2519 | |
| 2520 | static vector float __ATTRS_o_ai |
| 2521 | vec_vor(vector float a, vector float b) |
| 2522 | { |
| 2523 | vector unsigned int res = (vector unsigned int)a | (vector unsigned int)b; |
| 2524 | return (vector float)res; |
| 2525 | } |
| 2526 | |
| 2527 | /* vec_pack */ |
| 2528 | |
| 2529 | static vector signed char __ATTRS_o_ai |
| 2530 | vec_pack(vector signed short a, vector signed short b) |
| 2531 | { |
| 2532 | return (vector signed char)vec_perm(a, b, (vector unsigned char) |
| 2533 | (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| 2534 | 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F)); |
| 2535 | } |
| 2536 | |
| 2537 | static vector unsigned char __ATTRS_o_ai |
| 2538 | vec_pack(vector unsigned short a, vector unsigned short b) |
| 2539 | { |
| 2540 | return (vector unsigned char)vec_perm(a, b, (vector unsigned char) |
| 2541 | (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| 2542 | 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F)); |
| 2543 | } |
| 2544 | |
| 2545 | static vector short __ATTRS_o_ai |
| 2546 | vec_pack(vector int a, vector int b) |
| 2547 | { |
| 2548 | return (vector short)vec_perm(a, b, (vector unsigned char) |
| 2549 | (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F, |
| 2550 | 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F)); |
| 2551 | } |
| 2552 | |
| 2553 | static vector unsigned short __ATTRS_o_ai |
| 2554 | vec_pack(vector unsigned int a, vector unsigned int b) |
| 2555 | { |
| 2556 | return (vector unsigned short)vec_perm(a, b, (vector unsigned char) |
| 2557 | (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F, |
| 2558 | 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F)); |
| 2559 | } |
| 2560 | |
| 2561 | /* vec_vpkuhum */ |
| 2562 | |
| 2563 | #define __builtin_altivec_vpkuhum vec_vpkuhum |
| 2564 | |
| 2565 | static vector signed char __ATTRS_o_ai |
| 2566 | vec_vpkuhum(vector signed short a, vector signed short b) |
| 2567 | { |
| 2568 | return (vector signed char)vec_perm(a, b, (vector unsigned char) |
| 2569 | (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| 2570 | 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F)); |
| 2571 | } |
| 2572 | |
| 2573 | static vector unsigned char __ATTRS_o_ai |
| 2574 | vec_vpkuhum(vector unsigned short a, vector unsigned short b) |
| 2575 | { |
| 2576 | return (vector unsigned char)vec_perm(a, b, (vector unsigned char) |
| 2577 | (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| 2578 | 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F)); |
| 2579 | } |
| 2580 | |
| 2581 | /* vec_vpkuwum */ |
| 2582 | |
| 2583 | #define __builtin_altivec_vpkuwum vec_vpkuwum |
| 2584 | |
| 2585 | static vector short __ATTRS_o_ai |
| 2586 | vec_vpkuwum(vector int a, vector int b) |
| 2587 | { |
| 2588 | return (vector short)vec_perm(a, b, (vector unsigned char) |
| 2589 | (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F, |
| 2590 | 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F)); |
| 2591 | } |
| 2592 | |
| 2593 | static vector unsigned short __ATTRS_o_ai |
| 2594 | vec_vpkuwum(vector unsigned int a, vector unsigned int b) |
| 2595 | { |
| 2596 | return (vector unsigned short)vec_perm(a, b, (vector unsigned char) |
| 2597 | (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F, |
| 2598 | 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F)); |
| 2599 | } |
| 2600 | |
| 2601 | /* vec_packpx */ |
| 2602 | |
| 2603 | static vector pixel __attribute__((__always_inline__)) |
| 2604 | vec_packpx(vector unsigned int a, vector unsigned int b) |
| 2605 | { |
| 2606 | return (vector pixel)__builtin_altivec_vpkpx(a, b); |
| 2607 | } |
| 2608 | |
| 2609 | /* vec_vpkpx */ |
| 2610 | |
| 2611 | static vector pixel __attribute__((__always_inline__)) |
| 2612 | vec_vpkpx(vector unsigned int a, vector unsigned int b) |
| 2613 | { |
| 2614 | return (vector pixel)__builtin_altivec_vpkpx(a, b); |
| 2615 | } |
| 2616 | |
| 2617 | /* vec_packs */ |
| 2618 | |
| 2619 | static vector signed char __ATTRS_o_ai |
| 2620 | vec_packs(vector short a, vector short b) |
| 2621 | { |
| 2622 | return __builtin_altivec_vpkshss(a, b); |
| 2623 | } |
| 2624 | |
| 2625 | static vector unsigned char __ATTRS_o_ai |
| 2626 | vec_packs(vector unsigned short a, vector unsigned short b) |
| 2627 | { |
| 2628 | return __builtin_altivec_vpkuhus(a, b); |
| 2629 | } |
| 2630 | |
| 2631 | static vector signed short __ATTRS_o_ai |
| 2632 | vec_packs(vector int a, vector int b) |
| 2633 | { |
| 2634 | return __builtin_altivec_vpkswss(a, b); |
| 2635 | } |
| 2636 | |
| 2637 | static vector unsigned short __ATTRS_o_ai |
| 2638 | vec_packs(vector unsigned int a, vector unsigned int b) |
| 2639 | { |
| 2640 | return __builtin_altivec_vpkuwus(a, b); |
| 2641 | } |
| 2642 | |
| 2643 | /* vec_vpkshss */ |
| 2644 | |
| 2645 | static vector signed char __attribute__((__always_inline__)) |
| 2646 | vec_vpkshss(vector short a, vector short b) |
| 2647 | { |
| 2648 | return __builtin_altivec_vpkshss(a, b); |
| 2649 | } |
| 2650 | |
| 2651 | /* vec_vpkuhus */ |
| 2652 | |
| 2653 | static vector unsigned char __attribute__((__always_inline__)) |
| 2654 | vec_vpkuhus(vector unsigned short a, vector unsigned short b) |
| 2655 | { |
| 2656 | return __builtin_altivec_vpkuhus(a, b); |
| 2657 | } |
| 2658 | |
| 2659 | /* vec_vpkswss */ |
| 2660 | |
| 2661 | static vector signed short __attribute__((__always_inline__)) |
| 2662 | vec_vpkswss(vector int a, vector int b) |
| 2663 | { |
| 2664 | return __builtin_altivec_vpkswss(a, b); |
| 2665 | } |
| 2666 | |
| 2667 | /* vec_vpkuwus */ |
| 2668 | |
| 2669 | static vector unsigned short __attribute__((__always_inline__)) |
| 2670 | vec_vpkuwus(vector unsigned int a, vector unsigned int b) |
| 2671 | { |
| 2672 | return __builtin_altivec_vpkuwus(a, b); |
| 2673 | } |
| 2674 | |
| 2675 | /* vec_packsu */ |
| 2676 | |
| 2677 | static vector unsigned char __ATTRS_o_ai |
| 2678 | vec_packsu(vector short a, vector short b) |
| 2679 | { |
| 2680 | return __builtin_altivec_vpkshus(a, b); |
| 2681 | } |
| 2682 | |
| 2683 | static vector unsigned char __ATTRS_o_ai |
| 2684 | vec_packsu(vector unsigned short a, vector unsigned short b) |
| 2685 | { |
| 2686 | return __builtin_altivec_vpkuhus(a, b); |
| 2687 | } |
| 2688 | |
| 2689 | static vector unsigned short __ATTRS_o_ai |
| 2690 | vec_packsu(vector int a, vector int b) |
| 2691 | { |
| 2692 | return __builtin_altivec_vpkswus(a, b); |
| 2693 | } |
| 2694 | |
| 2695 | static vector unsigned short __ATTRS_o_ai |
| 2696 | vec_packsu(vector unsigned int a, vector unsigned int b) |
| 2697 | { |
| 2698 | return __builtin_altivec_vpkuwus(a, b); |
| 2699 | } |
| 2700 | |
| 2701 | /* vec_vpkshus */ |
| 2702 | |
| 2703 | static vector unsigned char __ATTRS_o_ai |
| 2704 | vec_vpkshus(vector short a, vector short b) |
| 2705 | { |
| 2706 | return __builtin_altivec_vpkshus(a, b); |
| 2707 | } |
| 2708 | |
| 2709 | static vector unsigned char __ATTRS_o_ai |
| 2710 | vec_vpkshus(vector unsigned short a, vector unsigned short b) |
| 2711 | { |
| 2712 | return __builtin_altivec_vpkuhus(a, b); |
| 2713 | } |
| 2714 | |
| 2715 | /* vec_vpkswus */ |
| 2716 | |
| 2717 | static vector unsigned short __ATTRS_o_ai |
| 2718 | vec_vpkswus(vector int a, vector int b) |
| 2719 | { |
| 2720 | return __builtin_altivec_vpkswus(a, b); |
| 2721 | } |
| 2722 | |
| 2723 | static vector unsigned short __ATTRS_o_ai |
| 2724 | vec_vpkswus(vector unsigned int a, vector unsigned int b) |
| 2725 | { |
| 2726 | return __builtin_altivec_vpkuwus(a, b); |
| 2727 | } |
| 2728 | |
| 2729 | /* vec_perm */ |
| 2730 | |
| 2731 | vector signed char __ATTRS_o_ai |
| 2732 | vec_perm(vector signed char a, vector signed char b, vector unsigned char c) |
| 2733 | { |
| 2734 | return (vector signed char)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 2735 | } |
| 2736 | |
| 2737 | vector unsigned char __ATTRS_o_ai |
| 2738 | vec_perm(vector unsigned char a, vector unsigned char b, vector unsigned char c) |
| 2739 | { |
| 2740 | return (vector unsigned char)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 2741 | } |
| 2742 | |
| 2743 | vector short __ATTRS_o_ai |
| 2744 | vec_perm(vector short a, vector short b, vector unsigned char c) |
| 2745 | { |
| 2746 | return (vector short)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 2747 | } |
| 2748 | |
| 2749 | vector unsigned short __ATTRS_o_ai |
| 2750 | vec_perm(vector unsigned short a, vector unsigned short b, vector unsigned char c) |
| 2751 | { |
| 2752 | return (vector unsigned short)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 2753 | } |
| 2754 | |
| 2755 | vector int __ATTRS_o_ai |
| 2756 | vec_perm(vector int a, vector int b, vector unsigned char c) |
| 2757 | { |
| 2758 | return (vector int)__builtin_altivec_vperm_4si(a, b, c); |
| 2759 | } |
| 2760 | |
| 2761 | vector unsigned int __ATTRS_o_ai |
| 2762 | vec_perm(vector unsigned int a, vector unsigned int b, vector unsigned char c) |
| 2763 | { |
| 2764 | return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 2765 | } |
| 2766 | |
| 2767 | vector float __ATTRS_o_ai |
| 2768 | vec_perm(vector float a, vector float b, vector unsigned char c) |
| 2769 | { |
| 2770 | return (vector float)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 2771 | } |
| 2772 | |
| 2773 | /* vec_vperm */ |
| 2774 | |
| 2775 | vector signed char __ATTRS_o_ai |
| 2776 | vec_vperm(vector signed char a, vector signed char b, vector unsigned char c) |
| 2777 | { |
| 2778 | return (vector signed char)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 2779 | } |
| 2780 | |
| 2781 | vector unsigned char __ATTRS_o_ai |
| 2782 | vec_vperm(vector unsigned char a, vector unsigned char b, vector unsigned char c) |
| 2783 | { |
| 2784 | return (vector unsigned char)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 2785 | } |
| 2786 | |
| 2787 | vector short __ATTRS_o_ai |
| 2788 | vec_vperm(vector short a, vector short b, vector unsigned char c) |
| 2789 | { |
| 2790 | return (vector short)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 2791 | } |
| 2792 | |
| 2793 | vector unsigned short __ATTRS_o_ai |
| 2794 | vec_vperm(vector unsigned short a, vector unsigned short b, vector unsigned char c) |
| 2795 | { |
| 2796 | return (vector unsigned short)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 2797 | } |
| 2798 | |
| 2799 | vector int __ATTRS_o_ai |
| 2800 | vec_vperm(vector int a, vector int b, vector unsigned char c) |
| 2801 | { |
| 2802 | return (vector int)__builtin_altivec_vperm_4si(a, b, c); |
| 2803 | } |
| 2804 | |
| 2805 | vector unsigned int __ATTRS_o_ai |
| 2806 | vec_vperm(vector unsigned int a, vector unsigned int b, vector unsigned char c) |
| 2807 | { |
| 2808 | return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 2809 | } |
| 2810 | |
| 2811 | vector float __ATTRS_o_ai |
| 2812 | vec_vperm(vector float a, vector float b, vector unsigned char c) |
| 2813 | { |
| 2814 | return (vector float)__builtin_altivec_vperm_4si((vector int)a, (vector int)b, c); |
| 2815 | } |
| 2816 | |
| 2817 | /* vec_re */ |
| 2818 | |
| 2819 | vector float __attribute__((__always_inline__)) |
| 2820 | vec_re(vector float a) |
| 2821 | { |
| 2822 | return __builtin_altivec_vrefp(a); |
| 2823 | } |
| 2824 | |
| 2825 | /* vec_vrefp */ |
| 2826 | |
| 2827 | vector float __attribute__((__always_inline__)) |
| 2828 | vec_vrefp(vector float a) |
| 2829 | { |
| 2830 | return __builtin_altivec_vrefp(a); |
| 2831 | } |
| 2832 | |
| 2833 | /* vec_rl */ |
| 2834 | |
| 2835 | static vector signed char __ATTRS_o_ai |
| 2836 | vec_rl(vector signed char a, vector unsigned char b) |
| 2837 | { |
| 2838 | return (vector signed char)__builtin_altivec_vrlb((vector char)a, b); |
| 2839 | } |
| 2840 | |
| 2841 | static vector unsigned char __ATTRS_o_ai |
| 2842 | vec_rl(vector unsigned char a, vector unsigned char b) |
| 2843 | { |
| 2844 | return (vector unsigned char)__builtin_altivec_vrlb((vector char)a, b); |
| 2845 | } |
| 2846 | |
| 2847 | static vector short __ATTRS_o_ai |
| 2848 | vec_rl(vector short a, vector unsigned short b) |
| 2849 | { |
| 2850 | return __builtin_altivec_vrlh(a, b); |
| 2851 | } |
| 2852 | |
| 2853 | static vector unsigned short __ATTRS_o_ai |
| 2854 | vec_rl(vector unsigned short a, vector unsigned short b) |
| 2855 | { |
| 2856 | return (vector unsigned short)__builtin_altivec_vrlh((vector short)a, b); |
| 2857 | } |
| 2858 | |
| 2859 | static vector int __ATTRS_o_ai |
| 2860 | vec_rl(vector int a, vector unsigned int b) |
| 2861 | { |
| 2862 | return __builtin_altivec_vrlw(a, b); |
| 2863 | } |
| 2864 | |
| 2865 | static vector unsigned int __ATTRS_o_ai |
| 2866 | vec_rl(vector unsigned int a, vector unsigned int b) |
| 2867 | { |
| 2868 | return (vector unsigned int)__builtin_altivec_vrlw((vector int)a, b); |
| 2869 | } |
| 2870 | |
| 2871 | /* vec_vrlb */ |
| 2872 | |
| 2873 | static vector signed char __ATTRS_o_ai |
| 2874 | vec_vrlb(vector signed char a, vector unsigned char b) |
| 2875 | { |
| 2876 | return (vector signed char)__builtin_altivec_vrlb((vector char)a, b); |
| 2877 | } |
| 2878 | |
| 2879 | static vector unsigned char __ATTRS_o_ai |
| 2880 | vec_vrlb(vector unsigned char a, vector unsigned char b) |
| 2881 | { |
| 2882 | return (vector unsigned char)__builtin_altivec_vrlb((vector char)a, b); |
| 2883 | } |
| 2884 | |
| 2885 | /* vec_vrlh */ |
| 2886 | |
| 2887 | static vector short __ATTRS_o_ai |
| 2888 | vec_vrlh(vector short a, vector unsigned short b) |
| 2889 | { |
| 2890 | return __builtin_altivec_vrlh(a, b); |
| 2891 | } |
| 2892 | |
| 2893 | static vector unsigned short __ATTRS_o_ai |
| 2894 | vec_vrlh(vector unsigned short a, vector unsigned short b) |
| 2895 | { |
| 2896 | return (vector unsigned short)__builtin_altivec_vrlh((vector short)a, b); |
| 2897 | } |
| 2898 | |
| 2899 | /* vec_vrlw */ |
| 2900 | |
| 2901 | static vector int __ATTRS_o_ai |
| 2902 | vec_vrlw(vector int a, vector unsigned int b) |
| 2903 | { |
| 2904 | return __builtin_altivec_vrlw(a, b); |
| 2905 | } |
| 2906 | |
| 2907 | static vector unsigned int __ATTRS_o_ai |
| 2908 | vec_vrlw(vector unsigned int a, vector unsigned int b) |
| 2909 | { |
| 2910 | return (vector unsigned int)__builtin_altivec_vrlw((vector int)a, b); |
| 2911 | } |
| 2912 | |
| 2913 | /* vec_round */ |
| 2914 | |
| 2915 | static vector float __attribute__((__always_inline__)) |
| 2916 | vec_round(vector float a) |
| 2917 | { |
| 2918 | return __builtin_altivec_vrfin(a); |
| 2919 | } |
| 2920 | |
| 2921 | /* vec_vrfin */ |
| 2922 | |
| 2923 | static vector float __attribute__((__always_inline__)) |
| 2924 | vec_vrfin(vector float a) |
| 2925 | { |
| 2926 | return __builtin_altivec_vrfin(a); |
| 2927 | } |
| 2928 | |
| 2929 | /* vec_rsqrte */ |
| 2930 | |
| 2931 | static __vector float __attribute__((__always_inline__)) |
| 2932 | vec_rsqrte(vector float a) |
| 2933 | { |
| 2934 | return __builtin_altivec_vrsqrtefp(a); |
| 2935 | } |
| 2936 | |
| 2937 | /* vec_vrsqrtefp */ |
| 2938 | |
| 2939 | static __vector float __attribute__((__always_inline__)) |
| 2940 | vec_vrsqrtefp(vector float a) |
| 2941 | { |
| 2942 | return __builtin_altivec_vrsqrtefp(a); |
| 2943 | } |
| 2944 | |
| 2945 | /* vec_sel */ |
| 2946 | |
| 2947 | #define __builtin_altivec_vsel_4si vec_sel |
| 2948 | |
| 2949 | static vector signed char __ATTRS_o_ai |
| 2950 | vec_sel(vector signed char a, vector signed char b, vector unsigned char c) |
| 2951 | { |
| 2952 | return (a & ~(vector signed char)c) | (b & (vector signed char)c); |
| 2953 | } |
| 2954 | |
| 2955 | static vector unsigned char __ATTRS_o_ai |
| 2956 | vec_sel(vector unsigned char a, vector unsigned char b, vector unsigned char c) |
| 2957 | { |
| 2958 | return (a & ~c) | (b & c); |
| 2959 | } |
| 2960 | |
| 2961 | static vector short __ATTRS_o_ai |
| 2962 | vec_sel(vector short a, vector short b, vector unsigned short c) |
| 2963 | { |
| 2964 | return (a & ~(vector short)c) | (b & (vector short)c); |
| 2965 | } |
| 2966 | |
| 2967 | static vector unsigned short __ATTRS_o_ai |
| 2968 | vec_sel(vector unsigned short a, vector unsigned short b, vector unsigned short c) |
| 2969 | { |
| 2970 | return (a & ~c) | (b & c); |
| 2971 | } |
| 2972 | |
| 2973 | static vector int __ATTRS_o_ai |
| 2974 | vec_sel(vector int a, vector int b, vector unsigned int c) |
| 2975 | { |
| 2976 | return (a & ~(vector int)c) | (b & (vector int)c); |
| 2977 | } |
| 2978 | |
| 2979 | static vector unsigned int __ATTRS_o_ai |
| 2980 | vec_sel(vector unsigned int a, vector unsigned int b, vector unsigned int c) |
| 2981 | { |
| 2982 | return (a & ~c) | (b & c); |
| 2983 | } |
| 2984 | |
| 2985 | static vector float __ATTRS_o_ai |
| 2986 | vec_sel(vector float a, vector float b, vector unsigned int c) |
| 2987 | { |
| 2988 | vector int res = ((vector int)a & ~(vector int)c) | ((vector int)b & (vector int)c); |
| 2989 | return (vector float)res; |
| 2990 | } |
| 2991 | |
| 2992 | /* vec_vsel */ |
| 2993 | |
| 2994 | static vector signed char __ATTRS_o_ai |
| 2995 | vec_vsel(vector signed char a, vector signed char b, vector unsigned char c) |
| 2996 | { |
| 2997 | return (a & ~(vector signed char)c) | (b & (vector signed char)c); |
| 2998 | } |
| 2999 | |
| 3000 | static vector unsigned char __ATTRS_o_ai |
| 3001 | vec_vsel(vector unsigned char a, vector unsigned char b, vector unsigned char c) |
| 3002 | { |
| 3003 | return (a & ~c) | (b & c); |
| 3004 | } |
| 3005 | |
| 3006 | static vector short __ATTRS_o_ai |
| 3007 | vec_vsel(vector short a, vector short b, vector unsigned short c) |
| 3008 | { |
| 3009 | return (a & ~(vector short)c) | (b & (vector short)c); |
| 3010 | } |
| 3011 | |
| 3012 | static vector unsigned short __ATTRS_o_ai |
| 3013 | vec_vsel(vector unsigned short a, vector unsigned short b, vector unsigned short c) |
| 3014 | { |
| 3015 | return (a & ~c) | (b & c); |
| 3016 | } |
| 3017 | |
| 3018 | static vector int __ATTRS_o_ai |
| 3019 | vec_vsel(vector int a, vector int b, vector unsigned int c) |
| 3020 | { |
| 3021 | return (a & ~(vector int)c) | (b & (vector int)c); |
| 3022 | } |
| 3023 | |
| 3024 | static vector unsigned int __ATTRS_o_ai |
| 3025 | vec_vsel(vector unsigned int a, vector unsigned int b, vector unsigned int c) |
| 3026 | { |
| 3027 | return (a & ~c) | (b & c); |
| 3028 | } |
| 3029 | |
| 3030 | static vector float __ATTRS_o_ai |
| 3031 | vec_vsel(vector float a, vector float b, vector unsigned int c) |
| 3032 | { |
| 3033 | vector int res = ((vector int)a & ~(vector int)c) | ((vector int)b & (vector int)c); |
| 3034 | return (vector float)res; |
| 3035 | } |
| 3036 | |
| 3037 | /* vec_sl */ |
| 3038 | |
| 3039 | static vector signed char __ATTRS_o_ai |
| 3040 | vec_sl(vector signed char a, vector unsigned char b) |
| 3041 | { |
| 3042 | return a << (vector signed char)b; |
| 3043 | } |
| 3044 | |
| 3045 | static vector unsigned char __ATTRS_o_ai |
| 3046 | vec_sl(vector unsigned char a, vector unsigned char b) |
| 3047 | { |
| 3048 | return a << b; |
| 3049 | } |
| 3050 | |
| 3051 | static vector short __ATTRS_o_ai |
| 3052 | vec_sl(vector short a, vector unsigned short b) |
| 3053 | { |
| 3054 | return a << (vector short)b; |
| 3055 | } |
| 3056 | |
| 3057 | static vector unsigned short __ATTRS_o_ai |
| 3058 | vec_sl(vector unsigned short a, vector unsigned short b) |
| 3059 | { |
| 3060 | return a << b; |
| 3061 | } |
| 3062 | |
| 3063 | static vector int __ATTRS_o_ai |
| 3064 | vec_sl(vector int a, vector unsigned int b) |
| 3065 | { |
| 3066 | return a << (vector int)b; |
| 3067 | } |
| 3068 | |
| 3069 | static vector unsigned int __ATTRS_o_ai |
| 3070 | vec_sl(vector unsigned int a, vector unsigned int b) |
| 3071 | { |
| 3072 | return a << b; |
| 3073 | } |
| 3074 | |
| 3075 | /* vec_vslb */ |
| 3076 | |
| 3077 | #define __builtin_altivec_vslb vec_vslb |
| 3078 | |
| 3079 | static vector signed char __ATTRS_o_ai |
| 3080 | vec_vslb(vector signed char a, vector unsigned char b) |
| 3081 | { |
| 3082 | return vec_sl(a, b); |
| 3083 | } |
| 3084 | |
| 3085 | static vector unsigned char __ATTRS_o_ai |
| 3086 | vec_vslb(vector unsigned char a, vector unsigned char b) |
| 3087 | { |
| 3088 | return vec_sl(a, b); |
| 3089 | } |
| 3090 | |
| 3091 | /* vec_vslh */ |
| 3092 | |
| 3093 | #define __builtin_altivec_vslh vec_vslh |
| 3094 | |
| 3095 | static vector short __ATTRS_o_ai |
| 3096 | vec_vslh(vector short a, vector unsigned short b) |
| 3097 | { |
| 3098 | return vec_sl(a, b); |
| 3099 | } |
| 3100 | |
| 3101 | static vector unsigned short __ATTRS_o_ai |
| 3102 | vec_vslh(vector unsigned short a, vector unsigned short b) |
| 3103 | { |
| 3104 | return vec_sl(a, b); |
| 3105 | } |
| 3106 | |
| 3107 | /* vec_vslw */ |
| 3108 | |
| 3109 | #define __builtin_altivec_vslw vec_vslw |
| 3110 | |
| 3111 | static vector int __ATTRS_o_ai |
| 3112 | vec_vslw(vector int a, vector unsigned int b) |
| 3113 | { |
| 3114 | return vec_sl(a, b); |
| 3115 | } |
| 3116 | |
| 3117 | static vector unsigned int __ATTRS_o_ai |
| 3118 | vec_vslw(vector unsigned int a, vector unsigned int b) |
| 3119 | { |
| 3120 | return vec_sl(a, b); |
| 3121 | } |
| 3122 | |
| 3123 | /* vec_sld */ |
| 3124 | |
| 3125 | #define __builtin_altivec_vsldoi_4si vec_sld |
| 3126 | |
| 3127 | static vector signed char __ATTRS_o_ai |
| 3128 | vec_sld(vector signed char a, vector signed char b, unsigned char c) |
| 3129 | { |
| 3130 | return (vector signed char)vec_perm(a, b, (vector unsigned char) |
| 3131 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 3132 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 3133 | } |
| 3134 | |
| 3135 | static vector unsigned char __ATTRS_o_ai |
| 3136 | vec_sld(vector unsigned char a, vector unsigned char b, unsigned char c) |
| 3137 | { |
| 3138 | return (vector unsigned char)vec_perm(a, b, (vector unsigned char) |
| 3139 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 3140 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 3141 | } |
| 3142 | |
| 3143 | static vector short __ATTRS_o_ai |
| 3144 | vec_sld(vector short a, vector short b, unsigned char c) |
| 3145 | { |
| 3146 | return (vector short)vec_perm(a, b, (vector unsigned char) |
| 3147 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 3148 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 3149 | } |
| 3150 | |
| 3151 | static vector unsigned short __ATTRS_o_ai |
| 3152 | vec_sld(vector unsigned short a, vector unsigned short b, unsigned char c) |
| 3153 | { |
| 3154 | return (vector unsigned short)vec_perm(a, b, (vector unsigned char) |
| 3155 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 3156 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 3157 | } |
| 3158 | |
| 3159 | static vector int __ATTRS_o_ai |
| 3160 | vec_sld(vector int a, vector int b, unsigned char c) |
| 3161 | { |
| 3162 | return vec_perm(a, b, (vector unsigned char) |
| 3163 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 3164 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 3165 | } |
| 3166 | |
| 3167 | static vector unsigned int __ATTRS_o_ai |
| 3168 | vec_sld(vector unsigned int a, vector unsigned int b, unsigned char c) |
| 3169 | { |
| 3170 | return (vector unsigned int)vec_perm(a, b, (vector unsigned char) |
| 3171 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 3172 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 3173 | } |
| 3174 | |
| 3175 | static vector float __ATTRS_o_ai |
| 3176 | vec_sld(vector float a, vector float b, unsigned char c) |
| 3177 | { |
| 3178 | return (vector float)vec_perm(a, b, (vector unsigned char) |
| 3179 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 3180 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 3181 | } |
| 3182 | |
| 3183 | /* vec_vsldoi */ |
| 3184 | |
| 3185 | static vector signed char __ATTRS_o_ai |
| 3186 | vec_vsldoi(vector signed char a, vector signed char b, unsigned char c) |
| 3187 | { |
| 3188 | return (vector signed char)vec_perm(a, b, (vector unsigned char) |
| 3189 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 3190 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 3191 | } |
| 3192 | |
| 3193 | static vector unsigned char __ATTRS_o_ai |
| 3194 | vec_vsldoi(vector unsigned char a, vector unsigned char b, unsigned char c) |
| 3195 | { |
| 3196 | return (vector unsigned char)vec_perm(a, b, (vector unsigned char) |
| 3197 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 3198 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 3199 | } |
| 3200 | |
| 3201 | static vector short __ATTRS_o_ai |
| 3202 | vec_vsldoi(vector short a, vector short b, unsigned char c) |
| 3203 | { |
| 3204 | return (vector short)vec_perm(a, b, (vector unsigned char) |
| 3205 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 3206 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 3207 | } |
| 3208 | |
| 3209 | static vector unsigned short __ATTRS_o_ai |
| 3210 | vec_vsldoi(vector unsigned short a, vector unsigned short b, unsigned char c) |
| 3211 | { |
| 3212 | return (vector unsigned short)vec_perm(a, b, (vector unsigned char) |
| 3213 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 3214 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 3215 | } |
| 3216 | |
| 3217 | static vector int __ATTRS_o_ai |
| 3218 | vec_vsldoi(vector int a, vector int b, unsigned char c) |
| 3219 | { |
| 3220 | return vec_perm(a, b, (vector unsigned char) |
| 3221 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 3222 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 3223 | } |
| 3224 | |
| 3225 | static vector unsigned int __ATTRS_o_ai |
| 3226 | vec_vsldoi(vector unsigned int a, vector unsigned int b, unsigned char c) |
| 3227 | { |
| 3228 | return (vector unsigned int)vec_perm(a, b, (vector unsigned char) |
| 3229 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 3230 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 3231 | } |
| 3232 | |
| 3233 | static vector float __ATTRS_o_ai |
| 3234 | vec_vsldoi(vector float a, vector float b, unsigned char c) |
| 3235 | { |
| 3236 | return (vector float)vec_perm(a, b, (vector unsigned char) |
| 3237 | (c, c+1, c+2, c+3, c+4, c+5, c+6, c+7, |
| 3238 | c+8, c+9, c+10, c+11, c+12, c+13, c+14, c+15)); |
| 3239 | } |
| 3240 | |
| 3241 | /* vec_sll */ |
| 3242 | |
| 3243 | static vector signed char __ATTRS_o_ai |
| 3244 | vec_sll(vector signed char a, vector unsigned char b) |
| 3245 | { |
| 3246 | return (vector signed char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3247 | } |
| 3248 | |
| 3249 | static vector signed char __ATTRS_o_ai |
| 3250 | vec_sll(vector signed char a, vector unsigned short b) |
| 3251 | { |
| 3252 | return (vector signed char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3253 | } |
| 3254 | |
| 3255 | static vector signed char __ATTRS_o_ai |
| 3256 | vec_sll(vector signed char a, vector unsigned int b) |
| 3257 | { |
| 3258 | return (vector signed char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3259 | } |
| 3260 | |
| 3261 | static vector unsigned char __ATTRS_o_ai |
| 3262 | vec_sll(vector unsigned char a, vector unsigned char b) |
| 3263 | { |
| 3264 | return (vector unsigned char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3265 | } |
| 3266 | |
| 3267 | static vector unsigned char __ATTRS_o_ai |
| 3268 | vec_sll(vector unsigned char a, vector unsigned short b) |
| 3269 | { |
| 3270 | return (vector unsigned char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3271 | } |
| 3272 | |
| 3273 | static vector unsigned char __ATTRS_o_ai |
| 3274 | vec_sll(vector unsigned char a, vector unsigned int b) |
| 3275 | { |
| 3276 | return (vector unsigned char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3277 | } |
| 3278 | |
| 3279 | static vector short __ATTRS_o_ai |
| 3280 | vec_sll(vector short a, vector unsigned char b) |
| 3281 | { |
| 3282 | return (vector short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3283 | } |
| 3284 | |
| 3285 | static vector short __ATTRS_o_ai |
| 3286 | vec_sll(vector short a, vector unsigned short b) |
| 3287 | { |
| 3288 | return (vector short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3289 | } |
| 3290 | |
| 3291 | static vector short __ATTRS_o_ai |
| 3292 | vec_sll(vector short a, vector unsigned int b) |
| 3293 | { |
| 3294 | return (vector short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3295 | } |
| 3296 | |
| 3297 | static vector unsigned short __ATTRS_o_ai |
| 3298 | vec_sll(vector unsigned short a, vector unsigned char b) |
| 3299 | { |
| 3300 | return (vector unsigned short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3301 | } |
| 3302 | |
| 3303 | static vector unsigned short __ATTRS_o_ai |
| 3304 | vec_sll(vector unsigned short a, vector unsigned short b) |
| 3305 | { |
| 3306 | return (vector unsigned short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3307 | } |
| 3308 | |
| 3309 | static vector unsigned short __ATTRS_o_ai |
| 3310 | vec_sll(vector unsigned short a, vector unsigned int b) |
| 3311 | { |
| 3312 | return (vector unsigned short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3313 | } |
| 3314 | |
| 3315 | static vector int __ATTRS_o_ai |
| 3316 | vec_sll(vector int a, vector unsigned char b) |
| 3317 | { |
| 3318 | return (vector int)__builtin_altivec_vsl(a, (vector int)b); |
| 3319 | } |
| 3320 | |
| 3321 | static vector int __ATTRS_o_ai |
| 3322 | vec_sll(vector int a, vector unsigned short b) |
| 3323 | { |
| 3324 | return (vector int)__builtin_altivec_vsl(a, (vector int)b); |
| 3325 | } |
| 3326 | |
| 3327 | static vector int __ATTRS_o_ai |
| 3328 | vec_sll(vector int a, vector unsigned int b) |
| 3329 | { |
| 3330 | return (vector int)__builtin_altivec_vsl(a, (vector int)b); |
| 3331 | } |
| 3332 | |
| 3333 | static vector unsigned int __ATTRS_o_ai |
| 3334 | vec_sll(vector unsigned int a, vector unsigned char b) |
| 3335 | { |
| 3336 | return (vector unsigned int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3337 | } |
| 3338 | |
| 3339 | static vector unsigned int __ATTRS_o_ai |
| 3340 | vec_sll(vector unsigned int a, vector unsigned short b) |
| 3341 | { |
| 3342 | return (vector unsigned int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3343 | } |
| 3344 | |
| 3345 | static vector unsigned int __ATTRS_o_ai |
| 3346 | vec_sll(vector unsigned int a, vector unsigned int b) |
| 3347 | { |
| 3348 | return (vector unsigned int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3349 | } |
| 3350 | |
| 3351 | /* vec_vsl */ |
| 3352 | |
| 3353 | static vector signed char __ATTRS_o_ai |
| 3354 | vec_vsl(vector signed char a, vector unsigned char b) |
| 3355 | { |
| 3356 | return (vector signed char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3357 | } |
| 3358 | |
| 3359 | static vector signed char __ATTRS_o_ai |
| 3360 | vec_vsl(vector signed char a, vector unsigned short b) |
| 3361 | { |
| 3362 | return (vector signed char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3363 | } |
| 3364 | |
| 3365 | static vector signed char __ATTRS_o_ai |
| 3366 | vec_vsl(vector signed char a, vector unsigned int b) |
| 3367 | { |
| 3368 | return (vector signed char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3369 | } |
| 3370 | |
| 3371 | static vector unsigned char __ATTRS_o_ai |
| 3372 | vec_vsl(vector unsigned char a, vector unsigned char b) |
| 3373 | { |
| 3374 | return (vector unsigned char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3375 | } |
| 3376 | |
| 3377 | static vector unsigned char __ATTRS_o_ai |
| 3378 | vec_vsl(vector unsigned char a, vector unsigned short b) |
| 3379 | { |
| 3380 | return (vector unsigned char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3381 | } |
| 3382 | |
| 3383 | static vector unsigned char __ATTRS_o_ai |
| 3384 | vec_vsl(vector unsigned char a, vector unsigned int b) |
| 3385 | { |
| 3386 | return (vector unsigned char)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3387 | } |
| 3388 | |
| 3389 | static vector short __ATTRS_o_ai |
| 3390 | vec_vsl(vector short a, vector unsigned char b) |
| 3391 | { |
| 3392 | return (vector short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3393 | } |
| 3394 | |
| 3395 | static vector short __ATTRS_o_ai |
| 3396 | vec_vsl(vector short a, vector unsigned short b) |
| 3397 | { |
| 3398 | return (vector short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3399 | } |
| 3400 | |
| 3401 | static vector short __ATTRS_o_ai |
| 3402 | vec_vsl(vector short a, vector unsigned int b) |
| 3403 | { |
| 3404 | return (vector short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3405 | } |
| 3406 | |
| 3407 | static vector unsigned short __ATTRS_o_ai |
| 3408 | vec_vsl(vector unsigned short a, vector unsigned char b) |
| 3409 | { |
| 3410 | return (vector unsigned short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3411 | } |
| 3412 | |
| 3413 | static vector unsigned short __ATTRS_o_ai |
| 3414 | vec_vsl(vector unsigned short a, vector unsigned short b) |
| 3415 | { |
| 3416 | return (vector unsigned short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3417 | } |
| 3418 | |
| 3419 | static vector unsigned short __ATTRS_o_ai |
| 3420 | vec_vsl(vector unsigned short a, vector unsigned int b) |
| 3421 | { |
| 3422 | return (vector unsigned short)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3423 | } |
| 3424 | |
| 3425 | static vector int __ATTRS_o_ai |
| 3426 | vec_vsl(vector int a, vector unsigned char b) |
| 3427 | { |
| 3428 | return (vector int)__builtin_altivec_vsl(a, (vector int)b); |
| 3429 | } |
| 3430 | |
| 3431 | static vector int __ATTRS_o_ai |
| 3432 | vec_vsl(vector int a, vector unsigned short b) |
| 3433 | { |
| 3434 | return (vector int)__builtin_altivec_vsl(a, (vector int)b); |
| 3435 | } |
| 3436 | |
| 3437 | static vector int __ATTRS_o_ai |
| 3438 | vec_vsl(vector int a, vector unsigned int b) |
| 3439 | { |
| 3440 | return (vector int)__builtin_altivec_vsl(a, (vector int)b); |
| 3441 | } |
| 3442 | |
| 3443 | static vector unsigned int __ATTRS_o_ai |
| 3444 | vec_vsl(vector unsigned int a, vector unsigned char b) |
| 3445 | { |
| 3446 | return (vector unsigned int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3447 | } |
| 3448 | |
| 3449 | static vector unsigned int __ATTRS_o_ai |
| 3450 | vec_vsl(vector unsigned int a, vector unsigned short b) |
| 3451 | { |
| 3452 | return (vector unsigned int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3453 | } |
| 3454 | |
| 3455 | static vector unsigned int __ATTRS_o_ai |
| 3456 | vec_vsl(vector unsigned int a, vector unsigned int b) |
| 3457 | { |
| 3458 | return (vector unsigned int)__builtin_altivec_vsl((vector int)a, (vector int)b); |
| 3459 | } |
| 3460 | |
| 3461 | /* vec_slo */ |
| 3462 | |
| 3463 | static vector signed char __ATTRS_o_ai |
| 3464 | vec_slo(vector signed char a, vector signed char b) |
| 3465 | { |
| 3466 | return (vector signed char)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3467 | } |
| 3468 | |
| 3469 | static vector signed char __ATTRS_o_ai |
| 3470 | vec_slo(vector signed char a, vector unsigned char b) |
| 3471 | { |
| 3472 | return (vector signed char)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3473 | } |
| 3474 | |
| 3475 | static vector unsigned char __ATTRS_o_ai |
| 3476 | vec_slo(vector unsigned char a, vector signed char b) |
| 3477 | { |
| 3478 | return (vector unsigned char)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3479 | } |
| 3480 | |
| 3481 | static vector unsigned char __ATTRS_o_ai |
| 3482 | vec_slo(vector unsigned char a, vector unsigned char b) |
| 3483 | { |
| 3484 | return (vector unsigned char)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3485 | } |
| 3486 | |
| 3487 | static vector short __ATTRS_o_ai |
| 3488 | vec_slo(vector short a, vector signed char b) |
| 3489 | { |
| 3490 | return (vector short)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3491 | } |
| 3492 | |
| 3493 | static vector short __ATTRS_o_ai |
| 3494 | vec_slo(vector short a, vector unsigned char b) |
| 3495 | { |
| 3496 | return (vector short)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3497 | } |
| 3498 | |
| 3499 | static vector unsigned short __ATTRS_o_ai |
| 3500 | vec_slo(vector unsigned short a, vector signed char b) |
| 3501 | { |
| 3502 | return (vector unsigned short)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3503 | } |
| 3504 | |
| 3505 | static vector unsigned short __ATTRS_o_ai |
| 3506 | vec_slo(vector unsigned short a, vector unsigned char b) |
| 3507 | { |
| 3508 | return (vector unsigned short)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3509 | } |
| 3510 | |
| 3511 | static vector int __ATTRS_o_ai |
| 3512 | vec_slo(vector int a, vector signed char b) |
| 3513 | { |
| 3514 | return (vector int)__builtin_altivec_vslo(a, (vector int)b); |
| 3515 | } |
| 3516 | |
| 3517 | static vector int __ATTRS_o_ai |
| 3518 | vec_slo(vector int a, vector unsigned char b) |
| 3519 | { |
| 3520 | return (vector int)__builtin_altivec_vslo(a, (vector int)b); |
| 3521 | } |
| 3522 | |
| 3523 | static vector unsigned int __ATTRS_o_ai |
| 3524 | vec_slo(vector unsigned int a, vector signed char b) |
| 3525 | { |
| 3526 | return (vector unsigned int)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3527 | } |
| 3528 | |
| 3529 | static vector unsigned int __ATTRS_o_ai |
| 3530 | vec_slo(vector unsigned int a, vector unsigned char b) |
| 3531 | { |
| 3532 | return (vector unsigned int)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3533 | } |
| 3534 | |
| 3535 | static vector float __ATTRS_o_ai |
| 3536 | vec_slo(vector float a, vector signed char b) |
| 3537 | { |
| 3538 | return (vector float)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3539 | } |
| 3540 | |
| 3541 | static vector float __ATTRS_o_ai |
| 3542 | vec_slo(vector float a, vector unsigned char b) |
| 3543 | { |
| 3544 | return (vector float)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3545 | } |
| 3546 | |
| 3547 | /* vec_vslo */ |
| 3548 | |
| 3549 | static vector signed char __ATTRS_o_ai |
| 3550 | vec_vslo(vector signed char a, vector signed char b) |
| 3551 | { |
| 3552 | return (vector signed char)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3553 | } |
| 3554 | |
| 3555 | static vector signed char __ATTRS_o_ai |
| 3556 | vec_vslo(vector signed char a, vector unsigned char b) |
| 3557 | { |
| 3558 | return (vector signed char)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3559 | } |
| 3560 | |
| 3561 | static vector unsigned char __ATTRS_o_ai |
| 3562 | vec_vslo(vector unsigned char a, vector signed char b) |
| 3563 | { |
| 3564 | return (vector unsigned char)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3565 | } |
| 3566 | |
| 3567 | static vector unsigned char __ATTRS_o_ai |
| 3568 | vec_vslo(vector unsigned char a, vector unsigned char b) |
| 3569 | { |
| 3570 | return (vector unsigned char)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3571 | } |
| 3572 | |
| 3573 | static vector short __ATTRS_o_ai |
| 3574 | vec_vslo(vector short a, vector signed char b) |
| 3575 | { |
| 3576 | return (vector short)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3577 | } |
| 3578 | |
| 3579 | static vector short __ATTRS_o_ai |
| 3580 | vec_vslo(vector short a, vector unsigned char b) |
| 3581 | { |
| 3582 | return (vector short)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3583 | } |
| 3584 | |
| 3585 | static vector unsigned short __ATTRS_o_ai |
| 3586 | vec_vslo(vector unsigned short a, vector signed char b) |
| 3587 | { |
| 3588 | return (vector unsigned short)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3589 | } |
| 3590 | |
| 3591 | static vector unsigned short __ATTRS_o_ai |
| 3592 | vec_vslo(vector unsigned short a, vector unsigned char b) |
| 3593 | { |
| 3594 | return (vector unsigned short)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3595 | } |
| 3596 | |
| 3597 | static vector int __ATTRS_o_ai |
| 3598 | vec_vslo(vector int a, vector signed char b) |
| 3599 | { |
| 3600 | return (vector int)__builtin_altivec_vslo(a, (vector int)b); |
| 3601 | } |
| 3602 | |
| 3603 | static vector int __ATTRS_o_ai |
| 3604 | vec_vslo(vector int a, vector unsigned char b) |
| 3605 | { |
| 3606 | return (vector int)__builtin_altivec_vslo(a, (vector int)b); |
| 3607 | } |
| 3608 | |
| 3609 | static vector unsigned int __ATTRS_o_ai |
| 3610 | vec_vslo(vector unsigned int a, vector signed char b) |
| 3611 | { |
| 3612 | return (vector unsigned int)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3613 | } |
| 3614 | |
| 3615 | static vector unsigned int __ATTRS_o_ai |
| 3616 | vec_vslo(vector unsigned int a, vector unsigned char b) |
| 3617 | { |
| 3618 | return (vector unsigned int)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3619 | } |
| 3620 | |
| 3621 | static vector float __ATTRS_o_ai |
| 3622 | vec_vslo(vector float a, vector signed char b) |
| 3623 | { |
| 3624 | return (vector float)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3625 | } |
| 3626 | |
| 3627 | static vector float __ATTRS_o_ai |
| 3628 | vec_vslo(vector float a, vector unsigned char b) |
| 3629 | { |
| 3630 | return (vector float)__builtin_altivec_vslo((vector int)a, (vector int)b); |
| 3631 | } |
| 3632 | |
| 3633 | /* vec_splat */ |
| 3634 | |
| 3635 | static vector signed char __ATTRS_o_ai |
| 3636 | vec_splat(vector signed char a, unsigned char b) |
| 3637 | { |
| 3638 | return (vector signed char)vec_perm(a, a, (vector unsigned char)(b)); |
| 3639 | } |
| 3640 | |
| 3641 | static vector unsigned char __ATTRS_o_ai |
| 3642 | vec_splat(vector unsigned char a, unsigned char b) |
| 3643 | { |
| 3644 | return (vector unsigned char)vec_perm(a, a, (vector unsigned char)(b)); |
| 3645 | } |
| 3646 | |
| 3647 | static vector short __ATTRS_o_ai |
| 3648 | vec_splat(vector short a, unsigned char b) |
| 3649 | { |
| 3650 | b *= 2; |
| 3651 | return (vector short)vec_perm(a, a, (vector unsigned char) |
| 3652 | (b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1)); |
| 3653 | } |
| 3654 | |
| 3655 | static vector unsigned short __ATTRS_o_ai |
| 3656 | vec_splat(vector unsigned short a, unsigned char b) |
| 3657 | { |
| 3658 | b *= 2; |
| 3659 | return (vector unsigned short)vec_perm(a, a, (vector unsigned char) |
| 3660 | (b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1)); |
| 3661 | } |
| 3662 | |
| 3663 | static vector int __ATTRS_o_ai |
| 3664 | vec_splat(vector int a, unsigned char b) |
| 3665 | { |
| 3666 | b *= 4; |
| 3667 | return vec_perm(a, a, (vector unsigned char) |
| 3668 | (b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3)); |
| 3669 | } |
| 3670 | |
| 3671 | static vector unsigned int __ATTRS_o_ai |
| 3672 | vec_splat(vector unsigned int a, unsigned char b) |
| 3673 | { |
| 3674 | b *= 4; |
| 3675 | return (vector unsigned int)vec_perm(a, a, (vector unsigned char) |
| 3676 | (b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3)); |
| 3677 | } |
| 3678 | |
| 3679 | static vector float __ATTRS_o_ai |
| 3680 | vec_splat(vector float a, unsigned char b) |
| 3681 | { |
| 3682 | b *= 4; |
| 3683 | return (vector float)vec_perm(a, a, (vector unsigned char) |
| 3684 | (b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3)); |
| 3685 | } |
| 3686 | |
| 3687 | /* vec_vspltb */ |
| 3688 | |
| 3689 | #define __builtin_altivec_vspltb vec_vspltb |
| 3690 | |
| 3691 | static vector signed char __ATTRS_o_ai |
| 3692 | vec_vspltb(vector signed char a, unsigned char b) |
| 3693 | { |
| 3694 | return (vector signed char)vec_perm(a, a, (vector unsigned char)(b)); |
| 3695 | } |
| 3696 | |
| 3697 | static vector unsigned char __ATTRS_o_ai |
| 3698 | vec_vspltb(vector unsigned char a, unsigned char b) |
| 3699 | { |
| 3700 | return (vector unsigned char)vec_perm(a, a, (vector unsigned char)(b)); |
| 3701 | } |
| 3702 | |
| 3703 | /* vec_vsplth */ |
| 3704 | |
| 3705 | #define __builtin_altivec_vsplth vec_vsplth |
| 3706 | |
| 3707 | static vector short __ATTRS_o_ai |
| 3708 | vec_vsplth(vector short a, unsigned char b) |
| 3709 | { |
| 3710 | b *= 2; |
| 3711 | return (vector short)vec_perm(a, a, (vector unsigned char) |
| 3712 | (b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1)); |
| 3713 | } |
| 3714 | |
| 3715 | static vector unsigned short __ATTRS_o_ai |
| 3716 | vec_vsplth(vector unsigned short a, unsigned char b) |
| 3717 | { |
| 3718 | b *= 2; |
| 3719 | return (vector unsigned short)vec_perm(a, a, (vector unsigned char) |
| 3720 | (b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1, b, b+1)); |
| 3721 | } |
| 3722 | |
| 3723 | /* vec_vspltw */ |
| 3724 | |
| 3725 | #define __builtin_altivec_vspltw vec_vspltw |
| 3726 | |
| 3727 | static vector int __ATTRS_o_ai |
| 3728 | vec_vspltw(vector int a, unsigned char b) |
| 3729 | { |
| 3730 | b *= 4; |
| 3731 | return (vector int)vec_perm(a, a, (vector unsigned char) |
| 3732 | (b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3)); |
| 3733 | } |
| 3734 | |
| 3735 | static vector unsigned int __ATTRS_o_ai |
| 3736 | vec_vspltw(vector unsigned int a, unsigned char b) |
| 3737 | { |
| 3738 | b *= 4; |
| 3739 | return (vector unsigned int)vec_perm(a, a, (vector unsigned char) |
| 3740 | (b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3)); |
| 3741 | } |
| 3742 | |
| 3743 | static vector float __ATTRS_o_ai |
| 3744 | vec_vspltw(vector float a, unsigned char b) |
| 3745 | { |
| 3746 | b *= 4; |
| 3747 | return (vector float)vec_perm(a, a, (vector unsigned char) |
| 3748 | (b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3, b, b+1, b+2, b+3)); |
| 3749 | } |
| 3750 | |
| 3751 | /* vec_splat_s8 */ |
| 3752 | |
| 3753 | #define __builtin_altivec_vspltisb vec_splat_s8 |
| 3754 | |
| 3755 | // FIXME: parameter should be treated as 5-bit signed literal |
| 3756 | static vector signed char __ATTRS_o_ai |
| 3757 | vec_splat_s8(signed char a) |
| 3758 | { |
| 3759 | return (vector signed char)(a); |
| 3760 | } |
| 3761 | |
| 3762 | /* vec_vspltisb */ |
| 3763 | |
| 3764 | // FIXME: parameter should be treated as 5-bit signed literal |
| 3765 | static vector signed char __ATTRS_o_ai |
| 3766 | vec_vspltisb(signed char a) |
| 3767 | { |
| 3768 | return (vector signed char)(a); |
| 3769 | } |
| 3770 | |
| 3771 | /* vec_splat_s16 */ |
| 3772 | |
| 3773 | #define __builtin_altivec_vspltish vec_splat_s16 |
| 3774 | |
| 3775 | // FIXME: parameter should be treated as 5-bit signed literal |
| 3776 | static vector short __ATTRS_o_ai |
| 3777 | vec_splat_s16(signed char a) |
| 3778 | { |
| 3779 | return (vector short)(a); |
| 3780 | } |
| 3781 | |
| 3782 | /* vec_vspltish */ |
| 3783 | |
| 3784 | // FIXME: parameter should be treated as 5-bit signed literal |
| 3785 | static vector short __ATTRS_o_ai |
| 3786 | vec_vspltish(signed char a) |
| 3787 | { |
| 3788 | return (vector short)(a); |
| 3789 | } |
| 3790 | |
| 3791 | /* vec_splat_s32 */ |
| 3792 | |
| 3793 | #define __builtin_altivec_vspltisw vec_splat_s32 |
| 3794 | |
| 3795 | // FIXME: parameter should be treated as 5-bit signed literal |
| 3796 | static vector int __ATTRS_o_ai |
| 3797 | vec_splat_s32(signed char a) |
| 3798 | { |
| 3799 | return (vector int)(a); |
| 3800 | } |
| 3801 | |
| 3802 | /* vec_vspltisw */ |
| 3803 | |
| 3804 | // FIXME: parameter should be treated as 5-bit signed literal |
| 3805 | static vector int __ATTRS_o_ai |
| 3806 | vec_vspltisw(signed char a) |
| 3807 | { |
| 3808 | return (vector int)(a); |
| 3809 | } |
| 3810 | |
| 3811 | /* vec_splat_u8 */ |
| 3812 | |
| 3813 | // FIXME: parameter should be treated as 5-bit signed literal |
| 3814 | static vector unsigned char __ATTRS_o_ai |
| 3815 | vec_splat_u8(unsigned char a) |
| 3816 | { |
| 3817 | return (vector unsigned char)(a); |
| 3818 | } |
| 3819 | |
| 3820 | /* vec_splat_u16 */ |
| 3821 | |
| 3822 | // FIXME: parameter should be treated as 5-bit signed literal |
| 3823 | static vector unsigned short __ATTRS_o_ai |
| 3824 | vec_splat_u16(signed char a) |
| 3825 | { |
| 3826 | return (vector unsigned short)(a); |
| 3827 | } |
| 3828 | |
| 3829 | /* vec_splat_u32 */ |
| 3830 | |
| 3831 | // FIXME: parameter should be treated as 5-bit signed literal |
| 3832 | static vector unsigned int __ATTRS_o_ai |
| 3833 | vec_splat_u32(signed char a) |
| 3834 | { |
| 3835 | return (vector unsigned int)(a); |
| 3836 | } |
| 3837 | |
| 3838 | /* vec_sr */ |
| 3839 | |
| 3840 | static vector signed char __ATTRS_o_ai |
| 3841 | vec_sr(vector signed char a, vector unsigned char b) |
| 3842 | { |
| 3843 | return a >> (vector signed char)b; |
| 3844 | } |
| 3845 | |
| 3846 | static vector unsigned char __ATTRS_o_ai |
| 3847 | vec_sr(vector unsigned char a, vector unsigned char b) |
| 3848 | { |
| 3849 | return a >> b; |
| 3850 | } |
| 3851 | |
| 3852 | static vector short __ATTRS_o_ai |
| 3853 | vec_sr(vector short a, vector unsigned short b) |
| 3854 | { |
| 3855 | return a >> (vector short)b; |
| 3856 | } |
| 3857 | |
| 3858 | static vector unsigned short __ATTRS_o_ai |
| 3859 | vec_sr(vector unsigned short a, vector unsigned short b) |
| 3860 | { |
| 3861 | return a >> b; |
| 3862 | } |
| 3863 | |
| 3864 | static vector int __ATTRS_o_ai |
| 3865 | vec_sr(vector int a, vector unsigned int b) |
| 3866 | { |
| 3867 | return a >> (vector int)b; |
| 3868 | } |
| 3869 | |
| 3870 | static vector unsigned int __ATTRS_o_ai |
| 3871 | vec_sr(vector unsigned int a, vector unsigned int b) |
| 3872 | { |
| 3873 | return a >> b; |
| 3874 | } |
| 3875 | |
| 3876 | /* vec_vsrb */ |
| 3877 | |
| 3878 | #define __builtin_altivec_vsrb vec_vsrb |
| 3879 | |
| 3880 | static vector signed char __ATTRS_o_ai |
| 3881 | vec_vsrb(vector signed char a, vector unsigned char b) |
| 3882 | { |
| 3883 | return a >> (vector signed char)b; |
| 3884 | } |
| 3885 | |
| 3886 | static vector unsigned char __ATTRS_o_ai |
| 3887 | vec_vsrb(vector unsigned char a, vector unsigned char b) |
| 3888 | { |
| 3889 | return a >> b; |
| 3890 | } |
| 3891 | |
| 3892 | /* vec_vsrh */ |
| 3893 | |
| 3894 | #define __builtin_altivec_vsrh vec_vsrh |
| 3895 | |
| 3896 | static vector short __ATTRS_o_ai |
| 3897 | vec_vsrh(vector short a, vector unsigned short b) |
| 3898 | { |
| 3899 | return a >> (vector short)b; |
| 3900 | } |
| 3901 | |
| 3902 | static vector unsigned short __ATTRS_o_ai |
| 3903 | vec_vsrh(vector unsigned short a, vector unsigned short b) |
| 3904 | { |
| 3905 | return a >> b; |
| 3906 | } |
| 3907 | |
| 3908 | /* vec_vsrw */ |
| 3909 | |
| 3910 | #define __builtin_altivec_vsrw vec_vsrw |
| 3911 | |
| 3912 | static vector int __ATTRS_o_ai |
| 3913 | vec_vsrw(vector int a, vector unsigned int b) |
| 3914 | { |
| 3915 | return a >> (vector int)b; |
| 3916 | } |
| 3917 | |
| 3918 | static vector unsigned int __ATTRS_o_ai |
| 3919 | vec_vsrw(vector unsigned int a, vector unsigned int b) |
| 3920 | { |
| 3921 | return a >> b; |
| 3922 | } |
| 3923 | |
| 3924 | /* vec_sra */ |
| 3925 | |
| 3926 | static vector signed char __ATTRS_o_ai |
| 3927 | vec_sra(vector signed char a, vector unsigned char b) |
| 3928 | { |
| 3929 | return (vector signed char)__builtin_altivec_vsrab((vector char)a, b); |
| 3930 | } |
| 3931 | |
| 3932 | static vector unsigned char __ATTRS_o_ai |
| 3933 | vec_sra(vector unsigned char a, vector unsigned char b) |
| 3934 | { |
| 3935 | return (vector unsigned char)__builtin_altivec_vsrab((vector char)a, b); |
| 3936 | } |
| 3937 | |
| 3938 | static vector short __ATTRS_o_ai |
| 3939 | vec_sra(vector short a, vector unsigned short b) |
| 3940 | { |
| 3941 | return __builtin_altivec_vsrah(a, (vector unsigned short)b); |
| 3942 | } |
| 3943 | |
| 3944 | static vector unsigned short __ATTRS_o_ai |
| 3945 | vec_sra(vector unsigned short a, vector unsigned short b) |
| 3946 | { |
| 3947 | return (vector unsigned short)__builtin_altivec_vsrah((vector short)a, b); |
| 3948 | } |
| 3949 | |
| 3950 | static vector int __ATTRS_o_ai |
| 3951 | vec_sra(vector int a, vector unsigned int b) |
| 3952 | { |
| 3953 | return __builtin_altivec_vsraw(a, b); |
| 3954 | } |
| 3955 | |
| 3956 | static vector unsigned int __ATTRS_o_ai |
| 3957 | vec_sra(vector unsigned int a, vector unsigned int b) |
| 3958 | { |
| 3959 | return (vector unsigned int)__builtin_altivec_vsraw((vector int)a, b); |
| 3960 | } |
| 3961 | |
| 3962 | /* vec_vsrab */ |
| 3963 | |
| 3964 | static vector signed char __ATTRS_o_ai |
| 3965 | vec_vsrab(vector signed char a, vector unsigned char b) |
| 3966 | { |
| 3967 | return (vector signed char)__builtin_altivec_vsrab((vector char)a, b); |
| 3968 | } |
| 3969 | |
| 3970 | static vector unsigned char __ATTRS_o_ai |
| 3971 | vec_vsrab(vector unsigned char a, vector unsigned char b) |
| 3972 | { |
| 3973 | return (vector unsigned char)__builtin_altivec_vsrab((vector char)a, b); |
| 3974 | } |
| 3975 | |
| 3976 | /* vec_vsrah */ |
| 3977 | |
| 3978 | static vector short __ATTRS_o_ai |
| 3979 | vec_vsrah(vector short a, vector unsigned short b) |
| 3980 | { |
| 3981 | return __builtin_altivec_vsrah(a, (vector unsigned short)b); |
| 3982 | } |
| 3983 | |
| 3984 | static vector unsigned short __ATTRS_o_ai |
| 3985 | vec_vsrah(vector unsigned short a, vector unsigned short b) |
| 3986 | { |
| 3987 | return (vector unsigned short)__builtin_altivec_vsrah((vector short)a, b); |
| 3988 | } |
| 3989 | |
| 3990 | /* vec_vsraw */ |
| 3991 | |
| 3992 | static vector int __ATTRS_o_ai |
| 3993 | vec_vsraw(vector int a, vector unsigned int b) |
| 3994 | { |
| 3995 | return __builtin_altivec_vsraw(a, b); |
| 3996 | } |
| 3997 | |
| 3998 | static vector unsigned int __ATTRS_o_ai |
| 3999 | vec_vsraw(vector unsigned int a, vector unsigned int b) |
| 4000 | { |
| 4001 | return (vector unsigned int)__builtin_altivec_vsraw((vector int)a, b); |
| 4002 | } |
| 4003 | |
| 4004 | /* vec_srl */ |
| 4005 | |
| 4006 | static vector signed char __ATTRS_o_ai |
| 4007 | vec_srl(vector signed char a, vector unsigned char b) |
| 4008 | { |
| 4009 | return (vector signed char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4010 | } |
| 4011 | |
| 4012 | static vector signed char __ATTRS_o_ai |
| 4013 | vec_srl(vector signed char a, vector unsigned short b) |
| 4014 | { |
| 4015 | return (vector signed char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4016 | } |
| 4017 | |
| 4018 | static vector signed char __ATTRS_o_ai |
| 4019 | vec_srl(vector signed char a, vector unsigned int b) |
| 4020 | { |
| 4021 | return (vector signed char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4022 | } |
| 4023 | |
| 4024 | static vector unsigned char __ATTRS_o_ai |
| 4025 | vec_srl(vector unsigned char a, vector unsigned char b) |
| 4026 | { |
| 4027 | return (vector unsigned char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4028 | } |
| 4029 | |
| 4030 | static vector unsigned char __ATTRS_o_ai |
| 4031 | vec_srl(vector unsigned char a, vector unsigned short b) |
| 4032 | { |
| 4033 | return (vector unsigned char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4034 | } |
| 4035 | |
| 4036 | static vector unsigned char __ATTRS_o_ai |
| 4037 | vec_srl(vector unsigned char a, vector unsigned int b) |
| 4038 | { |
| 4039 | return (vector unsigned char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4040 | } |
| 4041 | |
| 4042 | static vector short __ATTRS_o_ai |
| 4043 | vec_srl(vector short a, vector unsigned char b) |
| 4044 | { |
| 4045 | return (vector short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4046 | } |
| 4047 | |
| 4048 | static vector short __ATTRS_o_ai |
| 4049 | vec_srl(vector short a, vector unsigned short b) |
| 4050 | { |
| 4051 | return (vector short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4052 | } |
| 4053 | |
| 4054 | static vector short __ATTRS_o_ai |
| 4055 | vec_srl(vector short a, vector unsigned int b) |
| 4056 | { |
| 4057 | return (vector short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4058 | } |
| 4059 | |
| 4060 | static vector unsigned short __ATTRS_o_ai |
| 4061 | vec_srl(vector unsigned short a, vector unsigned char b) |
| 4062 | { |
| 4063 | return (vector unsigned short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4064 | } |
| 4065 | |
| 4066 | static vector unsigned short __ATTRS_o_ai |
| 4067 | vec_srl(vector unsigned short a, vector unsigned short b) |
| 4068 | { |
| 4069 | return (vector unsigned short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4070 | } |
| 4071 | |
| 4072 | static vector unsigned short __ATTRS_o_ai |
| 4073 | vec_srl(vector unsigned short a, vector unsigned int b) |
| 4074 | { |
| 4075 | return (vector unsigned short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4076 | } |
| 4077 | |
| 4078 | static vector int __ATTRS_o_ai |
| 4079 | vec_srl(vector int a, vector unsigned char b) |
| 4080 | { |
| 4081 | return (vector int)__builtin_altivec_vsr(a, (vector int)b); |
| 4082 | } |
| 4083 | |
| 4084 | static vector int __ATTRS_o_ai |
| 4085 | vec_srl(vector int a, vector unsigned short b) |
| 4086 | { |
| 4087 | return (vector int)__builtin_altivec_vsr(a, (vector int)b); |
| 4088 | } |
| 4089 | |
| 4090 | static vector int __ATTRS_o_ai |
| 4091 | vec_srl(vector int a, vector unsigned int b) |
| 4092 | { |
| 4093 | return (vector int)__builtin_altivec_vsr(a, (vector int)b); |
| 4094 | } |
| 4095 | |
| 4096 | static vector unsigned int __ATTRS_o_ai |
| 4097 | vec_srl(vector unsigned int a, vector unsigned char b) |
| 4098 | { |
| 4099 | return (vector unsigned int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4100 | } |
| 4101 | |
| 4102 | static vector unsigned int __ATTRS_o_ai |
| 4103 | vec_srl(vector unsigned int a, vector unsigned short b) |
| 4104 | { |
| 4105 | return (vector unsigned int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4106 | } |
| 4107 | |
| 4108 | static vector unsigned int __ATTRS_o_ai |
| 4109 | vec_srl(vector unsigned int a, vector unsigned int b) |
| 4110 | { |
| 4111 | return (vector unsigned int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4112 | } |
| 4113 | |
| 4114 | /* vec_vsr */ |
| 4115 | |
| 4116 | static vector signed char __ATTRS_o_ai |
| 4117 | vec_vsr(vector signed char a, vector unsigned char b) |
| 4118 | { |
| 4119 | return (vector signed char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4120 | } |
| 4121 | |
| 4122 | static vector signed char __ATTRS_o_ai |
| 4123 | vec_vsr(vector signed char a, vector unsigned short b) |
| 4124 | { |
| 4125 | return (vector signed char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4126 | } |
| 4127 | |
| 4128 | static vector signed char __ATTRS_o_ai |
| 4129 | vec_vsr(vector signed char a, vector unsigned int b) |
| 4130 | { |
| 4131 | return (vector signed char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4132 | } |
| 4133 | |
| 4134 | static vector unsigned char __ATTRS_o_ai |
| 4135 | vec_vsr(vector unsigned char a, vector unsigned char b) |
| 4136 | { |
| 4137 | return (vector unsigned char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4138 | } |
| 4139 | |
| 4140 | static vector unsigned char __ATTRS_o_ai |
| 4141 | vec_vsr(vector unsigned char a, vector unsigned short b) |
| 4142 | { |
| 4143 | return (vector unsigned char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4144 | } |
| 4145 | |
| 4146 | static vector unsigned char __ATTRS_o_ai |
| 4147 | vec_vsr(vector unsigned char a, vector unsigned int b) |
| 4148 | { |
| 4149 | return (vector unsigned char)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4150 | } |
| 4151 | |
| 4152 | static vector short __ATTRS_o_ai |
| 4153 | vec_vsr(vector short a, vector unsigned char b) |
| 4154 | { |
| 4155 | return (vector short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4156 | } |
| 4157 | |
| 4158 | static vector short __ATTRS_o_ai |
| 4159 | vec_vsr(vector short a, vector unsigned short b) |
| 4160 | { |
| 4161 | return (vector short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4162 | } |
| 4163 | |
| 4164 | static vector short __ATTRS_o_ai |
| 4165 | vec_vsr(vector short a, vector unsigned int b) |
| 4166 | { |
| 4167 | return (vector short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4168 | } |
| 4169 | |
| 4170 | static vector unsigned short __ATTRS_o_ai |
| 4171 | vec_vsr(vector unsigned short a, vector unsigned char b) |
| 4172 | { |
| 4173 | return (vector unsigned short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4174 | } |
| 4175 | |
| 4176 | static vector unsigned short __ATTRS_o_ai |
| 4177 | vec_vsr(vector unsigned short a, vector unsigned short b) |
| 4178 | { |
| 4179 | return (vector unsigned short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4180 | } |
| 4181 | |
| 4182 | static vector unsigned short __ATTRS_o_ai |
| 4183 | vec_vsr(vector unsigned short a, vector unsigned int b) |
| 4184 | { |
| 4185 | return (vector unsigned short)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4186 | } |
| 4187 | |
| 4188 | static vector int __ATTRS_o_ai |
| 4189 | vec_vsr(vector int a, vector unsigned char b) |
| 4190 | { |
| 4191 | return (vector int)__builtin_altivec_vsr(a, (vector int)b); |
| 4192 | } |
| 4193 | |
| 4194 | static vector int __ATTRS_o_ai |
| 4195 | vec_vsr(vector int a, vector unsigned short b) |
| 4196 | { |
| 4197 | return (vector int)__builtin_altivec_vsr(a, (vector int)b); |
| 4198 | } |
| 4199 | |
| 4200 | static vector int __ATTRS_o_ai |
| 4201 | vec_vsr(vector int a, vector unsigned int b) |
| 4202 | { |
| 4203 | return (vector int)__builtin_altivec_vsr(a, (vector int)b); |
| 4204 | } |
| 4205 | |
| 4206 | static vector unsigned int __ATTRS_o_ai |
| 4207 | vec_vsr(vector unsigned int a, vector unsigned char b) |
| 4208 | { |
| 4209 | return (vector unsigned int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4210 | } |
| 4211 | |
| 4212 | static vector unsigned int __ATTRS_o_ai |
| 4213 | vec_vsr(vector unsigned int a, vector unsigned short b) |
| 4214 | { |
| 4215 | return (vector unsigned int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4216 | } |
| 4217 | |
| 4218 | static vector unsigned int __ATTRS_o_ai |
| 4219 | vec_vsr(vector unsigned int a, vector unsigned int b) |
| 4220 | { |
| 4221 | return (vector unsigned int)__builtin_altivec_vsr((vector int)a, (vector int)b); |
| 4222 | } |
| 4223 | |
| 4224 | /* vec_sro */ |
| 4225 | |
| 4226 | static vector signed char __ATTRS_o_ai |
| 4227 | vec_sro(vector signed char a, vector signed char b) |
| 4228 | { |
| 4229 | return (vector signed char)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4230 | } |
| 4231 | |
| 4232 | static vector signed char __ATTRS_o_ai |
| 4233 | vec_sro(vector signed char a, vector unsigned char b) |
| 4234 | { |
| 4235 | return (vector signed char)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4236 | } |
| 4237 | |
| 4238 | static vector unsigned char __ATTRS_o_ai |
| 4239 | vec_sro(vector unsigned char a, vector signed char b) |
| 4240 | { |
| 4241 | return (vector unsigned char)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4242 | } |
| 4243 | |
| 4244 | static vector unsigned char __ATTRS_o_ai |
| 4245 | vec_sro(vector unsigned char a, vector unsigned char b) |
| 4246 | { |
| 4247 | return (vector unsigned char)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4248 | } |
| 4249 | |
| 4250 | static vector short __ATTRS_o_ai |
| 4251 | vec_sro(vector short a, vector signed char b) |
| 4252 | { |
| 4253 | return (vector short)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4254 | } |
| 4255 | |
| 4256 | static vector short __ATTRS_o_ai |
| 4257 | vec_sro(vector short a, vector unsigned char b) |
| 4258 | { |
| 4259 | return (vector short)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4260 | } |
| 4261 | |
| 4262 | static vector unsigned short __ATTRS_o_ai |
| 4263 | vec_sro(vector unsigned short a, vector signed char b) |
| 4264 | { |
| 4265 | return (vector unsigned short)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4266 | } |
| 4267 | |
| 4268 | static vector unsigned short __ATTRS_o_ai |
| 4269 | vec_sro(vector unsigned short a, vector unsigned char b) |
| 4270 | { |
| 4271 | return (vector unsigned short)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4272 | } |
| 4273 | |
| 4274 | static vector int __ATTRS_o_ai |
| 4275 | vec_sro(vector int a, vector signed char b) |
| 4276 | { |
| 4277 | return (vector int)__builtin_altivec_vsro(a, (vector int)b); |
| 4278 | } |
| 4279 | |
| 4280 | static vector int __ATTRS_o_ai |
| 4281 | vec_sro(vector int a, vector unsigned char b) |
| 4282 | { |
| 4283 | return (vector int)__builtin_altivec_vsro(a, (vector int)b); |
| 4284 | } |
| 4285 | |
| 4286 | static vector unsigned int __ATTRS_o_ai |
| 4287 | vec_sro(vector unsigned int a, vector signed char b) |
| 4288 | { |
| 4289 | return (vector unsigned int)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4290 | } |
| 4291 | |
| 4292 | static vector unsigned int __ATTRS_o_ai |
| 4293 | vec_sro(vector unsigned int a, vector unsigned char b) |
| 4294 | { |
| 4295 | return (vector unsigned int)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4296 | } |
| 4297 | |
| 4298 | static vector float __ATTRS_o_ai |
| 4299 | vec_sro(vector float a, vector signed char b) |
| 4300 | { |
| 4301 | return (vector float)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4302 | } |
| 4303 | |
| 4304 | static vector float __ATTRS_o_ai |
| 4305 | vec_sro(vector float a, vector unsigned char b) |
| 4306 | { |
| 4307 | return (vector float)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4308 | } |
| 4309 | |
| 4310 | /* vec_vsro */ |
| 4311 | |
| 4312 | static vector signed char __ATTRS_o_ai |
| 4313 | vec_vsro(vector signed char a, vector signed char b) |
| 4314 | { |
| 4315 | return (vector signed char)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4316 | } |
| 4317 | |
| 4318 | static vector signed char __ATTRS_o_ai |
| 4319 | vec_vsro(vector signed char a, vector unsigned char b) |
| 4320 | { |
| 4321 | return (vector signed char)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4322 | } |
| 4323 | |
| 4324 | static vector unsigned char __ATTRS_o_ai |
| 4325 | vec_vsro(vector unsigned char a, vector signed char b) |
| 4326 | { |
| 4327 | return (vector unsigned char)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4328 | } |
| 4329 | |
| 4330 | static vector unsigned char __ATTRS_o_ai |
| 4331 | vec_vsro(vector unsigned char a, vector unsigned char b) |
| 4332 | { |
| 4333 | return (vector unsigned char)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4334 | } |
| 4335 | |
| 4336 | static vector short __ATTRS_o_ai |
| 4337 | vec_vsro(vector short a, vector signed char b) |
| 4338 | { |
| 4339 | return (vector short)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4340 | } |
| 4341 | |
| 4342 | static vector short __ATTRS_o_ai |
| 4343 | vec_vsro(vector short a, vector unsigned char b) |
| 4344 | { |
| 4345 | return (vector short)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4346 | } |
| 4347 | |
| 4348 | static vector unsigned short __ATTRS_o_ai |
| 4349 | vec_vsro(vector unsigned short a, vector signed char b) |
| 4350 | { |
| 4351 | return (vector unsigned short)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4352 | } |
| 4353 | |
| 4354 | static vector unsigned short __ATTRS_o_ai |
| 4355 | vec_vsro(vector unsigned short a, vector unsigned char b) |
| 4356 | { |
| 4357 | return (vector unsigned short)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4358 | } |
| 4359 | |
| 4360 | static vector int __ATTRS_o_ai |
| 4361 | vec_vsro(vector int a, vector signed char b) |
| 4362 | { |
| 4363 | return (vector int)__builtin_altivec_vsro(a, (vector int)b); |
| 4364 | } |
| 4365 | |
| 4366 | static vector int __ATTRS_o_ai |
| 4367 | vec_vsro(vector int a, vector unsigned char b) |
| 4368 | { |
| 4369 | return (vector int)__builtin_altivec_vsro(a, (vector int)b); |
| 4370 | } |
| 4371 | |
| 4372 | static vector unsigned int __ATTRS_o_ai |
| 4373 | vec_vsro(vector unsigned int a, vector signed char b) |
| 4374 | { |
| 4375 | return (vector unsigned int)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4376 | } |
| 4377 | |
| 4378 | static vector unsigned int __ATTRS_o_ai |
| 4379 | vec_vsro(vector unsigned int a, vector unsigned char b) |
| 4380 | { |
| 4381 | return (vector unsigned int)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4382 | } |
| 4383 | |
| 4384 | static vector float __ATTRS_o_ai |
| 4385 | vec_vsro(vector float a, vector signed char b) |
| 4386 | { |
| 4387 | return (vector float)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4388 | } |
| 4389 | |
| 4390 | static vector float __ATTRS_o_ai |
| 4391 | vec_vsro(vector float a, vector unsigned char b) |
| 4392 | { |
| 4393 | return (vector float)__builtin_altivec_vsro((vector int)a, (vector int)b); |
| 4394 | } |
| 4395 | |
| 4396 | /* vec_st */ |
| 4397 | |
| 4398 | static void __ATTRS_o_ai |
| 4399 | vec_st(vector signed char a, int b, vector signed char *c) |
| 4400 | { |
| 4401 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4402 | } |
| 4403 | |
| 4404 | static void __ATTRS_o_ai |
| 4405 | vec_st(vector signed char a, int b, signed char *c) |
| 4406 | { |
| 4407 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4408 | } |
| 4409 | |
| 4410 | static void __ATTRS_o_ai |
| 4411 | vec_st(vector unsigned char a, int b, vector unsigned char *c) |
| 4412 | { |
| 4413 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4414 | } |
| 4415 | |
| 4416 | static void __ATTRS_o_ai |
| 4417 | vec_st(vector unsigned char a, int b, unsigned char *c) |
| 4418 | { |
| 4419 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4420 | } |
| 4421 | |
| 4422 | static void __ATTRS_o_ai |
| 4423 | vec_st(vector short a, int b, vector short *c) |
| 4424 | { |
| 4425 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4426 | } |
| 4427 | |
| 4428 | static void __ATTRS_o_ai |
| 4429 | vec_st(vector short a, int b, short *c) |
| 4430 | { |
| 4431 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4432 | } |
| 4433 | |
| 4434 | static void __ATTRS_o_ai |
| 4435 | vec_st(vector unsigned short a, int b, vector unsigned short *c) |
| 4436 | { |
| 4437 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4438 | } |
| 4439 | |
| 4440 | static void __ATTRS_o_ai |
| 4441 | vec_st(vector unsigned short a, int b, unsigned short *c) |
| 4442 | { |
| 4443 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4444 | } |
| 4445 | |
| 4446 | static void __ATTRS_o_ai |
| 4447 | vec_st(vector int a, int b, vector int *c) |
| 4448 | { |
| 4449 | __builtin_altivec_stvx(a, b, c); |
| 4450 | } |
| 4451 | |
| 4452 | static void __ATTRS_o_ai |
| 4453 | vec_st(vector int a, int b, int *c) |
| 4454 | { |
| 4455 | __builtin_altivec_stvx(a, b, c); |
| 4456 | } |
| 4457 | |
| 4458 | static void __ATTRS_o_ai |
| 4459 | vec_st(vector unsigned int a, int b, vector unsigned int *c) |
| 4460 | { |
| 4461 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4462 | } |
| 4463 | |
| 4464 | static void __ATTRS_o_ai |
| 4465 | vec_st(vector unsigned int a, int b, unsigned int *c) |
| 4466 | { |
| 4467 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4468 | } |
| 4469 | |
| 4470 | static void __ATTRS_o_ai |
| 4471 | vec_st(vector float a, int b, vector float *c) |
| 4472 | { |
| 4473 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4474 | } |
| 4475 | |
| 4476 | static void __ATTRS_o_ai |
| 4477 | vec_st(vector float a, int b, float *c) |
| 4478 | { |
| 4479 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4480 | } |
| 4481 | |
| 4482 | /* vec_stvx */ |
| 4483 | |
| 4484 | static void __ATTRS_o_ai |
| 4485 | vec_stvx(vector signed char a, int b, vector signed char *c) |
| 4486 | { |
| 4487 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4488 | } |
| 4489 | |
| 4490 | static void __ATTRS_o_ai |
| 4491 | vec_stvx(vector signed char a, int b, signed char *c) |
| 4492 | { |
| 4493 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4494 | } |
| 4495 | |
| 4496 | static void __ATTRS_o_ai |
| 4497 | vec_stvx(vector unsigned char a, int b, vector unsigned char *c) |
| 4498 | { |
| 4499 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4500 | } |
| 4501 | |
| 4502 | static void __ATTRS_o_ai |
| 4503 | vec_stvx(vector unsigned char a, int b, unsigned char *c) |
| 4504 | { |
| 4505 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4506 | } |
| 4507 | |
| 4508 | static void __ATTRS_o_ai |
| 4509 | vec_stvx(vector short a, int b, vector short *c) |
| 4510 | { |
| 4511 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4512 | } |
| 4513 | |
| 4514 | static void __ATTRS_o_ai |
| 4515 | vec_stvx(vector short a, int b, short *c) |
| 4516 | { |
| 4517 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4518 | } |
| 4519 | |
| 4520 | static void __ATTRS_o_ai |
| 4521 | vec_stvx(vector unsigned short a, int b, vector unsigned short *c) |
| 4522 | { |
| 4523 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4524 | } |
| 4525 | |
| 4526 | static void __ATTRS_o_ai |
| 4527 | vec_stvx(vector unsigned short a, int b, unsigned short *c) |
| 4528 | { |
| 4529 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4530 | } |
| 4531 | |
| 4532 | static void __ATTRS_o_ai |
| 4533 | vec_stvx(vector int a, int b, vector int *c) |
| 4534 | { |
| 4535 | __builtin_altivec_stvx(a, b, c); |
| 4536 | } |
| 4537 | |
| 4538 | static void __ATTRS_o_ai |
| 4539 | vec_stvx(vector int a, int b, int *c) |
| 4540 | { |
| 4541 | __builtin_altivec_stvx(a, b, c); |
| 4542 | } |
| 4543 | |
| 4544 | static void __ATTRS_o_ai |
| 4545 | vec_stvx(vector unsigned int a, int b, vector unsigned int *c) |
| 4546 | { |
| 4547 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4548 | } |
| 4549 | |
| 4550 | static void __ATTRS_o_ai |
| 4551 | vec_stvx(vector unsigned int a, int b, unsigned int *c) |
| 4552 | { |
| 4553 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4554 | } |
| 4555 | |
| 4556 | static void __ATTRS_o_ai |
| 4557 | vec_stvx(vector float a, int b, vector float *c) |
| 4558 | { |
| 4559 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4560 | } |
| 4561 | |
| 4562 | static void __ATTRS_o_ai |
| 4563 | vec_stvx(vector float a, int b, float *c) |
| 4564 | { |
| 4565 | __builtin_altivec_stvx((vector int)a, b, c); |
| 4566 | } |
| 4567 | |
| 4568 | /* vec_ste */ |
| 4569 | |
| 4570 | static void __ATTRS_o_ai |
| 4571 | vec_ste(vector signed char a, int b, signed char *c) |
| 4572 | { |
| 4573 | __builtin_altivec_stvebx((vector char)a, b, c); |
| 4574 | } |
| 4575 | |
| 4576 | static void __ATTRS_o_ai |
| 4577 | vec_ste(vector unsigned char a, int b, unsigned char *c) |
| 4578 | { |
| 4579 | __builtin_altivec_stvebx((vector char)a, b, c); |
| 4580 | } |
| 4581 | |
| 4582 | static void __ATTRS_o_ai |
| 4583 | vec_ste(vector short a, int b, short *c) |
| 4584 | { |
| 4585 | __builtin_altivec_stvehx(a, b, c); |
| 4586 | } |
| 4587 | |
| 4588 | static void __ATTRS_o_ai |
| 4589 | vec_ste(vector unsigned short a, int b, unsigned short *c) |
| 4590 | { |
| 4591 | __builtin_altivec_stvehx((vector short)a, b, c); |
| 4592 | } |
| 4593 | |
| 4594 | static void __ATTRS_o_ai |
| 4595 | vec_ste(vector int a, int b, int *c) |
| 4596 | { |
| 4597 | __builtin_altivec_stvewx(a, b, c); |
| 4598 | } |
| 4599 | |
| 4600 | static void __ATTRS_o_ai |
| 4601 | vec_ste(vector unsigned int a, int b, unsigned int *c) |
| 4602 | { |
| 4603 | __builtin_altivec_stvewx((vector int)a, b, c); |
| 4604 | } |
| 4605 | |
| 4606 | static void __ATTRS_o_ai |
| 4607 | vec_ste(vector float a, int b, float *c) |
| 4608 | { |
| 4609 | __builtin_altivec_stvewx((vector int)a, b, c); |
| 4610 | } |
| 4611 | |
| 4612 | /* vec_stvebx */ |
| 4613 | |
| 4614 | static void __ATTRS_o_ai |
| 4615 | vec_stvebx(vector signed char a, int b, signed char *c) |
| 4616 | { |
| 4617 | __builtin_altivec_stvebx((vector char)a, b, c); |
| 4618 | } |
| 4619 | |
| 4620 | static void __ATTRS_o_ai |
| 4621 | vec_stvebx(vector unsigned char a, int b, unsigned char *c) |
| 4622 | { |
| 4623 | __builtin_altivec_stvebx((vector char)a, b, c); |
| 4624 | } |
| 4625 | |
| 4626 | /* vec_stvehx */ |
| 4627 | |
| 4628 | static void __ATTRS_o_ai |
| 4629 | vec_stvehx(vector short a, int b, short *c) |
| 4630 | { |
| 4631 | __builtin_altivec_stvehx(a, b, c); |
| 4632 | } |
| 4633 | |
| 4634 | static void __ATTRS_o_ai |
| 4635 | vec_stvehx(vector unsigned short a, int b, unsigned short *c) |
| 4636 | { |
| 4637 | __builtin_altivec_stvehx((vector short)a, b, c); |
| 4638 | } |
| 4639 | |
| 4640 | /* vec_stvewx */ |
| 4641 | |
| 4642 | static void __ATTRS_o_ai |
| 4643 | vec_stvewx(vector int a, int b, int *c) |
| 4644 | { |
| 4645 | __builtin_altivec_stvewx(a, b, c); |
| 4646 | } |
| 4647 | |
| 4648 | static void __ATTRS_o_ai |
| 4649 | vec_stvewx(vector unsigned int a, int b, unsigned int *c) |
| 4650 | { |
| 4651 | __builtin_altivec_stvewx((vector int)a, b, c); |
| 4652 | } |
| 4653 | |
| 4654 | static void __ATTRS_o_ai |
| 4655 | vec_stvewx(vector float a, int b, float *c) |
| 4656 | { |
| 4657 | __builtin_altivec_stvewx((vector int)a, b, c); |
| 4658 | } |
| 4659 | |
| 4660 | /* vec_stl */ |
| 4661 | |
| 4662 | static void __ATTRS_o_ai |
| 4663 | vec_stl(vector signed char a, int b, vector signed char *c) |
| 4664 | { |
| 4665 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4666 | } |
| 4667 | |
| 4668 | static void __ATTRS_o_ai |
| 4669 | vec_stl(vector signed char a, int b, signed char *c) |
| 4670 | { |
| 4671 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4672 | } |
| 4673 | |
| 4674 | static void __ATTRS_o_ai |
| 4675 | vec_stl(vector unsigned char a, int b, vector unsigned char *c) |
| 4676 | { |
| 4677 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4678 | } |
| 4679 | |
| 4680 | static void __ATTRS_o_ai |
| 4681 | vec_stl(vector unsigned char a, int b, unsigned char *c) |
| 4682 | { |
| 4683 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4684 | } |
| 4685 | |
| 4686 | static void __ATTRS_o_ai |
| 4687 | vec_stl(vector short a, int b, vector short *c) |
| 4688 | { |
| 4689 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4690 | } |
| 4691 | |
| 4692 | static void __ATTRS_o_ai |
| 4693 | vec_stl(vector short a, int b, short *c) |
| 4694 | { |
| 4695 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4696 | } |
| 4697 | |
| 4698 | static void __ATTRS_o_ai |
| 4699 | vec_stl(vector unsigned short a, int b, vector unsigned short *c) |
| 4700 | { |
| 4701 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4702 | } |
| 4703 | |
| 4704 | static void __ATTRS_o_ai |
| 4705 | vec_stl(vector unsigned short a, int b, unsigned short *c) |
| 4706 | { |
| 4707 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4708 | } |
| 4709 | |
| 4710 | static void __ATTRS_o_ai |
| 4711 | vec_stl(vector int a, int b, vector int *c) |
| 4712 | { |
| 4713 | __builtin_altivec_stvxl(a, b, c); |
| 4714 | } |
| 4715 | |
| 4716 | static void __ATTRS_o_ai |
| 4717 | vec_stl(vector int a, int b, int *c) |
| 4718 | { |
| 4719 | __builtin_altivec_stvxl(a, b, c); |
| 4720 | } |
| 4721 | |
| 4722 | static void __ATTRS_o_ai |
| 4723 | vec_stl(vector unsigned int a, int b, vector unsigned int *c) |
| 4724 | { |
| 4725 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4726 | } |
| 4727 | |
| 4728 | static void __ATTRS_o_ai |
| 4729 | vec_stl(vector unsigned int a, int b, unsigned int *c) |
| 4730 | { |
| 4731 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4732 | } |
| 4733 | |
| 4734 | static void __ATTRS_o_ai |
| 4735 | vec_stl(vector float a, int b, vector float *c) |
| 4736 | { |
| 4737 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4738 | } |
| 4739 | |
| 4740 | static void __ATTRS_o_ai |
| 4741 | vec_stl(vector float a, int b, float *c) |
| 4742 | { |
| 4743 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4744 | } |
| 4745 | |
| 4746 | /* vec_stvxl */ |
| 4747 | |
| 4748 | static void __ATTRS_o_ai |
| 4749 | vec_stvxl(vector signed char a, int b, vector signed char *c) |
| 4750 | { |
| 4751 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4752 | } |
| 4753 | |
| 4754 | static void __ATTRS_o_ai |
| 4755 | vec_stvxl(vector signed char a, int b, signed char *c) |
| 4756 | { |
| 4757 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4758 | } |
| 4759 | |
| 4760 | static void __ATTRS_o_ai |
| 4761 | vec_stvxl(vector unsigned char a, int b, vector unsigned char *c) |
| 4762 | { |
| 4763 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4764 | } |
| 4765 | |
| 4766 | static void __ATTRS_o_ai |
| 4767 | vec_stvxl(vector unsigned char a, int b, unsigned char *c) |
| 4768 | { |
| 4769 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4770 | } |
| 4771 | |
| 4772 | static void __ATTRS_o_ai |
| 4773 | vec_stvxl(vector short a, int b, vector short *c) |
| 4774 | { |
| 4775 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4776 | } |
| 4777 | |
| 4778 | static void __ATTRS_o_ai |
| 4779 | vec_stvxl(vector short a, int b, short *c) |
| 4780 | { |
| 4781 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4782 | } |
| 4783 | |
| 4784 | static void __ATTRS_o_ai |
| 4785 | vec_stvxl(vector unsigned short a, int b, vector unsigned short *c) |
| 4786 | { |
| 4787 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4788 | } |
| 4789 | |
| 4790 | static void __ATTRS_o_ai |
| 4791 | vec_stvxl(vector unsigned short a, int b, unsigned short *c) |
| 4792 | { |
| 4793 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4794 | } |
| 4795 | |
| 4796 | static void __ATTRS_o_ai |
| 4797 | vec_stvxl(vector int a, int b, vector int *c) |
| 4798 | { |
| 4799 | __builtin_altivec_stvxl(a, b, c); |
| 4800 | } |
| 4801 | |
| 4802 | static void __ATTRS_o_ai |
| 4803 | vec_stvxl(vector int a, int b, int *c) |
| 4804 | { |
| 4805 | __builtin_altivec_stvxl(a, b, c); |
| 4806 | } |
| 4807 | |
| 4808 | static void __ATTRS_o_ai |
| 4809 | vec_stvxl(vector unsigned int a, int b, vector unsigned int *c) |
| 4810 | { |
| 4811 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4812 | } |
| 4813 | |
| 4814 | static void __ATTRS_o_ai |
| 4815 | vec_stvxl(vector unsigned int a, int b, unsigned int *c) |
| 4816 | { |
| 4817 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4818 | } |
| 4819 | |
| 4820 | static void __ATTRS_o_ai |
| 4821 | vec_stvxl(vector float a, int b, vector float *c) |
| 4822 | { |
| 4823 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4824 | } |
| 4825 | |
| 4826 | static void __ATTRS_o_ai |
| 4827 | vec_stvxl(vector float a, int b, float *c) |
| 4828 | { |
| 4829 | __builtin_altivec_stvxl((vector int)a, b, c); |
| 4830 | } |
| 4831 | |
| 4832 | /* vec_sub */ |
| 4833 | |
| 4834 | static vector signed char __ATTRS_o_ai |
| 4835 | vec_sub(vector signed char a, vector signed char b) |
| 4836 | { |
| 4837 | return a - b; |
| 4838 | } |
| 4839 | |
| 4840 | static vector unsigned char __ATTRS_o_ai |
| 4841 | vec_sub(vector unsigned char a, vector unsigned char b) |
| 4842 | { |
| 4843 | return a - b; |
| 4844 | } |
| 4845 | |
| 4846 | static vector short __ATTRS_o_ai |
| 4847 | vec_sub(vector short a, vector short b) |
| 4848 | { |
| 4849 | return a - b; |
| 4850 | } |
| 4851 | |
| 4852 | static vector unsigned short __ATTRS_o_ai |
| 4853 | vec_sub(vector unsigned short a, vector unsigned short b) |
| 4854 | { |
| 4855 | return a - b; |
| 4856 | } |
| 4857 | |
| 4858 | static vector int __ATTRS_o_ai |
| 4859 | vec_sub(vector int a, vector int b) |
| 4860 | { |
| 4861 | return a - b; |
| 4862 | } |
| 4863 | |
| 4864 | static vector unsigned int __ATTRS_o_ai |
| 4865 | vec_sub(vector unsigned int a, vector unsigned int b) |
| 4866 | { |
| 4867 | return a - b; |
| 4868 | } |
| 4869 | |
| 4870 | static vector float __ATTRS_o_ai |
| 4871 | vec_sub(vector float a, vector float b) |
| 4872 | { |
| 4873 | return a - b; |
| 4874 | } |
| 4875 | |
| 4876 | /* vec_vsububm */ |
| 4877 | |
| 4878 | #define __builtin_altivec_vsububm vec_vsububm |
| 4879 | |
| 4880 | static vector signed char __ATTRS_o_ai |
| 4881 | vec_vsububm(vector signed char a, vector signed char b) |
| 4882 | { |
| 4883 | return a - b; |
| 4884 | } |
| 4885 | |
| 4886 | static vector unsigned char __ATTRS_o_ai |
| 4887 | vec_vsububm(vector unsigned char a, vector unsigned char b) |
| 4888 | { |
| 4889 | return a - b; |
| 4890 | } |
| 4891 | |
| 4892 | /* vec_vsubuhm */ |
| 4893 | |
| 4894 | #define __builtin_altivec_vsubuhm vec_vsubuhm |
| 4895 | |
| 4896 | static vector short __ATTRS_o_ai |
| 4897 | vec_vsubuhm(vector short a, vector short b) |
| 4898 | { |
| 4899 | return a - b; |
| 4900 | } |
| 4901 | |
| 4902 | static vector unsigned short __ATTRS_o_ai |
| 4903 | vec_vsubuhm(vector unsigned short a, vector unsigned short b) |
| 4904 | { |
| 4905 | return a - b; |
| 4906 | } |
| 4907 | |
| 4908 | /* vec_vsubuwm */ |
| 4909 | |
| 4910 | #define __builtin_altivec_vsubuwm vec_vsubuwm |
| 4911 | |
| 4912 | static vector int __ATTRS_o_ai |
| 4913 | vec_vsubuwm(vector int a, vector int b) |
| 4914 | { |
| 4915 | return a - b; |
| 4916 | } |
| 4917 | |
| 4918 | static vector unsigned int __ATTRS_o_ai |
| 4919 | vec_vsubuwm(vector unsigned int a, vector unsigned int b) |
| 4920 | { |
| 4921 | return a - b; |
| 4922 | } |
| 4923 | |
| 4924 | /* vec_vsubfp */ |
| 4925 | |
| 4926 | #define __builtin_altivec_vsubfp vec_vsubfp |
| 4927 | |
| 4928 | static vector float __attribute__((__always_inline__)) |
| 4929 | vec_vsubfp(vector float a, vector float b) |
| 4930 | { |
| 4931 | return a - b; |
| 4932 | } |
| 4933 | |
| 4934 | /* vec_subc */ |
| 4935 | |
| 4936 | static vector unsigned int __attribute__((__always_inline__)) |
| 4937 | vec_subc(vector unsigned int a, vector unsigned int b) |
| 4938 | { |
| 4939 | return __builtin_altivec_vsubcuw(a, b); |
| 4940 | } |
| 4941 | |
| 4942 | /* vec_vsubcuw */ |
| 4943 | |
| 4944 | static vector unsigned int __attribute__((__always_inline__)) |
| 4945 | vec_vsubcuw(vector unsigned int a, vector unsigned int b) |
| 4946 | { |
| 4947 | return __builtin_altivec_vsubcuw(a, b); |
| 4948 | } |
| 4949 | |
| 4950 | /* vec_subs */ |
| 4951 | |
| 4952 | static vector signed char __ATTRS_o_ai |
| 4953 | vec_subs(vector signed char a, vector signed char b) |
| 4954 | { |
| 4955 | return __builtin_altivec_vsubsbs(a, b); |
| 4956 | } |
| 4957 | |
| 4958 | static vector unsigned char __ATTRS_o_ai |
| 4959 | vec_subs(vector unsigned char a, vector unsigned char b) |
| 4960 | { |
| 4961 | return __builtin_altivec_vsububs(a, b); |
| 4962 | } |
| 4963 | |
| 4964 | static vector short __ATTRS_o_ai |
| 4965 | vec_subs(vector short a, vector short b) |
| 4966 | { |
| 4967 | return __builtin_altivec_vsubshs(a, b); |
| 4968 | } |
| 4969 | |
| 4970 | static vector unsigned short __ATTRS_o_ai |
| 4971 | vec_subs(vector unsigned short a, vector unsigned short b) |
| 4972 | { |
| 4973 | return __builtin_altivec_vsubuhs(a, b); |
| 4974 | } |
| 4975 | |
| 4976 | static vector int __ATTRS_o_ai |
| 4977 | vec_subs(vector int a, vector int b) |
| 4978 | { |
| 4979 | return __builtin_altivec_vsubsws(a, b); |
| 4980 | } |
| 4981 | |
| 4982 | static vector unsigned int __ATTRS_o_ai |
| 4983 | vec_subs(vector unsigned int a, vector unsigned int b) |
| 4984 | { |
| 4985 | return __builtin_altivec_vsubuws(a, b); |
| 4986 | } |
| 4987 | |
| 4988 | /* vec_vsubsbs */ |
| 4989 | |
| 4990 | static vector signed char __attribute__((__always_inline__)) |
| 4991 | vec_vsubsbs(vector signed char a, vector signed char b) |
| 4992 | { |
| 4993 | return __builtin_altivec_vsubsbs(a, b); |
| 4994 | } |
| 4995 | |
| 4996 | /* vec_vsububs */ |
| 4997 | |
| 4998 | static vector unsigned char __attribute__((__always_inline__)) |
| 4999 | vec_vsububs(vector unsigned char a, vector unsigned char b) |
| 5000 | { |
| 5001 | return __builtin_altivec_vsububs(a, b); |
| 5002 | } |
| 5003 | |
| 5004 | /* vec_vsubshs */ |
| 5005 | |
| 5006 | static vector short __attribute__((__always_inline__)) |
| 5007 | vec_vsubshs(vector short a, vector short b) |
| 5008 | { |
| 5009 | return __builtin_altivec_vsubshs(a, b); |
| 5010 | } |
| 5011 | |
| 5012 | /* vec_vsubuhs */ |
| 5013 | |
| 5014 | static vector unsigned short __attribute__((__always_inline__)) |
| 5015 | vec_vsubuhs(vector unsigned short a, vector unsigned short b) |
| 5016 | { |
| 5017 | return __builtin_altivec_vsubuhs(a, b); |
| 5018 | } |
| 5019 | |
| 5020 | /* vec_vsubsws */ |
| 5021 | |
| 5022 | static vector int __attribute__((__always_inline__)) |
| 5023 | vec_vsubsws(vector int a, vector int b) |
| 5024 | { |
| 5025 | return __builtin_altivec_vsubsws(a, b); |
| 5026 | } |
| 5027 | |
| 5028 | /* vec_vsubuws */ |
| 5029 | |
| 5030 | static vector unsigned int __attribute__((__always_inline__)) |
| 5031 | vec_vsubuws(vector unsigned int a, vector unsigned int b) |
| 5032 | { |
| 5033 | return __builtin_altivec_vsubuws(a, b); |
| 5034 | } |
| 5035 | |
| 5036 | /* vec_sum4s */ |
| 5037 | |
| 5038 | static vector int __ATTRS_o_ai |
| 5039 | vec_sum4s(vector signed char a, vector int b) |
| 5040 | { |
| 5041 | return __builtin_altivec_vsum4sbs(a, b); |
| 5042 | } |
| 5043 | |
| 5044 | static vector unsigned int __ATTRS_o_ai |
| 5045 | vec_sum4s(vector unsigned char a, vector unsigned int b) |
| 5046 | { |
| 5047 | return __builtin_altivec_vsum4ubs(a, b); |
| 5048 | } |
| 5049 | |
| 5050 | static vector int __ATTRS_o_ai |
| 5051 | vec_sum4s(vector signed short a, vector int b) |
| 5052 | { |
| 5053 | return __builtin_altivec_vsum4shs(a, b); |
| 5054 | } |
| 5055 | |
| 5056 | /* vec_vsum4sbs */ |
| 5057 | |
| 5058 | static vector int __attribute__((__always_inline__)) |
| 5059 | vec_vsum4sbs(vector signed char a, vector int b) |
| 5060 | { |
| 5061 | return __builtin_altivec_vsum4sbs(a, b); |
| 5062 | } |
| 5063 | |
| 5064 | /* vec_vsum4ubs */ |
| 5065 | |
| 5066 | static vector unsigned int __attribute__((__always_inline__)) |
| 5067 | vec_vsum4ubs(vector unsigned char a, vector unsigned int b) |
| 5068 | { |
| 5069 | return __builtin_altivec_vsum4ubs(a, b); |
| 5070 | } |
| 5071 | |
| 5072 | /* vec_vsum4shs */ |
| 5073 | |
| 5074 | static vector int __attribute__((__always_inline__)) |
| 5075 | vec_vsum4shs(vector signed short a, vector int b) |
| 5076 | { |
| 5077 | return __builtin_altivec_vsum4shs(a, b); |
| 5078 | } |
| 5079 | |
| 5080 | /* vec_sum2s */ |
| 5081 | |
| 5082 | static vector signed int __attribute__((__always_inline__)) |
| 5083 | vec_sum2s(vector int a, vector int b) |
| 5084 | { |
| 5085 | return __builtin_altivec_vsum2sws(a, b); |
| 5086 | } |
| 5087 | |
| 5088 | /* vec_vsum2sws */ |
| 5089 | |
| 5090 | static vector signed int __attribute__((__always_inline__)) |
| 5091 | vec_vsum2sws(vector int a, vector int b) |
| 5092 | { |
| 5093 | return __builtin_altivec_vsum2sws(a, b); |
| 5094 | } |
| 5095 | |
| 5096 | /* vec_sums */ |
| 5097 | |
| 5098 | static vector signed int __attribute__((__always_inline__)) |
| 5099 | vec_sums(vector signed int a, vector signed int b) |
| 5100 | { |
| 5101 | return __builtin_altivec_vsumsws(a, b); |
| 5102 | } |
| 5103 | |
| 5104 | /* vec_vsumsws */ |
| 5105 | |
| 5106 | static vector signed int __attribute__((__always_inline__)) |
| 5107 | vec_vsumsws(vector signed int a, vector signed int b) |
| 5108 | { |
| 5109 | return __builtin_altivec_vsumsws(a, b); |
| 5110 | } |
| 5111 | |
| 5112 | /* vec_trunc */ |
| 5113 | |
| 5114 | static vector float __attribute__((__always_inline__)) |
| 5115 | vec_trunc(vector float a) |
| 5116 | { |
| 5117 | return __builtin_altivec_vrfiz(a); |
| 5118 | } |
| 5119 | |
| 5120 | /* vec_vrfiz */ |
| 5121 | |
| 5122 | static vector float __attribute__((__always_inline__)) |
| 5123 | vec_vrfiz(vector float a) |
| 5124 | { |
| 5125 | return __builtin_altivec_vrfiz(a); |
| 5126 | } |
| 5127 | |
| 5128 | /* vec_unpackh */ |
| 5129 | |
| 5130 | static vector short __ATTRS_o_ai |
| 5131 | vec_unpackh(vector signed char a) |
| 5132 | { |
| 5133 | return __builtin_altivec_vupkhsb((vector char)a); |
| 5134 | } |
| 5135 | |
| 5136 | static vector int __ATTRS_o_ai |
| 5137 | vec_unpackh(vector short a) |
| 5138 | { |
| 5139 | return __builtin_altivec_vupkhsh(a); |
| 5140 | } |
| 5141 | |
| 5142 | /* vec_vupkhsb */ |
| 5143 | |
| 5144 | static vector short __attribute__((__always_inline__)) |
| 5145 | vec_vupkhsb(vector signed char a) |
| 5146 | { |
| 5147 | return __builtin_altivec_vupkhsb((vector char)a); |
| 5148 | } |
| 5149 | |
| 5150 | /* vec_vupkhsh */ |
| 5151 | |
| 5152 | static vector int __attribute__((__always_inline__)) |
| 5153 | vec_vupkhsh(vector short a) |
| 5154 | { |
| 5155 | return __builtin_altivec_vupkhsh(a); |
| 5156 | } |
| 5157 | |
| 5158 | /* vec_unpackl */ |
| 5159 | |
| 5160 | static vector short __ATTRS_o_ai |
| 5161 | vec_unpackl(vector signed char a) |
| 5162 | { |
| 5163 | return __builtin_altivec_vupklsb((vector char)a); |
| 5164 | } |
| 5165 | |
| 5166 | static vector int __ATTRS_o_ai |
| 5167 | vec_unpackl(vector short a) |
| 5168 | { |
| 5169 | return __builtin_altivec_vupklsh(a); |
| 5170 | } |
| 5171 | |
| 5172 | /* vec_vupklsb */ |
| 5173 | |
| 5174 | static vector short __attribute__((__always_inline__)) |
| 5175 | vec_vupklsb(vector signed char a) |
| 5176 | { |
| 5177 | return __builtin_altivec_vupklsb((vector char)a); |
| 5178 | } |
| 5179 | |
| 5180 | /* vec_vupklsh */ |
| 5181 | |
| 5182 | static vector int __attribute__((__always_inline__)) |
| 5183 | vec_vupklsh(vector short a) |
| 5184 | { |
| 5185 | return __builtin_altivec_vupklsh(a); |
| 5186 | } |
| 5187 | |
| 5188 | /* vec_xor */ |
| 5189 | |
| 5190 | #define __builtin_altivec_vxor vec_xor |
| 5191 | |
| 5192 | static vector signed char __ATTRS_o_ai |
| 5193 | vec_xor(vector signed char a, vector signed char b) |
| 5194 | { |
| 5195 | return a ^ b; |
| 5196 | } |
| 5197 | |
| 5198 | static vector unsigned char __ATTRS_o_ai |
| 5199 | vec_xor(vector unsigned char a, vector unsigned char b) |
| 5200 | { |
| 5201 | return a ^ b; |
| 5202 | } |
| 5203 | |
| 5204 | static vector short __ATTRS_o_ai |
| 5205 | vec_xor(vector short a, vector short b) |
| 5206 | { |
| 5207 | return a ^ b; |
| 5208 | } |
| 5209 | |
| 5210 | static vector unsigned short __ATTRS_o_ai |
| 5211 | vec_xor(vector unsigned short a, vector unsigned short b) |
| 5212 | { |
| 5213 | return a ^ b; |
| 5214 | } |
| 5215 | |
| 5216 | static vector int __ATTRS_o_ai |
| 5217 | vec_xor(vector int a, vector int b) |
| 5218 | { |
| 5219 | return a ^ b; |
| 5220 | } |
| 5221 | |
| 5222 | static vector unsigned int __ATTRS_o_ai |
| 5223 | vec_xor(vector unsigned int a, vector unsigned int b) |
| 5224 | { |
| 5225 | return a ^ b; |
| 5226 | } |
| 5227 | |
| 5228 | static vector float __ATTRS_o_ai |
| 5229 | vec_xor(vector float a, vector float b) |
| 5230 | { |
| 5231 | vector unsigned int res = (vector unsigned int)a ^ (vector unsigned int)b; |
| 5232 | return (vector float)res; |
| 5233 | } |
| 5234 | |
| 5235 | /* vec_vxor */ |
| 5236 | |
| 5237 | static vector signed char __ATTRS_o_ai |
| 5238 | vec_vxor(vector signed char a, vector signed char b) |
| 5239 | { |
| 5240 | return a ^ b; |
| 5241 | } |
| 5242 | |
| 5243 | static vector unsigned char __ATTRS_o_ai |
| 5244 | vec_vxor(vector unsigned char a, vector unsigned char b) |
| 5245 | { |
| 5246 | return a ^ b; |
| 5247 | } |
| 5248 | |
| 5249 | static vector short __ATTRS_o_ai |
| 5250 | vec_vxor(vector short a, vector short b) |
| 5251 | { |
| 5252 | return a ^ b; |
| 5253 | } |
| 5254 | |
| 5255 | static vector unsigned short __ATTRS_o_ai |
| 5256 | vec_vxor(vector unsigned short a, vector unsigned short b) |
| 5257 | { |
| 5258 | return a ^ b; |
| 5259 | } |
| 5260 | |
| 5261 | static vector int __ATTRS_o_ai |
| 5262 | vec_vxor(vector int a, vector int b) |
| 5263 | { |
| 5264 | return a ^ b; |
| 5265 | } |
| 5266 | |
| 5267 | static vector unsigned int __ATTRS_o_ai |
| 5268 | vec_vxor(vector unsigned int a, vector unsigned int b) |
| 5269 | { |
| 5270 | return a ^ b; |
| 5271 | } |
| 5272 | |
| 5273 | static vector float __ATTRS_o_ai |
| 5274 | vec_vxor(vector float a, vector float b) |
| 5275 | { |
| 5276 | vector unsigned int res = (vector unsigned int)a ^ (vector unsigned int)b; |
| 5277 | return (vector float)res; |
| 5278 | } |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5279 | |
| 5280 | /* ------------------------------ predicates ------------------------------------ */ |
| 5281 | |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5282 | /* vec_all_eq */ |
| 5283 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5284 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5285 | vec_all_eq(vector signed char a, vector signed char b) |
| 5286 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 5287 | return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5288 | } |
| 5289 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5290 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5291 | vec_all_eq(vector unsigned char a, vector unsigned char b) |
| 5292 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 5293 | return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5294 | } |
| 5295 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5296 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5297 | vec_all_eq(vector short a, vector short b) |
| 5298 | { |
| 5299 | return __builtin_altivec_vcmpequh_p(__CR6_LT, a, b); |
| 5300 | } |
| 5301 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5302 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5303 | vec_all_eq(vector unsigned short a, vector unsigned short b) |
| 5304 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 5305 | return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)a, (vector short)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5306 | } |
| 5307 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5308 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5309 | vec_all_eq(vector int a, vector int b) |
| 5310 | { |
| 5311 | return __builtin_altivec_vcmpequw_p(__CR6_LT, a, b); |
| 5312 | } |
| 5313 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5314 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5315 | vec_all_eq(vector unsigned int a, vector unsigned int b) |
| 5316 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 5317 | return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)a, (vector int)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5318 | } |
| 5319 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5320 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5321 | vec_all_eq(vector float a, vector float b) |
| 5322 | { |
| 5323 | return __builtin_altivec_vcmpeqfp_p(__CR6_LT, a, b); |
| 5324 | } |
| 5325 | |
| 5326 | /* vec_all_ge */ |
| 5327 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5328 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5329 | vec_all_ge(vector signed char a, vector signed char b) |
| 5330 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5331 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5332 | } |
| 5333 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5334 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5335 | vec_all_ge(vector unsigned char a, vector unsigned char b) |
| 5336 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5337 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5338 | } |
| 5339 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5340 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5341 | vec_all_ge(vector short a, vector short b) |
| 5342 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5343 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5344 | } |
| 5345 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5346 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5347 | vec_all_ge(vector unsigned short a, vector unsigned short b) |
| 5348 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5349 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5350 | } |
| 5351 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5352 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5353 | vec_all_ge(vector int a, vector int b) |
| 5354 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5355 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5356 | } |
| 5357 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5358 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5359 | vec_all_ge(vector unsigned int a, vector unsigned int b) |
| 5360 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5361 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5362 | } |
| 5363 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5364 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5365 | vec_all_ge(vector float a, vector float b) |
| 5366 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5367 | return __builtin_altivec_vcmpgefp_p(__CR6_LT, a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5368 | } |
| 5369 | |
| 5370 | /* vec_all_gt */ |
| 5371 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5372 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5373 | vec_all_gt(vector signed char a, vector signed char b) |
| 5374 | { |
| 5375 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT, a, b); |
| 5376 | } |
| 5377 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5378 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5379 | vec_all_gt(vector unsigned char a, vector unsigned char b) |
| 5380 | { |
| 5381 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, a, b); |
| 5382 | } |
| 5383 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5384 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5385 | vec_all_gt(vector short a, vector short b) |
| 5386 | { |
| 5387 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT, a, b); |
| 5388 | } |
| 5389 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5390 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5391 | vec_all_gt(vector unsigned short a, vector unsigned short b) |
| 5392 | { |
| 5393 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, a, b); |
| 5394 | } |
| 5395 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5396 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5397 | vec_all_gt(vector int a, vector int b) |
| 5398 | { |
| 5399 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT, a, b); |
| 5400 | } |
| 5401 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5402 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5403 | vec_all_gt(vector unsigned int a, vector unsigned int b) |
| 5404 | { |
| 5405 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, a, b); |
| 5406 | } |
| 5407 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5408 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5409 | vec_all_gt(vector float a, vector float b) |
| 5410 | { |
| 5411 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT, a, b); |
| 5412 | } |
| 5413 | |
| 5414 | /* vec_all_in */ |
| 5415 | |
| 5416 | static int __attribute__((__always_inline__)) |
| 5417 | vec_all_in(vector float a, vector float b) |
| 5418 | { |
| 5419 | return __builtin_altivec_vcmpbfp_p(__CR6_EQ, a, b); |
| 5420 | } |
| 5421 | |
| 5422 | /* vec_all_le */ |
| 5423 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5424 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5425 | vec_all_le(vector signed char a, vector signed char b) |
| 5426 | { |
| 5427 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, a, b); |
| 5428 | } |
| 5429 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5430 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5431 | vec_all_le(vector unsigned char a, vector unsigned char b) |
| 5432 | { |
| 5433 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, a, b); |
| 5434 | } |
| 5435 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5436 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5437 | vec_all_le(vector short a, vector short b) |
| 5438 | { |
| 5439 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, a, b); |
| 5440 | } |
| 5441 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5442 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5443 | vec_all_le(vector unsigned short a, vector unsigned short b) |
| 5444 | { |
| 5445 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, a, b); |
| 5446 | } |
| 5447 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5448 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5449 | vec_all_le(vector int a, vector int b) |
| 5450 | { |
| 5451 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, a, b); |
| 5452 | } |
| 5453 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5454 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5455 | vec_all_le(vector unsigned int a, vector unsigned int b) |
| 5456 | { |
| 5457 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, a, b); |
| 5458 | } |
| 5459 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5460 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5461 | vec_all_le(vector float a, vector float b) |
| 5462 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5463 | return __builtin_altivec_vcmpgefp_p(__CR6_LT, b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5464 | } |
| 5465 | |
| 5466 | /* vec_all_lt */ |
| 5467 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5468 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5469 | vec_all_lt(vector signed char a, vector signed char b) |
| 5470 | { |
| 5471 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT, b, a); |
| 5472 | } |
| 5473 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5474 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5475 | vec_all_lt(vector unsigned char a, vector unsigned char b) |
| 5476 | { |
| 5477 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, b, a); |
| 5478 | } |
| 5479 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5480 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5481 | vec_all_lt(vector short a, vector short b) |
| 5482 | { |
| 5483 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT, b, a); |
| 5484 | } |
| 5485 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5486 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5487 | vec_all_lt(vector unsigned short a, vector unsigned short b) |
| 5488 | { |
| 5489 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, b, a); |
| 5490 | } |
| 5491 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5492 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5493 | vec_all_lt(vector int a, vector int b) |
| 5494 | { |
| 5495 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT, b, a); |
| 5496 | } |
| 5497 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5498 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5499 | vec_all_lt(vector unsigned int a, vector unsigned int b) |
| 5500 | { |
| 5501 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, b, a); |
| 5502 | } |
| 5503 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5504 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5505 | vec_all_lt(vector float a, vector float b) |
| 5506 | { |
| 5507 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT, b, a); |
| 5508 | } |
| 5509 | |
| 5510 | /* vec_all_nan */ |
| 5511 | |
| 5512 | static int __attribute__((__always_inline__)) |
| 5513 | vec_all_nan(vector float a) |
| 5514 | { |
| 5515 | return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, a, a); |
| 5516 | } |
| 5517 | |
| 5518 | /* vec_all_ne */ |
| 5519 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5520 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5521 | vec_all_ne(vector signed char a, vector signed char b) |
| 5522 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 5523 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5524 | } |
| 5525 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5526 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5527 | vec_all_ne(vector unsigned char a, vector unsigned char b) |
| 5528 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 5529 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5530 | } |
| 5531 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5532 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5533 | vec_all_ne(vector short a, vector short b) |
| 5534 | { |
| 5535 | return __builtin_altivec_vcmpequh_p(__CR6_EQ, a, b); |
| 5536 | } |
| 5537 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5538 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5539 | vec_all_ne(vector unsigned short a, vector unsigned short b) |
| 5540 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 5541 | return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)a, (vector short)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5542 | } |
| 5543 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5544 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5545 | vec_all_ne(vector int a, vector int b) |
| 5546 | { |
| 5547 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, a, b); |
| 5548 | } |
| 5549 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5550 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5551 | vec_all_ne(vector unsigned int a, vector unsigned int b) |
| 5552 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 5553 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)a, (vector int)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5554 | } |
| 5555 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5556 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5557 | vec_all_ne(vector float a, vector float b) |
| 5558 | { |
| 5559 | return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, a, b); |
| 5560 | } |
| 5561 | |
| 5562 | /* vec_all_nge */ |
| 5563 | |
| 5564 | static int __attribute__((__always_inline__)) |
| 5565 | vec_all_nge(vector float a, vector float b) |
| 5566 | { |
| 5567 | return __builtin_altivec_vcmpgefp_p(__CR6_EQ, a, b); |
| 5568 | } |
| 5569 | |
| 5570 | /* vec_all_ngt */ |
| 5571 | |
| 5572 | static int __attribute__((__always_inline__)) |
| 5573 | vec_all_ngt(vector float a, vector float b) |
| 5574 | { |
| 5575 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, a, b); |
| 5576 | } |
| 5577 | |
| 5578 | /* vec_all_nle */ |
| 5579 | |
| 5580 | static int __attribute__((__always_inline__)) |
| 5581 | vec_all_nle(vector float a, vector float b) |
| 5582 | { |
| 5583 | return __builtin_altivec_vcmpgefp_p(__CR6_EQ, b, a); |
| 5584 | } |
| 5585 | |
| 5586 | /* vec_all_nlt */ |
| 5587 | |
| 5588 | static int __attribute__((__always_inline__)) |
| 5589 | vec_all_nlt(vector float a, vector float b) |
| 5590 | { |
| 5591 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, b, a); |
| 5592 | } |
| 5593 | |
| 5594 | /* vec_all_numeric */ |
| 5595 | |
| 5596 | static int __attribute__((__always_inline__)) |
| 5597 | vec_all_numeric(vector float a) |
| 5598 | { |
| 5599 | return __builtin_altivec_vcmpeqfp_p(__CR6_LT, a, a); |
| 5600 | } |
| 5601 | |
| 5602 | /* vec_any_eq */ |
| 5603 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5604 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5605 | vec_any_eq(vector signed char a, vector signed char b) |
| 5606 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 5607 | return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5608 | } |
| 5609 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5610 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5611 | vec_any_eq(vector unsigned char a, vector unsigned char b) |
| 5612 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 5613 | return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5614 | } |
| 5615 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5616 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5617 | vec_any_eq(vector short a, vector short b) |
| 5618 | { |
| 5619 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, a, b); |
| 5620 | } |
| 5621 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5622 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5623 | vec_any_eq(vector unsigned short a, vector unsigned short b) |
| 5624 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 5625 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)a, (vector short)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5626 | } |
| 5627 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5628 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5629 | vec_any_eq(vector int a, vector int b) |
| 5630 | { |
| 5631 | return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, a, b); |
| 5632 | } |
| 5633 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5634 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5635 | vec_any_eq(vector unsigned int a, vector unsigned int b) |
| 5636 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 5637 | return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)a, (vector int)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5638 | } |
| 5639 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5640 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5641 | vec_any_eq(vector float a, vector float b) |
| 5642 | { |
| 5643 | return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, a, b); |
| 5644 | } |
| 5645 | |
| 5646 | /* vec_any_ge */ |
| 5647 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5648 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5649 | vec_any_ge(vector signed char a, vector signed char b) |
| 5650 | { |
| 5651 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, b, a); |
| 5652 | } |
| 5653 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5654 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5655 | vec_any_ge(vector unsigned char a, vector unsigned char b) |
| 5656 | { |
| 5657 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, b, a); |
| 5658 | } |
| 5659 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5660 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5661 | vec_any_ge(vector short a, vector short b) |
| 5662 | { |
| 5663 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, b, a); |
| 5664 | } |
| 5665 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5666 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5667 | vec_any_ge(vector unsigned short a, vector unsigned short b) |
| 5668 | { |
| 5669 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, b, a); |
| 5670 | } |
| 5671 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5672 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5673 | vec_any_ge(vector int a, vector int b) |
| 5674 | { |
| 5675 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, b, a); |
| 5676 | } |
| 5677 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5678 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5679 | vec_any_ge(vector unsigned int a, vector unsigned int b) |
| 5680 | { |
| 5681 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, b, a); |
| 5682 | } |
| 5683 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5684 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5685 | vec_any_ge(vector float a, vector float b) |
| 5686 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5687 | return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, a, b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5688 | } |
| 5689 | |
| 5690 | /* vec_any_gt */ |
| 5691 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5692 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5693 | vec_any_gt(vector signed char a, vector signed char b) |
| 5694 | { |
| 5695 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, a, b); |
| 5696 | } |
| 5697 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5698 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5699 | vec_any_gt(vector unsigned char a, vector unsigned char b) |
| 5700 | { |
| 5701 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, a, b); |
| 5702 | } |
| 5703 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5704 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5705 | vec_any_gt(vector short a, vector short b) |
| 5706 | { |
| 5707 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, a, b); |
| 5708 | } |
| 5709 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5710 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5711 | vec_any_gt(vector unsigned short a, vector unsigned short b) |
| 5712 | { |
| 5713 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, a, b); |
| 5714 | } |
| 5715 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5716 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5717 | vec_any_gt(vector int a, vector int b) |
| 5718 | { |
| 5719 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, a, b); |
| 5720 | } |
| 5721 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5722 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5723 | vec_any_gt(vector unsigned int a, vector unsigned int b) |
| 5724 | { |
| 5725 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, a, b); |
| 5726 | } |
| 5727 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5728 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5729 | vec_any_gt(vector float a, vector float b) |
| 5730 | { |
| 5731 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, a, b); |
| 5732 | } |
| 5733 | |
| 5734 | /* vec_any_le */ |
| 5735 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5736 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5737 | vec_any_le(vector signed char a, vector signed char b) |
| 5738 | { |
| 5739 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, a, b); |
| 5740 | } |
| 5741 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5742 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5743 | vec_any_le(vector unsigned char a, vector unsigned char b) |
| 5744 | { |
| 5745 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, a, b); |
| 5746 | } |
| 5747 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5748 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5749 | vec_any_le(vector short a, vector short b) |
| 5750 | { |
| 5751 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, a, b); |
| 5752 | } |
| 5753 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5754 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5755 | vec_any_le(vector unsigned short a, vector unsigned short b) |
| 5756 | { |
| 5757 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, a, b); |
| 5758 | } |
| 5759 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5760 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5761 | vec_any_le(vector int a, vector int b) |
| 5762 | { |
| 5763 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, a, b); |
| 5764 | } |
| 5765 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5766 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5767 | vec_any_le(vector unsigned int a, vector unsigned int b) |
| 5768 | { |
| 5769 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, a, b); |
| 5770 | } |
| 5771 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5772 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5773 | vec_any_le(vector float a, vector float b) |
| 5774 | { |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5775 | return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, b, a); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5776 | } |
| 5777 | |
| 5778 | /* vec_any_lt */ |
| 5779 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5780 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5781 | vec_any_lt(vector signed char a, vector signed char b) |
| 5782 | { |
| 5783 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, b, a); |
| 5784 | } |
| 5785 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5786 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5787 | vec_any_lt(vector unsigned char a, vector unsigned char b) |
| 5788 | { |
| 5789 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, b, a); |
| 5790 | } |
| 5791 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5792 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5793 | vec_any_lt(vector short a, vector short b) |
| 5794 | { |
| 5795 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, b, a); |
| 5796 | } |
| 5797 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5798 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5799 | vec_any_lt(vector unsigned short a, vector unsigned short b) |
| 5800 | { |
| 5801 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, b, a); |
| 5802 | } |
| 5803 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5804 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5805 | vec_any_lt(vector int a, vector int b) |
| 5806 | { |
| 5807 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, b, a); |
| 5808 | } |
| 5809 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5810 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5811 | vec_any_lt(vector unsigned int a, vector unsigned int b) |
| 5812 | { |
| 5813 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, b, a); |
| 5814 | } |
| 5815 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5816 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5817 | vec_any_lt(vector float a, vector float b) |
| 5818 | { |
| 5819 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, b, a); |
| 5820 | } |
| 5821 | |
| 5822 | /* vec_any_nan */ |
| 5823 | |
| 5824 | static int __attribute__((__always_inline__)) |
| 5825 | vec_any_nan(vector float a) |
| 5826 | { |
| 5827 | return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, a, a); |
| 5828 | } |
| 5829 | |
| 5830 | /* vec_any_ne */ |
| 5831 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5832 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5833 | vec_any_ne(vector signed char a, vector signed char b) |
| 5834 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 5835 | return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5836 | } |
| 5837 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5838 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5839 | vec_any_ne(vector unsigned char a, vector unsigned char b) |
| 5840 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 5841 | return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)a, (vector char)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5842 | } |
| 5843 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5844 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5845 | vec_any_ne(vector short a, vector short b) |
| 5846 | { |
| 5847 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, a, b); |
| 5848 | } |
| 5849 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5850 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5851 | vec_any_ne(vector unsigned short a, vector unsigned short b) |
| 5852 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 5853 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)a, (vector short)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5854 | } |
| 5855 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5856 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5857 | vec_any_ne(vector int a, vector int b) |
| 5858 | { |
| 5859 | return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, a, b); |
| 5860 | } |
| 5861 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5862 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5863 | vec_any_ne(vector unsigned int a, vector unsigned int b) |
| 5864 | { |
Chris Lattner | ab866b4 | 2010-04-14 20:35:39 +0000 | [diff] [blame] | 5865 | return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)a, (vector int)b); |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5866 | } |
| 5867 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5868 | static int __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5869 | vec_any_ne(vector float a, vector float b) |
| 5870 | { |
| 5871 | return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, a, b); |
| 5872 | } |
| 5873 | |
| 5874 | /* vec_any_nge */ |
| 5875 | |
| 5876 | static int __attribute__((__always_inline__)) |
| 5877 | vec_any_nge(vector float a, vector float b) |
| 5878 | { |
| 5879 | return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, a, b); |
| 5880 | } |
| 5881 | |
| 5882 | /* vec_any_ngt */ |
| 5883 | |
| 5884 | static int __attribute__((__always_inline__)) |
| 5885 | vec_any_ngt(vector float a, vector float b) |
| 5886 | { |
| 5887 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, a, b); |
| 5888 | } |
| 5889 | |
| 5890 | /* vec_any_nle */ |
| 5891 | |
| 5892 | static int __attribute__((__always_inline__)) |
| 5893 | vec_any_nle(vector float a, vector float b) |
| 5894 | { |
| 5895 | return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, b, a); |
| 5896 | } |
| 5897 | |
| 5898 | /* vec_any_nlt */ |
| 5899 | |
| 5900 | static int __attribute__((__always_inline__)) |
| 5901 | vec_any_nlt(vector float a, vector float b) |
| 5902 | { |
| 5903 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, b, a); |
| 5904 | } |
| 5905 | |
| 5906 | /* vec_any_numeric */ |
| 5907 | |
| 5908 | static int __attribute__((__always_inline__)) |
| 5909 | vec_any_numeric(vector float a) |
| 5910 | { |
| 5911 | return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, a, a); |
| 5912 | } |
| 5913 | |
| 5914 | /* vec_any_out */ |
| 5915 | |
| 5916 | static int __attribute__((__always_inline__)) |
| 5917 | vec_any_out(vector float a, vector float b) |
| 5918 | { |
| 5919 | return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, a, b); |
| 5920 | } |
| 5921 | |
Anton Korobeynikov | 4d3a7b0 | 2010-06-19 09:47:18 +0000 | [diff] [blame] | 5922 | #undef __ATTRS_o_ai |
Chris Lattner | dd17394 | 2010-04-14 03:54:58 +0000 | [diff] [blame] | 5923 | |
| 5924 | #endif /* __ALTIVEC_H */ |