Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [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 | |
| 23 | #ifndef __ALTIVEC_H |
| 24 | #define __ALTIVEC_H |
| 25 | |
| 26 | #ifndef __ALTIVEC__ |
| 27 | #error "AltiVec support not enabled" |
| 28 | #endif |
| 29 | |
| 30 | /* constants for mapping CR6 bits to predicate result. */ |
| 31 | |
| 32 | #define __CR6_EQ 0 |
| 33 | #define __CR6_EQ_REV 1 |
| 34 | #define __CR6_LT 2 |
| 35 | #define __CR6_LT_REV 3 |
| 36 | |
| 37 | #define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__)) |
| 38 | |
| 39 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 40 | vec_perm(vector signed char __a, vector signed char __b, vector unsigned char __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 41 | |
| 42 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 43 | vec_perm(vector unsigned char __a, |
| 44 | vector unsigned char __b, |
| 45 | vector unsigned char __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 46 | |
| 47 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 48 | vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 49 | |
| 50 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 51 | vec_perm(vector short __a, vector short __b, vector unsigned char __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 52 | |
| 53 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 54 | vec_perm(vector unsigned short __a, |
| 55 | vector unsigned short __b, |
| 56 | vector unsigned char __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 57 | |
| 58 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 59 | vec_perm(vector bool short __a, vector bool short __b, vector unsigned char __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 60 | |
| 61 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 62 | vec_perm(vector pixel __a, vector pixel __b, vector unsigned char __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 63 | |
| 64 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 65 | vec_perm(vector int __a, vector int __b, vector unsigned char __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 66 | |
| 67 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 68 | vec_perm(vector unsigned int __a, vector unsigned int __b, vector unsigned char __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 69 | |
| 70 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 71 | vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 72 | |
| 73 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 74 | vec_perm(vector float __a, vector float __b, vector unsigned char __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 75 | |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 76 | static vector unsigned char __ATTRS_o_ai |
| 77 | vec_xor(vector unsigned char __a, vector unsigned char __b); |
| 78 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 79 | /* vec_abs */ |
| 80 | |
| 81 | #define __builtin_altivec_abs_v16qi vec_abs |
| 82 | #define __builtin_altivec_abs_v8hi vec_abs |
| 83 | #define __builtin_altivec_abs_v4si vec_abs |
| 84 | |
| 85 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 86 | vec_abs(vector signed char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 87 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 88 | return __builtin_altivec_vmaxsb(__a, -__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | static vector signed short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 92 | vec_abs(vector signed short __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 93 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 94 | return __builtin_altivec_vmaxsh(__a, -__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | static vector signed int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 98 | vec_abs(vector signed int __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 99 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 100 | return __builtin_altivec_vmaxsw(__a, -__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 101 | } |
| 102 | |
| 103 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 104 | vec_abs(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 105 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 106 | vector unsigned int __res = (vector unsigned int)__a |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 107 | & (vector unsigned int)(0x7FFFFFFF); |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 108 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | /* vec_abss */ |
| 112 | |
| 113 | #define __builtin_altivec_abss_v16qi vec_abss |
| 114 | #define __builtin_altivec_abss_v8hi vec_abss |
| 115 | #define __builtin_altivec_abss_v4si vec_abss |
| 116 | |
| 117 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 118 | vec_abss(vector signed char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 119 | { |
| 120 | return __builtin_altivec_vmaxsb |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 121 | (__a, __builtin_altivec_vsubsbs((vector signed char)(0), __a)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | static vector signed short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 125 | vec_abss(vector signed short __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 126 | { |
| 127 | return __builtin_altivec_vmaxsh |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 128 | (__a, __builtin_altivec_vsubshs((vector signed short)(0), __a)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | static vector signed int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 132 | vec_abss(vector signed int __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 133 | { |
| 134 | return __builtin_altivec_vmaxsw |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 135 | (__a, __builtin_altivec_vsubsws((vector signed int)(0), __a)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | /* vec_add */ |
| 139 | |
| 140 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 141 | vec_add(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 142 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 143 | return __a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 147 | vec_add(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 148 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 149 | return (vector signed char)__a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 153 | vec_add(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 154 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 155 | return __a + (vector signed char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 156 | } |
| 157 | |
| 158 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 159 | vec_add(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 160 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 161 | return __a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 162 | } |
| 163 | |
| 164 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 165 | vec_add(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 166 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 167 | return (vector unsigned char)__a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 168 | } |
| 169 | |
| 170 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 171 | vec_add(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 172 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 173 | return __a + (vector unsigned char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 174 | } |
| 175 | |
| 176 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 177 | vec_add(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 178 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 179 | return __a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 180 | } |
| 181 | |
| 182 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 183 | vec_add(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 184 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 185 | return (vector short)__a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 186 | } |
| 187 | |
| 188 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 189 | vec_add(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 190 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 191 | return __a + (vector short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 192 | } |
| 193 | |
| 194 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 195 | vec_add(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 196 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 197 | return __a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 198 | } |
| 199 | |
| 200 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 201 | vec_add(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 202 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 203 | return (vector unsigned short)__a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 204 | } |
| 205 | |
| 206 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 207 | vec_add(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 208 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 209 | return __a + (vector unsigned short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 210 | } |
| 211 | |
| 212 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 213 | vec_add(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 214 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 215 | return __a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 216 | } |
| 217 | |
| 218 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 219 | vec_add(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 220 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 221 | return (vector int)__a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 222 | } |
| 223 | |
| 224 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 225 | vec_add(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 226 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 227 | return __a + (vector int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 228 | } |
| 229 | |
| 230 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 231 | vec_add(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 232 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 233 | return __a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 234 | } |
| 235 | |
| 236 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 237 | vec_add(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 238 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 239 | return (vector unsigned int)__a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 243 | vec_add(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 244 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 245 | return __a + (vector unsigned int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 246 | } |
| 247 | |
| 248 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 249 | vec_add(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 250 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 251 | return __a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 252 | } |
| 253 | |
| 254 | /* vec_vaddubm */ |
| 255 | |
| 256 | #define __builtin_altivec_vaddubm vec_vaddubm |
| 257 | |
| 258 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 259 | vec_vaddubm(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 260 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 261 | return __a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 262 | } |
| 263 | |
| 264 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 265 | vec_vaddubm(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 266 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 267 | return (vector signed char)__a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 268 | } |
| 269 | |
| 270 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 271 | vec_vaddubm(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 272 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 273 | return __a + (vector signed char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 274 | } |
| 275 | |
| 276 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 277 | vec_vaddubm(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 278 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 279 | return __a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 280 | } |
| 281 | |
| 282 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 283 | vec_vaddubm(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 284 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 285 | return (vector unsigned char)__a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 286 | } |
| 287 | |
| 288 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 289 | vec_vaddubm(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 290 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 291 | return __a + (vector unsigned char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 292 | } |
| 293 | |
| 294 | /* vec_vadduhm */ |
| 295 | |
| 296 | #define __builtin_altivec_vadduhm vec_vadduhm |
| 297 | |
| 298 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 299 | vec_vadduhm(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 300 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 301 | return __a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 302 | } |
| 303 | |
| 304 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 305 | vec_vadduhm(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 306 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 307 | return (vector short)__a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 308 | } |
| 309 | |
| 310 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 311 | vec_vadduhm(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 312 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 313 | return __a + (vector short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 314 | } |
| 315 | |
| 316 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 317 | vec_vadduhm(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 318 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 319 | return __a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 320 | } |
| 321 | |
| 322 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 323 | vec_vadduhm(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 324 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 325 | return (vector unsigned short)__a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 326 | } |
| 327 | |
| 328 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 329 | vec_vadduhm(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 330 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 331 | return __a + (vector unsigned short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 332 | } |
| 333 | |
| 334 | /* vec_vadduwm */ |
| 335 | |
| 336 | #define __builtin_altivec_vadduwm vec_vadduwm |
| 337 | |
| 338 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 339 | vec_vadduwm(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 340 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 341 | return __a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 342 | } |
| 343 | |
| 344 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 345 | vec_vadduwm(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 346 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 347 | return (vector int)__a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 348 | } |
| 349 | |
| 350 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 351 | vec_vadduwm(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 352 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 353 | return __a + (vector int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 354 | } |
| 355 | |
| 356 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 357 | vec_vadduwm(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 358 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 359 | return __a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 360 | } |
| 361 | |
| 362 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 363 | vec_vadduwm(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 364 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 365 | return (vector unsigned int)__a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 366 | } |
| 367 | |
| 368 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 369 | vec_vadduwm(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 370 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 371 | return __a + (vector unsigned int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 372 | } |
| 373 | |
| 374 | /* vec_vaddfp */ |
| 375 | |
| 376 | #define __builtin_altivec_vaddfp vec_vaddfp |
| 377 | |
| 378 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 379 | vec_vaddfp(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 380 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 381 | return __a + __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 382 | } |
| 383 | |
| 384 | /* vec_addc */ |
| 385 | |
| 386 | static vector unsigned int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 387 | vec_addc(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 388 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 389 | return __builtin_altivec_vaddcuw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 390 | } |
| 391 | |
| 392 | /* vec_vaddcuw */ |
| 393 | |
| 394 | static vector unsigned int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 395 | vec_vaddcuw(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 396 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 397 | return __builtin_altivec_vaddcuw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 398 | } |
| 399 | |
| 400 | /* vec_adds */ |
| 401 | |
| 402 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 403 | vec_adds(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 404 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 405 | return __builtin_altivec_vaddsbs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 406 | } |
| 407 | |
| 408 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 409 | vec_adds(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 410 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 411 | return __builtin_altivec_vaddsbs((vector signed char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 412 | } |
| 413 | |
| 414 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 415 | vec_adds(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 416 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 417 | return __builtin_altivec_vaddsbs(__a, (vector signed char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 418 | } |
| 419 | |
| 420 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 421 | vec_adds(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 422 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 423 | return __builtin_altivec_vaddubs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 424 | } |
| 425 | |
| 426 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 427 | vec_adds(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 428 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 429 | return __builtin_altivec_vaddubs((vector unsigned char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 430 | } |
| 431 | |
| 432 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 433 | vec_adds(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 434 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 435 | return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 436 | } |
| 437 | |
| 438 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 439 | vec_adds(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 440 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 441 | return __builtin_altivec_vaddshs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 442 | } |
| 443 | |
| 444 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 445 | vec_adds(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 446 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 447 | return __builtin_altivec_vaddshs((vector short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 448 | } |
| 449 | |
| 450 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 451 | vec_adds(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 452 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 453 | return __builtin_altivec_vaddshs(__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 454 | } |
| 455 | |
| 456 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 457 | vec_adds(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 458 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 459 | return __builtin_altivec_vadduhs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 460 | } |
| 461 | |
| 462 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 463 | vec_adds(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 464 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 465 | return __builtin_altivec_vadduhs((vector unsigned short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 466 | } |
| 467 | |
| 468 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 469 | vec_adds(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 470 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 471 | return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 472 | } |
| 473 | |
| 474 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 475 | vec_adds(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 476 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 477 | return __builtin_altivec_vaddsws(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 478 | } |
| 479 | |
| 480 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 481 | vec_adds(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 482 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 483 | return __builtin_altivec_vaddsws((vector int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 484 | } |
| 485 | |
| 486 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 487 | vec_adds(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 488 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 489 | return __builtin_altivec_vaddsws(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 490 | } |
| 491 | |
| 492 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 493 | vec_adds(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 494 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 495 | return __builtin_altivec_vadduws(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 496 | } |
| 497 | |
| 498 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 499 | vec_adds(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 500 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 501 | return __builtin_altivec_vadduws((vector unsigned int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 502 | } |
| 503 | |
| 504 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 505 | vec_adds(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 506 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 507 | return __builtin_altivec_vadduws(__a, (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 508 | } |
| 509 | |
| 510 | /* vec_vaddsbs */ |
| 511 | |
| 512 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 513 | vec_vaddsbs(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 514 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 515 | return __builtin_altivec_vaddsbs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 516 | } |
| 517 | |
| 518 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 519 | vec_vaddsbs(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 520 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 521 | return __builtin_altivec_vaddsbs((vector signed char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 522 | } |
| 523 | |
| 524 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 525 | vec_vaddsbs(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 526 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 527 | return __builtin_altivec_vaddsbs(__a, (vector signed char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 528 | } |
| 529 | |
| 530 | /* vec_vaddubs */ |
| 531 | |
| 532 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 533 | vec_vaddubs(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 534 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 535 | return __builtin_altivec_vaddubs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 536 | } |
| 537 | |
| 538 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 539 | vec_vaddubs(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 540 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 541 | return __builtin_altivec_vaddubs((vector unsigned char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 542 | } |
| 543 | |
| 544 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 545 | vec_vaddubs(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 546 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 547 | return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 548 | } |
| 549 | |
| 550 | /* vec_vaddshs */ |
| 551 | |
| 552 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 553 | vec_vaddshs(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 554 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 555 | return __builtin_altivec_vaddshs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 556 | } |
| 557 | |
| 558 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 559 | vec_vaddshs(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 560 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 561 | return __builtin_altivec_vaddshs((vector short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 562 | } |
| 563 | |
| 564 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 565 | vec_vaddshs(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 566 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 567 | return __builtin_altivec_vaddshs(__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 568 | } |
| 569 | |
| 570 | /* vec_vadduhs */ |
| 571 | |
| 572 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 573 | vec_vadduhs(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 574 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 575 | return __builtin_altivec_vadduhs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 576 | } |
| 577 | |
| 578 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 579 | vec_vadduhs(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 580 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 581 | return __builtin_altivec_vadduhs((vector unsigned short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 582 | } |
| 583 | |
| 584 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 585 | vec_vadduhs(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 586 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 587 | return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 588 | } |
| 589 | |
| 590 | /* vec_vaddsws */ |
| 591 | |
| 592 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 593 | vec_vaddsws(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 594 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 595 | return __builtin_altivec_vaddsws(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 596 | } |
| 597 | |
| 598 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 599 | vec_vaddsws(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 600 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 601 | return __builtin_altivec_vaddsws((vector int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 602 | } |
| 603 | |
| 604 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 605 | vec_vaddsws(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 606 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 607 | return __builtin_altivec_vaddsws(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 608 | } |
| 609 | |
| 610 | /* vec_vadduws */ |
| 611 | |
| 612 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 613 | vec_vadduws(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 614 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 615 | return __builtin_altivec_vadduws(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 616 | } |
| 617 | |
| 618 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 619 | vec_vadduws(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 620 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 621 | return __builtin_altivec_vadduws((vector unsigned int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 622 | } |
| 623 | |
| 624 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 625 | vec_vadduws(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 626 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 627 | return __builtin_altivec_vadduws(__a, (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 628 | } |
| 629 | |
| 630 | /* vec_and */ |
| 631 | |
| 632 | #define __builtin_altivec_vand vec_and |
| 633 | |
| 634 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 635 | vec_and(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 636 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 637 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 638 | } |
| 639 | |
| 640 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 641 | vec_and(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 642 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 643 | return (vector signed char)__a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 644 | } |
| 645 | |
| 646 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 647 | vec_and(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 648 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 649 | return __a & (vector signed char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 650 | } |
| 651 | |
| 652 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 653 | vec_and(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 654 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 655 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 656 | } |
| 657 | |
| 658 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 659 | vec_and(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 660 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 661 | return (vector unsigned char)__a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 662 | } |
| 663 | |
| 664 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 665 | vec_and(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 666 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 667 | return __a & (vector unsigned char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 668 | } |
| 669 | |
| 670 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 671 | vec_and(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 672 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 673 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 674 | } |
| 675 | |
| 676 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 677 | vec_and(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 678 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 679 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 680 | } |
| 681 | |
| 682 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 683 | vec_and(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 684 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 685 | return (vector short)__a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 686 | } |
| 687 | |
| 688 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 689 | vec_and(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 690 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 691 | return __a & (vector short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 692 | } |
| 693 | |
| 694 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 695 | vec_and(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 696 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 697 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 698 | } |
| 699 | |
| 700 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 701 | vec_and(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 702 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 703 | return (vector unsigned short)__a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 704 | } |
| 705 | |
| 706 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 707 | vec_and(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 708 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 709 | return __a & (vector unsigned short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 710 | } |
| 711 | |
| 712 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 713 | vec_and(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 714 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 715 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 716 | } |
| 717 | |
| 718 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 719 | vec_and(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 720 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 721 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 722 | } |
| 723 | |
| 724 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 725 | vec_and(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 726 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 727 | return (vector int)__a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 728 | } |
| 729 | |
| 730 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 731 | vec_and(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 732 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 733 | return __a & (vector int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 734 | } |
| 735 | |
| 736 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 737 | vec_and(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 738 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 739 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 740 | } |
| 741 | |
| 742 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 743 | vec_and(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 744 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 745 | return (vector unsigned int)__a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 746 | } |
| 747 | |
| 748 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 749 | vec_and(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 750 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 751 | return __a & (vector unsigned int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 752 | } |
| 753 | |
| 754 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 755 | vec_and(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 756 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 757 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 758 | } |
| 759 | |
| 760 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 761 | vec_and(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 762 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 763 | vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b; |
| 764 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 765 | } |
| 766 | |
| 767 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 768 | vec_and(vector bool int __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 769 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 770 | vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b; |
| 771 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 772 | } |
| 773 | |
| 774 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 775 | vec_and(vector float __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 776 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 777 | vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b; |
| 778 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 779 | } |
| 780 | |
| 781 | /* vec_vand */ |
| 782 | |
| 783 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 784 | vec_vand(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 785 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 786 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 787 | } |
| 788 | |
| 789 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 790 | vec_vand(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 791 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 792 | return (vector signed char)__a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 793 | } |
| 794 | |
| 795 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 796 | vec_vand(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 797 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 798 | return __a & (vector signed char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 799 | } |
| 800 | |
| 801 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 802 | vec_vand(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 803 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 804 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 805 | } |
| 806 | |
| 807 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 808 | vec_vand(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 809 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 810 | return (vector unsigned char)__a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 811 | } |
| 812 | |
| 813 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 814 | vec_vand(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 815 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 816 | return __a & (vector unsigned char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 817 | } |
| 818 | |
| 819 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 820 | vec_vand(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 821 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 822 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 823 | } |
| 824 | |
| 825 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 826 | vec_vand(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 827 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 828 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 829 | } |
| 830 | |
| 831 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 832 | vec_vand(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 833 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 834 | return (vector short)__a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 835 | } |
| 836 | |
| 837 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 838 | vec_vand(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 839 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 840 | return __a & (vector short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 841 | } |
| 842 | |
| 843 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 844 | vec_vand(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 845 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 846 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 847 | } |
| 848 | |
| 849 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 850 | vec_vand(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 851 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 852 | return (vector unsigned short)__a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 853 | } |
| 854 | |
| 855 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 856 | vec_vand(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 857 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 858 | return __a & (vector unsigned short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 859 | } |
| 860 | |
| 861 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 862 | vec_vand(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 863 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 864 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 865 | } |
| 866 | |
| 867 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 868 | vec_vand(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 869 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 870 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 871 | } |
| 872 | |
| 873 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 874 | vec_vand(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 875 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 876 | return (vector int)__a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 877 | } |
| 878 | |
| 879 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 880 | vec_vand(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 881 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 882 | return __a & (vector int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 883 | } |
| 884 | |
| 885 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 886 | vec_vand(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 887 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 888 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 889 | } |
| 890 | |
| 891 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 892 | vec_vand(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 893 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 894 | return (vector unsigned int)__a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 895 | } |
| 896 | |
| 897 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 898 | vec_vand(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 899 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 900 | return __a & (vector unsigned int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 901 | } |
| 902 | |
| 903 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 904 | vec_vand(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 905 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 906 | return __a & __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 907 | } |
| 908 | |
| 909 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 910 | vec_vand(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 911 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 912 | vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b; |
| 913 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 914 | } |
| 915 | |
| 916 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 917 | vec_vand(vector bool int __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 918 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 919 | vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b; |
| 920 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 921 | } |
| 922 | |
| 923 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 924 | vec_vand(vector float __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 925 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 926 | vector unsigned int __res = (vector unsigned int)__a & (vector unsigned int)__b; |
| 927 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 928 | } |
| 929 | |
| 930 | /* vec_andc */ |
| 931 | |
| 932 | #define __builtin_altivec_vandc vec_andc |
| 933 | |
| 934 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 935 | vec_andc(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 936 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 937 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 938 | } |
| 939 | |
| 940 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 941 | vec_andc(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 942 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 943 | return (vector signed char)__a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 944 | } |
| 945 | |
| 946 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 947 | vec_andc(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 948 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 949 | return __a & ~(vector signed char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 950 | } |
| 951 | |
| 952 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 953 | vec_andc(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 954 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 955 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 956 | } |
| 957 | |
| 958 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 959 | vec_andc(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 960 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 961 | return (vector unsigned char)__a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 962 | } |
| 963 | |
| 964 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 965 | vec_andc(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 966 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 967 | return __a & ~(vector unsigned char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 968 | } |
| 969 | |
| 970 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 971 | vec_andc(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 972 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 973 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 974 | } |
| 975 | |
| 976 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 977 | vec_andc(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 978 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 979 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 980 | } |
| 981 | |
| 982 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 983 | vec_andc(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 984 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 985 | return (vector short)__a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 986 | } |
| 987 | |
| 988 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 989 | vec_andc(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 990 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 991 | return __a & ~(vector short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 992 | } |
| 993 | |
| 994 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 995 | vec_andc(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 996 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 997 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 998 | } |
| 999 | |
| 1000 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1001 | vec_andc(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1002 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1003 | return (vector unsigned short)__a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1004 | } |
| 1005 | |
| 1006 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1007 | vec_andc(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1008 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1009 | return __a & ~(vector unsigned short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1010 | } |
| 1011 | |
| 1012 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1013 | vec_andc(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1014 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1015 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1016 | } |
| 1017 | |
| 1018 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1019 | vec_andc(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1020 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1021 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1022 | } |
| 1023 | |
| 1024 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1025 | vec_andc(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1026 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1027 | return (vector int)__a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1028 | } |
| 1029 | |
| 1030 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1031 | vec_andc(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1032 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1033 | return __a & ~(vector int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1034 | } |
| 1035 | |
| 1036 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1037 | vec_andc(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1038 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1039 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1040 | } |
| 1041 | |
| 1042 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1043 | vec_andc(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1044 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1045 | return (vector unsigned int)__a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1046 | } |
| 1047 | |
| 1048 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1049 | vec_andc(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1050 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1051 | return __a & ~(vector unsigned int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1052 | } |
| 1053 | |
| 1054 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1055 | vec_andc(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1056 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1057 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1058 | } |
| 1059 | |
| 1060 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1061 | vec_andc(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1062 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1063 | vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b; |
| 1064 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1065 | } |
| 1066 | |
| 1067 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1068 | vec_andc(vector bool int __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1069 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1070 | vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b; |
| 1071 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1072 | } |
| 1073 | |
| 1074 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1075 | vec_andc(vector float __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1076 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1077 | vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b; |
| 1078 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1079 | } |
| 1080 | |
| 1081 | /* vec_vandc */ |
| 1082 | |
| 1083 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1084 | vec_vandc(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1085 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1086 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1087 | } |
| 1088 | |
| 1089 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1090 | vec_vandc(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1091 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1092 | return (vector signed char)__a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1093 | } |
| 1094 | |
| 1095 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1096 | vec_vandc(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1097 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1098 | return __a & ~(vector signed char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1099 | } |
| 1100 | |
| 1101 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1102 | vec_vandc(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1103 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1104 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1105 | } |
| 1106 | |
| 1107 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1108 | vec_vandc(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1109 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1110 | return (vector unsigned char)__a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1111 | } |
| 1112 | |
| 1113 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1114 | vec_vandc(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1115 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1116 | return __a & ~(vector unsigned char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1117 | } |
| 1118 | |
| 1119 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1120 | vec_vandc(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1121 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1122 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1123 | } |
| 1124 | |
| 1125 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1126 | vec_vandc(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1127 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1128 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1129 | } |
| 1130 | |
| 1131 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1132 | vec_vandc(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1133 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1134 | return (vector short)__a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1135 | } |
| 1136 | |
| 1137 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1138 | vec_vandc(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1139 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1140 | return __a & ~(vector short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1141 | } |
| 1142 | |
| 1143 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1144 | vec_vandc(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1145 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1146 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1147 | } |
| 1148 | |
| 1149 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1150 | vec_vandc(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1151 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1152 | return (vector unsigned short)__a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1153 | } |
| 1154 | |
| 1155 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1156 | vec_vandc(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1157 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1158 | return __a & ~(vector unsigned short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1159 | } |
| 1160 | |
| 1161 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1162 | vec_vandc(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1163 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1164 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1165 | } |
| 1166 | |
| 1167 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1168 | vec_vandc(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1169 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1170 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1171 | } |
| 1172 | |
| 1173 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1174 | vec_vandc(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1175 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1176 | return (vector int)__a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1177 | } |
| 1178 | |
| 1179 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1180 | vec_vandc(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1181 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1182 | return __a & ~(vector int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1183 | } |
| 1184 | |
| 1185 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1186 | vec_vandc(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1187 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1188 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1189 | } |
| 1190 | |
| 1191 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1192 | vec_vandc(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1193 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1194 | return (vector unsigned int)__a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1195 | } |
| 1196 | |
| 1197 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1198 | vec_vandc(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1199 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1200 | return __a & ~(vector unsigned int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1201 | } |
| 1202 | |
| 1203 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1204 | vec_vandc(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1205 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1206 | return __a & ~__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1207 | } |
| 1208 | |
| 1209 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1210 | vec_vandc(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1211 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1212 | vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b; |
| 1213 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1214 | } |
| 1215 | |
| 1216 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1217 | vec_vandc(vector bool int __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1218 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1219 | vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b; |
| 1220 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1221 | } |
| 1222 | |
| 1223 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1224 | vec_vandc(vector float __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1225 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1226 | vector unsigned int __res = (vector unsigned int)__a & ~(vector unsigned int)__b; |
| 1227 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1228 | } |
| 1229 | |
| 1230 | /* vec_avg */ |
| 1231 | |
| 1232 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1233 | vec_avg(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1234 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1235 | return __builtin_altivec_vavgsb(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1236 | } |
| 1237 | |
| 1238 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1239 | vec_avg(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1240 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1241 | return __builtin_altivec_vavgub(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1242 | } |
| 1243 | |
| 1244 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1245 | vec_avg(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1246 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1247 | return __builtin_altivec_vavgsh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1248 | } |
| 1249 | |
| 1250 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1251 | vec_avg(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1252 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1253 | return __builtin_altivec_vavguh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1254 | } |
| 1255 | |
| 1256 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1257 | vec_avg(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1258 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1259 | return __builtin_altivec_vavgsw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1260 | } |
| 1261 | |
| 1262 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1263 | vec_avg(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1264 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1265 | return __builtin_altivec_vavguw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1266 | } |
| 1267 | |
| 1268 | /* vec_vavgsb */ |
| 1269 | |
| 1270 | static vector signed char __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1271 | vec_vavgsb(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1272 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1273 | return __builtin_altivec_vavgsb(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1274 | } |
| 1275 | |
| 1276 | /* vec_vavgub */ |
| 1277 | |
| 1278 | static vector unsigned char __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1279 | vec_vavgub(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1280 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1281 | return __builtin_altivec_vavgub(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1282 | } |
| 1283 | |
| 1284 | /* vec_vavgsh */ |
| 1285 | |
| 1286 | static vector short __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1287 | vec_vavgsh(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1288 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1289 | return __builtin_altivec_vavgsh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1290 | } |
| 1291 | |
| 1292 | /* vec_vavguh */ |
| 1293 | |
| 1294 | static vector unsigned short __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1295 | vec_vavguh(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1296 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1297 | return __builtin_altivec_vavguh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1298 | } |
| 1299 | |
| 1300 | /* vec_vavgsw */ |
| 1301 | |
| 1302 | static vector int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1303 | vec_vavgsw(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1304 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1305 | return __builtin_altivec_vavgsw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1306 | } |
| 1307 | |
| 1308 | /* vec_vavguw */ |
| 1309 | |
| 1310 | static vector unsigned int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1311 | vec_vavguw(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1312 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1313 | return __builtin_altivec_vavguw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1314 | } |
| 1315 | |
| 1316 | /* vec_ceil */ |
| 1317 | |
| 1318 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1319 | vec_ceil(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1320 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1321 | return __builtin_altivec_vrfip(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1322 | } |
| 1323 | |
| 1324 | /* vec_vrfip */ |
| 1325 | |
| 1326 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1327 | vec_vrfip(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1328 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1329 | return __builtin_altivec_vrfip(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1330 | } |
| 1331 | |
| 1332 | /* vec_cmpb */ |
| 1333 | |
| 1334 | static vector int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1335 | vec_cmpb(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1336 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1337 | return __builtin_altivec_vcmpbfp(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1338 | } |
| 1339 | |
| 1340 | /* vec_vcmpbfp */ |
| 1341 | |
| 1342 | static vector int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1343 | vec_vcmpbfp(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1344 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1345 | return __builtin_altivec_vcmpbfp(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1346 | } |
| 1347 | |
| 1348 | /* vec_cmpeq */ |
| 1349 | |
| 1350 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1351 | vec_cmpeq(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1352 | { |
| 1353 | return (vector bool char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1354 | __builtin_altivec_vcmpequb((vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1355 | } |
| 1356 | |
| 1357 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1358 | vec_cmpeq(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1359 | { |
| 1360 | return (vector bool char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1361 | __builtin_altivec_vcmpequb((vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1362 | } |
| 1363 | |
| 1364 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1365 | vec_cmpeq(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1366 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1367 | return (vector bool short)__builtin_altivec_vcmpequh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1368 | } |
| 1369 | |
| 1370 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1371 | vec_cmpeq(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1372 | { |
| 1373 | return (vector bool short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1374 | __builtin_altivec_vcmpequh((vector short)__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1375 | } |
| 1376 | |
| 1377 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1378 | vec_cmpeq(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1379 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1380 | return (vector bool int)__builtin_altivec_vcmpequw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1381 | } |
| 1382 | |
| 1383 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1384 | vec_cmpeq(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1385 | { |
| 1386 | return (vector bool int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1387 | __builtin_altivec_vcmpequw((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1388 | } |
| 1389 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 1390 | #ifdef __POWER8_VECTOR__ |
| 1391 | static vector bool long long __ATTRS_o_ai |
| 1392 | vec_cmpeq(vector signed long long __a, vector signed long long __b) |
| 1393 | { |
| 1394 | return (vector bool long long) __builtin_altivec_vcmpequd(__a, __b); |
| 1395 | } |
| 1396 | |
| 1397 | static vector bool long long __ATTRS_o_ai |
| 1398 | vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) |
| 1399 | { |
| 1400 | return (vector bool long long) |
| 1401 | __builtin_altivec_vcmpequd((vector long long)__a, (vector long long) __b); |
| 1402 | } |
| 1403 | #endif |
| 1404 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1405 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1406 | vec_cmpeq(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1407 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1408 | return (vector bool int)__builtin_altivec_vcmpeqfp(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1409 | } |
| 1410 | |
| 1411 | /* vec_cmpge */ |
| 1412 | |
| 1413 | static vector bool int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1414 | vec_cmpge(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1415 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1416 | return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1417 | } |
| 1418 | |
| 1419 | /* vec_vcmpgefp */ |
| 1420 | |
| 1421 | static vector bool int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1422 | vec_vcmpgefp(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1423 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1424 | return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1425 | } |
| 1426 | |
| 1427 | /* vec_cmpgt */ |
| 1428 | |
| 1429 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1430 | vec_cmpgt(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1431 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1432 | return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1433 | } |
| 1434 | |
| 1435 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1436 | vec_cmpgt(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1437 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1438 | return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1439 | } |
| 1440 | |
| 1441 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1442 | vec_cmpgt(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1443 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1444 | return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1445 | } |
| 1446 | |
| 1447 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1448 | vec_cmpgt(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1449 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1450 | return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1451 | } |
| 1452 | |
| 1453 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1454 | vec_cmpgt(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1455 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1456 | return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1457 | } |
| 1458 | |
| 1459 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1460 | vec_cmpgt(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1461 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1462 | return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1463 | } |
| 1464 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 1465 | #ifdef __POWER8_VECTOR__ |
| 1466 | static vector bool long long __ATTRS_o_ai |
| 1467 | vec_cmpgt(vector signed long long __a, vector signed long long __b) |
| 1468 | { |
| 1469 | return (vector bool long long)__builtin_altivec_vcmpgtsd(__a, __b); |
| 1470 | } |
| 1471 | |
| 1472 | static vector bool long long __ATTRS_o_ai |
| 1473 | vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) |
| 1474 | { |
| 1475 | return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b); |
| 1476 | } |
| 1477 | #endif |
| 1478 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1479 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1480 | vec_cmpgt(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1481 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1482 | return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1483 | } |
| 1484 | |
| 1485 | /* vec_vcmpgtsb */ |
| 1486 | |
| 1487 | static vector bool char __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1488 | vec_vcmpgtsb(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1489 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1490 | return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1491 | } |
| 1492 | |
| 1493 | /* vec_vcmpgtub */ |
| 1494 | |
| 1495 | static vector bool char __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1496 | vec_vcmpgtub(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1497 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1498 | return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1499 | } |
| 1500 | |
| 1501 | /* vec_vcmpgtsh */ |
| 1502 | |
| 1503 | static vector bool short __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1504 | vec_vcmpgtsh(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1505 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1506 | return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1507 | } |
| 1508 | |
| 1509 | /* vec_vcmpgtuh */ |
| 1510 | |
| 1511 | static vector bool short __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1512 | vec_vcmpgtuh(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1513 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1514 | return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1515 | } |
| 1516 | |
| 1517 | /* vec_vcmpgtsw */ |
| 1518 | |
| 1519 | static vector bool int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1520 | vec_vcmpgtsw(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1521 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1522 | return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1523 | } |
| 1524 | |
| 1525 | /* vec_vcmpgtuw */ |
| 1526 | |
| 1527 | static vector bool int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1528 | vec_vcmpgtuw(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1529 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1530 | return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1531 | } |
| 1532 | |
| 1533 | /* vec_vcmpgtfp */ |
| 1534 | |
| 1535 | static vector bool int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1536 | vec_vcmpgtfp(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1537 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1538 | return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1539 | } |
| 1540 | |
| 1541 | /* vec_cmple */ |
| 1542 | |
| 1543 | static vector bool int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1544 | vec_cmple(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1545 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1546 | return (vector bool int)__builtin_altivec_vcmpgefp(__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1547 | } |
| 1548 | |
| 1549 | /* vec_cmplt */ |
| 1550 | |
| 1551 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1552 | vec_cmplt(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1553 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1554 | return (vector bool char)__builtin_altivec_vcmpgtsb(__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1555 | } |
| 1556 | |
| 1557 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1558 | vec_cmplt(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1559 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1560 | return (vector bool char)__builtin_altivec_vcmpgtub(__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1561 | } |
| 1562 | |
| 1563 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1564 | vec_cmplt(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1565 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1566 | return (vector bool short)__builtin_altivec_vcmpgtsh(__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1567 | } |
| 1568 | |
| 1569 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1570 | vec_cmplt(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1571 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1572 | return (vector bool short)__builtin_altivec_vcmpgtuh(__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1573 | } |
| 1574 | |
| 1575 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1576 | vec_cmplt(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1577 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1578 | return (vector bool int)__builtin_altivec_vcmpgtsw(__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1579 | } |
| 1580 | |
| 1581 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1582 | vec_cmplt(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1583 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1584 | return (vector bool int)__builtin_altivec_vcmpgtuw(__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1585 | } |
| 1586 | |
| 1587 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1588 | vec_cmplt(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1589 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1590 | return (vector bool int)__builtin_altivec_vcmpgtfp(__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1591 | } |
| 1592 | |
| 1593 | /* vec_ctf */ |
| 1594 | |
| 1595 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1596 | vec_ctf(vector int __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1597 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1598 | return __builtin_altivec_vcfsx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1599 | } |
| 1600 | |
| 1601 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1602 | vec_ctf(vector unsigned int __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1603 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1604 | return __builtin_altivec_vcfux((vector int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1605 | } |
| 1606 | |
| 1607 | /* vec_vcfsx */ |
| 1608 | |
| 1609 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1610 | vec_vcfsx(vector int __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1611 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1612 | return __builtin_altivec_vcfsx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1613 | } |
| 1614 | |
| 1615 | /* vec_vcfux */ |
| 1616 | |
| 1617 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1618 | vec_vcfux(vector unsigned int __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1619 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1620 | return __builtin_altivec_vcfux((vector int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1621 | } |
| 1622 | |
| 1623 | /* vec_cts */ |
| 1624 | |
| 1625 | static vector int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1626 | vec_cts(vector float __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1627 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1628 | return __builtin_altivec_vctsxs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1629 | } |
| 1630 | |
| 1631 | /* vec_vctsxs */ |
| 1632 | |
| 1633 | static vector int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1634 | vec_vctsxs(vector float __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1635 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1636 | return __builtin_altivec_vctsxs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1637 | } |
| 1638 | |
| 1639 | /* vec_ctu */ |
| 1640 | |
| 1641 | static vector unsigned int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1642 | vec_ctu(vector float __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1643 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1644 | return __builtin_altivec_vctuxs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1645 | } |
| 1646 | |
| 1647 | /* vec_vctuxs */ |
| 1648 | |
| 1649 | static vector unsigned int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1650 | vec_vctuxs(vector float __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1651 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1652 | return __builtin_altivec_vctuxs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1653 | } |
| 1654 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 1655 | /* vec_div */ |
| 1656 | #ifdef __VSX__ |
| 1657 | static vector float __ATTRS_o_ai |
| 1658 | vec_div(vector float __a, vector float __b) |
| 1659 | { |
| 1660 | return __builtin_vsx_xvdivsp(__a, __b); |
| 1661 | } |
| 1662 | |
| 1663 | static vector double __ATTRS_o_ai |
| 1664 | vec_div(vector double __a, vector double __b) |
| 1665 | { |
| 1666 | return __builtin_vsx_xvdivdp(__a, __b); |
| 1667 | } |
| 1668 | #endif |
| 1669 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1670 | /* vec_dss */ |
| 1671 | |
| 1672 | static void __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1673 | vec_dss(int __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1674 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1675 | __builtin_altivec_dss(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1676 | } |
| 1677 | |
| 1678 | /* vec_dssall */ |
| 1679 | |
| 1680 | static void __attribute__((__always_inline__)) |
| 1681 | vec_dssall(void) |
| 1682 | { |
| 1683 | __builtin_altivec_dssall(); |
| 1684 | } |
| 1685 | |
| 1686 | /* vec_dst */ |
| 1687 | |
| 1688 | static void __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1689 | vec_dst(const void *__a, int __b, int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1690 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1691 | __builtin_altivec_dst(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1692 | } |
| 1693 | |
| 1694 | /* vec_dstst */ |
| 1695 | |
| 1696 | static void __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1697 | vec_dstst(const void *__a, int __b, int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1698 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1699 | __builtin_altivec_dstst(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1700 | } |
| 1701 | |
| 1702 | /* vec_dststt */ |
| 1703 | |
| 1704 | static void __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1705 | vec_dststt(const void *__a, int __b, int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1706 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1707 | __builtin_altivec_dststt(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1708 | } |
| 1709 | |
| 1710 | /* vec_dstt */ |
| 1711 | |
| 1712 | static void __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1713 | vec_dstt(const void *__a, int __b, int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1714 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1715 | __builtin_altivec_dstt(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1716 | } |
| 1717 | |
| 1718 | /* vec_expte */ |
| 1719 | |
| 1720 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1721 | vec_expte(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1722 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1723 | return __builtin_altivec_vexptefp(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1724 | } |
| 1725 | |
| 1726 | /* vec_vexptefp */ |
| 1727 | |
| 1728 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1729 | vec_vexptefp(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1730 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1731 | return __builtin_altivec_vexptefp(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1732 | } |
| 1733 | |
| 1734 | /* vec_floor */ |
| 1735 | |
| 1736 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1737 | vec_floor(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1738 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1739 | return __builtin_altivec_vrfim(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1740 | } |
| 1741 | |
| 1742 | /* vec_vrfim */ |
| 1743 | |
| 1744 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1745 | vec_vrfim(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1746 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1747 | return __builtin_altivec_vrfim(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1748 | } |
| 1749 | |
| 1750 | /* vec_ld */ |
| 1751 | |
| 1752 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1753 | vec_ld(int __a, const vector signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1754 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1755 | return (vector signed char)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1756 | } |
| 1757 | |
| 1758 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1759 | vec_ld(int __a, const signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1760 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1761 | return (vector signed char)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1762 | } |
| 1763 | |
| 1764 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1765 | vec_ld(int __a, const vector unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1766 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1767 | return (vector unsigned char)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1768 | } |
| 1769 | |
| 1770 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1771 | vec_ld(int __a, const unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1772 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1773 | return (vector unsigned char)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1774 | } |
| 1775 | |
| 1776 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1777 | vec_ld(int __a, const vector bool char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1778 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1779 | return (vector bool char)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1780 | } |
| 1781 | |
| 1782 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1783 | vec_ld(int __a, const vector short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1784 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1785 | return (vector short)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1786 | } |
| 1787 | |
| 1788 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1789 | vec_ld(int __a, const short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1790 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1791 | return (vector short)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1792 | } |
| 1793 | |
| 1794 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1795 | vec_ld(int __a, const vector unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1796 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1797 | return (vector unsigned short)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1798 | } |
| 1799 | |
| 1800 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1801 | vec_ld(int __a, const unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1802 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1803 | return (vector unsigned short)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1804 | } |
| 1805 | |
| 1806 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1807 | vec_ld(int __a, const vector bool short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1808 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1809 | return (vector bool short)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1810 | } |
| 1811 | |
| 1812 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1813 | vec_ld(int __a, const vector pixel *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1814 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1815 | return (vector pixel)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1816 | } |
| 1817 | |
| 1818 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1819 | vec_ld(int __a, const vector int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1820 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1821 | return (vector int)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1822 | } |
| 1823 | |
| 1824 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1825 | vec_ld(int __a, const int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1826 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1827 | return (vector int)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1828 | } |
| 1829 | |
| 1830 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1831 | vec_ld(int __a, const vector unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1832 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1833 | return (vector unsigned int)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1834 | } |
| 1835 | |
| 1836 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1837 | vec_ld(int __a, const unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1838 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1839 | return (vector unsigned int)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1840 | } |
| 1841 | |
| 1842 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1843 | vec_ld(int __a, const vector bool int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1844 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1845 | return (vector bool int)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1846 | } |
| 1847 | |
| 1848 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1849 | vec_ld(int __a, const vector float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1850 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1851 | return (vector float)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1852 | } |
| 1853 | |
| 1854 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1855 | vec_ld(int __a, const float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1856 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1857 | return (vector float)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1858 | } |
| 1859 | |
| 1860 | /* vec_lvx */ |
| 1861 | |
| 1862 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1863 | vec_lvx(int __a, const vector signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1864 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1865 | return (vector signed char)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1866 | } |
| 1867 | |
| 1868 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1869 | vec_lvx(int __a, const signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1870 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1871 | return (vector signed char)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1872 | } |
| 1873 | |
| 1874 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1875 | vec_lvx(int __a, const vector unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1876 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1877 | return (vector unsigned char)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1878 | } |
| 1879 | |
| 1880 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1881 | vec_lvx(int __a, const unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1882 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1883 | return (vector unsigned char)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1884 | } |
| 1885 | |
| 1886 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1887 | vec_lvx(int __a, const vector bool char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1888 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1889 | return (vector bool char)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1890 | } |
| 1891 | |
| 1892 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1893 | vec_lvx(int __a, const vector short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1894 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1895 | return (vector short)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1896 | } |
| 1897 | |
| 1898 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1899 | vec_lvx(int __a, const short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1900 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1901 | return (vector short)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1902 | } |
| 1903 | |
| 1904 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1905 | vec_lvx(int __a, const vector unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1906 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1907 | return (vector unsigned short)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1908 | } |
| 1909 | |
| 1910 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1911 | vec_lvx(int __a, const unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1912 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1913 | return (vector unsigned short)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1914 | } |
| 1915 | |
| 1916 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1917 | vec_lvx(int __a, const vector bool short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1918 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1919 | return (vector bool short)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1920 | } |
| 1921 | |
| 1922 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1923 | vec_lvx(int __a, const vector pixel *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1924 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1925 | return (vector pixel)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1926 | } |
| 1927 | |
| 1928 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1929 | vec_lvx(int __a, const vector int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1930 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1931 | return (vector int)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1932 | } |
| 1933 | |
| 1934 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1935 | vec_lvx(int __a, const int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1936 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1937 | return (vector int)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1938 | } |
| 1939 | |
| 1940 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1941 | vec_lvx(int __a, const vector unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1942 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1943 | return (vector unsigned int)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1944 | } |
| 1945 | |
| 1946 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1947 | vec_lvx(int __a, const unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1948 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1949 | return (vector unsigned int)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1950 | } |
| 1951 | |
| 1952 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1953 | vec_lvx(int __a, const vector bool int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1954 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1955 | return (vector bool int)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1956 | } |
| 1957 | |
| 1958 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1959 | vec_lvx(int __a, const vector float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1960 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1961 | return (vector float)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1962 | } |
| 1963 | |
| 1964 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1965 | vec_lvx(int __a, const float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1966 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1967 | return (vector float)__builtin_altivec_lvx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1968 | } |
| 1969 | |
| 1970 | /* vec_lde */ |
| 1971 | |
| 1972 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1973 | vec_lde(int __a, const signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1974 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1975 | return (vector signed char)__builtin_altivec_lvebx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1976 | } |
| 1977 | |
| 1978 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1979 | vec_lde(int __a, const unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1980 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1981 | return (vector unsigned char)__builtin_altivec_lvebx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1982 | } |
| 1983 | |
| 1984 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1985 | vec_lde(int __a, const short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1986 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1987 | return (vector short)__builtin_altivec_lvehx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1988 | } |
| 1989 | |
| 1990 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1991 | vec_lde(int __a, const unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1992 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1993 | return (vector unsigned short)__builtin_altivec_lvehx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1994 | } |
| 1995 | |
| 1996 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1997 | vec_lde(int __a, const int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 1998 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 1999 | return (vector int)__builtin_altivec_lvewx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2000 | } |
| 2001 | |
| 2002 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2003 | vec_lde(int __a, const unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2004 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2005 | return (vector unsigned int)__builtin_altivec_lvewx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2006 | } |
| 2007 | |
| 2008 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2009 | vec_lde(int __a, const float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2010 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2011 | return (vector float)__builtin_altivec_lvewx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2012 | } |
| 2013 | |
| 2014 | /* vec_lvebx */ |
| 2015 | |
| 2016 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2017 | vec_lvebx(int __a, const signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2018 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2019 | return (vector signed char)__builtin_altivec_lvebx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2020 | } |
| 2021 | |
| 2022 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2023 | vec_lvebx(int __a, const unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2024 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2025 | return (vector unsigned char)__builtin_altivec_lvebx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2026 | } |
| 2027 | |
| 2028 | /* vec_lvehx */ |
| 2029 | |
| 2030 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2031 | vec_lvehx(int __a, const short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2032 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2033 | return (vector short)__builtin_altivec_lvehx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2034 | } |
| 2035 | |
| 2036 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2037 | vec_lvehx(int __a, const unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2038 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2039 | return (vector unsigned short)__builtin_altivec_lvehx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2040 | } |
| 2041 | |
| 2042 | /* vec_lvewx */ |
| 2043 | |
| 2044 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2045 | vec_lvewx(int __a, const int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2046 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2047 | return (vector int)__builtin_altivec_lvewx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2048 | } |
| 2049 | |
| 2050 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2051 | vec_lvewx(int __a, const unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2052 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2053 | return (vector unsigned int)__builtin_altivec_lvewx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2054 | } |
| 2055 | |
| 2056 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2057 | vec_lvewx(int __a, const float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2058 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2059 | return (vector float)__builtin_altivec_lvewx(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2060 | } |
| 2061 | |
| 2062 | /* vec_ldl */ |
| 2063 | |
| 2064 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2065 | vec_ldl(int __a, const vector signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2066 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2067 | return (vector signed char)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2068 | } |
| 2069 | |
| 2070 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2071 | vec_ldl(int __a, const signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2072 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2073 | return (vector signed char)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2074 | } |
| 2075 | |
| 2076 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2077 | vec_ldl(int __a, const vector unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2078 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2079 | return (vector unsigned char)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2080 | } |
| 2081 | |
| 2082 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2083 | vec_ldl(int __a, const unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2084 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2085 | return (vector unsigned char)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2086 | } |
| 2087 | |
| 2088 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2089 | vec_ldl(int __a, const vector bool char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2090 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2091 | return (vector bool char)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2092 | } |
| 2093 | |
| 2094 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2095 | vec_ldl(int __a, const vector short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2096 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2097 | return (vector short)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2098 | } |
| 2099 | |
| 2100 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2101 | vec_ldl(int __a, const short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2102 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2103 | return (vector short)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2104 | } |
| 2105 | |
| 2106 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2107 | vec_ldl(int __a, const vector unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2108 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2109 | return (vector unsigned short)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2110 | } |
| 2111 | |
| 2112 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2113 | vec_ldl(int __a, const unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2114 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2115 | return (vector unsigned short)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2116 | } |
| 2117 | |
| 2118 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2119 | vec_ldl(int __a, const vector bool short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2120 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2121 | return (vector bool short)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2122 | } |
| 2123 | |
| 2124 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2125 | vec_ldl(int __a, const vector pixel *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2126 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2127 | return (vector pixel short)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2128 | } |
| 2129 | |
| 2130 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2131 | vec_ldl(int __a, const vector int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2132 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2133 | return (vector int)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2134 | } |
| 2135 | |
| 2136 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2137 | vec_ldl(int __a, const int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2138 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2139 | return (vector int)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2140 | } |
| 2141 | |
| 2142 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2143 | vec_ldl(int __a, const vector unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2144 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2145 | return (vector unsigned int)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2146 | } |
| 2147 | |
| 2148 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2149 | vec_ldl(int __a, const unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2150 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2151 | return (vector unsigned int)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2152 | } |
| 2153 | |
| 2154 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2155 | vec_ldl(int __a, const vector bool int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2156 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2157 | return (vector bool int)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2158 | } |
| 2159 | |
| 2160 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2161 | vec_ldl(int __a, const vector float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2162 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2163 | return (vector float)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2164 | } |
| 2165 | |
| 2166 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2167 | vec_ldl(int __a, const float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2168 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2169 | return (vector float)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2170 | } |
| 2171 | |
| 2172 | /* vec_lvxl */ |
| 2173 | |
| 2174 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2175 | vec_lvxl(int __a, const vector signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2176 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2177 | return (vector signed char)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2178 | } |
| 2179 | |
| 2180 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2181 | vec_lvxl(int __a, const signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2182 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2183 | return (vector signed char)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2184 | } |
| 2185 | |
| 2186 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2187 | vec_lvxl(int __a, const vector unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2188 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2189 | return (vector unsigned char)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2190 | } |
| 2191 | |
| 2192 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2193 | vec_lvxl(int __a, const unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2194 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2195 | return (vector unsigned char)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2196 | } |
| 2197 | |
| 2198 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2199 | vec_lvxl(int __a, const vector bool char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2200 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2201 | return (vector bool char)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2202 | } |
| 2203 | |
| 2204 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2205 | vec_lvxl(int __a, const vector short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2206 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2207 | return (vector short)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2208 | } |
| 2209 | |
| 2210 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2211 | vec_lvxl(int __a, const short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2212 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2213 | return (vector short)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2214 | } |
| 2215 | |
| 2216 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2217 | vec_lvxl(int __a, const vector unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2218 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2219 | return (vector unsigned short)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2220 | } |
| 2221 | |
| 2222 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2223 | vec_lvxl(int __a, const unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2224 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2225 | return (vector unsigned short)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2226 | } |
| 2227 | |
| 2228 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2229 | vec_lvxl(int __a, const vector bool short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2230 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2231 | return (vector bool short)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2232 | } |
| 2233 | |
| 2234 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2235 | vec_lvxl(int __a, const vector pixel *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2236 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2237 | return (vector pixel)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2238 | } |
| 2239 | |
| 2240 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2241 | vec_lvxl(int __a, const vector int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2242 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2243 | return (vector int)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2244 | } |
| 2245 | |
| 2246 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2247 | vec_lvxl(int __a, const int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2248 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2249 | return (vector int)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2250 | } |
| 2251 | |
| 2252 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2253 | vec_lvxl(int __a, const vector unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2254 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2255 | return (vector unsigned int)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2256 | } |
| 2257 | |
| 2258 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2259 | vec_lvxl(int __a, const unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2260 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2261 | return (vector unsigned int)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2262 | } |
| 2263 | |
| 2264 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2265 | vec_lvxl(int __a, const vector bool int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2266 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2267 | return (vector bool int)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2268 | } |
| 2269 | |
| 2270 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2271 | vec_lvxl(int __a, const vector float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2272 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2273 | return (vector float)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2274 | } |
| 2275 | |
| 2276 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2277 | vec_lvxl(int __a, const float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2278 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2279 | return (vector float)__builtin_altivec_lvxl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2280 | } |
| 2281 | |
| 2282 | /* vec_loge */ |
| 2283 | |
| 2284 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2285 | vec_loge(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2286 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2287 | return __builtin_altivec_vlogefp(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2288 | } |
| 2289 | |
| 2290 | /* vec_vlogefp */ |
| 2291 | |
| 2292 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2293 | vec_vlogefp(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2294 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2295 | return __builtin_altivec_vlogefp(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2296 | } |
| 2297 | |
| 2298 | /* vec_lvsl */ |
| 2299 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2300 | #ifdef __LITTLE_ENDIAN__ |
| 2301 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 2302 | __attribute__((__deprecated__("use assignment for unaligned little endian \ |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2303 | loads/stores"))) |
| 2304 | vec_lvsl(int __a, const signed char *__b) |
| 2305 | { |
| 2306 | vector unsigned char mask = |
| 2307 | (vector unsigned char)__builtin_altivec_lvsl(__a, __b); |
| 2308 | vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; |
| 2309 | return vec_perm(mask, mask, reverse); |
| 2310 | } |
| 2311 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2312 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2313 | vec_lvsl(int __a, const signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2314 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2315 | return (vector unsigned char)__builtin_altivec_lvsl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2316 | } |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2317 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2318 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2319 | #ifdef __LITTLE_ENDIAN__ |
| 2320 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 2321 | __attribute__((__deprecated__("use assignment for unaligned little endian \ |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2322 | loads/stores"))) |
| 2323 | vec_lvsl(int __a, const unsigned char *__b) |
| 2324 | { |
| 2325 | vector unsigned char mask = |
| 2326 | (vector unsigned char)__builtin_altivec_lvsl(__a, __b); |
| 2327 | vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; |
| 2328 | return vec_perm(mask, mask, reverse); |
| 2329 | } |
| 2330 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2331 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2332 | vec_lvsl(int __a, const unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2333 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2334 | return (vector unsigned char)__builtin_altivec_lvsl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2335 | } |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2336 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2337 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2338 | #ifdef __LITTLE_ENDIAN__ |
| 2339 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 2340 | __attribute__((__deprecated__("use assignment for unaligned little endian \ |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2341 | loads/stores"))) |
| 2342 | vec_lvsl(int __a, const short *__b) |
| 2343 | { |
| 2344 | vector unsigned char mask = |
| 2345 | (vector unsigned char)__builtin_altivec_lvsl(__a, __b); |
| 2346 | vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; |
| 2347 | return vec_perm(mask, mask, reverse); |
| 2348 | } |
| 2349 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2350 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2351 | vec_lvsl(int __a, const short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2352 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2353 | return (vector unsigned char)__builtin_altivec_lvsl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2354 | } |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2355 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2356 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2357 | #ifdef __LITTLE_ENDIAN__ |
| 2358 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 2359 | __attribute__((__deprecated__("use assignment for unaligned little endian \ |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2360 | loads/stores"))) |
| 2361 | vec_lvsl(int __a, const unsigned short *__b) |
| 2362 | { |
| 2363 | vector unsigned char mask = |
| 2364 | (vector unsigned char)__builtin_altivec_lvsl(__a, __b); |
| 2365 | vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; |
| 2366 | return vec_perm(mask, mask, reverse); |
| 2367 | } |
| 2368 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2369 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2370 | vec_lvsl(int __a, const unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2371 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2372 | return (vector unsigned char)__builtin_altivec_lvsl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2373 | } |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2374 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2375 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2376 | #ifdef __LITTLE_ENDIAN__ |
| 2377 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 2378 | __attribute__((__deprecated__("use assignment for unaligned little endian \ |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2379 | loads/stores"))) |
| 2380 | vec_lvsl(int __a, const int *__b) |
| 2381 | { |
| 2382 | vector unsigned char mask = |
| 2383 | (vector unsigned char)__builtin_altivec_lvsl(__a, __b); |
| 2384 | vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; |
| 2385 | return vec_perm(mask, mask, reverse); |
| 2386 | } |
| 2387 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2388 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2389 | vec_lvsl(int __a, const int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2390 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2391 | return (vector unsigned char)__builtin_altivec_lvsl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2392 | } |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2393 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2394 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2395 | #ifdef __LITTLE_ENDIAN__ |
| 2396 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 2397 | __attribute__((__deprecated__("use assignment for unaligned little endian \ |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2398 | loads/stores"))) |
| 2399 | vec_lvsl(int __a, const unsigned int *__b) |
| 2400 | { |
| 2401 | vector unsigned char mask = |
| 2402 | (vector unsigned char)__builtin_altivec_lvsl(__a, __b); |
| 2403 | vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; |
| 2404 | return vec_perm(mask, mask, reverse); |
| 2405 | } |
| 2406 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2407 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2408 | vec_lvsl(int __a, const unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2409 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2410 | return (vector unsigned char)__builtin_altivec_lvsl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2411 | } |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2412 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2413 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2414 | #ifdef __LITTLE_ENDIAN__ |
| 2415 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 2416 | __attribute__((__deprecated__("use assignment for unaligned little endian \ |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2417 | loads/stores"))) |
| 2418 | vec_lvsl(int __a, const float *__b) |
| 2419 | { |
| 2420 | vector unsigned char mask = |
| 2421 | (vector unsigned char)__builtin_altivec_lvsl(__a, __b); |
| 2422 | vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; |
| 2423 | return vec_perm(mask, mask, reverse); |
| 2424 | } |
| 2425 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2426 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2427 | vec_lvsl(int __a, const float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2428 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2429 | return (vector unsigned char)__builtin_altivec_lvsl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2430 | } |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2431 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2432 | |
| 2433 | /* vec_lvsr */ |
| 2434 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2435 | #ifdef __LITTLE_ENDIAN__ |
| 2436 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 2437 | __attribute__((__deprecated__("use assignment for unaligned little endian \ |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2438 | loads/stores"))) |
| 2439 | vec_lvsr(int __a, const signed char *__b) |
| 2440 | { |
| 2441 | vector unsigned char mask = |
| 2442 | (vector unsigned char)__builtin_altivec_lvsr(__a, __b); |
| 2443 | vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; |
| 2444 | return vec_perm(mask, mask, reverse); |
| 2445 | } |
| 2446 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2447 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2448 | vec_lvsr(int __a, const signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2449 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2450 | return (vector unsigned char)__builtin_altivec_lvsr(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2451 | } |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2452 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2453 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2454 | #ifdef __LITTLE_ENDIAN__ |
| 2455 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 2456 | __attribute__((__deprecated__("use assignment for unaligned little endian \ |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2457 | loads/stores"))) |
| 2458 | vec_lvsr(int __a, const unsigned char *__b) |
| 2459 | { |
| 2460 | vector unsigned char mask = |
| 2461 | (vector unsigned char)__builtin_altivec_lvsr(__a, __b); |
| 2462 | vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; |
| 2463 | return vec_perm(mask, mask, reverse); |
| 2464 | } |
| 2465 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2466 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2467 | vec_lvsr(int __a, const unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2468 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2469 | return (vector unsigned char)__builtin_altivec_lvsr(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2470 | } |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2471 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2472 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2473 | #ifdef __LITTLE_ENDIAN__ |
| 2474 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 2475 | __attribute__((__deprecated__("use assignment for unaligned little endian \ |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2476 | loads/stores"))) |
| 2477 | vec_lvsr(int __a, const short *__b) |
| 2478 | { |
| 2479 | vector unsigned char mask = |
| 2480 | (vector unsigned char)__builtin_altivec_lvsr(__a, __b); |
| 2481 | vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; |
| 2482 | return vec_perm(mask, mask, reverse); |
| 2483 | } |
| 2484 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2485 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2486 | vec_lvsr(int __a, const short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2487 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2488 | return (vector unsigned char)__builtin_altivec_lvsr(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2489 | } |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2490 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2491 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2492 | #ifdef __LITTLE_ENDIAN__ |
| 2493 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 2494 | __attribute__((__deprecated__("use assignment for unaligned little endian \ |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2495 | loads/stores"))) |
| 2496 | vec_lvsr(int __a, const unsigned short *__b) |
| 2497 | { |
| 2498 | vector unsigned char mask = |
| 2499 | (vector unsigned char)__builtin_altivec_lvsr(__a, __b); |
| 2500 | vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; |
| 2501 | return vec_perm(mask, mask, reverse); |
| 2502 | } |
| 2503 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2504 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2505 | vec_lvsr(int __a, const unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2506 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2507 | return (vector unsigned char)__builtin_altivec_lvsr(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2508 | } |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2509 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2510 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2511 | #ifdef __LITTLE_ENDIAN__ |
| 2512 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 2513 | __attribute__((__deprecated__("use assignment for unaligned little endian \ |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2514 | loads/stores"))) |
| 2515 | vec_lvsr(int __a, const int *__b) |
| 2516 | { |
| 2517 | vector unsigned char mask = |
| 2518 | (vector unsigned char)__builtin_altivec_lvsr(__a, __b); |
| 2519 | vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; |
| 2520 | return vec_perm(mask, mask, reverse); |
| 2521 | } |
| 2522 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2523 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2524 | vec_lvsr(int __a, const int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2525 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2526 | return (vector unsigned char)__builtin_altivec_lvsr(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2527 | } |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2528 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2529 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2530 | #ifdef __LITTLE_ENDIAN__ |
| 2531 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 2532 | __attribute__((__deprecated__("use assignment for unaligned little endian \ |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2533 | loads/stores"))) |
| 2534 | vec_lvsr(int __a, const unsigned int *__b) |
| 2535 | { |
| 2536 | vector unsigned char mask = |
| 2537 | (vector unsigned char)__builtin_altivec_lvsr(__a, __b); |
| 2538 | vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; |
| 2539 | return vec_perm(mask, mask, reverse); |
| 2540 | } |
| 2541 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2542 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2543 | vec_lvsr(int __a, const unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2544 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2545 | return (vector unsigned char)__builtin_altivec_lvsr(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2546 | } |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2547 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2548 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2549 | #ifdef __LITTLE_ENDIAN__ |
| 2550 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 2551 | __attribute__((__deprecated__("use assignment for unaligned little endian \ |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2552 | loads/stores"))) |
| 2553 | vec_lvsr(int __a, const float *__b) |
| 2554 | { |
| 2555 | vector unsigned char mask = |
| 2556 | (vector unsigned char)__builtin_altivec_lvsr(__a, __b); |
| 2557 | vector unsigned char reverse = {15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0}; |
| 2558 | return vec_perm(mask, mask, reverse); |
| 2559 | } |
| 2560 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2561 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2562 | vec_lvsr(int __a, const float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2563 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2564 | return (vector unsigned char)__builtin_altivec_lvsr(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2565 | } |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2566 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2567 | |
| 2568 | /* vec_madd */ |
| 2569 | |
| 2570 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2571 | vec_madd(vector float __a, vector float __b, vector float __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2572 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2573 | return __builtin_altivec_vmaddfp(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2574 | } |
| 2575 | |
| 2576 | /* vec_vmaddfp */ |
| 2577 | |
| 2578 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2579 | vec_vmaddfp(vector float __a, vector float __b, vector float __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2580 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2581 | return __builtin_altivec_vmaddfp(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2582 | } |
| 2583 | |
| 2584 | /* vec_madds */ |
| 2585 | |
| 2586 | static vector signed short __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2587 | vec_madds(vector signed short __a, vector signed short __b, vector signed short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2588 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2589 | return __builtin_altivec_vmhaddshs(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2590 | } |
| 2591 | |
| 2592 | /* vec_vmhaddshs */ |
| 2593 | static vector signed short __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2594 | vec_vmhaddshs(vector signed short __a, |
| 2595 | vector signed short __b, |
| 2596 | vector signed short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2597 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2598 | return __builtin_altivec_vmhaddshs(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2599 | } |
| 2600 | |
| 2601 | /* vec_max */ |
| 2602 | |
| 2603 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2604 | vec_max(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2605 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2606 | return __builtin_altivec_vmaxsb(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2607 | } |
| 2608 | |
| 2609 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2610 | vec_max(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2611 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2612 | return __builtin_altivec_vmaxsb((vector signed char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2613 | } |
| 2614 | |
| 2615 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2616 | vec_max(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2617 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2618 | return __builtin_altivec_vmaxsb(__a, (vector signed char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2619 | } |
| 2620 | |
| 2621 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2622 | vec_max(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2623 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2624 | return __builtin_altivec_vmaxub(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2625 | } |
| 2626 | |
| 2627 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2628 | vec_max(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2629 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2630 | return __builtin_altivec_vmaxub((vector unsigned char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2631 | } |
| 2632 | |
| 2633 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2634 | vec_max(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2635 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2636 | return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2637 | } |
| 2638 | |
| 2639 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2640 | vec_max(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2641 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2642 | return __builtin_altivec_vmaxsh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2643 | } |
| 2644 | |
| 2645 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2646 | vec_max(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2647 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2648 | return __builtin_altivec_vmaxsh((vector short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2649 | } |
| 2650 | |
| 2651 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2652 | vec_max(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2653 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2654 | return __builtin_altivec_vmaxsh(__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2655 | } |
| 2656 | |
| 2657 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2658 | vec_max(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2659 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2660 | return __builtin_altivec_vmaxuh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2661 | } |
| 2662 | |
| 2663 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2664 | vec_max(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2665 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2666 | return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2667 | } |
| 2668 | |
| 2669 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2670 | vec_max(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2671 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2672 | return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2673 | } |
| 2674 | |
| 2675 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2676 | vec_max(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2677 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2678 | return __builtin_altivec_vmaxsw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2679 | } |
| 2680 | |
| 2681 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2682 | vec_max(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2683 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2684 | return __builtin_altivec_vmaxsw((vector int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2685 | } |
| 2686 | |
| 2687 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2688 | vec_max(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2689 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2690 | return __builtin_altivec_vmaxsw(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2691 | } |
| 2692 | |
| 2693 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2694 | vec_max(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2695 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2696 | return __builtin_altivec_vmaxuw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2697 | } |
| 2698 | |
| 2699 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2700 | vec_max(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2701 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2702 | return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2703 | } |
| 2704 | |
| 2705 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2706 | vec_max(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2707 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2708 | return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2709 | } |
| 2710 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 2711 | #ifdef __POWER8_VECTOR__ |
| 2712 | static vector signed long long __ATTRS_o_ai |
| 2713 | vec_max(vector signed long long __a, vector signed long long __b) |
| 2714 | { |
| 2715 | return __builtin_altivec_vmaxsd(__a, __b); |
| 2716 | } |
| 2717 | |
| 2718 | static vector unsigned long long __ATTRS_o_ai |
| 2719 | vec_max(vector unsigned long long __a, vector unsigned long long __b) |
| 2720 | { |
| 2721 | return __builtin_altivec_vmaxud(__a, __b); |
| 2722 | } |
| 2723 | #endif |
| 2724 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2725 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2726 | vec_max(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2727 | { |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2728 | #ifdef __VSX__ |
| 2729 | return __builtin_vsx_xvmaxsp(__a, __b); |
| 2730 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2731 | return __builtin_altivec_vmaxfp(__a, __b); |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2732 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2733 | } |
| 2734 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2735 | #ifdef __VSX__ |
| 2736 | static vector double __ATTRS_o_ai |
| 2737 | vec_max(vector double __a, vector double __b) |
| 2738 | { |
| 2739 | return __builtin_vsx_xvmaxdp(__a, __b); |
| 2740 | } |
| 2741 | #endif |
| 2742 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2743 | /* vec_vmaxsb */ |
| 2744 | |
| 2745 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2746 | vec_vmaxsb(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2747 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2748 | return __builtin_altivec_vmaxsb(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2749 | } |
| 2750 | |
| 2751 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2752 | vec_vmaxsb(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2753 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2754 | return __builtin_altivec_vmaxsb((vector signed char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2755 | } |
| 2756 | |
| 2757 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2758 | vec_vmaxsb(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2759 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2760 | return __builtin_altivec_vmaxsb(__a, (vector signed char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2761 | } |
| 2762 | |
| 2763 | /* vec_vmaxub */ |
| 2764 | |
| 2765 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2766 | vec_vmaxub(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2767 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2768 | return __builtin_altivec_vmaxub(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2769 | } |
| 2770 | |
| 2771 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2772 | vec_vmaxub(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2773 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2774 | return __builtin_altivec_vmaxub((vector unsigned char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2775 | } |
| 2776 | |
| 2777 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2778 | vec_vmaxub(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2779 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2780 | return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2781 | } |
| 2782 | |
| 2783 | /* vec_vmaxsh */ |
| 2784 | |
| 2785 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2786 | vec_vmaxsh(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2787 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2788 | return __builtin_altivec_vmaxsh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2789 | } |
| 2790 | |
| 2791 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2792 | vec_vmaxsh(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2793 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2794 | return __builtin_altivec_vmaxsh((vector short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2795 | } |
| 2796 | |
| 2797 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2798 | vec_vmaxsh(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2799 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2800 | return __builtin_altivec_vmaxsh(__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2801 | } |
| 2802 | |
| 2803 | /* vec_vmaxuh */ |
| 2804 | |
| 2805 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2806 | vec_vmaxuh(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2807 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2808 | return __builtin_altivec_vmaxuh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2809 | } |
| 2810 | |
| 2811 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2812 | vec_vmaxuh(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2813 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2814 | return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2815 | } |
| 2816 | |
| 2817 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2818 | vec_vmaxuh(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2819 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2820 | return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2821 | } |
| 2822 | |
| 2823 | /* vec_vmaxsw */ |
| 2824 | |
| 2825 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2826 | vec_vmaxsw(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2827 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2828 | return __builtin_altivec_vmaxsw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2829 | } |
| 2830 | |
| 2831 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2832 | vec_vmaxsw(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2833 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2834 | return __builtin_altivec_vmaxsw((vector int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2835 | } |
| 2836 | |
| 2837 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2838 | vec_vmaxsw(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2839 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2840 | return __builtin_altivec_vmaxsw(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2841 | } |
| 2842 | |
| 2843 | /* vec_vmaxuw */ |
| 2844 | |
| 2845 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2846 | vec_vmaxuw(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2847 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2848 | return __builtin_altivec_vmaxuw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2849 | } |
| 2850 | |
| 2851 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2852 | vec_vmaxuw(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2853 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2854 | return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2855 | } |
| 2856 | |
| 2857 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2858 | vec_vmaxuw(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2859 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2860 | return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2861 | } |
| 2862 | |
| 2863 | /* vec_vmaxfp */ |
| 2864 | |
| 2865 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2866 | vec_vmaxfp(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2867 | { |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2868 | #ifdef __VSX__ |
| 2869 | return __builtin_vsx_xvmaxsp(__a, __b); |
| 2870 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2871 | return __builtin_altivec_vmaxfp(__a, __b); |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 2872 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2873 | } |
| 2874 | |
| 2875 | /* vec_mergeh */ |
| 2876 | |
| 2877 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2878 | vec_mergeh(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2879 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2880 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2881 | (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, |
| 2882 | 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17)); |
| 2883 | } |
| 2884 | |
| 2885 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2886 | vec_mergeh(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2887 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2888 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2889 | (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, |
| 2890 | 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17)); |
| 2891 | } |
| 2892 | |
| 2893 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2894 | vec_mergeh(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2895 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2896 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2897 | (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, |
| 2898 | 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17)); |
| 2899 | } |
| 2900 | |
| 2901 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2902 | vec_mergeh(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2903 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2904 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2905 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 2906 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 2907 | } |
| 2908 | |
| 2909 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2910 | vec_mergeh(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2911 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2912 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2913 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 2914 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 2915 | } |
| 2916 | |
| 2917 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2918 | vec_mergeh(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2919 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2920 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2921 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 2922 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 2923 | } |
| 2924 | |
| 2925 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2926 | vec_mergeh(vector pixel __a, vector pixel __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2927 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2928 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2929 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 2930 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 2931 | } |
| 2932 | |
| 2933 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2934 | vec_mergeh(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2935 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2936 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2937 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 2938 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 2939 | } |
| 2940 | |
| 2941 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2942 | vec_mergeh(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2943 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2944 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2945 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 2946 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 2947 | } |
| 2948 | |
| 2949 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2950 | vec_mergeh(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2951 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2952 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2953 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 2954 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 2955 | } |
| 2956 | |
| 2957 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2958 | vec_mergeh(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2959 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2960 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2961 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 2962 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 2963 | } |
| 2964 | |
| 2965 | /* vec_vmrghb */ |
| 2966 | |
| 2967 | #define __builtin_altivec_vmrghb vec_vmrghb |
| 2968 | |
| 2969 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2970 | vec_vmrghb(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2971 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2972 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2973 | (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, |
| 2974 | 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17)); |
| 2975 | } |
| 2976 | |
| 2977 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2978 | vec_vmrghb(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2979 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2980 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2981 | (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, |
| 2982 | 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17)); |
| 2983 | } |
| 2984 | |
| 2985 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2986 | vec_vmrghb(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2987 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2988 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2989 | (0x00, 0x10, 0x01, 0x11, 0x02, 0x12, 0x03, 0x13, |
| 2990 | 0x04, 0x14, 0x05, 0x15, 0x06, 0x16, 0x07, 0x17)); |
| 2991 | } |
| 2992 | |
| 2993 | /* vec_vmrghh */ |
| 2994 | |
| 2995 | #define __builtin_altivec_vmrghh vec_vmrghh |
| 2996 | |
| 2997 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 2998 | vec_vmrghh(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 2999 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3000 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3001 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 3002 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 3003 | } |
| 3004 | |
| 3005 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3006 | vec_vmrghh(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3007 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3008 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3009 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 3010 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 3011 | } |
| 3012 | |
| 3013 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3014 | vec_vmrghh(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3015 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3016 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3017 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 3018 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 3019 | } |
| 3020 | |
| 3021 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3022 | vec_vmrghh(vector pixel __a, vector pixel __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3023 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3024 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3025 | (0x00, 0x01, 0x10, 0x11, 0x02, 0x03, 0x12, 0x13, |
| 3026 | 0x04, 0x05, 0x14, 0x15, 0x06, 0x07, 0x16, 0x17)); |
| 3027 | } |
| 3028 | |
| 3029 | /* vec_vmrghw */ |
| 3030 | |
| 3031 | #define __builtin_altivec_vmrghw vec_vmrghw |
| 3032 | |
| 3033 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3034 | vec_vmrghw(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3035 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3036 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3037 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 3038 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 3039 | } |
| 3040 | |
| 3041 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3042 | vec_vmrghw(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3043 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3044 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3045 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 3046 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 3047 | } |
| 3048 | |
| 3049 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3050 | vec_vmrghw(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3051 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3052 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3053 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 3054 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 3055 | } |
| 3056 | |
| 3057 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3058 | vec_vmrghw(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3059 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3060 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3061 | (0x00, 0x01, 0x02, 0x03, 0x10, 0x11, 0x12, 0x13, |
| 3062 | 0x04, 0x05, 0x06, 0x07, 0x14, 0x15, 0x16, 0x17)); |
| 3063 | } |
| 3064 | |
| 3065 | /* vec_mergel */ |
| 3066 | |
| 3067 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3068 | vec_mergel(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3069 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3070 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3071 | (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, |
| 3072 | 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F)); |
| 3073 | } |
| 3074 | |
| 3075 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3076 | vec_mergel(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3077 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3078 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3079 | (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, |
| 3080 | 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F)); |
| 3081 | } |
| 3082 | |
| 3083 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3084 | vec_mergel(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3085 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3086 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3087 | (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, |
| 3088 | 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F)); |
| 3089 | } |
| 3090 | |
| 3091 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3092 | vec_mergel(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3093 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3094 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3095 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 3096 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 3097 | } |
| 3098 | |
| 3099 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3100 | vec_mergel(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3101 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3102 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3103 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 3104 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 3105 | } |
| 3106 | |
| 3107 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3108 | vec_mergel(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3109 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3110 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3111 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 3112 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 3113 | } |
| 3114 | |
| 3115 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3116 | vec_mergel(vector pixel __a, vector pixel __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3117 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3118 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3119 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 3120 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 3121 | } |
| 3122 | |
| 3123 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3124 | vec_mergel(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3125 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3126 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3127 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 3128 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 3129 | } |
| 3130 | |
| 3131 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3132 | vec_mergel(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3133 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3134 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3135 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 3136 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 3137 | } |
| 3138 | |
| 3139 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3140 | vec_mergel(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3141 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3142 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3143 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 3144 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 3145 | } |
| 3146 | |
| 3147 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3148 | vec_mergel(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3149 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3150 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3151 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 3152 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 3153 | } |
| 3154 | |
| 3155 | /* vec_vmrglb */ |
| 3156 | |
| 3157 | #define __builtin_altivec_vmrglb vec_vmrglb |
| 3158 | |
| 3159 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3160 | vec_vmrglb(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3161 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3162 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3163 | (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, |
| 3164 | 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F)); |
| 3165 | } |
| 3166 | |
| 3167 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3168 | vec_vmrglb(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3169 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3170 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3171 | (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, |
| 3172 | 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F)); |
| 3173 | } |
| 3174 | |
| 3175 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3176 | vec_vmrglb(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3177 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3178 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3179 | (0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A, 0x0B, 0x1B, |
| 3180 | 0x0C, 0x1C, 0x0D, 0x1D, 0x0E, 0x1E, 0x0F, 0x1F)); |
| 3181 | } |
| 3182 | |
| 3183 | /* vec_vmrglh */ |
| 3184 | |
| 3185 | #define __builtin_altivec_vmrglh vec_vmrglh |
| 3186 | |
| 3187 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3188 | vec_vmrglh(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3189 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3190 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3191 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 3192 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 3193 | } |
| 3194 | |
| 3195 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3196 | vec_vmrglh(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3197 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3198 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3199 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 3200 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 3201 | } |
| 3202 | |
| 3203 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3204 | vec_vmrglh(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3205 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3206 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3207 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 3208 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 3209 | } |
| 3210 | |
| 3211 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3212 | vec_vmrglh(vector pixel __a, vector pixel __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3213 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3214 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3215 | (0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B, 0x1A, 0x1B, |
| 3216 | 0x0C, 0x0D, 0x1C, 0x1D, 0x0E, 0x0F, 0x1E, 0x1F)); |
| 3217 | } |
| 3218 | |
| 3219 | /* vec_vmrglw */ |
| 3220 | |
| 3221 | #define __builtin_altivec_vmrglw vec_vmrglw |
| 3222 | |
| 3223 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3224 | vec_vmrglw(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3225 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3226 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3227 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 3228 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 3229 | } |
| 3230 | |
| 3231 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3232 | vec_vmrglw(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3233 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3234 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3235 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 3236 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 3237 | } |
| 3238 | |
| 3239 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3240 | vec_vmrglw(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3241 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3242 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3243 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 3244 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 3245 | } |
| 3246 | |
| 3247 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3248 | vec_vmrglw(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3249 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3250 | return vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3251 | (0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19, 0x1A, 0x1B, |
| 3252 | 0x0C, 0x0D, 0x0E, 0x0F, 0x1C, 0x1D, 0x1E, 0x1F)); |
| 3253 | } |
| 3254 | |
| 3255 | /* vec_mfvscr */ |
| 3256 | |
| 3257 | static vector unsigned short __attribute__((__always_inline__)) |
| 3258 | vec_mfvscr(void) |
| 3259 | { |
| 3260 | return __builtin_altivec_mfvscr(); |
| 3261 | } |
| 3262 | |
| 3263 | /* vec_min */ |
| 3264 | |
| 3265 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3266 | vec_min(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3267 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3268 | return __builtin_altivec_vminsb(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3269 | } |
| 3270 | |
| 3271 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3272 | vec_min(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3273 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3274 | return __builtin_altivec_vminsb((vector signed char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3275 | } |
| 3276 | |
| 3277 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3278 | vec_min(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3279 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3280 | return __builtin_altivec_vminsb(__a, (vector signed char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3281 | } |
| 3282 | |
| 3283 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3284 | vec_min(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3285 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3286 | return __builtin_altivec_vminub(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3287 | } |
| 3288 | |
| 3289 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3290 | vec_min(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3291 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3292 | return __builtin_altivec_vminub((vector unsigned char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3293 | } |
| 3294 | |
| 3295 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3296 | vec_min(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3297 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3298 | return __builtin_altivec_vminub(__a, (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3299 | } |
| 3300 | |
| 3301 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3302 | vec_min(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3303 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3304 | return __builtin_altivec_vminsh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3305 | } |
| 3306 | |
| 3307 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3308 | vec_min(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3309 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3310 | return __builtin_altivec_vminsh((vector short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3311 | } |
| 3312 | |
| 3313 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3314 | vec_min(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3315 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3316 | return __builtin_altivec_vminsh(__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3317 | } |
| 3318 | |
| 3319 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3320 | vec_min(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3321 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3322 | return __builtin_altivec_vminuh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3323 | } |
| 3324 | |
| 3325 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3326 | vec_min(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3327 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3328 | return __builtin_altivec_vminuh((vector unsigned short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3329 | } |
| 3330 | |
| 3331 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3332 | vec_min(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3333 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3334 | return __builtin_altivec_vminuh(__a, (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3335 | } |
| 3336 | |
| 3337 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3338 | vec_min(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3339 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3340 | return __builtin_altivec_vminsw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3341 | } |
| 3342 | |
| 3343 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3344 | vec_min(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3345 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3346 | return __builtin_altivec_vminsw((vector int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3347 | } |
| 3348 | |
| 3349 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3350 | vec_min(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3351 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3352 | return __builtin_altivec_vminsw(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3353 | } |
| 3354 | |
| 3355 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3356 | vec_min(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3357 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3358 | return __builtin_altivec_vminuw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3359 | } |
| 3360 | |
| 3361 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3362 | vec_min(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3363 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3364 | return __builtin_altivec_vminuw((vector unsigned int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3365 | } |
| 3366 | |
| 3367 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3368 | vec_min(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3369 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3370 | return __builtin_altivec_vminuw(__a, (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3371 | } |
| 3372 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 3373 | #ifdef __POWER8_VECTOR__ |
| 3374 | static vector signed long long __ATTRS_o_ai |
| 3375 | vec_min(vector signed long long __a, vector signed long long __b) |
| 3376 | { |
| 3377 | return __builtin_altivec_vminsd(__a, __b); |
| 3378 | } |
| 3379 | |
| 3380 | static vector unsigned long long __ATTRS_o_ai |
| 3381 | vec_min(vector unsigned long long __a, vector unsigned long long __b) |
| 3382 | { |
| 3383 | return __builtin_altivec_vminud(__a, __b); |
| 3384 | } |
| 3385 | #endif |
| 3386 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3387 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3388 | vec_min(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3389 | { |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 3390 | #ifdef __VSX__ |
| 3391 | return __builtin_vsx_xvminsp(__a, __b); |
| 3392 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3393 | return __builtin_altivec_vminfp(__a, __b); |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 3394 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3395 | } |
| 3396 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 3397 | #ifdef __VSX__ |
| 3398 | static vector double __ATTRS_o_ai |
| 3399 | vec_min(vector double __a, vector double __b) |
| 3400 | { |
| 3401 | return __builtin_vsx_xvmindp(__a, __b); |
| 3402 | } |
| 3403 | #endif |
| 3404 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3405 | /* vec_vminsb */ |
| 3406 | |
| 3407 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3408 | vec_vminsb(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3409 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3410 | return __builtin_altivec_vminsb(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3411 | } |
| 3412 | |
| 3413 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3414 | vec_vminsb(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3415 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3416 | return __builtin_altivec_vminsb((vector signed char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3417 | } |
| 3418 | |
| 3419 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3420 | vec_vminsb(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3421 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3422 | return __builtin_altivec_vminsb(__a, (vector signed char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3423 | } |
| 3424 | |
| 3425 | /* vec_vminub */ |
| 3426 | |
| 3427 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3428 | vec_vminub(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3429 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3430 | return __builtin_altivec_vminub(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3431 | } |
| 3432 | |
| 3433 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3434 | vec_vminub(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3435 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3436 | return __builtin_altivec_vminub((vector unsigned char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3437 | } |
| 3438 | |
| 3439 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3440 | vec_vminub(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3441 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3442 | return __builtin_altivec_vminub(__a, (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3443 | } |
| 3444 | |
| 3445 | /* vec_vminsh */ |
| 3446 | |
| 3447 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3448 | vec_vminsh(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3449 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3450 | return __builtin_altivec_vminsh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3451 | } |
| 3452 | |
| 3453 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3454 | vec_vminsh(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3455 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3456 | return __builtin_altivec_vminsh((vector short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3457 | } |
| 3458 | |
| 3459 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3460 | vec_vminsh(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3461 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3462 | return __builtin_altivec_vminsh(__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3463 | } |
| 3464 | |
| 3465 | /* vec_vminuh */ |
| 3466 | |
| 3467 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3468 | vec_vminuh(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3469 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3470 | return __builtin_altivec_vminuh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3471 | } |
| 3472 | |
| 3473 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3474 | vec_vminuh(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3475 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3476 | return __builtin_altivec_vminuh((vector unsigned short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3477 | } |
| 3478 | |
| 3479 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3480 | vec_vminuh(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3481 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3482 | return __builtin_altivec_vminuh(__a, (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3483 | } |
| 3484 | |
| 3485 | /* vec_vminsw */ |
| 3486 | |
| 3487 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3488 | vec_vminsw(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3489 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3490 | return __builtin_altivec_vminsw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3491 | } |
| 3492 | |
| 3493 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3494 | vec_vminsw(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3495 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3496 | return __builtin_altivec_vminsw((vector int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3497 | } |
| 3498 | |
| 3499 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3500 | vec_vminsw(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3501 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3502 | return __builtin_altivec_vminsw(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3503 | } |
| 3504 | |
| 3505 | /* vec_vminuw */ |
| 3506 | |
| 3507 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3508 | vec_vminuw(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3509 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3510 | return __builtin_altivec_vminuw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3511 | } |
| 3512 | |
| 3513 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3514 | vec_vminuw(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3515 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3516 | return __builtin_altivec_vminuw((vector unsigned int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3517 | } |
| 3518 | |
| 3519 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3520 | vec_vminuw(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3521 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3522 | return __builtin_altivec_vminuw(__a, (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3523 | } |
| 3524 | |
| 3525 | /* vec_vminfp */ |
| 3526 | |
| 3527 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3528 | vec_vminfp(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3529 | { |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 3530 | #ifdef __VSX__ |
| 3531 | return __builtin_vsx_xvminsp(__a, __b); |
| 3532 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3533 | return __builtin_altivec_vminfp(__a, __b); |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 3534 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3535 | } |
| 3536 | |
| 3537 | /* vec_mladd */ |
| 3538 | |
| 3539 | #define __builtin_altivec_vmladduhm vec_mladd |
| 3540 | |
| 3541 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3542 | vec_mladd(vector short __a, vector short __b, vector short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3543 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3544 | return __a * __b + __c; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3545 | } |
| 3546 | |
| 3547 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3548 | vec_mladd(vector short __a, vector unsigned short __b, vector unsigned short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3549 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3550 | return __a * (vector short)__b + (vector short)__c; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3551 | } |
| 3552 | |
| 3553 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3554 | vec_mladd(vector unsigned short __a, vector short __b, vector short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3555 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3556 | return (vector short)__a * __b + __c; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3557 | } |
| 3558 | |
| 3559 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3560 | vec_mladd(vector unsigned short __a, |
| 3561 | vector unsigned short __b, |
| 3562 | vector unsigned short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3563 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3564 | return __a * __b + __c; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3565 | } |
| 3566 | |
| 3567 | /* vec_vmladduhm */ |
| 3568 | |
| 3569 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3570 | vec_vmladduhm(vector short __a, vector short __b, vector short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3571 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3572 | return __a * __b + __c; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3573 | } |
| 3574 | |
| 3575 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3576 | vec_vmladduhm(vector short __a, vector unsigned short __b, vector unsigned short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3577 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3578 | return __a * (vector short)__b + (vector short)__c; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3579 | } |
| 3580 | |
| 3581 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3582 | vec_vmladduhm(vector unsigned short __a, vector short __b, vector short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3583 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3584 | return (vector short)__a * __b + __c; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3585 | } |
| 3586 | |
| 3587 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3588 | vec_vmladduhm(vector unsigned short __a, |
| 3589 | vector unsigned short __b, |
| 3590 | vector unsigned short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3591 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3592 | return __a * __b + __c; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3593 | } |
| 3594 | |
| 3595 | /* vec_mradds */ |
| 3596 | |
| 3597 | static vector short __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3598 | vec_mradds(vector short __a, vector short __b, vector short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3599 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3600 | return __builtin_altivec_vmhraddshs(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3601 | } |
| 3602 | |
| 3603 | /* vec_vmhraddshs */ |
| 3604 | |
| 3605 | static vector short __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3606 | vec_vmhraddshs(vector short __a, vector short __b, vector short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3607 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3608 | return __builtin_altivec_vmhraddshs(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3609 | } |
| 3610 | |
| 3611 | /* vec_msum */ |
| 3612 | |
| 3613 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3614 | vec_msum(vector signed char __a, vector unsigned char __b, vector int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3615 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3616 | return __builtin_altivec_vmsummbm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3617 | } |
| 3618 | |
| 3619 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3620 | vec_msum(vector unsigned char __a, vector unsigned char __b, vector unsigned int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3621 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3622 | return __builtin_altivec_vmsumubm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3623 | } |
| 3624 | |
| 3625 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3626 | vec_msum(vector short __a, vector short __b, vector int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3627 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3628 | return __builtin_altivec_vmsumshm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3629 | } |
| 3630 | |
| 3631 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3632 | vec_msum(vector unsigned short __a, |
| 3633 | vector unsigned short __b, |
| 3634 | vector unsigned int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3635 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3636 | return __builtin_altivec_vmsumuhm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3637 | } |
| 3638 | |
| 3639 | /* vec_vmsummbm */ |
| 3640 | |
| 3641 | static vector int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3642 | vec_vmsummbm(vector signed char __a, vector unsigned char __b, vector int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3643 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3644 | return __builtin_altivec_vmsummbm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3645 | } |
| 3646 | |
| 3647 | /* vec_vmsumubm */ |
| 3648 | |
| 3649 | static vector unsigned int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3650 | vec_vmsumubm(vector unsigned char __a, |
| 3651 | vector unsigned char __b, |
| 3652 | vector unsigned int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3653 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3654 | return __builtin_altivec_vmsumubm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3655 | } |
| 3656 | |
| 3657 | /* vec_vmsumshm */ |
| 3658 | |
| 3659 | static vector int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3660 | vec_vmsumshm(vector short __a, vector short __b, vector int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3661 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3662 | return __builtin_altivec_vmsumshm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3663 | } |
| 3664 | |
| 3665 | /* vec_vmsumuhm */ |
| 3666 | |
| 3667 | static vector unsigned int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3668 | vec_vmsumuhm(vector unsigned short __a, |
| 3669 | vector unsigned short __b, |
| 3670 | vector unsigned int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3671 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3672 | return __builtin_altivec_vmsumuhm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3673 | } |
| 3674 | |
| 3675 | /* vec_msums */ |
| 3676 | |
| 3677 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3678 | vec_msums(vector short __a, vector short __b, vector int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3679 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3680 | return __builtin_altivec_vmsumshs(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3681 | } |
| 3682 | |
| 3683 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3684 | vec_msums(vector unsigned short __a, |
| 3685 | vector unsigned short __b, |
| 3686 | vector unsigned int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3687 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3688 | return __builtin_altivec_vmsumuhs(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3689 | } |
| 3690 | |
| 3691 | /* vec_vmsumshs */ |
| 3692 | |
| 3693 | static vector int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3694 | vec_vmsumshs(vector short __a, vector short __b, vector int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3695 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3696 | return __builtin_altivec_vmsumshs(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3697 | } |
| 3698 | |
| 3699 | /* vec_vmsumuhs */ |
| 3700 | |
| 3701 | static vector unsigned int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3702 | vec_vmsumuhs(vector unsigned short __a, |
| 3703 | vector unsigned short __b, |
| 3704 | vector unsigned int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3705 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3706 | return __builtin_altivec_vmsumuhs(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3707 | } |
| 3708 | |
| 3709 | /* vec_mtvscr */ |
| 3710 | |
| 3711 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3712 | vec_mtvscr(vector signed char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3713 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3714 | __builtin_altivec_mtvscr((vector int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3715 | } |
| 3716 | |
| 3717 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3718 | vec_mtvscr(vector unsigned char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3719 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3720 | __builtin_altivec_mtvscr((vector int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3721 | } |
| 3722 | |
| 3723 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3724 | vec_mtvscr(vector bool char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3725 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3726 | __builtin_altivec_mtvscr((vector int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3727 | } |
| 3728 | |
| 3729 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3730 | vec_mtvscr(vector short __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3731 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3732 | __builtin_altivec_mtvscr((vector int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3733 | } |
| 3734 | |
| 3735 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3736 | vec_mtvscr(vector unsigned short __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3737 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3738 | __builtin_altivec_mtvscr((vector int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3739 | } |
| 3740 | |
| 3741 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3742 | vec_mtvscr(vector bool short __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3743 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3744 | __builtin_altivec_mtvscr((vector int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3745 | } |
| 3746 | |
| 3747 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3748 | vec_mtvscr(vector pixel __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3749 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3750 | __builtin_altivec_mtvscr((vector int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3751 | } |
| 3752 | |
| 3753 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3754 | vec_mtvscr(vector int __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3755 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3756 | __builtin_altivec_mtvscr((vector int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3757 | } |
| 3758 | |
| 3759 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3760 | vec_mtvscr(vector unsigned int __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3761 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3762 | __builtin_altivec_mtvscr((vector int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3763 | } |
| 3764 | |
| 3765 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3766 | vec_mtvscr(vector bool int __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3767 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3768 | __builtin_altivec_mtvscr((vector int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3769 | } |
| 3770 | |
| 3771 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3772 | vec_mtvscr(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3773 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3774 | __builtin_altivec_mtvscr((vector int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3775 | } |
| 3776 | |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3777 | /* The vmulos* and vmules* instructions have a big endian bias, so |
| 3778 | we must reverse the meaning of "even" and "odd" for little endian. */ |
| 3779 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3780 | /* vec_mule */ |
| 3781 | |
| 3782 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3783 | vec_mule(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3784 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3785 | #ifdef __LITTLE_ENDIAN__ |
| 3786 | return __builtin_altivec_vmulosb(__a, __b); |
| 3787 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3788 | return __builtin_altivec_vmulesb(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3789 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3790 | } |
| 3791 | |
| 3792 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3793 | vec_mule(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3794 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3795 | #ifdef __LITTLE_ENDIAN__ |
| 3796 | return __builtin_altivec_vmuloub(__a, __b); |
| 3797 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3798 | return __builtin_altivec_vmuleub(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3799 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3800 | } |
| 3801 | |
| 3802 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3803 | vec_mule(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3804 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3805 | #ifdef __LITTLE_ENDIAN__ |
| 3806 | return __builtin_altivec_vmulosh(__a, __b); |
| 3807 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3808 | return __builtin_altivec_vmulesh(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3809 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3810 | } |
| 3811 | |
| 3812 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3813 | vec_mule(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3814 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3815 | #ifdef __LITTLE_ENDIAN__ |
| 3816 | return __builtin_altivec_vmulouh(__a, __b); |
| 3817 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3818 | return __builtin_altivec_vmuleuh(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3819 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3820 | } |
| 3821 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 3822 | #ifdef __POWER8_VECTOR__ |
| 3823 | static vector signed long long __ATTRS_o_ai |
| 3824 | vec_mule(vector signed int __a, vector signed int __b) |
| 3825 | { |
| 3826 | #ifdef __LITTLE_ENDIAN__ |
| 3827 | return __builtin_altivec_vmulosw(__a, __b); |
| 3828 | #else |
| 3829 | return __builtin_altivec_vmulesw(__a, __b); |
| 3830 | #endif |
| 3831 | } |
| 3832 | |
| 3833 | static vector unsigned long long __ATTRS_o_ai |
| 3834 | vec_mule(vector unsigned int __a, vector unsigned int __b) |
| 3835 | { |
| 3836 | #ifdef __LITTLE_ENDIAN__ |
| 3837 | return __builtin_altivec_vmulouw(__a, __b); |
| 3838 | #else |
| 3839 | return __builtin_altivec_vmuleuw(__a, __b); |
| 3840 | #endif |
| 3841 | } |
| 3842 | #endif |
| 3843 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3844 | /* vec_vmulesb */ |
| 3845 | |
| 3846 | static vector short __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3847 | vec_vmulesb(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3848 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3849 | #ifdef __LITTLE_ENDIAN__ |
| 3850 | return __builtin_altivec_vmulosb(__a, __b); |
| 3851 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3852 | return __builtin_altivec_vmulesb(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3853 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3854 | } |
| 3855 | |
| 3856 | /* vec_vmuleub */ |
| 3857 | |
| 3858 | static vector unsigned short __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3859 | vec_vmuleub(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3860 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3861 | #ifdef __LITTLE_ENDIAN__ |
| 3862 | return __builtin_altivec_vmuloub(__a, __b); |
| 3863 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3864 | return __builtin_altivec_vmuleub(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3865 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3866 | } |
| 3867 | |
| 3868 | /* vec_vmulesh */ |
| 3869 | |
| 3870 | static vector int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3871 | vec_vmulesh(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3872 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3873 | #ifdef __LITTLE_ENDIAN__ |
| 3874 | return __builtin_altivec_vmulosh(__a, __b); |
| 3875 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3876 | return __builtin_altivec_vmulesh(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3877 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3878 | } |
| 3879 | |
| 3880 | /* vec_vmuleuh */ |
| 3881 | |
| 3882 | static vector unsigned int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3883 | vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3884 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3885 | #ifdef __LITTLE_ENDIAN__ |
| 3886 | return __builtin_altivec_vmulouh(__a, __b); |
| 3887 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3888 | return __builtin_altivec_vmuleuh(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3889 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3890 | } |
| 3891 | |
| 3892 | /* vec_mulo */ |
| 3893 | |
| 3894 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3895 | vec_mulo(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3896 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3897 | #ifdef __LITTLE_ENDIAN__ |
| 3898 | return __builtin_altivec_vmulesb(__a, __b); |
| 3899 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3900 | return __builtin_altivec_vmulosb(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3901 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3902 | } |
| 3903 | |
| 3904 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3905 | vec_mulo(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3906 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3907 | #ifdef __LITTLE_ENDIAN__ |
| 3908 | return __builtin_altivec_vmuleub(__a, __b); |
| 3909 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3910 | return __builtin_altivec_vmuloub(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3911 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3912 | } |
| 3913 | |
| 3914 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3915 | vec_mulo(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3916 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3917 | #ifdef __LITTLE_ENDIAN__ |
| 3918 | return __builtin_altivec_vmulesh(__a, __b); |
| 3919 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3920 | return __builtin_altivec_vmulosh(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3921 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3922 | } |
| 3923 | |
| 3924 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3925 | vec_mulo(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3926 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3927 | #ifdef __LITTLE_ENDIAN__ |
| 3928 | return __builtin_altivec_vmuleuh(__a, __b); |
| 3929 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3930 | return __builtin_altivec_vmulouh(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3931 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3932 | } |
| 3933 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 3934 | #ifdef __POWER8_VECTOR__ |
| 3935 | static vector signed long long __ATTRS_o_ai |
| 3936 | vec_mulo(vector signed int __a, vector signed int __b) |
| 3937 | { |
| 3938 | #ifdef __LITTLE_ENDIAN__ |
| 3939 | return __builtin_altivec_vmulesw(__a, __b); |
| 3940 | #else |
| 3941 | return __builtin_altivec_vmulosw(__a, __b); |
| 3942 | #endif |
| 3943 | } |
| 3944 | |
| 3945 | static vector unsigned long long __ATTRS_o_ai |
| 3946 | vec_mulo(vector unsigned int __a, vector unsigned int __b) |
| 3947 | { |
| 3948 | #ifdef __LITTLE_ENDIAN__ |
| 3949 | return __builtin_altivec_vmuleuw(__a, __b); |
| 3950 | #else |
| 3951 | return __builtin_altivec_vmulouw(__a, __b); |
| 3952 | #endif |
| 3953 | } |
| 3954 | #endif |
| 3955 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3956 | /* vec_vmulosb */ |
| 3957 | |
| 3958 | static vector short __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3959 | vec_vmulosb(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3960 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3961 | #ifdef __LITTLE_ENDIAN__ |
| 3962 | return __builtin_altivec_vmulesb(__a, __b); |
| 3963 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3964 | return __builtin_altivec_vmulosb(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3965 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3966 | } |
| 3967 | |
| 3968 | /* vec_vmuloub */ |
| 3969 | |
| 3970 | static vector unsigned short __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3971 | vec_vmuloub(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3972 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3973 | #ifdef __LITTLE_ENDIAN__ |
| 3974 | return __builtin_altivec_vmuleub(__a, __b); |
| 3975 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3976 | return __builtin_altivec_vmuloub(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3977 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3978 | } |
| 3979 | |
| 3980 | /* vec_vmulosh */ |
| 3981 | |
| 3982 | static vector int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3983 | vec_vmulosh(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3984 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3985 | #ifdef __LITTLE_ENDIAN__ |
| 3986 | return __builtin_altivec_vmulesh(__a, __b); |
| 3987 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3988 | return __builtin_altivec_vmulosh(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3989 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3990 | } |
| 3991 | |
| 3992 | /* vec_vmulouh */ |
| 3993 | |
| 3994 | static vector unsigned int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 3995 | vec_vmulouh(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 3996 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 3997 | #ifdef __LITTLE_ENDIAN__ |
| 3998 | return __builtin_altivec_vmuleuh(__a, __b); |
| 3999 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4000 | return __builtin_altivec_vmulouh(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4001 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4002 | } |
| 4003 | |
| 4004 | /* vec_nmsub */ |
| 4005 | |
| 4006 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4007 | vec_nmsub(vector float __a, vector float __b, vector float __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4008 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4009 | return __builtin_altivec_vnmsubfp(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4010 | } |
| 4011 | |
| 4012 | /* vec_vnmsubfp */ |
| 4013 | |
| 4014 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4015 | vec_vnmsubfp(vector float __a, vector float __b, vector float __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4016 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4017 | return __builtin_altivec_vnmsubfp(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4018 | } |
| 4019 | |
| 4020 | /* vec_nor */ |
| 4021 | |
| 4022 | #define __builtin_altivec_vnor vec_nor |
| 4023 | |
| 4024 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4025 | vec_nor(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4026 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4027 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4028 | } |
| 4029 | |
| 4030 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4031 | vec_nor(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4032 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4033 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4034 | } |
| 4035 | |
| 4036 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4037 | vec_nor(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4038 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4039 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4040 | } |
| 4041 | |
| 4042 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4043 | vec_nor(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4044 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4045 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4046 | } |
| 4047 | |
| 4048 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4049 | vec_nor(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4050 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4051 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4052 | } |
| 4053 | |
| 4054 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4055 | vec_nor(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4056 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4057 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4058 | } |
| 4059 | |
| 4060 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4061 | vec_nor(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4062 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4063 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4064 | } |
| 4065 | |
| 4066 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4067 | vec_nor(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4068 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4069 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4070 | } |
| 4071 | |
| 4072 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4073 | vec_nor(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4074 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4075 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4076 | } |
| 4077 | |
| 4078 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4079 | vec_nor(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4080 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4081 | vector unsigned int __res = ~((vector unsigned int)__a | (vector unsigned int)__b); |
| 4082 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4083 | } |
| 4084 | |
| 4085 | /* vec_vnor */ |
| 4086 | |
| 4087 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4088 | vec_vnor(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4089 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4090 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4091 | } |
| 4092 | |
| 4093 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4094 | vec_vnor(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4095 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4096 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4097 | } |
| 4098 | |
| 4099 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4100 | vec_vnor(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4101 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4102 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4103 | } |
| 4104 | |
| 4105 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4106 | vec_vnor(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4107 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4108 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4109 | } |
| 4110 | |
| 4111 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4112 | vec_vnor(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4113 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4114 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4115 | } |
| 4116 | |
| 4117 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4118 | vec_vnor(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4119 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4120 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4121 | } |
| 4122 | |
| 4123 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4124 | vec_vnor(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4125 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4126 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4127 | } |
| 4128 | |
| 4129 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4130 | vec_vnor(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4131 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4132 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4133 | } |
| 4134 | |
| 4135 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4136 | vec_vnor(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4137 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4138 | return ~(__a | __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4139 | } |
| 4140 | |
| 4141 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4142 | vec_vnor(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4143 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4144 | vector unsigned int __res = ~((vector unsigned int)__a | (vector unsigned int)__b); |
| 4145 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4146 | } |
| 4147 | |
| 4148 | /* vec_or */ |
| 4149 | |
| 4150 | #define __builtin_altivec_vor vec_or |
| 4151 | |
| 4152 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4153 | vec_or(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4154 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4155 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4156 | } |
| 4157 | |
| 4158 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4159 | vec_or(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4160 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4161 | return (vector signed char)__a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4162 | } |
| 4163 | |
| 4164 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4165 | vec_or(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4166 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4167 | return __a | (vector signed char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4168 | } |
| 4169 | |
| 4170 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4171 | vec_or(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4172 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4173 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4174 | } |
| 4175 | |
| 4176 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4177 | vec_or(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4178 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4179 | return (vector unsigned char)__a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4180 | } |
| 4181 | |
| 4182 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4183 | vec_or(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4184 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4185 | return __a | (vector unsigned char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4186 | } |
| 4187 | |
| 4188 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4189 | vec_or(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4190 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4191 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4192 | } |
| 4193 | |
| 4194 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4195 | vec_or(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4196 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4197 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4198 | } |
| 4199 | |
| 4200 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4201 | vec_or(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4202 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4203 | return (vector short)__a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4204 | } |
| 4205 | |
| 4206 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4207 | vec_or(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4208 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4209 | return __a | (vector short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4210 | } |
| 4211 | |
| 4212 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4213 | vec_or(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4214 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4215 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4216 | } |
| 4217 | |
| 4218 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4219 | vec_or(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4220 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4221 | return (vector unsigned short)__a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4222 | } |
| 4223 | |
| 4224 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4225 | vec_or(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4226 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4227 | return __a | (vector unsigned short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4228 | } |
| 4229 | |
| 4230 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4231 | vec_or(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4232 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4233 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4234 | } |
| 4235 | |
| 4236 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4237 | vec_or(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4238 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4239 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4240 | } |
| 4241 | |
| 4242 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4243 | vec_or(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4244 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4245 | return (vector int)__a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4246 | } |
| 4247 | |
| 4248 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4249 | vec_or(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4250 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4251 | return __a | (vector int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4252 | } |
| 4253 | |
| 4254 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4255 | vec_or(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4256 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4257 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4258 | } |
| 4259 | |
| 4260 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4261 | vec_or(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4262 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4263 | return (vector unsigned int)__a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4264 | } |
| 4265 | |
| 4266 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4267 | vec_or(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4268 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4269 | return __a | (vector unsigned int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4270 | } |
| 4271 | |
| 4272 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4273 | vec_or(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4274 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4275 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4276 | } |
| 4277 | |
| 4278 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4279 | vec_or(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4280 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4281 | vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b; |
| 4282 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4283 | } |
| 4284 | |
| 4285 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4286 | vec_or(vector bool int __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4287 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4288 | vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b; |
| 4289 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4290 | } |
| 4291 | |
| 4292 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4293 | vec_or(vector float __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4294 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4295 | vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b; |
| 4296 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4297 | } |
| 4298 | |
| 4299 | /* vec_vor */ |
| 4300 | |
| 4301 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4302 | vec_vor(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4303 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4304 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4305 | } |
| 4306 | |
| 4307 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4308 | vec_vor(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4309 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4310 | return (vector signed char)__a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4311 | } |
| 4312 | |
| 4313 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4314 | vec_vor(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4315 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4316 | return __a | (vector signed char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4317 | } |
| 4318 | |
| 4319 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4320 | vec_vor(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4321 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4322 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4323 | } |
| 4324 | |
| 4325 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4326 | vec_vor(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4327 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4328 | return (vector unsigned char)__a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4329 | } |
| 4330 | |
| 4331 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4332 | vec_vor(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4333 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4334 | return __a | (vector unsigned char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4335 | } |
| 4336 | |
| 4337 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4338 | vec_vor(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4339 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4340 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4341 | } |
| 4342 | |
| 4343 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4344 | vec_vor(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4345 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4346 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4347 | } |
| 4348 | |
| 4349 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4350 | vec_vor(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4351 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4352 | return (vector short)__a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4353 | } |
| 4354 | |
| 4355 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4356 | vec_vor(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4357 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4358 | return __a | (vector short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4359 | } |
| 4360 | |
| 4361 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4362 | vec_vor(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4363 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4364 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4365 | } |
| 4366 | |
| 4367 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4368 | vec_vor(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4369 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4370 | return (vector unsigned short)__a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4371 | } |
| 4372 | |
| 4373 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4374 | vec_vor(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4375 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4376 | return __a | (vector unsigned short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4377 | } |
| 4378 | |
| 4379 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4380 | vec_vor(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4381 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4382 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4383 | } |
| 4384 | |
| 4385 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4386 | vec_vor(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4387 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4388 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4389 | } |
| 4390 | |
| 4391 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4392 | vec_vor(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4393 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4394 | return (vector int)__a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4395 | } |
| 4396 | |
| 4397 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4398 | vec_vor(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4399 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4400 | return __a | (vector int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4401 | } |
| 4402 | |
| 4403 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4404 | vec_vor(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4405 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4406 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4407 | } |
| 4408 | |
| 4409 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4410 | vec_vor(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4411 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4412 | return (vector unsigned int)__a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4413 | } |
| 4414 | |
| 4415 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4416 | vec_vor(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4417 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4418 | return __a | (vector unsigned int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4419 | } |
| 4420 | |
| 4421 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4422 | vec_vor(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4423 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4424 | return __a | __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4425 | } |
| 4426 | |
| 4427 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4428 | vec_vor(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4429 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4430 | vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b; |
| 4431 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4432 | } |
| 4433 | |
| 4434 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4435 | vec_vor(vector bool int __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4436 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4437 | vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b; |
| 4438 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4439 | } |
| 4440 | |
| 4441 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4442 | vec_vor(vector float __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4443 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4444 | vector unsigned int __res = (vector unsigned int)__a | (vector unsigned int)__b; |
| 4445 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4446 | } |
| 4447 | |
| 4448 | /* vec_pack */ |
| 4449 | |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4450 | /* The various vector pack instructions have a big-endian bias, so for |
| 4451 | little endian we must handle reversed element numbering. */ |
| 4452 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4453 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4454 | vec_pack(vector signed short __a, vector signed short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4455 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4456 | #ifdef __LITTLE_ENDIAN__ |
| 4457 | return (vector signed char)vec_perm(__a, __b, (vector unsigned char) |
| 4458 | (0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, |
| 4459 | 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E)); |
| 4460 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4461 | return (vector signed char)vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4462 | (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| 4463 | 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F)); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4464 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4465 | } |
| 4466 | |
| 4467 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4468 | vec_pack(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4469 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4470 | #ifdef __LITTLE_ENDIAN__ |
| 4471 | return (vector unsigned char)vec_perm(__a, __b, (vector unsigned char) |
| 4472 | (0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, |
| 4473 | 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E)); |
| 4474 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4475 | return (vector unsigned char)vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4476 | (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| 4477 | 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F)); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4478 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4479 | } |
| 4480 | |
| 4481 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4482 | vec_pack(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4483 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4484 | #ifdef __LITTLE_ENDIAN__ |
| 4485 | return (vector bool char)vec_perm(__a, __b, (vector unsigned char) |
| 4486 | (0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, |
| 4487 | 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E)); |
| 4488 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4489 | return (vector bool char)vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4490 | (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| 4491 | 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F)); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4492 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4493 | } |
| 4494 | |
| 4495 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4496 | vec_pack(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4497 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4498 | #ifdef __LITTLE_ENDIAN__ |
| 4499 | return (vector short)vec_perm(__a, __b, (vector unsigned char) |
| 4500 | (0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D, |
| 4501 | 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D)); |
| 4502 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4503 | return (vector short)vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4504 | (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F, |
| 4505 | 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F)); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4506 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4507 | } |
| 4508 | |
| 4509 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4510 | vec_pack(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4511 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4512 | #ifdef __LITTLE_ENDIAN__ |
| 4513 | return (vector unsigned short)vec_perm(__a, __b, (vector unsigned char) |
| 4514 | (0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D, |
| 4515 | 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D)); |
| 4516 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4517 | return (vector unsigned short)vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4518 | (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F, |
| 4519 | 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F)); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4520 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4521 | } |
| 4522 | |
| 4523 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4524 | vec_pack(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4525 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4526 | #ifdef __LITTLE_ENDIAN__ |
| 4527 | return (vector bool short)vec_perm(__a, __b, (vector unsigned char) |
| 4528 | (0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D, |
| 4529 | 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D)); |
| 4530 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4531 | return (vector bool short)vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4532 | (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F, |
| 4533 | 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F)); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4534 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4535 | } |
| 4536 | |
| 4537 | /* vec_vpkuhum */ |
| 4538 | |
| 4539 | #define __builtin_altivec_vpkuhum vec_vpkuhum |
| 4540 | |
| 4541 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4542 | vec_vpkuhum(vector signed short __a, vector signed short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4543 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4544 | #ifdef __LITTLE_ENDIAN__ |
| 4545 | return (vector signed char)vec_perm(__a, __b, (vector unsigned char) |
| 4546 | (0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, |
| 4547 | 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E)); |
| 4548 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4549 | return (vector signed char)vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4550 | (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| 4551 | 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F)); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4552 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4553 | } |
| 4554 | |
| 4555 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4556 | vec_vpkuhum(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4557 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4558 | #ifdef __LITTLE_ENDIAN__ |
| 4559 | return (vector unsigned char)vec_perm(__a, __b, (vector unsigned char) |
| 4560 | (0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, |
| 4561 | 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E)); |
| 4562 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4563 | return (vector unsigned char)vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4564 | (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| 4565 | 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F)); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4566 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4567 | } |
| 4568 | |
| 4569 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4570 | vec_vpkuhum(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4571 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4572 | #ifdef __LITTLE_ENDIAN__ |
| 4573 | return (vector bool char)vec_perm(__a, __b, (vector unsigned char) |
| 4574 | (0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, |
| 4575 | 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E)); |
| 4576 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4577 | return (vector bool char)vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4578 | (0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, |
| 4579 | 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F)); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4580 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4581 | } |
| 4582 | |
| 4583 | /* vec_vpkuwum */ |
| 4584 | |
| 4585 | #define __builtin_altivec_vpkuwum vec_vpkuwum |
| 4586 | |
| 4587 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4588 | vec_vpkuwum(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4589 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4590 | #ifdef __LITTLE_ENDIAN__ |
| 4591 | return (vector short)vec_perm(__a, __b, (vector unsigned char) |
| 4592 | (0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D, |
| 4593 | 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D)); |
| 4594 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4595 | return (vector short)vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4596 | (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F, |
| 4597 | 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F)); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4598 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4599 | } |
| 4600 | |
| 4601 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4602 | vec_vpkuwum(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4603 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4604 | #ifdef __LITTLE_ENDIAN__ |
| 4605 | return (vector unsigned short)vec_perm(__a, __b, (vector unsigned char) |
| 4606 | (0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D, |
| 4607 | 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D)); |
| 4608 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4609 | return (vector unsigned short)vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4610 | (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F, |
| 4611 | 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F)); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4612 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4613 | } |
| 4614 | |
| 4615 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4616 | vec_vpkuwum(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4617 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4618 | #ifdef __LITTLE_ENDIAN__ |
| 4619 | return (vector bool short)vec_perm(__a, __b, (vector unsigned char) |
| 4620 | (0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D, |
| 4621 | 0x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D)); |
| 4622 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4623 | return (vector bool short)vec_perm(__a, __b, (vector unsigned char) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4624 | (0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F, |
| 4625 | 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F)); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4626 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4627 | } |
| 4628 | |
| 4629 | /* vec_packpx */ |
| 4630 | |
| 4631 | static vector pixel __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4632 | vec_packpx(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4633 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4634 | #ifdef __LITTLE_ENDIAN__ |
| 4635 | return (vector pixel)__builtin_altivec_vpkpx(__b, __a); |
| 4636 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4637 | return (vector pixel)__builtin_altivec_vpkpx(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4638 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4639 | } |
| 4640 | |
| 4641 | /* vec_vpkpx */ |
| 4642 | |
| 4643 | static vector pixel __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4644 | vec_vpkpx(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4645 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4646 | #ifdef __LITTLE_ENDIAN__ |
| 4647 | return (vector pixel)__builtin_altivec_vpkpx(__b, __a); |
| 4648 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4649 | return (vector pixel)__builtin_altivec_vpkpx(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4650 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4651 | } |
| 4652 | |
| 4653 | /* vec_packs */ |
| 4654 | |
| 4655 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4656 | vec_packs(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4657 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4658 | #ifdef __LITTLE_ENDIAN__ |
| 4659 | return __builtin_altivec_vpkshss(__b, __a); |
| 4660 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4661 | return __builtin_altivec_vpkshss(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4662 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4663 | } |
| 4664 | |
| 4665 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4666 | vec_packs(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4667 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4668 | #ifdef __LITTLE_ENDIAN__ |
| 4669 | return __builtin_altivec_vpkuhus(__b, __a); |
| 4670 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4671 | return __builtin_altivec_vpkuhus(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4672 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4673 | } |
| 4674 | |
| 4675 | static vector signed short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4676 | vec_packs(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4677 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4678 | #ifdef __LITTLE_ENDIAN__ |
| 4679 | return __builtin_altivec_vpkswss(__b, __a); |
| 4680 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4681 | return __builtin_altivec_vpkswss(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4682 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4683 | } |
| 4684 | |
| 4685 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4686 | vec_packs(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4687 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4688 | #ifdef __LITTLE_ENDIAN__ |
| 4689 | return __builtin_altivec_vpkuwus(__b, __a); |
| 4690 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4691 | return __builtin_altivec_vpkuwus(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4692 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4693 | } |
| 4694 | |
| 4695 | /* vec_vpkshss */ |
| 4696 | |
| 4697 | static vector signed char __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4698 | vec_vpkshss(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4699 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4700 | #ifdef __LITTLE_ENDIAN__ |
| 4701 | return __builtin_altivec_vpkshss(__b, __a); |
| 4702 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4703 | return __builtin_altivec_vpkshss(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4704 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4705 | } |
| 4706 | |
| 4707 | /* vec_vpkuhus */ |
| 4708 | |
| 4709 | static vector unsigned char __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4710 | vec_vpkuhus(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4711 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4712 | #ifdef __LITTLE_ENDIAN__ |
| 4713 | return __builtin_altivec_vpkuhus(__b, __a); |
| 4714 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4715 | return __builtin_altivec_vpkuhus(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4716 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4717 | } |
| 4718 | |
| 4719 | /* vec_vpkswss */ |
| 4720 | |
| 4721 | static vector signed short __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4722 | vec_vpkswss(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4723 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4724 | #ifdef __LITTLE_ENDIAN__ |
| 4725 | return __builtin_altivec_vpkswss(__b, __a); |
| 4726 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4727 | return __builtin_altivec_vpkswss(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4728 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4729 | } |
| 4730 | |
| 4731 | /* vec_vpkuwus */ |
| 4732 | |
| 4733 | static vector unsigned short __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4734 | vec_vpkuwus(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4735 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4736 | #ifdef __LITTLE_ENDIAN__ |
| 4737 | return __builtin_altivec_vpkuwus(__b, __a); |
| 4738 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4739 | return __builtin_altivec_vpkuwus(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4740 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4741 | } |
| 4742 | |
| 4743 | /* vec_packsu */ |
| 4744 | |
| 4745 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4746 | vec_packsu(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4747 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4748 | #ifdef __LITTLE_ENDIAN__ |
| 4749 | return __builtin_altivec_vpkshus(__b, __a); |
| 4750 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4751 | return __builtin_altivec_vpkshus(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4752 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4753 | } |
| 4754 | |
| 4755 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4756 | vec_packsu(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4757 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4758 | #ifdef __LITTLE_ENDIAN__ |
| 4759 | return __builtin_altivec_vpkuhus(__b, __a); |
| 4760 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4761 | return __builtin_altivec_vpkuhus(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4762 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4763 | } |
| 4764 | |
| 4765 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4766 | vec_packsu(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4767 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4768 | #ifdef __LITTLE_ENDIAN__ |
| 4769 | return __builtin_altivec_vpkswus(__b, __a); |
| 4770 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4771 | return __builtin_altivec_vpkswus(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4772 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4773 | } |
| 4774 | |
| 4775 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4776 | vec_packsu(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4777 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4778 | #ifdef __LITTLE_ENDIAN__ |
| 4779 | return __builtin_altivec_vpkuwus(__b, __a); |
| 4780 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4781 | return __builtin_altivec_vpkuwus(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4782 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4783 | } |
| 4784 | |
| 4785 | /* vec_vpkshus */ |
| 4786 | |
| 4787 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4788 | vec_vpkshus(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4789 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4790 | #ifdef __LITTLE_ENDIAN__ |
| 4791 | return __builtin_altivec_vpkshus(__b, __a); |
| 4792 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4793 | return __builtin_altivec_vpkshus(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4794 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4795 | } |
| 4796 | |
| 4797 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4798 | vec_vpkshus(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4799 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4800 | #ifdef __LITTLE_ENDIAN__ |
| 4801 | return __builtin_altivec_vpkuhus(__b, __a); |
| 4802 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4803 | return __builtin_altivec_vpkuhus(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4804 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4805 | } |
| 4806 | |
| 4807 | /* vec_vpkswus */ |
| 4808 | |
| 4809 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4810 | vec_vpkswus(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4811 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4812 | #ifdef __LITTLE_ENDIAN__ |
| 4813 | return __builtin_altivec_vpkswus(__b, __a); |
| 4814 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4815 | return __builtin_altivec_vpkswus(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4816 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4817 | } |
| 4818 | |
| 4819 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4820 | vec_vpkswus(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4821 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4822 | #ifdef __LITTLE_ENDIAN__ |
| 4823 | return __builtin_altivec_vpkuwus(__b, __a); |
| 4824 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4825 | return __builtin_altivec_vpkuwus(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4826 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4827 | } |
| 4828 | |
| 4829 | /* vec_perm */ |
| 4830 | |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4831 | // The vperm instruction is defined architecturally with a big-endian bias. |
| 4832 | // For little endian, we swap the input operands and invert the permute |
| 4833 | // control vector. Only the rightmost 5 bits matter, so we could use |
| 4834 | // a vector of all 31s instead of all 255s to perform the inversion. |
| 4835 | // However, when the PCV is not a constant, using 255 has an advantage |
| 4836 | // in that the vec_xor can be recognized as a vec_nor (and for P8 and |
| 4837 | // later, possibly a vec_nand). |
| 4838 | |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 4839 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4840 | vec_perm(vector signed char __a, vector signed char __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4841 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4842 | #ifdef __LITTLE_ENDIAN__ |
| 4843 | vector unsigned char __d = {255,255,255,255,255,255,255,255, |
| 4844 | 255,255,255,255,255,255,255,255}; |
| 4845 | __d = vec_xor(__c, __d); |
| 4846 | return (vector signed char) |
| 4847 | __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d); |
| 4848 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4849 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4850 | __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4851 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4852 | } |
| 4853 | |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 4854 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4855 | vec_perm(vector unsigned char __a, |
| 4856 | vector unsigned char __b, |
| 4857 | vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4858 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4859 | #ifdef __LITTLE_ENDIAN__ |
| 4860 | vector unsigned char __d = {255,255,255,255,255,255,255,255, |
| 4861 | 255,255,255,255,255,255,255,255}; |
| 4862 | __d = vec_xor(__c, __d); |
| 4863 | return (vector unsigned char) |
| 4864 | __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d); |
| 4865 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4866 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4867 | __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4868 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4869 | } |
| 4870 | |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 4871 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4872 | vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4873 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4874 | #ifdef __LITTLE_ENDIAN__ |
| 4875 | vector unsigned char __d = {255,255,255,255,255,255,255,255, |
| 4876 | 255,255,255,255,255,255,255,255}; |
| 4877 | __d = vec_xor(__c, __d); |
| 4878 | return (vector bool char) |
| 4879 | __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d); |
| 4880 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4881 | return (vector bool char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4882 | __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4883 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4884 | } |
| 4885 | |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 4886 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4887 | vec_perm(vector short __a, vector short __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4888 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4889 | #ifdef __LITTLE_ENDIAN__ |
| 4890 | vector unsigned char __d = {255,255,255,255,255,255,255,255, |
| 4891 | 255,255,255,255,255,255,255,255}; |
| 4892 | __d = vec_xor(__c, __d); |
| 4893 | return (vector short) |
| 4894 | __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d); |
| 4895 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4896 | return (vector short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4897 | __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4898 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4899 | } |
| 4900 | |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 4901 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4902 | vec_perm(vector unsigned short __a, |
| 4903 | vector unsigned short __b, |
| 4904 | vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4905 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4906 | #ifdef __LITTLE_ENDIAN__ |
| 4907 | vector unsigned char __d = {255,255,255,255,255,255,255,255, |
| 4908 | 255,255,255,255,255,255,255,255}; |
| 4909 | __d = vec_xor(__c, __d); |
| 4910 | return (vector unsigned short) |
| 4911 | __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d); |
| 4912 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4913 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4914 | __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4915 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4916 | } |
| 4917 | |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 4918 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4919 | vec_perm(vector bool short __a, vector bool short __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4920 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4921 | #ifdef __LITTLE_ENDIAN__ |
| 4922 | vector unsigned char __d = {255,255,255,255,255,255,255,255, |
| 4923 | 255,255,255,255,255,255,255,255}; |
| 4924 | __d = vec_xor(__c, __d); |
| 4925 | return (vector bool short) |
| 4926 | __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d); |
| 4927 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4928 | return (vector bool short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4929 | __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4930 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4931 | } |
| 4932 | |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 4933 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4934 | vec_perm(vector pixel __a, vector pixel __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4935 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4936 | #ifdef __LITTLE_ENDIAN__ |
| 4937 | vector unsigned char __d = {255,255,255,255,255,255,255,255, |
| 4938 | 255,255,255,255,255,255,255,255}; |
| 4939 | __d = vec_xor(__c, __d); |
| 4940 | return (vector pixel) |
| 4941 | __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d); |
| 4942 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4943 | return (vector pixel) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4944 | __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4945 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4946 | } |
| 4947 | |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 4948 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4949 | vec_perm(vector int __a, vector int __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4950 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4951 | #ifdef __LITTLE_ENDIAN__ |
| 4952 | vector unsigned char __d = {255,255,255,255,255,255,255,255, |
| 4953 | 255,255,255,255,255,255,255,255}; |
| 4954 | __d = vec_xor(__c, __d); |
| 4955 | return (vector int)__builtin_altivec_vperm_4si(__b, __a, __d); |
| 4956 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4957 | return (vector int)__builtin_altivec_vperm_4si(__a, __b, __c); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4958 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4959 | } |
| 4960 | |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 4961 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4962 | vec_perm(vector unsigned int __a, vector unsigned int __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4963 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4964 | #ifdef __LITTLE_ENDIAN__ |
| 4965 | vector unsigned char __d = {255,255,255,255,255,255,255,255, |
| 4966 | 255,255,255,255,255,255,255,255}; |
| 4967 | __d = vec_xor(__c, __d); |
| 4968 | return (vector unsigned int) |
| 4969 | __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d); |
| 4970 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4971 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4972 | __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4973 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4974 | } |
| 4975 | |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 4976 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4977 | vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4978 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4979 | #ifdef __LITTLE_ENDIAN__ |
| 4980 | vector unsigned char __d = {255,255,255,255,255,255,255,255, |
| 4981 | 255,255,255,255,255,255,255,255}; |
| 4982 | __d = vec_xor(__c, __d); |
| 4983 | return (vector bool int) |
| 4984 | __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d); |
| 4985 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4986 | return (vector bool int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4987 | __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4988 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4989 | } |
| 4990 | |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 4991 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 4992 | vec_perm(vector float __a, vector float __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 4993 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 4994 | #ifdef __LITTLE_ENDIAN__ |
| 4995 | vector unsigned char __d = {255,255,255,255,255,255,255,255, |
| 4996 | 255,255,255,255,255,255,255,255}; |
| 4997 | __d = vec_xor(__c, __d); |
| 4998 | return (vector float) |
| 4999 | __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d); |
| 5000 | #else |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5001 | return (vector float) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5002 | __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 5003 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5004 | } |
| 5005 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 5006 | #ifdef __VSX__ |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 5007 | static vector long long __ATTRS_o_ai |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 5008 | vec_perm(vector long long __a, vector long long __b, vector unsigned char __c) |
| 5009 | { |
| 5010 | #ifdef __LITTLE_ENDIAN__ |
| 5011 | vector unsigned char __d = {255,255,255,255,255,255,255,255, |
| 5012 | 255,255,255,255,255,255,255,255}; |
| 5013 | __d = vec_xor(__c, __d); |
| 5014 | return (vector long long)__builtin_altivec_vperm_4si(__b, __a, __d); |
| 5015 | #else |
| 5016 | return (vector long long)__builtin_altivec_vperm_4si(__a, __b, __c); |
| 5017 | #endif |
| 5018 | } |
| 5019 | |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 5020 | static vector unsigned long long __ATTRS_o_ai |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 5021 | vec_perm(vector unsigned long long __a, vector unsigned long long __b, |
| 5022 | vector unsigned char __c) |
| 5023 | { |
| 5024 | #ifdef __LITTLE_ENDIAN__ |
| 5025 | vector unsigned char __d = {255,255,255,255,255,255,255,255, |
| 5026 | 255,255,255,255,255,255,255,255}; |
| 5027 | __d = vec_xor(__c, __d); |
| 5028 | return (vector unsigned long long) |
| 5029 | __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d); |
| 5030 | #else |
| 5031 | return (vector unsigned long long) |
| 5032 | __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c); |
| 5033 | #endif |
| 5034 | } |
| 5035 | |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 5036 | static vector double __ATTRS_o_ai |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 5037 | vec_perm(vector double __a, vector double __b, vector unsigned char __c) |
| 5038 | { |
| 5039 | #ifdef __LITTLE_ENDIAN__ |
| 5040 | vector unsigned char __d = {255,255,255,255,255,255,255,255, |
| 5041 | 255,255,255,255,255,255,255,255}; |
| 5042 | __d = vec_xor(__c, __d); |
| 5043 | return (vector double) |
| 5044 | __builtin_altivec_vperm_4si((vector int)__b, (vector int)__a, __d); |
| 5045 | #else |
| 5046 | return (vector double) |
| 5047 | __builtin_altivec_vperm_4si((vector int)__a, (vector int)__b, __c); |
| 5048 | #endif |
| 5049 | } |
| 5050 | #endif |
| 5051 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5052 | /* vec_vperm */ |
| 5053 | |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5054 | static vector signed char __ATTRS_o_ai |
| 5055 | vec_vperm(vector signed char __a, vector signed char __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5056 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 5057 | return vec_perm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5058 | } |
| 5059 | |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5060 | static vector unsigned char __ATTRS_o_ai |
| 5061 | vec_vperm(vector unsigned char __a, |
| 5062 | vector unsigned char __b, |
| 5063 | vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5064 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 5065 | return vec_perm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5066 | } |
| 5067 | |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5068 | static vector bool char __ATTRS_o_ai |
| 5069 | vec_vperm(vector bool char __a, vector bool char __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5070 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 5071 | return vec_perm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5072 | } |
| 5073 | |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5074 | static vector short __ATTRS_o_ai |
| 5075 | vec_vperm(vector short __a, vector short __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5076 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 5077 | return vec_perm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5078 | } |
| 5079 | |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5080 | static vector unsigned short __ATTRS_o_ai |
| 5081 | vec_vperm(vector unsigned short __a, |
| 5082 | vector unsigned short __b, |
| 5083 | vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5084 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 5085 | return vec_perm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5086 | } |
| 5087 | |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5088 | static vector bool short __ATTRS_o_ai |
| 5089 | vec_vperm(vector bool short __a, vector bool short __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5090 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 5091 | return vec_perm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5092 | } |
| 5093 | |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5094 | static vector pixel __ATTRS_o_ai |
| 5095 | vec_vperm(vector pixel __a, vector pixel __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5096 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 5097 | return vec_perm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5098 | } |
| 5099 | |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5100 | static vector int __ATTRS_o_ai |
| 5101 | vec_vperm(vector int __a, vector int __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5102 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 5103 | return vec_perm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5104 | } |
| 5105 | |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5106 | static vector unsigned int __ATTRS_o_ai |
| 5107 | vec_vperm(vector unsigned int __a, vector unsigned int __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5108 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 5109 | return vec_perm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5110 | } |
| 5111 | |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5112 | static vector bool int __ATTRS_o_ai |
| 5113 | vec_vperm(vector bool int __a, vector bool int __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5114 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 5115 | return vec_perm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5116 | } |
| 5117 | |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5118 | static vector float __ATTRS_o_ai |
| 5119 | vec_vperm(vector float __a, vector float __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5120 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 5121 | return vec_perm(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5122 | } |
| 5123 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 5124 | #ifdef __VSX__ |
| 5125 | static vector long long __ATTRS_o_ai |
| 5126 | vec_vperm(vector long long __a, vector long long __b, vector unsigned char __c) |
| 5127 | { |
| 5128 | return vec_perm(__a, __b, __c); |
| 5129 | } |
| 5130 | |
| 5131 | static vector unsigned long long __ATTRS_o_ai |
| 5132 | vec_vperm(vector unsigned long long __a, vector unsigned long long __b, |
| 5133 | vector unsigned char __c) |
| 5134 | { |
| 5135 | return vec_perm(__a, __b, __c); |
| 5136 | } |
| 5137 | |
| 5138 | static vector double __ATTRS_o_ai |
| 5139 | vec_vperm(vector double __a, vector double __b, vector unsigned char __c) |
| 5140 | { |
| 5141 | return vec_perm(__a, __b, __c); |
| 5142 | } |
| 5143 | #endif |
| 5144 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5145 | /* vec_re */ |
| 5146 | |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5147 | static vector float __attribute__((__always_inline__)) |
| 5148 | vec_re(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5149 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5150 | return __builtin_altivec_vrefp(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5151 | } |
| 5152 | |
| 5153 | /* vec_vrefp */ |
| 5154 | |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5155 | static vector float __attribute__((__always_inline__)) |
| 5156 | vec_vrefp(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5157 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5158 | return __builtin_altivec_vrefp(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5159 | } |
| 5160 | |
| 5161 | /* vec_rl */ |
| 5162 | |
| 5163 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5164 | vec_rl(vector signed char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5165 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5166 | return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5167 | } |
| 5168 | |
| 5169 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5170 | vec_rl(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5171 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5172 | return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5173 | } |
| 5174 | |
| 5175 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5176 | vec_rl(vector short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5177 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5178 | return __builtin_altivec_vrlh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5179 | } |
| 5180 | |
| 5181 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5182 | vec_rl(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5183 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5184 | return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5185 | } |
| 5186 | |
| 5187 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5188 | vec_rl(vector int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5189 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5190 | return __builtin_altivec_vrlw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5191 | } |
| 5192 | |
| 5193 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5194 | vec_rl(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5195 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5196 | return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5197 | } |
| 5198 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 5199 | #ifdef __POWER8_VECTOR__ |
| 5200 | static vector signed long long __ATTRS_o_ai |
| 5201 | vec_rl(vector signed long long __a, vector unsigned long long __b) |
| 5202 | { |
| 5203 | return __builtin_altivec_vrld(__a, __b); |
| 5204 | } |
| 5205 | |
| 5206 | static vector unsigned long long __ATTRS_o_ai |
| 5207 | vec_rl(vector unsigned long long __a, vector unsigned long long __b) |
| 5208 | { |
| 5209 | return __builtin_altivec_vrld(__a, __b); |
| 5210 | } |
| 5211 | #endif |
| 5212 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5213 | /* vec_vrlb */ |
| 5214 | |
| 5215 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5216 | vec_vrlb(vector signed char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5217 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5218 | return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5219 | } |
| 5220 | |
| 5221 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5222 | vec_vrlb(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5223 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5224 | return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5225 | } |
| 5226 | |
| 5227 | /* vec_vrlh */ |
| 5228 | |
| 5229 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5230 | vec_vrlh(vector short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5231 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5232 | return __builtin_altivec_vrlh(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5233 | } |
| 5234 | |
| 5235 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5236 | vec_vrlh(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5237 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5238 | return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5239 | } |
| 5240 | |
| 5241 | /* vec_vrlw */ |
| 5242 | |
| 5243 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5244 | vec_vrlw(vector int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5245 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5246 | return __builtin_altivec_vrlw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5247 | } |
| 5248 | |
| 5249 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5250 | vec_vrlw(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5251 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5252 | return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5253 | } |
| 5254 | |
| 5255 | /* vec_round */ |
| 5256 | |
| 5257 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5258 | vec_round(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5259 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5260 | return __builtin_altivec_vrfin(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5261 | } |
| 5262 | |
| 5263 | /* vec_vrfin */ |
| 5264 | |
| 5265 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5266 | vec_vrfin(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5267 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5268 | return __builtin_altivec_vrfin(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5269 | } |
| 5270 | |
| 5271 | /* vec_rsqrte */ |
| 5272 | |
| 5273 | static __vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5274 | vec_rsqrte(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5275 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5276 | return __builtin_altivec_vrsqrtefp(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5277 | } |
| 5278 | |
| 5279 | /* vec_vrsqrtefp */ |
| 5280 | |
| 5281 | static __vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5282 | vec_vrsqrtefp(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5283 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5284 | return __builtin_altivec_vrsqrtefp(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5285 | } |
| 5286 | |
| 5287 | /* vec_sel */ |
| 5288 | |
| 5289 | #define __builtin_altivec_vsel_4si vec_sel |
| 5290 | |
| 5291 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5292 | vec_sel(vector signed char __a, vector signed char __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5293 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5294 | return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5295 | } |
| 5296 | |
| 5297 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5298 | vec_sel(vector signed char __a, vector signed char __b, vector bool char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5299 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5300 | return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5301 | } |
| 5302 | |
| 5303 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5304 | vec_sel(vector unsigned char __a, vector unsigned char __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5305 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5306 | return (__a & ~__c) | (__b & __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5307 | } |
| 5308 | |
| 5309 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5310 | vec_sel(vector unsigned char __a, vector unsigned char __b, vector bool char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5311 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5312 | return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5313 | } |
| 5314 | |
| 5315 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5316 | vec_sel(vector bool char __a, vector bool char __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5317 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5318 | return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5319 | } |
| 5320 | |
| 5321 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5322 | vec_sel(vector bool char __a, vector bool char __b, vector bool char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5323 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5324 | return (__a & ~__c) | (__b & __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5325 | } |
| 5326 | |
| 5327 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5328 | vec_sel(vector short __a, vector short __b, vector unsigned short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5329 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5330 | return (__a & ~(vector short)__c) | (__b & (vector short)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5331 | } |
| 5332 | |
| 5333 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5334 | vec_sel(vector short __a, vector short __b, vector bool short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5335 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5336 | return (__a & ~(vector short)__c) | (__b & (vector short)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5337 | } |
| 5338 | |
| 5339 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5340 | vec_sel(vector unsigned short __a, |
| 5341 | vector unsigned short __b, |
| 5342 | vector unsigned short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5343 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5344 | return (__a & ~__c) | (__b & __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5345 | } |
| 5346 | |
| 5347 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5348 | vec_sel(vector unsigned short __a, vector unsigned short __b, vector bool short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5349 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5350 | return (__a & ~(vector unsigned short)__c) | (__b & (vector unsigned short)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5351 | } |
| 5352 | |
| 5353 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5354 | vec_sel(vector bool short __a, vector bool short __b, vector unsigned short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5355 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5356 | return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5357 | } |
| 5358 | |
| 5359 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5360 | vec_sel(vector bool short __a, vector bool short __b, vector bool short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5361 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5362 | return (__a & ~__c) | (__b & __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5363 | } |
| 5364 | |
| 5365 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5366 | vec_sel(vector int __a, vector int __b, vector unsigned int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5367 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5368 | return (__a & ~(vector int)__c) | (__b & (vector int)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5369 | } |
| 5370 | |
| 5371 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5372 | vec_sel(vector int __a, vector int __b, vector bool int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5373 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5374 | return (__a & ~(vector int)__c) | (__b & (vector int)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5375 | } |
| 5376 | |
| 5377 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5378 | vec_sel(vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5379 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5380 | return (__a & ~__c) | (__b & __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5381 | } |
| 5382 | |
| 5383 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5384 | vec_sel(vector unsigned int __a, vector unsigned int __b, vector bool int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5385 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5386 | return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5387 | } |
| 5388 | |
| 5389 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5390 | vec_sel(vector bool int __a, vector bool int __b, vector unsigned int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5391 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5392 | return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5393 | } |
| 5394 | |
| 5395 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5396 | vec_sel(vector bool int __a, vector bool int __b, vector bool int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5397 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5398 | return (__a & ~__c) | (__b & __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5399 | } |
| 5400 | |
| 5401 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5402 | vec_sel(vector float __a, vector float __b, vector unsigned int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5403 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5404 | vector int __res = ((vector int)__a & ~(vector int)__c) |
| 5405 | | ((vector int)__b & (vector int)__c); |
| 5406 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5407 | } |
| 5408 | |
| 5409 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5410 | vec_sel(vector float __a, vector float __b, vector bool int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5411 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5412 | vector int __res = ((vector int)__a & ~(vector int)__c) |
| 5413 | | ((vector int)__b & (vector int)__c); |
| 5414 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5415 | } |
| 5416 | |
| 5417 | /* vec_vsel */ |
| 5418 | |
| 5419 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5420 | vec_vsel(vector signed char __a, vector signed char __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5421 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5422 | return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5423 | } |
| 5424 | |
| 5425 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5426 | vec_vsel(vector signed char __a, vector signed char __b, vector bool char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5427 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5428 | return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5429 | } |
| 5430 | |
| 5431 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5432 | vec_vsel(vector unsigned char __a, vector unsigned char __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5433 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5434 | return (__a & ~__c) | (__b & __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5435 | } |
| 5436 | |
| 5437 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5438 | vec_vsel(vector unsigned char __a, vector unsigned char __b, vector bool char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5439 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5440 | return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5441 | } |
| 5442 | |
| 5443 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5444 | vec_vsel(vector bool char __a, vector bool char __b, vector unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5445 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5446 | return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5447 | } |
| 5448 | |
| 5449 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5450 | vec_vsel(vector bool char __a, vector bool char __b, vector bool char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5451 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5452 | return (__a & ~__c) | (__b & __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5453 | } |
| 5454 | |
| 5455 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5456 | vec_vsel(vector short __a, vector short __b, vector unsigned short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5457 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5458 | return (__a & ~(vector short)__c) | (__b & (vector short)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5459 | } |
| 5460 | |
| 5461 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5462 | vec_vsel(vector short __a, vector short __b, vector bool short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5463 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5464 | return (__a & ~(vector short)__c) | (__b & (vector short)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5465 | } |
| 5466 | |
| 5467 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5468 | vec_vsel(vector unsigned short __a, |
| 5469 | vector unsigned short __b, |
| 5470 | vector unsigned short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5471 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5472 | return (__a & ~__c) | (__b & __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5473 | } |
| 5474 | |
| 5475 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5476 | vec_vsel(vector unsigned short __a, vector unsigned short __b, vector bool short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5477 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5478 | return (__a & ~(vector unsigned short)__c) | (__b & (vector unsigned short)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5479 | } |
| 5480 | |
| 5481 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5482 | vec_vsel(vector bool short __a, vector bool short __b, vector unsigned short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5483 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5484 | return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5485 | } |
| 5486 | |
| 5487 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5488 | vec_vsel(vector bool short __a, vector bool short __b, vector bool short __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5489 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5490 | return (__a & ~__c) | (__b & __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5491 | } |
| 5492 | |
| 5493 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5494 | vec_vsel(vector int __a, vector int __b, vector unsigned int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5495 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5496 | return (__a & ~(vector int)__c) | (__b & (vector int)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5497 | } |
| 5498 | |
| 5499 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5500 | vec_vsel(vector int __a, vector int __b, vector bool int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5501 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5502 | return (__a & ~(vector int)__c) | (__b & (vector int)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5503 | } |
| 5504 | |
| 5505 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5506 | vec_vsel(vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5507 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5508 | return (__a & ~__c) | (__b & __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5509 | } |
| 5510 | |
| 5511 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5512 | vec_vsel(vector unsigned int __a, vector unsigned int __b, vector bool int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5513 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5514 | return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5515 | } |
| 5516 | |
| 5517 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5518 | vec_vsel(vector bool int __a, vector bool int __b, vector unsigned int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5519 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5520 | return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5521 | } |
| 5522 | |
| 5523 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5524 | vec_vsel(vector bool int __a, vector bool int __b, vector bool int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5525 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5526 | return (__a & ~__c) | (__b & __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5527 | } |
| 5528 | |
| 5529 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5530 | vec_vsel(vector float __a, vector float __b, vector unsigned int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5531 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5532 | vector int __res = ((vector int)__a & ~(vector int)__c) |
| 5533 | | ((vector int)__b & (vector int)__c); |
| 5534 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5535 | } |
| 5536 | |
| 5537 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5538 | vec_vsel(vector float __a, vector float __b, vector bool int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5539 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5540 | vector int __res = ((vector int)__a & ~(vector int)__c) |
| 5541 | | ((vector int)__b & (vector int)__c); |
| 5542 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5543 | } |
| 5544 | |
| 5545 | /* vec_sl */ |
| 5546 | |
| 5547 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5548 | vec_sl(vector signed char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5549 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5550 | return __a << (vector signed char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5551 | } |
| 5552 | |
| 5553 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5554 | vec_sl(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5555 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5556 | return __a << __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5557 | } |
| 5558 | |
| 5559 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5560 | vec_sl(vector short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5561 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5562 | return __a << (vector short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5563 | } |
| 5564 | |
| 5565 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5566 | vec_sl(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5567 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5568 | return __a << __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5569 | } |
| 5570 | |
| 5571 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5572 | vec_sl(vector int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5573 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5574 | return __a << (vector int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5575 | } |
| 5576 | |
| 5577 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5578 | vec_sl(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5579 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5580 | return __a << __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5581 | } |
| 5582 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 5583 | #ifdef __POWER8_VECTOR__ |
| 5584 | static vector signed long long __ATTRS_o_ai |
| 5585 | vec_sl(vector signed long long __a, vector unsigned long long __b) |
| 5586 | { |
| 5587 | return __a << (vector long long)__b; |
| 5588 | } |
| 5589 | |
| 5590 | static vector unsigned long long __ATTRS_o_ai |
| 5591 | vec_sl(vector unsigned long long __a, vector unsigned long long __b) |
| 5592 | { |
| 5593 | return __a << __b; |
| 5594 | } |
| 5595 | #endif |
| 5596 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5597 | /* vec_vslb */ |
| 5598 | |
| 5599 | #define __builtin_altivec_vslb vec_vslb |
| 5600 | |
| 5601 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5602 | vec_vslb(vector signed char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5603 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5604 | return vec_sl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5605 | } |
| 5606 | |
| 5607 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5608 | vec_vslb(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5609 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5610 | return vec_sl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5611 | } |
| 5612 | |
| 5613 | /* vec_vslh */ |
| 5614 | |
| 5615 | #define __builtin_altivec_vslh vec_vslh |
| 5616 | |
| 5617 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5618 | vec_vslh(vector short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5619 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5620 | return vec_sl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5621 | } |
| 5622 | |
| 5623 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5624 | vec_vslh(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5625 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5626 | return vec_sl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5627 | } |
| 5628 | |
| 5629 | /* vec_vslw */ |
| 5630 | |
| 5631 | #define __builtin_altivec_vslw vec_vslw |
| 5632 | |
| 5633 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5634 | vec_vslw(vector int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5635 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5636 | return vec_sl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5637 | } |
| 5638 | |
| 5639 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5640 | vec_vslw(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5641 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5642 | return vec_sl(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5643 | } |
| 5644 | |
| 5645 | /* vec_sld */ |
| 5646 | |
| 5647 | #define __builtin_altivec_vsldoi_4si vec_sld |
| 5648 | |
| 5649 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5650 | vec_sld(vector signed char __a, vector signed char __b, unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5651 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5652 | return vec_perm(__a, __b, (vector unsigned char) |
| 5653 | (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7, |
| 5654 | __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5655 | } |
| 5656 | |
| 5657 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5658 | vec_sld(vector unsigned char __a, vector unsigned char __b, unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5659 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5660 | return vec_perm(__a, __b, (vector unsigned char) |
| 5661 | (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7, |
| 5662 | __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5663 | } |
| 5664 | |
| 5665 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5666 | vec_sld(vector short __a, vector short __b, unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5667 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5668 | return vec_perm(__a, __b, (vector unsigned char) |
| 5669 | (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7, |
| 5670 | __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5671 | } |
| 5672 | |
| 5673 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5674 | vec_sld(vector unsigned short __a, vector unsigned short __b, unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5675 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5676 | return vec_perm(__a, __b, (vector unsigned char) |
| 5677 | (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7, |
| 5678 | __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5679 | } |
| 5680 | |
| 5681 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5682 | vec_sld(vector pixel __a, vector pixel __b, unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5683 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5684 | return vec_perm(__a, __b, (vector unsigned char) |
| 5685 | (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7, |
| 5686 | __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5687 | } |
| 5688 | |
| 5689 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5690 | vec_sld(vector int __a, vector int __b, unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5691 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5692 | return vec_perm(__a, __b, (vector unsigned char) |
| 5693 | (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7, |
| 5694 | __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5695 | } |
| 5696 | |
| 5697 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5698 | vec_sld(vector unsigned int __a, vector unsigned int __b, unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5699 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5700 | return vec_perm(__a, __b, (vector unsigned char) |
| 5701 | (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7, |
| 5702 | __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5703 | } |
| 5704 | |
| 5705 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5706 | vec_sld(vector float __a, vector float __b, unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5707 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5708 | return vec_perm(__a, __b, (vector unsigned char) |
| 5709 | (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7, |
| 5710 | __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5711 | } |
| 5712 | |
| 5713 | /* vec_vsldoi */ |
| 5714 | |
| 5715 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5716 | vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5717 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5718 | return vec_perm(__a, __b, (vector unsigned char) |
| 5719 | (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7, |
| 5720 | __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5721 | } |
| 5722 | |
| 5723 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5724 | vec_vsldoi(vector unsigned char __a, vector unsigned char __b, unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5725 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5726 | return vec_perm(__a, __b, (vector unsigned char) |
| 5727 | (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7, |
| 5728 | __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5729 | } |
| 5730 | |
| 5731 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5732 | vec_vsldoi(vector short __a, vector short __b, unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5733 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5734 | return vec_perm(__a, __b, (vector unsigned char) |
| 5735 | (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7, |
| 5736 | __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5737 | } |
| 5738 | |
| 5739 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5740 | vec_vsldoi(vector unsigned short __a, vector unsigned short __b, unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5741 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5742 | return vec_perm(__a, __b, (vector unsigned char) |
| 5743 | (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7, |
| 5744 | __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5745 | } |
| 5746 | |
| 5747 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5748 | vec_vsldoi(vector pixel __a, vector pixel __b, unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5749 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5750 | return vec_perm(__a, __b, (vector unsigned char) |
| 5751 | (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7, |
| 5752 | __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5753 | } |
| 5754 | |
| 5755 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5756 | vec_vsldoi(vector int __a, vector int __b, unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5757 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5758 | return vec_perm(__a, __b, (vector unsigned char) |
| 5759 | (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7, |
| 5760 | __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5761 | } |
| 5762 | |
| 5763 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5764 | vec_vsldoi(vector unsigned int __a, vector unsigned int __b, unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5765 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5766 | return vec_perm(__a, __b, (vector unsigned char) |
| 5767 | (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7, |
| 5768 | __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5769 | } |
| 5770 | |
| 5771 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5772 | vec_vsldoi(vector float __a, vector float __b, unsigned char __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5773 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5774 | return vec_perm(__a, __b, (vector unsigned char) |
| 5775 | (__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7, |
| 5776 | __c+8, __c+9, __c+10, __c+11, __c+12, __c+13, __c+14, __c+15)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5777 | } |
| 5778 | |
| 5779 | /* vec_sll */ |
| 5780 | |
| 5781 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5782 | vec_sll(vector signed char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5783 | { |
| 5784 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5785 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5786 | } |
| 5787 | |
| 5788 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5789 | vec_sll(vector signed char __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5790 | { |
| 5791 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5792 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5793 | } |
| 5794 | |
| 5795 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5796 | vec_sll(vector signed char __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5797 | { |
| 5798 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5799 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5800 | } |
| 5801 | |
| 5802 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5803 | vec_sll(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5804 | { |
| 5805 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5806 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5807 | } |
| 5808 | |
| 5809 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5810 | vec_sll(vector unsigned char __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5811 | { |
| 5812 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5813 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5814 | } |
| 5815 | |
| 5816 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5817 | vec_sll(vector unsigned char __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5818 | { |
| 5819 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5820 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5821 | } |
| 5822 | |
| 5823 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5824 | vec_sll(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5825 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5826 | return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5827 | } |
| 5828 | |
| 5829 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5830 | vec_sll(vector bool char __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5831 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5832 | return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5833 | } |
| 5834 | |
| 5835 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5836 | vec_sll(vector bool char __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5837 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5838 | return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5839 | } |
| 5840 | |
| 5841 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5842 | vec_sll(vector short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5843 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5844 | return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5845 | } |
| 5846 | |
| 5847 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5848 | vec_sll(vector short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5849 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5850 | return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5851 | } |
| 5852 | |
| 5853 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5854 | vec_sll(vector short __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5855 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5856 | return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5857 | } |
| 5858 | |
| 5859 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5860 | vec_sll(vector unsigned short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5861 | { |
| 5862 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5863 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5864 | } |
| 5865 | |
| 5866 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5867 | vec_sll(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5868 | { |
| 5869 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5870 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5871 | } |
| 5872 | |
| 5873 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5874 | vec_sll(vector unsigned short __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5875 | { |
| 5876 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5877 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5878 | } |
| 5879 | |
| 5880 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5881 | vec_sll(vector bool short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5882 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5883 | return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5884 | } |
| 5885 | |
| 5886 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5887 | vec_sll(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5888 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5889 | return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5890 | } |
| 5891 | |
| 5892 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5893 | vec_sll(vector bool short __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5894 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5895 | return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5896 | } |
| 5897 | |
| 5898 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5899 | vec_sll(vector pixel __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5900 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5901 | return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5902 | } |
| 5903 | |
| 5904 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5905 | vec_sll(vector pixel __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5906 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5907 | return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5908 | } |
| 5909 | |
| 5910 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5911 | vec_sll(vector pixel __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5912 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5913 | return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5914 | } |
| 5915 | |
| 5916 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5917 | vec_sll(vector int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5918 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5919 | return (vector int)__builtin_altivec_vsl(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5920 | } |
| 5921 | |
| 5922 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5923 | vec_sll(vector int __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5924 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5925 | return (vector int)__builtin_altivec_vsl(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5926 | } |
| 5927 | |
| 5928 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5929 | vec_sll(vector int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5930 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5931 | return (vector int)__builtin_altivec_vsl(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5932 | } |
| 5933 | |
| 5934 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5935 | vec_sll(vector unsigned int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5936 | { |
| 5937 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5938 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5939 | } |
| 5940 | |
| 5941 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5942 | vec_sll(vector unsigned int __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5943 | { |
| 5944 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5945 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5946 | } |
| 5947 | |
| 5948 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5949 | vec_sll(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5950 | { |
| 5951 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5952 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5953 | } |
| 5954 | |
| 5955 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5956 | vec_sll(vector bool int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5957 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5958 | return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5959 | } |
| 5960 | |
| 5961 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5962 | vec_sll(vector bool int __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5963 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5964 | return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5965 | } |
| 5966 | |
| 5967 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5968 | vec_sll(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5969 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5970 | return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5971 | } |
| 5972 | |
| 5973 | /* vec_vsl */ |
| 5974 | |
| 5975 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5976 | vec_vsl(vector signed char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5977 | { |
| 5978 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5979 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5980 | } |
| 5981 | |
| 5982 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5983 | vec_vsl(vector signed char __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5984 | { |
| 5985 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5986 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5987 | } |
| 5988 | |
| 5989 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5990 | vec_vsl(vector signed char __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5991 | { |
| 5992 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5993 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5994 | } |
| 5995 | |
| 5996 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 5997 | vec_vsl(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 5998 | { |
| 5999 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6000 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6001 | } |
| 6002 | |
| 6003 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6004 | vec_vsl(vector unsigned char __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6005 | { |
| 6006 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6007 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6008 | } |
| 6009 | |
| 6010 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6011 | vec_vsl(vector unsigned char __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6012 | { |
| 6013 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6014 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6015 | } |
| 6016 | |
| 6017 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6018 | vec_vsl(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6019 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6020 | return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6021 | } |
| 6022 | |
| 6023 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6024 | vec_vsl(vector bool char __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6025 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6026 | return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6027 | } |
| 6028 | |
| 6029 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6030 | vec_vsl(vector bool char __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6031 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6032 | return (vector bool char)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6033 | } |
| 6034 | |
| 6035 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6036 | vec_vsl(vector short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6037 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6038 | return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6039 | } |
| 6040 | |
| 6041 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6042 | vec_vsl(vector short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6043 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6044 | return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6045 | } |
| 6046 | |
| 6047 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6048 | vec_vsl(vector short __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6049 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6050 | return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6051 | } |
| 6052 | |
| 6053 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6054 | vec_vsl(vector unsigned short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6055 | { |
| 6056 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6057 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6058 | } |
| 6059 | |
| 6060 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6061 | vec_vsl(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6062 | { |
| 6063 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6064 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6065 | } |
| 6066 | |
| 6067 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6068 | vec_vsl(vector unsigned short __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6069 | { |
| 6070 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6071 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6072 | } |
| 6073 | |
| 6074 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6075 | vec_vsl(vector bool short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6076 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6077 | return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6078 | } |
| 6079 | |
| 6080 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6081 | vec_vsl(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6082 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6083 | return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6084 | } |
| 6085 | |
| 6086 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6087 | vec_vsl(vector bool short __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6088 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6089 | return (vector bool short)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6090 | } |
| 6091 | |
| 6092 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6093 | vec_vsl(vector pixel __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6094 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6095 | return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6096 | } |
| 6097 | |
| 6098 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6099 | vec_vsl(vector pixel __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6100 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6101 | return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6102 | } |
| 6103 | |
| 6104 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6105 | vec_vsl(vector pixel __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6106 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6107 | return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6108 | } |
| 6109 | |
| 6110 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6111 | vec_vsl(vector int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6112 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6113 | return (vector int)__builtin_altivec_vsl(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6114 | } |
| 6115 | |
| 6116 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6117 | vec_vsl(vector int __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6118 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6119 | return (vector int)__builtin_altivec_vsl(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6120 | } |
| 6121 | |
| 6122 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6123 | vec_vsl(vector int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6124 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6125 | return (vector int)__builtin_altivec_vsl(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6126 | } |
| 6127 | |
| 6128 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6129 | vec_vsl(vector unsigned int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6130 | { |
| 6131 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6132 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6133 | } |
| 6134 | |
| 6135 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6136 | vec_vsl(vector unsigned int __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6137 | { |
| 6138 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6139 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6140 | } |
| 6141 | |
| 6142 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6143 | vec_vsl(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6144 | { |
| 6145 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6146 | __builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6147 | } |
| 6148 | |
| 6149 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6150 | vec_vsl(vector bool int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6151 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6152 | return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6153 | } |
| 6154 | |
| 6155 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6156 | vec_vsl(vector bool int __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6157 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6158 | return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6159 | } |
| 6160 | |
| 6161 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6162 | vec_vsl(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6163 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6164 | return (vector bool int)__builtin_altivec_vsl((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6165 | } |
| 6166 | |
| 6167 | /* vec_slo */ |
| 6168 | |
| 6169 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6170 | vec_slo(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6171 | { |
| 6172 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6173 | __builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6174 | } |
| 6175 | |
| 6176 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6177 | vec_slo(vector signed char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6178 | { |
| 6179 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6180 | __builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6181 | } |
| 6182 | |
| 6183 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6184 | vec_slo(vector unsigned char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6185 | { |
| 6186 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6187 | __builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6188 | } |
| 6189 | |
| 6190 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6191 | vec_slo(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6192 | { |
| 6193 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6194 | __builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6195 | } |
| 6196 | |
| 6197 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6198 | vec_slo(vector short __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6199 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6200 | return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6201 | } |
| 6202 | |
| 6203 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6204 | vec_slo(vector short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6205 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6206 | return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6207 | } |
| 6208 | |
| 6209 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6210 | vec_slo(vector unsigned short __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6211 | { |
| 6212 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6213 | __builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6214 | } |
| 6215 | |
| 6216 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6217 | vec_slo(vector unsigned short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6218 | { |
| 6219 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6220 | __builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6221 | } |
| 6222 | |
| 6223 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6224 | vec_slo(vector pixel __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6225 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6226 | return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6227 | } |
| 6228 | |
| 6229 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6230 | vec_slo(vector pixel __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6231 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6232 | return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6233 | } |
| 6234 | |
| 6235 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6236 | vec_slo(vector int __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6237 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6238 | return (vector int)__builtin_altivec_vslo(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6239 | } |
| 6240 | |
| 6241 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6242 | vec_slo(vector int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6243 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6244 | return (vector int)__builtin_altivec_vslo(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6245 | } |
| 6246 | |
| 6247 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6248 | vec_slo(vector unsigned int __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6249 | { |
| 6250 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6251 | __builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6252 | } |
| 6253 | |
| 6254 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6255 | vec_slo(vector unsigned int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6256 | { |
| 6257 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6258 | __builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6259 | } |
| 6260 | |
| 6261 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6262 | vec_slo(vector float __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6263 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6264 | return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6265 | } |
| 6266 | |
| 6267 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6268 | vec_slo(vector float __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6269 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6270 | return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6271 | } |
| 6272 | |
| 6273 | /* vec_vslo */ |
| 6274 | |
| 6275 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6276 | vec_vslo(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6277 | { |
| 6278 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6279 | __builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6280 | } |
| 6281 | |
| 6282 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6283 | vec_vslo(vector signed char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6284 | { |
| 6285 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6286 | __builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6287 | } |
| 6288 | |
| 6289 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6290 | vec_vslo(vector unsigned char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6291 | { |
| 6292 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6293 | __builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6294 | } |
| 6295 | |
| 6296 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6297 | vec_vslo(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6298 | { |
| 6299 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6300 | __builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6301 | } |
| 6302 | |
| 6303 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6304 | vec_vslo(vector short __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6305 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6306 | return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6307 | } |
| 6308 | |
| 6309 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6310 | vec_vslo(vector short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6311 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6312 | return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6313 | } |
| 6314 | |
| 6315 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6316 | vec_vslo(vector unsigned short __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6317 | { |
| 6318 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6319 | __builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6320 | } |
| 6321 | |
| 6322 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6323 | vec_vslo(vector unsigned short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6324 | { |
| 6325 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6326 | __builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6327 | } |
| 6328 | |
| 6329 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6330 | vec_vslo(vector pixel __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6331 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6332 | return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6333 | } |
| 6334 | |
| 6335 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6336 | vec_vslo(vector pixel __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6337 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6338 | return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6339 | } |
| 6340 | |
| 6341 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6342 | vec_vslo(vector int __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6343 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6344 | return (vector int)__builtin_altivec_vslo(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6345 | } |
| 6346 | |
| 6347 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6348 | vec_vslo(vector int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6349 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6350 | return (vector int)__builtin_altivec_vslo(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6351 | } |
| 6352 | |
| 6353 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6354 | vec_vslo(vector unsigned int __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6355 | { |
| 6356 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6357 | __builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6358 | } |
| 6359 | |
| 6360 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6361 | vec_vslo(vector unsigned int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6362 | { |
| 6363 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6364 | __builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6365 | } |
| 6366 | |
| 6367 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6368 | vec_vslo(vector float __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6369 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6370 | return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6371 | } |
| 6372 | |
| 6373 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6374 | vec_vslo(vector float __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6375 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6376 | return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6377 | } |
| 6378 | |
| 6379 | /* vec_splat */ |
| 6380 | |
| 6381 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6382 | vec_splat(vector signed char __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6383 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6384 | return vec_perm(__a, __a, (vector unsigned char)(__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6385 | } |
| 6386 | |
| 6387 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6388 | vec_splat(vector unsigned char __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6389 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6390 | return vec_perm(__a, __a, (vector unsigned char)(__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6391 | } |
| 6392 | |
| 6393 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6394 | vec_splat(vector bool char __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6395 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6396 | return vec_perm(__a, __a, (vector unsigned char)(__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6397 | } |
| 6398 | |
| 6399 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6400 | vec_splat(vector short __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6401 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6402 | __b *= 2; |
| 6403 | unsigned char b1=__b+1; |
| 6404 | return vec_perm(__a, __a, (vector unsigned char) |
| 6405 | (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6406 | } |
| 6407 | |
| 6408 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6409 | vec_splat(vector unsigned short __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6410 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6411 | __b *= 2; |
| 6412 | unsigned char b1=__b+1; |
| 6413 | return vec_perm(__a, __a, (vector unsigned char) |
| 6414 | (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6415 | } |
| 6416 | |
| 6417 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6418 | vec_splat(vector bool short __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6419 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6420 | __b *= 2; |
| 6421 | unsigned char b1=__b+1; |
| 6422 | return vec_perm(__a, __a, (vector unsigned char) |
| 6423 | (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6424 | } |
| 6425 | |
| 6426 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6427 | vec_splat(vector pixel __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6428 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6429 | __b *= 2; |
| 6430 | unsigned char b1=__b+1; |
| 6431 | return vec_perm(__a, __a, (vector unsigned char) |
| 6432 | (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6433 | } |
| 6434 | |
| 6435 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6436 | vec_splat(vector int __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6437 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6438 | __b *= 4; |
| 6439 | unsigned char b1=__b+1, b2=__b+2, b3=__b+3; |
| 6440 | return vec_perm(__a, __a, (vector unsigned char) |
| 6441 | (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6442 | } |
| 6443 | |
| 6444 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6445 | vec_splat(vector unsigned int __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6446 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6447 | __b *= 4; |
| 6448 | unsigned char b1=__b+1, b2=__b+2, b3=__b+3; |
| 6449 | return vec_perm(__a, __a, (vector unsigned char) |
| 6450 | (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6451 | } |
| 6452 | |
| 6453 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6454 | vec_splat(vector bool int __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6455 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6456 | __b *= 4; |
| 6457 | unsigned char b1=__b+1, b2=__b+2, b3=__b+3; |
| 6458 | return vec_perm(__a, __a, (vector unsigned char) |
| 6459 | (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6460 | } |
| 6461 | |
| 6462 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6463 | vec_splat(vector float __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6464 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6465 | __b *= 4; |
| 6466 | unsigned char b1=__b+1, b2=__b+2, b3=__b+3; |
| 6467 | return vec_perm(__a, __a, (vector unsigned char) |
| 6468 | (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6469 | } |
| 6470 | |
| 6471 | /* vec_vspltb */ |
| 6472 | |
| 6473 | #define __builtin_altivec_vspltb vec_vspltb |
| 6474 | |
| 6475 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6476 | vec_vspltb(vector signed char __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6477 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6478 | return vec_perm(__a, __a, (vector unsigned char)(__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6479 | } |
| 6480 | |
| 6481 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6482 | vec_vspltb(vector unsigned char __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6483 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6484 | return vec_perm(__a, __a, (vector unsigned char)(__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6485 | } |
| 6486 | |
| 6487 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6488 | vec_vspltb(vector bool char __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6489 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6490 | return vec_perm(__a, __a, (vector unsigned char)(__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6491 | } |
| 6492 | |
| 6493 | /* vec_vsplth */ |
| 6494 | |
| 6495 | #define __builtin_altivec_vsplth vec_vsplth |
| 6496 | |
| 6497 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6498 | vec_vsplth(vector short __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6499 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6500 | __b *= 2; |
| 6501 | unsigned char b1=__b+1; |
| 6502 | return vec_perm(__a, __a, (vector unsigned char) |
| 6503 | (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6504 | } |
| 6505 | |
| 6506 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6507 | vec_vsplth(vector unsigned short __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6508 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6509 | __b *= 2; |
| 6510 | unsigned char b1=__b+1; |
| 6511 | return vec_perm(__a, __a, (vector unsigned char) |
| 6512 | (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6513 | } |
| 6514 | |
| 6515 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6516 | vec_vsplth(vector bool short __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6517 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6518 | __b *= 2; |
| 6519 | unsigned char b1=__b+1; |
| 6520 | return vec_perm(__a, __a, (vector unsigned char) |
| 6521 | (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6522 | } |
| 6523 | |
| 6524 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6525 | vec_vsplth(vector pixel __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6526 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6527 | __b *= 2; |
| 6528 | unsigned char b1=__b+1; |
| 6529 | return vec_perm(__a, __a, (vector unsigned char) |
| 6530 | (__b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1, __b, b1)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6531 | } |
| 6532 | |
| 6533 | /* vec_vspltw */ |
| 6534 | |
| 6535 | #define __builtin_altivec_vspltw vec_vspltw |
| 6536 | |
| 6537 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6538 | vec_vspltw(vector int __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6539 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6540 | __b *= 4; |
| 6541 | unsigned char b1=__b+1, b2=__b+2, b3=__b+3; |
| 6542 | return vec_perm(__a, __a, (vector unsigned char) |
| 6543 | (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6544 | } |
| 6545 | |
| 6546 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6547 | vec_vspltw(vector unsigned int __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6548 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6549 | __b *= 4; |
| 6550 | unsigned char b1=__b+1, b2=__b+2, b3=__b+3; |
| 6551 | return vec_perm(__a, __a, (vector unsigned char) |
| 6552 | (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6553 | } |
| 6554 | |
| 6555 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6556 | vec_vspltw(vector bool int __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6557 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6558 | __b *= 4; |
| 6559 | unsigned char b1=__b+1, b2=__b+2, b3=__b+3; |
| 6560 | return vec_perm(__a, __a, (vector unsigned char) |
| 6561 | (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6562 | } |
| 6563 | |
| 6564 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6565 | vec_vspltw(vector float __a, unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6566 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6567 | __b *= 4; |
| 6568 | unsigned char b1=__b+1, b2=__b+2, b3=__b+3; |
| 6569 | return vec_perm(__a, __a, (vector unsigned char) |
| 6570 | (__b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3, __b, b1, b2, b3)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6571 | } |
| 6572 | |
| 6573 | /* vec_splat_s8 */ |
| 6574 | |
| 6575 | #define __builtin_altivec_vspltisb vec_splat_s8 |
| 6576 | |
| 6577 | // FIXME: parameter should be treated as 5-bit signed literal |
| 6578 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6579 | vec_splat_s8(signed char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6580 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6581 | return (vector signed char)(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6582 | } |
| 6583 | |
| 6584 | /* vec_vspltisb */ |
| 6585 | |
| 6586 | // FIXME: parameter should be treated as 5-bit signed literal |
| 6587 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6588 | vec_vspltisb(signed char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6589 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6590 | return (vector signed char)(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6591 | } |
| 6592 | |
| 6593 | /* vec_splat_s16 */ |
| 6594 | |
| 6595 | #define __builtin_altivec_vspltish vec_splat_s16 |
| 6596 | |
| 6597 | // FIXME: parameter should be treated as 5-bit signed literal |
| 6598 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6599 | vec_splat_s16(signed char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6600 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6601 | return (vector short)(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6602 | } |
| 6603 | |
| 6604 | /* vec_vspltish */ |
| 6605 | |
| 6606 | // FIXME: parameter should be treated as 5-bit signed literal |
| 6607 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6608 | vec_vspltish(signed char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6609 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6610 | return (vector short)(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6611 | } |
| 6612 | |
| 6613 | /* vec_splat_s32 */ |
| 6614 | |
| 6615 | #define __builtin_altivec_vspltisw vec_splat_s32 |
| 6616 | |
| 6617 | // FIXME: parameter should be treated as 5-bit signed literal |
| 6618 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6619 | vec_splat_s32(signed char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6620 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6621 | return (vector int)(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6622 | } |
| 6623 | |
| 6624 | /* vec_vspltisw */ |
| 6625 | |
| 6626 | // FIXME: parameter should be treated as 5-bit signed literal |
| 6627 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6628 | vec_vspltisw(signed char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6629 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6630 | return (vector int)(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6631 | } |
| 6632 | |
| 6633 | /* vec_splat_u8 */ |
| 6634 | |
| 6635 | // FIXME: parameter should be treated as 5-bit signed literal |
| 6636 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6637 | vec_splat_u8(unsigned char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6638 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6639 | return (vector unsigned char)(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6640 | } |
| 6641 | |
| 6642 | /* vec_splat_u16 */ |
| 6643 | |
| 6644 | // FIXME: parameter should be treated as 5-bit signed literal |
| 6645 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6646 | vec_splat_u16(signed char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6647 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6648 | return (vector unsigned short)(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6649 | } |
| 6650 | |
| 6651 | /* vec_splat_u32 */ |
| 6652 | |
| 6653 | // FIXME: parameter should be treated as 5-bit signed literal |
| 6654 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6655 | vec_splat_u32(signed char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6656 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6657 | return (vector unsigned int)(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6658 | } |
| 6659 | |
| 6660 | /* vec_sr */ |
| 6661 | |
| 6662 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6663 | vec_sr(vector signed char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6664 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6665 | return __a >> (vector signed char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6666 | } |
| 6667 | |
| 6668 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6669 | vec_sr(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6670 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6671 | return __a >> __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6672 | } |
| 6673 | |
| 6674 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6675 | vec_sr(vector short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6676 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6677 | return __a >> (vector short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6678 | } |
| 6679 | |
| 6680 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6681 | vec_sr(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6682 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6683 | return __a >> __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6684 | } |
| 6685 | |
| 6686 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6687 | vec_sr(vector int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6688 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6689 | return __a >> (vector int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6690 | } |
| 6691 | |
| 6692 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6693 | vec_sr(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6694 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6695 | return __a >> __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6696 | } |
| 6697 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 6698 | #ifdef __POWER8_VECTOR__ |
| 6699 | static vector signed long long __ATTRS_o_ai |
| 6700 | vec_sr(vector signed long long __a, vector unsigned long long __b) |
| 6701 | { |
| 6702 | return __a >> (vector long long)__b; |
| 6703 | } |
| 6704 | |
| 6705 | static vector unsigned long long __ATTRS_o_ai |
| 6706 | vec_sr(vector unsigned long long __a, vector unsigned long long __b) |
| 6707 | { |
| 6708 | return __a >> __b; |
| 6709 | } |
| 6710 | #endif |
| 6711 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6712 | /* vec_vsrb */ |
| 6713 | |
| 6714 | #define __builtin_altivec_vsrb vec_vsrb |
| 6715 | |
| 6716 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6717 | vec_vsrb(vector signed char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6718 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6719 | return __a >> (vector signed char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6720 | } |
| 6721 | |
| 6722 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6723 | vec_vsrb(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6724 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6725 | return __a >> __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6726 | } |
| 6727 | |
| 6728 | /* vec_vsrh */ |
| 6729 | |
| 6730 | #define __builtin_altivec_vsrh vec_vsrh |
| 6731 | |
| 6732 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6733 | vec_vsrh(vector short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6734 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6735 | return __a >> (vector short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6736 | } |
| 6737 | |
| 6738 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6739 | vec_vsrh(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6740 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6741 | return __a >> __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6742 | } |
| 6743 | |
| 6744 | /* vec_vsrw */ |
| 6745 | |
| 6746 | #define __builtin_altivec_vsrw vec_vsrw |
| 6747 | |
| 6748 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6749 | vec_vsrw(vector int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6750 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6751 | return __a >> (vector int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6752 | } |
| 6753 | |
| 6754 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6755 | vec_vsrw(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6756 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6757 | return __a >> __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6758 | } |
| 6759 | |
| 6760 | /* vec_sra */ |
| 6761 | |
| 6762 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6763 | vec_sra(vector signed char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6764 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6765 | return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6766 | } |
| 6767 | |
| 6768 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6769 | vec_sra(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6770 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6771 | return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6772 | } |
| 6773 | |
| 6774 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6775 | vec_sra(vector short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6776 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6777 | return __builtin_altivec_vsrah(__a, (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6778 | } |
| 6779 | |
| 6780 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6781 | vec_sra(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6782 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6783 | return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6784 | } |
| 6785 | |
| 6786 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6787 | vec_sra(vector int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6788 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6789 | return __builtin_altivec_vsraw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6790 | } |
| 6791 | |
| 6792 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6793 | vec_sra(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6794 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6795 | return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6796 | } |
| 6797 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 6798 | #ifdef __POWER8_VECTOR__ |
| 6799 | static vector signed long long __ATTRS_o_ai |
| 6800 | vec_sra(vector signed long long __a, vector unsigned long long __b) |
| 6801 | { |
| 6802 | return __a >> __b; |
| 6803 | } |
| 6804 | |
| 6805 | static vector unsigned long long __ATTRS_o_ai |
| 6806 | vec_sra(vector unsigned long long __a, vector unsigned long long __b) |
| 6807 | { |
| 6808 | return (vector unsigned long long) ( (vector signed long long) __a >> __b); |
| 6809 | } |
| 6810 | #endif |
| 6811 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6812 | /* vec_vsrab */ |
| 6813 | |
| 6814 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6815 | vec_vsrab(vector signed char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6816 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6817 | return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6818 | } |
| 6819 | |
| 6820 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6821 | vec_vsrab(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6822 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6823 | return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6824 | } |
| 6825 | |
| 6826 | /* vec_vsrah */ |
| 6827 | |
| 6828 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6829 | vec_vsrah(vector short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6830 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6831 | return __builtin_altivec_vsrah(__a, (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6832 | } |
| 6833 | |
| 6834 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6835 | vec_vsrah(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6836 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6837 | return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6838 | } |
| 6839 | |
| 6840 | /* vec_vsraw */ |
| 6841 | |
| 6842 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6843 | vec_vsraw(vector int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6844 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6845 | return __builtin_altivec_vsraw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6846 | } |
| 6847 | |
| 6848 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6849 | vec_vsraw(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6850 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6851 | return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6852 | } |
| 6853 | |
| 6854 | /* vec_srl */ |
| 6855 | |
| 6856 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6857 | vec_srl(vector signed char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6858 | { |
| 6859 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6860 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6861 | } |
| 6862 | |
| 6863 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6864 | vec_srl(vector signed char __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6865 | { |
| 6866 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6867 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6868 | } |
| 6869 | |
| 6870 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6871 | vec_srl(vector signed char __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6872 | { |
| 6873 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6874 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6875 | } |
| 6876 | |
| 6877 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6878 | vec_srl(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6879 | { |
| 6880 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6881 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6882 | } |
| 6883 | |
| 6884 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6885 | vec_srl(vector unsigned char __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6886 | { |
| 6887 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6888 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6889 | } |
| 6890 | |
| 6891 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6892 | vec_srl(vector unsigned char __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6893 | { |
| 6894 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6895 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6896 | } |
| 6897 | |
| 6898 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6899 | vec_srl(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6900 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6901 | return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6902 | } |
| 6903 | |
| 6904 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6905 | vec_srl(vector bool char __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6906 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6907 | return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6908 | } |
| 6909 | |
| 6910 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6911 | vec_srl(vector bool char __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6912 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6913 | return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6914 | } |
| 6915 | |
| 6916 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6917 | vec_srl(vector short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6918 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6919 | return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6920 | } |
| 6921 | |
| 6922 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6923 | vec_srl(vector short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6924 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6925 | return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6926 | } |
| 6927 | |
| 6928 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6929 | vec_srl(vector short __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6930 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6931 | return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6932 | } |
| 6933 | |
| 6934 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6935 | vec_srl(vector unsigned short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6936 | { |
| 6937 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6938 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6939 | } |
| 6940 | |
| 6941 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6942 | vec_srl(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6943 | { |
| 6944 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6945 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6946 | } |
| 6947 | |
| 6948 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6949 | vec_srl(vector unsigned short __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6950 | { |
| 6951 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6952 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6953 | } |
| 6954 | |
| 6955 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6956 | vec_srl(vector bool short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6957 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6958 | return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6959 | } |
| 6960 | |
| 6961 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6962 | vec_srl(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6963 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6964 | return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6965 | } |
| 6966 | |
| 6967 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6968 | vec_srl(vector bool short __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6969 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6970 | return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6971 | } |
| 6972 | |
| 6973 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6974 | vec_srl(vector pixel __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6975 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6976 | return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6977 | } |
| 6978 | |
| 6979 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6980 | vec_srl(vector pixel __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6981 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6982 | return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6983 | } |
| 6984 | |
| 6985 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6986 | vec_srl(vector pixel __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6987 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6988 | return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6989 | } |
| 6990 | |
| 6991 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6992 | vec_srl(vector int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6993 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6994 | return (vector int)__builtin_altivec_vsr(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6995 | } |
| 6996 | |
| 6997 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 6998 | vec_srl(vector int __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 6999 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7000 | return (vector int)__builtin_altivec_vsr(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7001 | } |
| 7002 | |
| 7003 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7004 | vec_srl(vector int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7005 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7006 | return (vector int)__builtin_altivec_vsr(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7007 | } |
| 7008 | |
| 7009 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7010 | vec_srl(vector unsigned int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7011 | { |
| 7012 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7013 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7014 | } |
| 7015 | |
| 7016 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7017 | vec_srl(vector unsigned int __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7018 | { |
| 7019 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7020 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7021 | } |
| 7022 | |
| 7023 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7024 | vec_srl(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7025 | { |
| 7026 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7027 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7028 | } |
| 7029 | |
| 7030 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7031 | vec_srl(vector bool int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7032 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7033 | return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7034 | } |
| 7035 | |
| 7036 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7037 | vec_srl(vector bool int __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7038 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7039 | return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7040 | } |
| 7041 | |
| 7042 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7043 | vec_srl(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7044 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7045 | return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7046 | } |
| 7047 | |
| 7048 | /* vec_vsr */ |
| 7049 | |
| 7050 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7051 | vec_vsr(vector signed char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7052 | { |
| 7053 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7054 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7055 | } |
| 7056 | |
| 7057 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7058 | vec_vsr(vector signed char __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7059 | { |
| 7060 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7061 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7062 | } |
| 7063 | |
| 7064 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7065 | vec_vsr(vector signed char __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7066 | { |
| 7067 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7068 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7069 | } |
| 7070 | |
| 7071 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7072 | vec_vsr(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7073 | { |
| 7074 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7075 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7076 | } |
| 7077 | |
| 7078 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7079 | vec_vsr(vector unsigned char __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7080 | { |
| 7081 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7082 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7083 | } |
| 7084 | |
| 7085 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7086 | vec_vsr(vector unsigned char __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7087 | { |
| 7088 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7089 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7090 | } |
| 7091 | |
| 7092 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7093 | vec_vsr(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7094 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7095 | return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7096 | } |
| 7097 | |
| 7098 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7099 | vec_vsr(vector bool char __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7100 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7101 | return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7102 | } |
| 7103 | |
| 7104 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7105 | vec_vsr(vector bool char __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7106 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7107 | return (vector bool char)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7108 | } |
| 7109 | |
| 7110 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7111 | vec_vsr(vector short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7112 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7113 | return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7114 | } |
| 7115 | |
| 7116 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7117 | vec_vsr(vector short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7118 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7119 | return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7120 | } |
| 7121 | |
| 7122 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7123 | vec_vsr(vector short __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7124 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7125 | return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7126 | } |
| 7127 | |
| 7128 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7129 | vec_vsr(vector unsigned short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7130 | { |
| 7131 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7132 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7133 | } |
| 7134 | |
| 7135 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7136 | vec_vsr(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7137 | { |
| 7138 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7139 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7140 | } |
| 7141 | |
| 7142 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7143 | vec_vsr(vector unsigned short __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7144 | { |
| 7145 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7146 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7147 | } |
| 7148 | |
| 7149 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7150 | vec_vsr(vector bool short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7151 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7152 | return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7153 | } |
| 7154 | |
| 7155 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7156 | vec_vsr(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7157 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7158 | return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7159 | } |
| 7160 | |
| 7161 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7162 | vec_vsr(vector bool short __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7163 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7164 | return (vector bool short)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7165 | } |
| 7166 | |
| 7167 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7168 | vec_vsr(vector pixel __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7169 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7170 | return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7171 | } |
| 7172 | |
| 7173 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7174 | vec_vsr(vector pixel __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7175 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7176 | return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7177 | } |
| 7178 | |
| 7179 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7180 | vec_vsr(vector pixel __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7181 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7182 | return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7183 | } |
| 7184 | |
| 7185 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7186 | vec_vsr(vector int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7187 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7188 | return (vector int)__builtin_altivec_vsr(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7189 | } |
| 7190 | |
| 7191 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7192 | vec_vsr(vector int __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7193 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7194 | return (vector int)__builtin_altivec_vsr(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7195 | } |
| 7196 | |
| 7197 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7198 | vec_vsr(vector int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7199 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7200 | return (vector int)__builtin_altivec_vsr(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7201 | } |
| 7202 | |
| 7203 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7204 | vec_vsr(vector unsigned int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7205 | { |
| 7206 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7207 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7208 | } |
| 7209 | |
| 7210 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7211 | vec_vsr(vector unsigned int __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7212 | { |
| 7213 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7214 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7215 | } |
| 7216 | |
| 7217 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7218 | vec_vsr(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7219 | { |
| 7220 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7221 | __builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7222 | } |
| 7223 | |
| 7224 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7225 | vec_vsr(vector bool int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7226 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7227 | return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7228 | } |
| 7229 | |
| 7230 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7231 | vec_vsr(vector bool int __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7232 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7233 | return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7234 | } |
| 7235 | |
| 7236 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7237 | vec_vsr(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7238 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7239 | return (vector bool int)__builtin_altivec_vsr((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7240 | } |
| 7241 | |
| 7242 | /* vec_sro */ |
| 7243 | |
| 7244 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7245 | vec_sro(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7246 | { |
| 7247 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7248 | __builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7249 | } |
| 7250 | |
| 7251 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7252 | vec_sro(vector signed char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7253 | { |
| 7254 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7255 | __builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7256 | } |
| 7257 | |
| 7258 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7259 | vec_sro(vector unsigned char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7260 | { |
| 7261 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7262 | __builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7263 | } |
| 7264 | |
| 7265 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7266 | vec_sro(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7267 | { |
| 7268 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7269 | __builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7270 | } |
| 7271 | |
| 7272 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7273 | vec_sro(vector short __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7274 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7275 | return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7276 | } |
| 7277 | |
| 7278 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7279 | vec_sro(vector short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7280 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7281 | return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7282 | } |
| 7283 | |
| 7284 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7285 | vec_sro(vector unsigned short __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7286 | { |
| 7287 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7288 | __builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7289 | } |
| 7290 | |
| 7291 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7292 | vec_sro(vector unsigned short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7293 | { |
| 7294 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7295 | __builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7296 | } |
| 7297 | |
| 7298 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7299 | vec_sro(vector pixel __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7300 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7301 | return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7302 | } |
| 7303 | |
| 7304 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7305 | vec_sro(vector pixel __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7306 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7307 | return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7308 | } |
| 7309 | |
| 7310 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7311 | vec_sro(vector int __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7312 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7313 | return (vector int)__builtin_altivec_vsro(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7314 | } |
| 7315 | |
| 7316 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7317 | vec_sro(vector int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7318 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7319 | return (vector int)__builtin_altivec_vsro(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7320 | } |
| 7321 | |
| 7322 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7323 | vec_sro(vector unsigned int __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7324 | { |
| 7325 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7326 | __builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7327 | } |
| 7328 | |
| 7329 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7330 | vec_sro(vector unsigned int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7331 | { |
| 7332 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7333 | __builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7334 | } |
| 7335 | |
| 7336 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7337 | vec_sro(vector float __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7338 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7339 | return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7340 | } |
| 7341 | |
| 7342 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7343 | vec_sro(vector float __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7344 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7345 | return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7346 | } |
| 7347 | |
| 7348 | /* vec_vsro */ |
| 7349 | |
| 7350 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7351 | vec_vsro(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7352 | { |
| 7353 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7354 | __builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7355 | } |
| 7356 | |
| 7357 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7358 | vec_vsro(vector signed char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7359 | { |
| 7360 | return (vector signed char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7361 | __builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7362 | } |
| 7363 | |
| 7364 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7365 | vec_vsro(vector unsigned char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7366 | { |
| 7367 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7368 | __builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7369 | } |
| 7370 | |
| 7371 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7372 | vec_vsro(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7373 | { |
| 7374 | return (vector unsigned char) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7375 | __builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7376 | } |
| 7377 | |
| 7378 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7379 | vec_vsro(vector short __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7380 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7381 | return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7382 | } |
| 7383 | |
| 7384 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7385 | vec_vsro(vector short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7386 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7387 | return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7388 | } |
| 7389 | |
| 7390 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7391 | vec_vsro(vector unsigned short __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7392 | { |
| 7393 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7394 | __builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7395 | } |
| 7396 | |
| 7397 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7398 | vec_vsro(vector unsigned short __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7399 | { |
| 7400 | return (vector unsigned short) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7401 | __builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7402 | } |
| 7403 | |
| 7404 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7405 | vec_vsro(vector pixel __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7406 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7407 | return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7408 | } |
| 7409 | |
| 7410 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7411 | vec_vsro(vector pixel __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7412 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7413 | return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7414 | } |
| 7415 | |
| 7416 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7417 | vec_vsro(vector int __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7418 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7419 | return (vector int)__builtin_altivec_vsro(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7420 | } |
| 7421 | |
| 7422 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7423 | vec_vsro(vector int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7424 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7425 | return (vector int)__builtin_altivec_vsro(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7426 | } |
| 7427 | |
| 7428 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7429 | vec_vsro(vector unsigned int __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7430 | { |
| 7431 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7432 | __builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7433 | } |
| 7434 | |
| 7435 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7436 | vec_vsro(vector unsigned int __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7437 | { |
| 7438 | return (vector unsigned int) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7439 | __builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7440 | } |
| 7441 | |
| 7442 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7443 | vec_vsro(vector float __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7444 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7445 | return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7446 | } |
| 7447 | |
| 7448 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7449 | vec_vsro(vector float __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7450 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7451 | return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7452 | } |
| 7453 | |
| 7454 | /* vec_st */ |
| 7455 | |
| 7456 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7457 | vec_st(vector signed char __a, int __b, vector signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7458 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7459 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7460 | } |
| 7461 | |
| 7462 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7463 | vec_st(vector signed char __a, int __b, signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7464 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7465 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7466 | } |
| 7467 | |
| 7468 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7469 | vec_st(vector unsigned char __a, int __b, vector unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7470 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7471 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7472 | } |
| 7473 | |
| 7474 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7475 | vec_st(vector unsigned char __a, int __b, unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7476 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7477 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7478 | } |
| 7479 | |
| 7480 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7481 | vec_st(vector bool char __a, int __b, signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7482 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7483 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7484 | } |
| 7485 | |
| 7486 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7487 | vec_st(vector bool char __a, int __b, unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7488 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7489 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7490 | } |
| 7491 | |
| 7492 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7493 | vec_st(vector bool char __a, int __b, vector bool char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7494 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7495 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7496 | } |
| 7497 | |
| 7498 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7499 | vec_st(vector short __a, int __b, vector short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7500 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7501 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7502 | } |
| 7503 | |
| 7504 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7505 | vec_st(vector short __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7506 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7507 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7508 | } |
| 7509 | |
| 7510 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7511 | vec_st(vector unsigned short __a, int __b, vector unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7512 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7513 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7514 | } |
| 7515 | |
| 7516 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7517 | vec_st(vector unsigned short __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7518 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7519 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7520 | } |
| 7521 | |
| 7522 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7523 | vec_st(vector bool short __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7524 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7525 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7526 | } |
| 7527 | |
| 7528 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7529 | vec_st(vector bool short __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7530 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7531 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7532 | } |
| 7533 | |
| 7534 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7535 | vec_st(vector bool short __a, int __b, vector bool short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7536 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7537 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7538 | } |
| 7539 | |
| 7540 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7541 | vec_st(vector pixel __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7542 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7543 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7544 | } |
| 7545 | |
| 7546 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7547 | vec_st(vector pixel __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7548 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7549 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7550 | } |
| 7551 | |
| 7552 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7553 | vec_st(vector pixel __a, int __b, vector pixel *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7554 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7555 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7556 | } |
| 7557 | |
| 7558 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7559 | vec_st(vector int __a, int __b, vector int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7560 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7561 | __builtin_altivec_stvx(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7562 | } |
| 7563 | |
| 7564 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7565 | vec_st(vector int __a, int __b, int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7566 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7567 | __builtin_altivec_stvx(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7568 | } |
| 7569 | |
| 7570 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7571 | vec_st(vector unsigned int __a, int __b, vector unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7572 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7573 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7574 | } |
| 7575 | |
| 7576 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7577 | vec_st(vector unsigned int __a, int __b, unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7578 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7579 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7580 | } |
| 7581 | |
| 7582 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7583 | vec_st(vector bool int __a, int __b, int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7584 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7585 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7586 | } |
| 7587 | |
| 7588 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7589 | vec_st(vector bool int __a, int __b, unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7590 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7591 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7592 | } |
| 7593 | |
| 7594 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7595 | vec_st(vector bool int __a, int __b, vector bool int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7596 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7597 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7598 | } |
| 7599 | |
| 7600 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7601 | vec_st(vector float __a, int __b, vector float *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7602 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7603 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7604 | } |
| 7605 | |
| 7606 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7607 | vec_st(vector float __a, int __b, float *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7608 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7609 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7610 | } |
| 7611 | |
| 7612 | /* vec_stvx */ |
| 7613 | |
| 7614 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7615 | vec_stvx(vector signed char __a, int __b, vector signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7616 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7617 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7618 | } |
| 7619 | |
| 7620 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7621 | vec_stvx(vector signed char __a, int __b, signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7622 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7623 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7624 | } |
| 7625 | |
| 7626 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7627 | vec_stvx(vector unsigned char __a, int __b, vector unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7628 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7629 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7630 | } |
| 7631 | |
| 7632 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7633 | vec_stvx(vector unsigned char __a, int __b, unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7634 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7635 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7636 | } |
| 7637 | |
| 7638 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7639 | vec_stvx(vector bool char __a, int __b, signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7640 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7641 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7642 | } |
| 7643 | |
| 7644 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7645 | vec_stvx(vector bool char __a, int __b, unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7646 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7647 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7648 | } |
| 7649 | |
| 7650 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7651 | vec_stvx(vector bool char __a, int __b, vector bool char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7652 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7653 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7654 | } |
| 7655 | |
| 7656 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7657 | vec_stvx(vector short __a, int __b, vector short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7658 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7659 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7660 | } |
| 7661 | |
| 7662 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7663 | vec_stvx(vector short __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7664 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7665 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7666 | } |
| 7667 | |
| 7668 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7669 | vec_stvx(vector unsigned short __a, int __b, vector unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7670 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7671 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7672 | } |
| 7673 | |
| 7674 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7675 | vec_stvx(vector unsigned short __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7676 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7677 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7678 | } |
| 7679 | |
| 7680 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7681 | vec_stvx(vector bool short __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7682 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7683 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7684 | } |
| 7685 | |
| 7686 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7687 | vec_stvx(vector bool short __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7688 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7689 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7690 | } |
| 7691 | |
| 7692 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7693 | vec_stvx(vector bool short __a, int __b, vector bool short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7694 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7695 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7696 | } |
| 7697 | |
| 7698 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7699 | vec_stvx(vector pixel __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7700 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7701 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7702 | } |
| 7703 | |
| 7704 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7705 | vec_stvx(vector pixel __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7706 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7707 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7708 | } |
| 7709 | |
| 7710 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7711 | vec_stvx(vector pixel __a, int __b, vector pixel *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7712 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7713 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7714 | } |
| 7715 | |
| 7716 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7717 | vec_stvx(vector int __a, int __b, vector int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7718 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7719 | __builtin_altivec_stvx(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7720 | } |
| 7721 | |
| 7722 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7723 | vec_stvx(vector int __a, int __b, int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7724 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7725 | __builtin_altivec_stvx(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7726 | } |
| 7727 | |
| 7728 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7729 | vec_stvx(vector unsigned int __a, int __b, vector unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7730 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7731 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7732 | } |
| 7733 | |
| 7734 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7735 | vec_stvx(vector unsigned int __a, int __b, unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7736 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7737 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7738 | } |
| 7739 | |
| 7740 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7741 | vec_stvx(vector bool int __a, int __b, int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7742 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7743 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7744 | } |
| 7745 | |
| 7746 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7747 | vec_stvx(vector bool int __a, int __b, unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7748 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7749 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7750 | } |
| 7751 | |
| 7752 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7753 | vec_stvx(vector bool int __a, int __b, vector bool int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7754 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7755 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7756 | } |
| 7757 | |
| 7758 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7759 | vec_stvx(vector float __a, int __b, vector float *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7760 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7761 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7762 | } |
| 7763 | |
| 7764 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7765 | vec_stvx(vector float __a, int __b, float *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7766 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7767 | __builtin_altivec_stvx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7768 | } |
| 7769 | |
| 7770 | /* vec_ste */ |
| 7771 | |
| 7772 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7773 | vec_ste(vector signed char __a, int __b, signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7774 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7775 | __builtin_altivec_stvebx((vector char)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7776 | } |
| 7777 | |
| 7778 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7779 | vec_ste(vector unsigned char __a, int __b, unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7780 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7781 | __builtin_altivec_stvebx((vector char)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7782 | } |
| 7783 | |
| 7784 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7785 | vec_ste(vector bool char __a, int __b, signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7786 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7787 | __builtin_altivec_stvebx((vector char)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7788 | } |
| 7789 | |
| 7790 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7791 | vec_ste(vector bool char __a, int __b, unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7792 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7793 | __builtin_altivec_stvebx((vector char)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7794 | } |
| 7795 | |
| 7796 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7797 | vec_ste(vector short __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7798 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7799 | __builtin_altivec_stvehx(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7800 | } |
| 7801 | |
| 7802 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7803 | vec_ste(vector unsigned short __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7804 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7805 | __builtin_altivec_stvehx((vector short)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7806 | } |
| 7807 | |
| 7808 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7809 | vec_ste(vector bool short __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7810 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7811 | __builtin_altivec_stvehx((vector short)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7812 | } |
| 7813 | |
| 7814 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7815 | vec_ste(vector bool short __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7816 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7817 | __builtin_altivec_stvehx((vector short)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7818 | } |
| 7819 | |
| 7820 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7821 | vec_ste(vector pixel __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7822 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7823 | __builtin_altivec_stvehx((vector short)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7824 | } |
| 7825 | |
| 7826 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7827 | vec_ste(vector pixel __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7828 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7829 | __builtin_altivec_stvehx((vector short)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7830 | } |
| 7831 | |
| 7832 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7833 | vec_ste(vector int __a, int __b, int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7834 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7835 | __builtin_altivec_stvewx(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7836 | } |
| 7837 | |
| 7838 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7839 | vec_ste(vector unsigned int __a, int __b, unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7840 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7841 | __builtin_altivec_stvewx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7842 | } |
| 7843 | |
| 7844 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7845 | vec_ste(vector bool int __a, int __b, int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7846 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7847 | __builtin_altivec_stvewx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7848 | } |
| 7849 | |
| 7850 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7851 | vec_ste(vector bool int __a, int __b, unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7852 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7853 | __builtin_altivec_stvewx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7854 | } |
| 7855 | |
| 7856 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7857 | vec_ste(vector float __a, int __b, float *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7858 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7859 | __builtin_altivec_stvewx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7860 | } |
| 7861 | |
| 7862 | /* vec_stvebx */ |
| 7863 | |
| 7864 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7865 | vec_stvebx(vector signed char __a, int __b, signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7866 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7867 | __builtin_altivec_stvebx((vector char)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7868 | } |
| 7869 | |
| 7870 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7871 | vec_stvebx(vector unsigned char __a, int __b, unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7872 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7873 | __builtin_altivec_stvebx((vector char)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7874 | } |
| 7875 | |
| 7876 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7877 | vec_stvebx(vector bool char __a, int __b, signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7878 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7879 | __builtin_altivec_stvebx((vector char)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7880 | } |
| 7881 | |
| 7882 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7883 | vec_stvebx(vector bool char __a, int __b, unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7884 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7885 | __builtin_altivec_stvebx((vector char)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7886 | } |
| 7887 | |
| 7888 | /* vec_stvehx */ |
| 7889 | |
| 7890 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7891 | vec_stvehx(vector short __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7892 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7893 | __builtin_altivec_stvehx(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7894 | } |
| 7895 | |
| 7896 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7897 | vec_stvehx(vector unsigned short __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7898 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7899 | __builtin_altivec_stvehx((vector short)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7900 | } |
| 7901 | |
| 7902 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7903 | vec_stvehx(vector bool short __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7904 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7905 | __builtin_altivec_stvehx((vector short)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7906 | } |
| 7907 | |
| 7908 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7909 | vec_stvehx(vector bool short __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7910 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7911 | __builtin_altivec_stvehx((vector short)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7912 | } |
| 7913 | |
| 7914 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7915 | vec_stvehx(vector pixel __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7916 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7917 | __builtin_altivec_stvehx((vector short)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7918 | } |
| 7919 | |
| 7920 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7921 | vec_stvehx(vector pixel __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7922 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7923 | __builtin_altivec_stvehx((vector short)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7924 | } |
| 7925 | |
| 7926 | /* vec_stvewx */ |
| 7927 | |
| 7928 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7929 | vec_stvewx(vector int __a, int __b, int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7930 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7931 | __builtin_altivec_stvewx(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7932 | } |
| 7933 | |
| 7934 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7935 | vec_stvewx(vector unsigned int __a, int __b, unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7936 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7937 | __builtin_altivec_stvewx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7938 | } |
| 7939 | |
| 7940 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7941 | vec_stvewx(vector bool int __a, int __b, int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7942 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7943 | __builtin_altivec_stvewx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7944 | } |
| 7945 | |
| 7946 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7947 | vec_stvewx(vector bool int __a, int __b, unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7948 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7949 | __builtin_altivec_stvewx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7950 | } |
| 7951 | |
| 7952 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7953 | vec_stvewx(vector float __a, int __b, float *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7954 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7955 | __builtin_altivec_stvewx((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7956 | } |
| 7957 | |
| 7958 | /* vec_stl */ |
| 7959 | |
| 7960 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7961 | vec_stl(vector signed char __a, int __b, vector signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7962 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7963 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7964 | } |
| 7965 | |
| 7966 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7967 | vec_stl(vector signed char __a, int __b, signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7968 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7969 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7970 | } |
| 7971 | |
| 7972 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7973 | vec_stl(vector unsigned char __a, int __b, vector unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7974 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7975 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7976 | } |
| 7977 | |
| 7978 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7979 | vec_stl(vector unsigned char __a, int __b, unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7980 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7981 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7982 | } |
| 7983 | |
| 7984 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7985 | vec_stl(vector bool char __a, int __b, signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7986 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7987 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7988 | } |
| 7989 | |
| 7990 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7991 | vec_stl(vector bool char __a, int __b, unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7992 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7993 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7994 | } |
| 7995 | |
| 7996 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7997 | vec_stl(vector bool char __a, int __b, vector bool char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 7998 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 7999 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8000 | } |
| 8001 | |
| 8002 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8003 | vec_stl(vector short __a, int __b, vector short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8004 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8005 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8006 | } |
| 8007 | |
| 8008 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8009 | vec_stl(vector short __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8010 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8011 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8012 | } |
| 8013 | |
| 8014 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8015 | vec_stl(vector unsigned short __a, int __b, vector unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8016 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8017 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8018 | } |
| 8019 | |
| 8020 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8021 | vec_stl(vector unsigned short __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8022 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8023 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8024 | } |
| 8025 | |
| 8026 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8027 | vec_stl(vector bool short __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8028 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8029 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8030 | } |
| 8031 | |
| 8032 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8033 | vec_stl(vector bool short __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8034 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8035 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8036 | } |
| 8037 | |
| 8038 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8039 | vec_stl(vector bool short __a, int __b, vector bool short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8040 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8041 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8042 | } |
| 8043 | |
| 8044 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8045 | vec_stl(vector pixel __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8046 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8047 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8048 | } |
| 8049 | |
| 8050 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8051 | vec_stl(vector pixel __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8052 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8053 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8054 | } |
| 8055 | |
| 8056 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8057 | vec_stl(vector pixel __a, int __b, vector pixel *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8058 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8059 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8060 | } |
| 8061 | |
| 8062 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8063 | vec_stl(vector int __a, int __b, vector int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8064 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8065 | __builtin_altivec_stvxl(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8066 | } |
| 8067 | |
| 8068 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8069 | vec_stl(vector int __a, int __b, int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8070 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8071 | __builtin_altivec_stvxl(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8072 | } |
| 8073 | |
| 8074 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8075 | vec_stl(vector unsigned int __a, int __b, vector unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8076 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8077 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8078 | } |
| 8079 | |
| 8080 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8081 | vec_stl(vector unsigned int __a, int __b, unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8082 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8083 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8084 | } |
| 8085 | |
| 8086 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8087 | vec_stl(vector bool int __a, int __b, int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8088 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8089 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8090 | } |
| 8091 | |
| 8092 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8093 | vec_stl(vector bool int __a, int __b, unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8094 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8095 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8096 | } |
| 8097 | |
| 8098 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8099 | vec_stl(vector bool int __a, int __b, vector bool int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8100 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8101 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8102 | } |
| 8103 | |
| 8104 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8105 | vec_stl(vector float __a, int __b, vector float *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8106 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8107 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8108 | } |
| 8109 | |
| 8110 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8111 | vec_stl(vector float __a, int __b, float *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8112 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8113 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8114 | } |
| 8115 | |
| 8116 | /* vec_stvxl */ |
| 8117 | |
| 8118 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8119 | vec_stvxl(vector signed char __a, int __b, vector signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8120 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8121 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8122 | } |
| 8123 | |
| 8124 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8125 | vec_stvxl(vector signed char __a, int __b, signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8126 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8127 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8128 | } |
| 8129 | |
| 8130 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8131 | vec_stvxl(vector unsigned char __a, int __b, vector unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8132 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8133 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8134 | } |
| 8135 | |
| 8136 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8137 | vec_stvxl(vector unsigned char __a, int __b, unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8138 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8139 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8140 | } |
| 8141 | |
| 8142 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8143 | vec_stvxl(vector bool char __a, int __b, signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8144 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8145 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8146 | } |
| 8147 | |
| 8148 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8149 | vec_stvxl(vector bool char __a, int __b, unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8150 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8151 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8152 | } |
| 8153 | |
| 8154 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8155 | vec_stvxl(vector bool char __a, int __b, vector bool char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8156 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8157 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8158 | } |
| 8159 | |
| 8160 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8161 | vec_stvxl(vector short __a, int __b, vector short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8162 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8163 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8164 | } |
| 8165 | |
| 8166 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8167 | vec_stvxl(vector short __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8168 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8169 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8170 | } |
| 8171 | |
| 8172 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8173 | vec_stvxl(vector unsigned short __a, int __b, vector unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8174 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8175 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8176 | } |
| 8177 | |
| 8178 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8179 | vec_stvxl(vector unsigned short __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8180 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8181 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8182 | } |
| 8183 | |
| 8184 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8185 | vec_stvxl(vector bool short __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8186 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8187 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8188 | } |
| 8189 | |
| 8190 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8191 | vec_stvxl(vector bool short __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8192 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8193 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8194 | } |
| 8195 | |
| 8196 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8197 | vec_stvxl(vector bool short __a, int __b, vector bool short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8198 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8199 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8200 | } |
| 8201 | |
| 8202 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8203 | vec_stvxl(vector pixel __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8204 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8205 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8206 | } |
| 8207 | |
| 8208 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8209 | vec_stvxl(vector pixel __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8210 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8211 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8212 | } |
| 8213 | |
| 8214 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8215 | vec_stvxl(vector pixel __a, int __b, vector pixel *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8216 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8217 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8218 | } |
| 8219 | |
| 8220 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8221 | vec_stvxl(vector int __a, int __b, vector int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8222 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8223 | __builtin_altivec_stvxl(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8224 | } |
| 8225 | |
| 8226 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8227 | vec_stvxl(vector int __a, int __b, int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8228 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8229 | __builtin_altivec_stvxl(__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8230 | } |
| 8231 | |
| 8232 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8233 | vec_stvxl(vector unsigned int __a, int __b, vector unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8234 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8235 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8236 | } |
| 8237 | |
| 8238 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8239 | vec_stvxl(vector unsigned int __a, int __b, unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8240 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8241 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8242 | } |
| 8243 | |
| 8244 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8245 | vec_stvxl(vector bool int __a, int __b, int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8246 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8247 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8248 | } |
| 8249 | |
| 8250 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8251 | vec_stvxl(vector bool int __a, int __b, unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8252 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8253 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8254 | } |
| 8255 | |
| 8256 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8257 | vec_stvxl(vector bool int __a, int __b, vector bool int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8258 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8259 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8260 | } |
| 8261 | |
| 8262 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8263 | vec_stvxl(vector float __a, int __b, vector float *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8264 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8265 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8266 | } |
| 8267 | |
| 8268 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8269 | vec_stvxl(vector float __a, int __b, float *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8270 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8271 | __builtin_altivec_stvxl((vector int)__a, __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8272 | } |
| 8273 | |
| 8274 | /* vec_sub */ |
| 8275 | |
| 8276 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8277 | vec_sub(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8278 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8279 | return __a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8280 | } |
| 8281 | |
| 8282 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8283 | vec_sub(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8284 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8285 | return (vector signed char)__a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8286 | } |
| 8287 | |
| 8288 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8289 | vec_sub(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8290 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8291 | return __a - (vector signed char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8292 | } |
| 8293 | |
| 8294 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8295 | vec_sub(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8296 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8297 | return __a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8298 | } |
| 8299 | |
| 8300 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8301 | vec_sub(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8302 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8303 | return (vector unsigned char)__a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8304 | } |
| 8305 | |
| 8306 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8307 | vec_sub(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8308 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8309 | return __a - (vector unsigned char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8310 | } |
| 8311 | |
| 8312 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8313 | vec_sub(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8314 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8315 | return __a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8316 | } |
| 8317 | |
| 8318 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8319 | vec_sub(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8320 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8321 | return (vector short)__a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8322 | } |
| 8323 | |
| 8324 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8325 | vec_sub(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8326 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8327 | return __a - (vector short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8328 | } |
| 8329 | |
| 8330 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8331 | vec_sub(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8332 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8333 | return __a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8334 | } |
| 8335 | |
| 8336 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8337 | vec_sub(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8338 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8339 | return (vector unsigned short)__a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8340 | } |
| 8341 | |
| 8342 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8343 | vec_sub(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8344 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8345 | return __a - (vector unsigned short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8346 | } |
| 8347 | |
| 8348 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8349 | vec_sub(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8350 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8351 | return __a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8352 | } |
| 8353 | |
| 8354 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8355 | vec_sub(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8356 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8357 | return (vector int)__a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8358 | } |
| 8359 | |
| 8360 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8361 | vec_sub(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8362 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8363 | return __a - (vector int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8364 | } |
| 8365 | |
| 8366 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8367 | vec_sub(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8368 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8369 | return __a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8370 | } |
| 8371 | |
| 8372 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8373 | vec_sub(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8374 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8375 | return (vector unsigned int)__a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8376 | } |
| 8377 | |
| 8378 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8379 | vec_sub(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8380 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8381 | return __a - (vector unsigned int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8382 | } |
| 8383 | |
| 8384 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8385 | vec_sub(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8386 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8387 | return __a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8388 | } |
| 8389 | |
| 8390 | /* vec_vsububm */ |
| 8391 | |
| 8392 | #define __builtin_altivec_vsububm vec_vsububm |
| 8393 | |
| 8394 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8395 | vec_vsububm(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8396 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8397 | return __a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8398 | } |
| 8399 | |
| 8400 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8401 | vec_vsububm(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8402 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8403 | return (vector signed char)__a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8404 | } |
| 8405 | |
| 8406 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8407 | vec_vsububm(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8408 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8409 | return __a - (vector signed char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8410 | } |
| 8411 | |
| 8412 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8413 | vec_vsububm(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8414 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8415 | return __a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8416 | } |
| 8417 | |
| 8418 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8419 | vec_vsububm(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8420 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8421 | return (vector unsigned char)__a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8422 | } |
| 8423 | |
| 8424 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8425 | vec_vsububm(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8426 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8427 | return __a - (vector unsigned char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8428 | } |
| 8429 | |
| 8430 | /* vec_vsubuhm */ |
| 8431 | |
| 8432 | #define __builtin_altivec_vsubuhm vec_vsubuhm |
| 8433 | |
| 8434 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8435 | vec_vsubuhm(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8436 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8437 | return __a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8438 | } |
| 8439 | |
| 8440 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8441 | vec_vsubuhm(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8442 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8443 | return (vector short)__a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8444 | } |
| 8445 | |
| 8446 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8447 | vec_vsubuhm(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8448 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8449 | return __a - (vector short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8450 | } |
| 8451 | |
| 8452 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8453 | vec_vsubuhm(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8454 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8455 | return __a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8456 | } |
| 8457 | |
| 8458 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8459 | vec_vsubuhm(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8460 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8461 | return (vector unsigned short)__a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8462 | } |
| 8463 | |
| 8464 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8465 | vec_vsubuhm(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8466 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8467 | return __a - (vector unsigned short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8468 | } |
| 8469 | |
| 8470 | /* vec_vsubuwm */ |
| 8471 | |
| 8472 | #define __builtin_altivec_vsubuwm vec_vsubuwm |
| 8473 | |
| 8474 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8475 | vec_vsubuwm(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8476 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8477 | return __a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8478 | } |
| 8479 | |
| 8480 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8481 | vec_vsubuwm(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8482 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8483 | return (vector int)__a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8484 | } |
| 8485 | |
| 8486 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8487 | vec_vsubuwm(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8488 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8489 | return __a - (vector int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8490 | } |
| 8491 | |
| 8492 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8493 | vec_vsubuwm(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8494 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8495 | return __a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8496 | } |
| 8497 | |
| 8498 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8499 | vec_vsubuwm(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8500 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8501 | return (vector unsigned int)__a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8502 | } |
| 8503 | |
| 8504 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8505 | vec_vsubuwm(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8506 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8507 | return __a - (vector unsigned int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8508 | } |
| 8509 | |
| 8510 | /* vec_vsubfp */ |
| 8511 | |
| 8512 | #define __builtin_altivec_vsubfp vec_vsubfp |
| 8513 | |
| 8514 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8515 | vec_vsubfp(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8516 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8517 | return __a - __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8518 | } |
| 8519 | |
| 8520 | /* vec_subc */ |
| 8521 | |
| 8522 | static vector unsigned int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8523 | vec_subc(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8524 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8525 | return __builtin_altivec_vsubcuw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8526 | } |
| 8527 | |
| 8528 | /* vec_vsubcuw */ |
| 8529 | |
| 8530 | static vector unsigned int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8531 | vec_vsubcuw(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8532 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8533 | return __builtin_altivec_vsubcuw(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8534 | } |
| 8535 | |
| 8536 | /* vec_subs */ |
| 8537 | |
| 8538 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8539 | vec_subs(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8540 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8541 | return __builtin_altivec_vsubsbs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8542 | } |
| 8543 | |
| 8544 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8545 | vec_subs(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8546 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8547 | return __builtin_altivec_vsubsbs((vector signed char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8548 | } |
| 8549 | |
| 8550 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8551 | vec_subs(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8552 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8553 | return __builtin_altivec_vsubsbs(__a, (vector signed char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8554 | } |
| 8555 | |
| 8556 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8557 | vec_subs(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8558 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8559 | return __builtin_altivec_vsububs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8560 | } |
| 8561 | |
| 8562 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8563 | vec_subs(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8564 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8565 | return __builtin_altivec_vsububs((vector unsigned char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8566 | } |
| 8567 | |
| 8568 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8569 | vec_subs(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8570 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8571 | return __builtin_altivec_vsububs(__a, (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8572 | } |
| 8573 | |
| 8574 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8575 | vec_subs(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8576 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8577 | return __builtin_altivec_vsubshs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8578 | } |
| 8579 | |
| 8580 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8581 | vec_subs(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8582 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8583 | return __builtin_altivec_vsubshs((vector short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8584 | } |
| 8585 | |
| 8586 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8587 | vec_subs(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8588 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8589 | return __builtin_altivec_vsubshs(__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8590 | } |
| 8591 | |
| 8592 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8593 | vec_subs(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8594 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8595 | return __builtin_altivec_vsubuhs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8596 | } |
| 8597 | |
| 8598 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8599 | vec_subs(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8600 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8601 | return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8602 | } |
| 8603 | |
| 8604 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8605 | vec_subs(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8606 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8607 | return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8608 | } |
| 8609 | |
| 8610 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8611 | vec_subs(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8612 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8613 | return __builtin_altivec_vsubsws(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8614 | } |
| 8615 | |
| 8616 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8617 | vec_subs(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8618 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8619 | return __builtin_altivec_vsubsws((vector int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8620 | } |
| 8621 | |
| 8622 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8623 | vec_subs(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8624 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8625 | return __builtin_altivec_vsubsws(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8626 | } |
| 8627 | |
| 8628 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8629 | vec_subs(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8630 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8631 | return __builtin_altivec_vsubuws(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8632 | } |
| 8633 | |
| 8634 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8635 | vec_subs(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8636 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8637 | return __builtin_altivec_vsubuws((vector unsigned int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8638 | } |
| 8639 | |
| 8640 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8641 | vec_subs(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8642 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8643 | return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8644 | } |
| 8645 | |
| 8646 | /* vec_vsubsbs */ |
| 8647 | |
| 8648 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8649 | vec_vsubsbs(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8650 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8651 | return __builtin_altivec_vsubsbs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8652 | } |
| 8653 | |
| 8654 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8655 | vec_vsubsbs(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8656 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8657 | return __builtin_altivec_vsubsbs((vector signed char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8658 | } |
| 8659 | |
| 8660 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8661 | vec_vsubsbs(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8662 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8663 | return __builtin_altivec_vsubsbs(__a, (vector signed char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8664 | } |
| 8665 | |
| 8666 | /* vec_vsububs */ |
| 8667 | |
| 8668 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8669 | vec_vsububs(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8670 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8671 | return __builtin_altivec_vsububs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8672 | } |
| 8673 | |
| 8674 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8675 | vec_vsububs(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8676 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8677 | return __builtin_altivec_vsububs((vector unsigned char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8678 | } |
| 8679 | |
| 8680 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8681 | vec_vsububs(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8682 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8683 | return __builtin_altivec_vsububs(__a, (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8684 | } |
| 8685 | |
| 8686 | /* vec_vsubshs */ |
| 8687 | |
| 8688 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8689 | vec_vsubshs(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8690 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8691 | return __builtin_altivec_vsubshs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8692 | } |
| 8693 | |
| 8694 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8695 | vec_vsubshs(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8696 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8697 | return __builtin_altivec_vsubshs((vector short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8698 | } |
| 8699 | |
| 8700 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8701 | vec_vsubshs(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8702 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8703 | return __builtin_altivec_vsubshs(__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8704 | } |
| 8705 | |
| 8706 | /* vec_vsubuhs */ |
| 8707 | |
| 8708 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8709 | vec_vsubuhs(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8710 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8711 | return __builtin_altivec_vsubuhs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8712 | } |
| 8713 | |
| 8714 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8715 | vec_vsubuhs(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8716 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8717 | return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8718 | } |
| 8719 | |
| 8720 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8721 | vec_vsubuhs(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8722 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8723 | return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8724 | } |
| 8725 | |
| 8726 | /* vec_vsubsws */ |
| 8727 | |
| 8728 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8729 | vec_vsubsws(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8730 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8731 | return __builtin_altivec_vsubsws(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8732 | } |
| 8733 | |
| 8734 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8735 | vec_vsubsws(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8736 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8737 | return __builtin_altivec_vsubsws((vector int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8738 | } |
| 8739 | |
| 8740 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8741 | vec_vsubsws(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8742 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8743 | return __builtin_altivec_vsubsws(__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8744 | } |
| 8745 | |
| 8746 | /* vec_vsubuws */ |
| 8747 | |
| 8748 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8749 | vec_vsubuws(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8750 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8751 | return __builtin_altivec_vsubuws(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8752 | } |
| 8753 | |
| 8754 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8755 | vec_vsubuws(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8756 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8757 | return __builtin_altivec_vsubuws((vector unsigned int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8758 | } |
| 8759 | |
| 8760 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8761 | vec_vsubuws(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8762 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8763 | return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8764 | } |
| 8765 | |
| 8766 | /* vec_sum4s */ |
| 8767 | |
| 8768 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8769 | vec_sum4s(vector signed char __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8770 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8771 | return __builtin_altivec_vsum4sbs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8772 | } |
| 8773 | |
| 8774 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8775 | vec_sum4s(vector unsigned char __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8776 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8777 | return __builtin_altivec_vsum4ubs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8778 | } |
| 8779 | |
| 8780 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8781 | vec_sum4s(vector signed short __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8782 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8783 | return __builtin_altivec_vsum4shs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8784 | } |
| 8785 | |
| 8786 | /* vec_vsum4sbs */ |
| 8787 | |
| 8788 | static vector int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8789 | vec_vsum4sbs(vector signed char __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8790 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8791 | return __builtin_altivec_vsum4sbs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8792 | } |
| 8793 | |
| 8794 | /* vec_vsum4ubs */ |
| 8795 | |
| 8796 | static vector unsigned int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8797 | vec_vsum4ubs(vector unsigned char __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8798 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8799 | return __builtin_altivec_vsum4ubs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8800 | } |
| 8801 | |
| 8802 | /* vec_vsum4shs */ |
| 8803 | |
| 8804 | static vector int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8805 | vec_vsum4shs(vector signed short __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8806 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8807 | return __builtin_altivec_vsum4shs(__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8808 | } |
| 8809 | |
| 8810 | /* vec_sum2s */ |
| 8811 | |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8812 | /* The vsum2sws instruction has a big-endian bias, so that the second |
| 8813 | input vector and the result always reference big-endian elements |
| 8814 | 1 and 3 (little-endian element 0 and 2). For ease of porting the |
| 8815 | programmer wants elements 1 and 3 in both cases, so for little |
| 8816 | endian we must perform some permutes. */ |
| 8817 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8818 | static vector signed int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8819 | vec_sum2s(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8820 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8821 | #ifdef __LITTLE_ENDIAN__ |
| 8822 | vector int __c = (vector signed int) |
| 8823 | vec_perm(__b, __b, (vector unsigned char) |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 8824 | (4,5,6,7,0,1,2,3,12,13,14,15,8,9,10,11)); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8825 | __c = __builtin_altivec_vsum2sws(__a, __c); |
| 8826 | return (vector signed int) |
| 8827 | vec_perm(__c, __c, (vector unsigned char) |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 8828 | (4,5,6,7,0,1,2,3,12,13,14,15,8,9,10,11)); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8829 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8830 | return __builtin_altivec_vsum2sws(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8831 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8832 | } |
| 8833 | |
| 8834 | /* vec_vsum2sws */ |
| 8835 | |
| 8836 | static vector signed int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8837 | vec_vsum2sws(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8838 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8839 | #ifdef __LITTLE_ENDIAN__ |
| 8840 | vector int __c = (vector signed int) |
| 8841 | vec_perm(__b, __b, (vector unsigned char) |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 8842 | (4,5,6,7,0,1,2,3,12,13,14,15,8,9,10,11)); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8843 | __c = __builtin_altivec_vsum2sws(__a, __c); |
| 8844 | return (vector signed int) |
| 8845 | vec_perm(__c, __c, (vector unsigned char) |
Stephen Hines | b4d9c8b | 2015-03-30 16:04:04 -0700 | [diff] [blame] | 8846 | (4,5,6,7,0,1,2,3,12,13,14,15,8,9,10,11)); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8847 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8848 | return __builtin_altivec_vsum2sws(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8849 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8850 | } |
| 8851 | |
| 8852 | /* vec_sums */ |
| 8853 | |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8854 | /* The vsumsws instruction has a big-endian bias, so that the second |
| 8855 | input vector and the result always reference big-endian element 3 |
| 8856 | (little-endian element 0). For ease of porting the programmer |
| 8857 | wants element 3 in both cases, so for little endian we must perform |
| 8858 | some permutes. */ |
| 8859 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8860 | static vector signed int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8861 | vec_sums(vector signed int __a, vector signed int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8862 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8863 | #ifdef __LITTLE_ENDIAN__ |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 8864 | __b = (vector signed int)vec_splat(__b, 3); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8865 | __b = __builtin_altivec_vsumsws(__a, __b); |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 8866 | return (vector signed int)(0, 0, 0, __b[0]); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8867 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8868 | return __builtin_altivec_vsumsws(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8869 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8870 | } |
| 8871 | |
| 8872 | /* vec_vsumsws */ |
| 8873 | |
| 8874 | static vector signed int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8875 | vec_vsumsws(vector signed int __a, vector signed int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8876 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8877 | #ifdef __LITTLE_ENDIAN__ |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 8878 | __b = (vector signed int)vec_splat(__b, 3); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8879 | __b = __builtin_altivec_vsumsws(__a, __b); |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 8880 | return (vector signed int)(0, 0, 0, __b[0]); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8881 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8882 | return __builtin_altivec_vsumsws(__a, __b); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8883 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8884 | } |
| 8885 | |
| 8886 | /* vec_trunc */ |
| 8887 | |
| 8888 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8889 | vec_trunc(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8890 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8891 | return __builtin_altivec_vrfiz(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8892 | } |
| 8893 | |
| 8894 | /* vec_vrfiz */ |
| 8895 | |
| 8896 | static vector float __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8897 | vec_vrfiz(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8898 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8899 | return __builtin_altivec_vrfiz(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8900 | } |
| 8901 | |
| 8902 | /* vec_unpackh */ |
| 8903 | |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8904 | /* The vector unpack instructions all have a big-endian bias, so for |
| 8905 | little endian we must reverse the meanings of "high" and "low." */ |
| 8906 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8907 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8908 | vec_unpackh(vector signed char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8909 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8910 | #ifdef __LITTLE_ENDIAN__ |
| 8911 | return __builtin_altivec_vupklsb((vector char)__a); |
| 8912 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8913 | return __builtin_altivec_vupkhsb((vector char)__a); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8914 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8915 | } |
| 8916 | |
| 8917 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8918 | vec_unpackh(vector bool char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8919 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8920 | #ifdef __LITTLE_ENDIAN__ |
| 8921 | return (vector bool short)__builtin_altivec_vupklsb((vector char)__a); |
| 8922 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8923 | return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8924 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8925 | } |
| 8926 | |
| 8927 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8928 | vec_unpackh(vector short __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8929 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8930 | #ifdef __LITTLE_ENDIAN__ |
| 8931 | return __builtin_altivec_vupklsh(__a); |
| 8932 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8933 | return __builtin_altivec_vupkhsh(__a); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8934 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8935 | } |
| 8936 | |
| 8937 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8938 | vec_unpackh(vector bool short __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8939 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8940 | #ifdef __LITTLE_ENDIAN__ |
| 8941 | return (vector bool int)__builtin_altivec_vupklsh((vector short)__a); |
| 8942 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8943 | return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8944 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8945 | } |
| 8946 | |
| 8947 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8948 | vec_unpackh(vector pixel __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8949 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8950 | #ifdef __LITTLE_ENDIAN__ |
| 8951 | return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a); |
| 8952 | #else |
| 8953 | return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a); |
| 8954 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8955 | } |
| 8956 | |
| 8957 | /* vec_vupkhsb */ |
| 8958 | |
| 8959 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8960 | vec_vupkhsb(vector signed char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8961 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8962 | #ifdef __LITTLE_ENDIAN__ |
| 8963 | return __builtin_altivec_vupklsb((vector char)__a); |
| 8964 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8965 | return __builtin_altivec_vupkhsb((vector char)__a); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8966 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8967 | } |
| 8968 | |
| 8969 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8970 | vec_vupkhsb(vector bool char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8971 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8972 | #ifdef __LITTLE_ENDIAN__ |
| 8973 | return (vector bool short)__builtin_altivec_vupklsb((vector char)__a); |
| 8974 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8975 | return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8976 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8977 | } |
| 8978 | |
| 8979 | /* vec_vupkhsh */ |
| 8980 | |
| 8981 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8982 | vec_vupkhsh(vector short __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8983 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8984 | #ifdef __LITTLE_ENDIAN__ |
| 8985 | return __builtin_altivec_vupklsh(__a); |
| 8986 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8987 | return __builtin_altivec_vupkhsh(__a); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8988 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8989 | } |
| 8990 | |
| 8991 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8992 | vec_vupkhsh(vector bool short __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8993 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8994 | #ifdef __LITTLE_ENDIAN__ |
| 8995 | return (vector bool int)__builtin_altivec_vupklsh((vector short)__a); |
| 8996 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 8997 | return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 8998 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 8999 | } |
| 9000 | |
| 9001 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9002 | vec_vupkhsh(vector pixel __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9003 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9004 | #ifdef __LITTLE_ENDIAN__ |
| 9005 | return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a); |
| 9006 | #else |
| 9007 | return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a); |
| 9008 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9009 | } |
| 9010 | |
| 9011 | /* vec_unpackl */ |
| 9012 | |
| 9013 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9014 | vec_unpackl(vector signed char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9015 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9016 | #ifdef __LITTLE_ENDIAN__ |
| 9017 | return __builtin_altivec_vupkhsb((vector char)__a); |
| 9018 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9019 | return __builtin_altivec_vupklsb((vector char)__a); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9020 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9021 | } |
| 9022 | |
| 9023 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9024 | vec_unpackl(vector bool char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9025 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9026 | #ifdef __LITTLE_ENDIAN__ |
| 9027 | return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a); |
| 9028 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9029 | return (vector bool short)__builtin_altivec_vupklsb((vector char)__a); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9030 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9031 | } |
| 9032 | |
| 9033 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9034 | vec_unpackl(vector short __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9035 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9036 | #ifdef __LITTLE_ENDIAN__ |
| 9037 | return __builtin_altivec_vupkhsh(__a); |
| 9038 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9039 | return __builtin_altivec_vupklsh(__a); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9040 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9041 | } |
| 9042 | |
| 9043 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9044 | vec_unpackl(vector bool short __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9045 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9046 | #ifdef __LITTLE_ENDIAN__ |
| 9047 | return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a); |
| 9048 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9049 | return (vector bool int)__builtin_altivec_vupklsh((vector short)__a); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9050 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9051 | } |
| 9052 | |
| 9053 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9054 | vec_unpackl(vector pixel __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9055 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9056 | #ifdef __LITTLE_ENDIAN__ |
| 9057 | return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a); |
| 9058 | #else |
| 9059 | return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a); |
| 9060 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9061 | } |
| 9062 | |
| 9063 | /* vec_vupklsb */ |
| 9064 | |
| 9065 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9066 | vec_vupklsb(vector signed char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9067 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9068 | #ifdef __LITTLE_ENDIAN__ |
| 9069 | return __builtin_altivec_vupkhsb((vector char)__a); |
| 9070 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9071 | return __builtin_altivec_vupklsb((vector char)__a); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9072 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9073 | } |
| 9074 | |
| 9075 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9076 | vec_vupklsb(vector bool char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9077 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9078 | #ifdef __LITTLE_ENDIAN__ |
| 9079 | return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a); |
| 9080 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9081 | return (vector bool short)__builtin_altivec_vupklsb((vector char)__a); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9082 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9083 | } |
| 9084 | |
| 9085 | /* vec_vupklsh */ |
| 9086 | |
| 9087 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9088 | vec_vupklsh(vector short __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9089 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9090 | #ifdef __LITTLE_ENDIAN__ |
| 9091 | return __builtin_altivec_vupkhsh(__a); |
| 9092 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9093 | return __builtin_altivec_vupklsh(__a); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9094 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9095 | } |
| 9096 | |
| 9097 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9098 | vec_vupklsh(vector bool short __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9099 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9100 | #ifdef __LITTLE_ENDIAN__ |
| 9101 | return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a); |
| 9102 | #else |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9103 | return (vector bool int)__builtin_altivec_vupklsh((vector short)__a); |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9104 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9105 | } |
| 9106 | |
| 9107 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9108 | vec_vupklsh(vector pixel __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9109 | { |
Stephen Hines | 990d2fc | 2014-07-23 10:40:48 -0700 | [diff] [blame] | 9110 | #ifdef __LITTLE_ENDIAN__ |
| 9111 | return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a); |
| 9112 | #else |
| 9113 | return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a); |
| 9114 | #endif |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9115 | } |
| 9116 | |
Stephen Hines | ee4ca28 | 2014-12-02 17:05:12 -0800 | [diff] [blame] | 9117 | /* vec_vsx_ld */ |
| 9118 | |
| 9119 | #ifdef __VSX__ |
| 9120 | |
| 9121 | static vector signed int __ATTRS_o_ai |
| 9122 | vec_vsx_ld(int __a, const vector signed int *__b) |
| 9123 | { |
| 9124 | return (vector signed int)__builtin_vsx_lxvw4x(__a, __b); |
| 9125 | } |
| 9126 | |
| 9127 | static vector unsigned int __ATTRS_o_ai |
| 9128 | vec_vsx_ld(int __a, const vector unsigned int *__b) |
| 9129 | { |
| 9130 | return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b); |
| 9131 | } |
| 9132 | |
| 9133 | static vector float __ATTRS_o_ai |
| 9134 | vec_vsx_ld(int __a, const vector float *__b) |
| 9135 | { |
| 9136 | return (vector float)__builtin_vsx_lxvw4x(__a, __b); |
| 9137 | } |
| 9138 | |
| 9139 | static vector signed long long __ATTRS_o_ai |
| 9140 | vec_vsx_ld(int __a, const vector signed long long *__b) |
| 9141 | { |
| 9142 | return (vector signed long long)__builtin_vsx_lxvd2x(__a, __b); |
| 9143 | } |
| 9144 | |
| 9145 | static vector unsigned long long __ATTRS_o_ai |
| 9146 | vec_vsx_ld(int __a, const vector unsigned long long *__b) |
| 9147 | { |
| 9148 | return (vector unsigned long long)__builtin_vsx_lxvd2x(__a, __b); |
| 9149 | } |
| 9150 | |
| 9151 | static vector double __ATTRS_o_ai |
| 9152 | vec_vsx_ld(int __a, const vector double *__b) |
| 9153 | { |
| 9154 | return (vector double)__builtin_vsx_lxvd2x(__a, __b); |
| 9155 | } |
| 9156 | |
| 9157 | #endif |
| 9158 | |
| 9159 | /* vec_vsx_st */ |
| 9160 | |
| 9161 | #ifdef __VSX__ |
| 9162 | |
| 9163 | static void __ATTRS_o_ai |
| 9164 | vec_vsx_st(vector signed int __a, int __b, vector signed int *__c) |
| 9165 | { |
| 9166 | __builtin_vsx_stxvw4x((vector int)__a, __b, __c); |
| 9167 | } |
| 9168 | |
| 9169 | static void __ATTRS_o_ai |
| 9170 | vec_vsx_st(vector unsigned int __a, int __b, vector unsigned int *__c) |
| 9171 | { |
| 9172 | __builtin_vsx_stxvw4x((vector int)__a, __b, __c); |
| 9173 | } |
| 9174 | |
| 9175 | static void __ATTRS_o_ai |
| 9176 | vec_vsx_st(vector float __a, int __b, vector float *__c) |
| 9177 | { |
| 9178 | __builtin_vsx_stxvw4x((vector int)__a, __b, __c); |
| 9179 | } |
| 9180 | |
| 9181 | static void __ATTRS_o_ai |
| 9182 | vec_vsx_st(vector signed long long __a, int __b, vector signed long long *__c) |
| 9183 | { |
| 9184 | __builtin_vsx_stxvd2x((vector double)__a, __b, __c); |
| 9185 | } |
| 9186 | |
| 9187 | static void __ATTRS_o_ai |
| 9188 | vec_vsx_st(vector unsigned long long __a, int __b, |
| 9189 | vector unsigned long long *__c) |
| 9190 | { |
| 9191 | __builtin_vsx_stxvd2x((vector double)__a, __b, __c); |
| 9192 | } |
| 9193 | |
| 9194 | static void __ATTRS_o_ai |
| 9195 | vec_vsx_st(vector double __a, int __b, vector double *__c) |
| 9196 | { |
| 9197 | __builtin_vsx_stxvd2x((vector double)__a, __b, __c); |
| 9198 | } |
| 9199 | |
| 9200 | #endif |
| 9201 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9202 | /* vec_xor */ |
| 9203 | |
| 9204 | #define __builtin_altivec_vxor vec_xor |
| 9205 | |
| 9206 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9207 | vec_xor(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9208 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9209 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9210 | } |
| 9211 | |
| 9212 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9213 | vec_xor(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9214 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9215 | return (vector signed char)__a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9216 | } |
| 9217 | |
| 9218 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9219 | vec_xor(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9220 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9221 | return __a ^ (vector signed char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9222 | } |
| 9223 | |
| 9224 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9225 | vec_xor(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9226 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9227 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9228 | } |
| 9229 | |
| 9230 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9231 | vec_xor(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9232 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9233 | return (vector unsigned char)__a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9234 | } |
| 9235 | |
| 9236 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9237 | vec_xor(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9238 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9239 | return __a ^ (vector unsigned char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9240 | } |
| 9241 | |
| 9242 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9243 | vec_xor(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9244 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9245 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9246 | } |
| 9247 | |
| 9248 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9249 | vec_xor(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9250 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9251 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9252 | } |
| 9253 | |
| 9254 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9255 | vec_xor(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9256 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9257 | return (vector short)__a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9258 | } |
| 9259 | |
| 9260 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9261 | vec_xor(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9262 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9263 | return __a ^ (vector short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9264 | } |
| 9265 | |
| 9266 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9267 | vec_xor(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9268 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9269 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9270 | } |
| 9271 | |
| 9272 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9273 | vec_xor(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9274 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9275 | return (vector unsigned short)__a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9276 | } |
| 9277 | |
| 9278 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9279 | vec_xor(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9280 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9281 | return __a ^ (vector unsigned short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9282 | } |
| 9283 | |
| 9284 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9285 | vec_xor(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9286 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9287 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9288 | } |
| 9289 | |
| 9290 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9291 | vec_xor(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9292 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9293 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9294 | } |
| 9295 | |
| 9296 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9297 | vec_xor(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9298 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9299 | return (vector int)__a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9300 | } |
| 9301 | |
| 9302 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9303 | vec_xor(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9304 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9305 | return __a ^ (vector int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9306 | } |
| 9307 | |
| 9308 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9309 | vec_xor(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9310 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9311 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9312 | } |
| 9313 | |
| 9314 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9315 | vec_xor(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9316 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9317 | return (vector unsigned int)__a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9318 | } |
| 9319 | |
| 9320 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9321 | vec_xor(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9322 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9323 | return __a ^ (vector unsigned int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9324 | } |
| 9325 | |
| 9326 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9327 | vec_xor(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9328 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9329 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9330 | } |
| 9331 | |
| 9332 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9333 | vec_xor(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9334 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9335 | vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b; |
| 9336 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9337 | } |
| 9338 | |
| 9339 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9340 | vec_xor(vector bool int __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9341 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9342 | vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b; |
| 9343 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9344 | } |
| 9345 | |
| 9346 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9347 | vec_xor(vector float __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9348 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9349 | vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b; |
| 9350 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9351 | } |
| 9352 | |
| 9353 | /* vec_vxor */ |
| 9354 | |
| 9355 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9356 | vec_vxor(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9357 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9358 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9359 | } |
| 9360 | |
| 9361 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9362 | vec_vxor(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9363 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9364 | return (vector signed char)__a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9365 | } |
| 9366 | |
| 9367 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9368 | vec_vxor(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9369 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9370 | return __a ^ (vector signed char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9371 | } |
| 9372 | |
| 9373 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9374 | vec_vxor(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9375 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9376 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9377 | } |
| 9378 | |
| 9379 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9380 | vec_vxor(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9381 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9382 | return (vector unsigned char)__a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9383 | } |
| 9384 | |
| 9385 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9386 | vec_vxor(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9387 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9388 | return __a ^ (vector unsigned char)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9389 | } |
| 9390 | |
| 9391 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9392 | vec_vxor(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9393 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9394 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9395 | } |
| 9396 | |
| 9397 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9398 | vec_vxor(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9399 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9400 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9401 | } |
| 9402 | |
| 9403 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9404 | vec_vxor(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9405 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9406 | return (vector short)__a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9407 | } |
| 9408 | |
| 9409 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9410 | vec_vxor(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9411 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9412 | return __a ^ (vector short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9413 | } |
| 9414 | |
| 9415 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9416 | vec_vxor(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9417 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9418 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9419 | } |
| 9420 | |
| 9421 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9422 | vec_vxor(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9423 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9424 | return (vector unsigned short)__a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9425 | } |
| 9426 | |
| 9427 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9428 | vec_vxor(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9429 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9430 | return __a ^ (vector unsigned short)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9431 | } |
| 9432 | |
| 9433 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9434 | vec_vxor(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9435 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9436 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9437 | } |
| 9438 | |
| 9439 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9440 | vec_vxor(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9441 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9442 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9443 | } |
| 9444 | |
| 9445 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9446 | vec_vxor(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9447 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9448 | return (vector int)__a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9449 | } |
| 9450 | |
| 9451 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9452 | vec_vxor(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9453 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9454 | return __a ^ (vector int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9455 | } |
| 9456 | |
| 9457 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9458 | vec_vxor(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9459 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9460 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9461 | } |
| 9462 | |
| 9463 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9464 | vec_vxor(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9465 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9466 | return (vector unsigned int)__a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9467 | } |
| 9468 | |
| 9469 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9470 | vec_vxor(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9471 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9472 | return __a ^ (vector unsigned int)__b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9473 | } |
| 9474 | |
| 9475 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9476 | vec_vxor(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9477 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9478 | return __a ^ __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9479 | } |
| 9480 | |
| 9481 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9482 | vec_vxor(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9483 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9484 | vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b; |
| 9485 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9486 | } |
| 9487 | |
| 9488 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9489 | vec_vxor(vector bool int __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9490 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9491 | vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b; |
| 9492 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9493 | } |
| 9494 | |
| 9495 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9496 | vec_vxor(vector float __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9497 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9498 | vector unsigned int __res = (vector unsigned int)__a ^ (vector unsigned int)__b; |
| 9499 | return (vector float)__res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9500 | } |
| 9501 | |
| 9502 | /* ------------------------ extensions for CBEA ----------------------------- */ |
| 9503 | |
| 9504 | /* vec_extract */ |
| 9505 | |
| 9506 | static signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9507 | vec_extract(vector signed char __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9508 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9509 | return __a[__b]; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9510 | } |
| 9511 | |
| 9512 | static unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9513 | vec_extract(vector unsigned char __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9514 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9515 | return __a[__b]; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9516 | } |
| 9517 | |
| 9518 | static short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9519 | vec_extract(vector short __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9520 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9521 | return __a[__b]; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9522 | } |
| 9523 | |
| 9524 | static unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9525 | vec_extract(vector unsigned short __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9526 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9527 | return __a[__b]; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9528 | } |
| 9529 | |
| 9530 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9531 | vec_extract(vector int __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9532 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9533 | return __a[__b]; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9534 | } |
| 9535 | |
| 9536 | static unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9537 | vec_extract(vector unsigned int __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9538 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9539 | return __a[__b]; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9540 | } |
| 9541 | |
| 9542 | static float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9543 | vec_extract(vector float __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9544 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9545 | return __a[__b]; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9546 | } |
| 9547 | |
| 9548 | /* vec_insert */ |
| 9549 | |
| 9550 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9551 | vec_insert(signed char __a, vector signed char __b, int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9552 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9553 | __b[__c] = __a; |
| 9554 | return __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9555 | } |
| 9556 | |
| 9557 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9558 | vec_insert(unsigned char __a, vector unsigned char __b, int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9559 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9560 | __b[__c] = __a; |
| 9561 | return __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9562 | } |
| 9563 | |
| 9564 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9565 | vec_insert(short __a, vector short __b, int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9566 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9567 | __b[__c] = __a; |
| 9568 | return __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9569 | } |
| 9570 | |
| 9571 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9572 | vec_insert(unsigned short __a, vector unsigned short __b, int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9573 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9574 | __b[__c] = __a; |
| 9575 | return __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9576 | } |
| 9577 | |
| 9578 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9579 | vec_insert(int __a, vector int __b, int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9580 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9581 | __b[__c] = __a; |
| 9582 | return __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9583 | } |
| 9584 | |
| 9585 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9586 | vec_insert(unsigned int __a, vector unsigned int __b, int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9587 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9588 | __b[__c] = __a; |
| 9589 | return __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9590 | } |
| 9591 | |
| 9592 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9593 | vec_insert(float __a, vector float __b, int __c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9594 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9595 | __b[__c] = __a; |
| 9596 | return __b; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9597 | } |
| 9598 | |
| 9599 | /* vec_lvlx */ |
| 9600 | |
| 9601 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9602 | vec_lvlx(int __a, const signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9603 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9604 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9605 | (vector signed char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9606 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9607 | } |
| 9608 | |
| 9609 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9610 | vec_lvlx(int __a, const vector signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9611 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9612 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9613 | (vector signed char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9614 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9615 | } |
| 9616 | |
| 9617 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9618 | vec_lvlx(int __a, const unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9619 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9620 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9621 | (vector unsigned char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9622 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9623 | } |
| 9624 | |
| 9625 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9626 | vec_lvlx(int __a, const vector unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9627 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9628 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9629 | (vector unsigned char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9630 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9631 | } |
| 9632 | |
| 9633 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9634 | vec_lvlx(int __a, const vector bool char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9635 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9636 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9637 | (vector bool char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9638 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9639 | } |
| 9640 | |
| 9641 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9642 | vec_lvlx(int __a, const short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9643 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9644 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9645 | (vector short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9646 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9647 | } |
| 9648 | |
| 9649 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9650 | vec_lvlx(int __a, const vector short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9651 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9652 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9653 | (vector short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9654 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9655 | } |
| 9656 | |
| 9657 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9658 | vec_lvlx(int __a, const unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9659 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9660 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9661 | (vector unsigned short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9662 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9663 | } |
| 9664 | |
| 9665 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9666 | vec_lvlx(int __a, const vector unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9667 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9668 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9669 | (vector unsigned short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9670 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9671 | } |
| 9672 | |
| 9673 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9674 | vec_lvlx(int __a, const vector bool short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9675 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9676 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9677 | (vector bool short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9678 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9679 | } |
| 9680 | |
| 9681 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9682 | vec_lvlx(int __a, const vector pixel *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9683 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9684 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9685 | (vector pixel)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9686 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9687 | } |
| 9688 | |
| 9689 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9690 | vec_lvlx(int __a, const int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9691 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9692 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9693 | (vector int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9694 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9695 | } |
| 9696 | |
| 9697 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9698 | vec_lvlx(int __a, const vector int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9699 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9700 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9701 | (vector int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9702 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9703 | } |
| 9704 | |
| 9705 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9706 | vec_lvlx(int __a, const unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9707 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9708 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9709 | (vector unsigned int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9710 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9711 | } |
| 9712 | |
| 9713 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9714 | vec_lvlx(int __a, const vector unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9715 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9716 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9717 | (vector unsigned int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9718 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9719 | } |
| 9720 | |
| 9721 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9722 | vec_lvlx(int __a, const vector bool int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9723 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9724 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9725 | (vector bool int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9726 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9727 | } |
| 9728 | |
| 9729 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9730 | vec_lvlx(int __a, const float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9731 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9732 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9733 | (vector float)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9734 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9735 | } |
| 9736 | |
| 9737 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9738 | vec_lvlx(int __a, const vector float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9739 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9740 | return vec_perm(vec_ld(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9741 | (vector float)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9742 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9743 | } |
| 9744 | |
| 9745 | /* vec_lvlxl */ |
| 9746 | |
| 9747 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9748 | vec_lvlxl(int __a, const signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9749 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9750 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9751 | (vector signed char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9752 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9753 | } |
| 9754 | |
| 9755 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9756 | vec_lvlxl(int __a, const vector signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9757 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9758 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9759 | (vector signed char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9760 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9761 | } |
| 9762 | |
| 9763 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9764 | vec_lvlxl(int __a, const unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9765 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9766 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9767 | (vector unsigned char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9768 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9769 | } |
| 9770 | |
| 9771 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9772 | vec_lvlxl(int __a, const vector unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9773 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9774 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9775 | (vector unsigned char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9776 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9777 | } |
| 9778 | |
| 9779 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9780 | vec_lvlxl(int __a, const vector bool char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9781 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9782 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9783 | (vector bool char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9784 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9785 | } |
| 9786 | |
| 9787 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9788 | vec_lvlxl(int __a, const short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9789 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9790 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9791 | (vector short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9792 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9793 | } |
| 9794 | |
| 9795 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9796 | vec_lvlxl(int __a, const vector short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9797 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9798 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9799 | (vector short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9800 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9801 | } |
| 9802 | |
| 9803 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9804 | vec_lvlxl(int __a, const unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9805 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9806 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9807 | (vector unsigned short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9808 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9809 | } |
| 9810 | |
| 9811 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9812 | vec_lvlxl(int __a, const vector unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9813 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9814 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9815 | (vector unsigned short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9816 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9817 | } |
| 9818 | |
| 9819 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9820 | vec_lvlxl(int __a, const vector bool short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9821 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9822 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9823 | (vector bool short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9824 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9825 | } |
| 9826 | |
| 9827 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9828 | vec_lvlxl(int __a, const vector pixel *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9829 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9830 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9831 | (vector pixel)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9832 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9833 | } |
| 9834 | |
| 9835 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9836 | vec_lvlxl(int __a, const int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9837 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9838 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9839 | (vector int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9840 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9841 | } |
| 9842 | |
| 9843 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9844 | vec_lvlxl(int __a, const vector int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9845 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9846 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9847 | (vector int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9848 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9849 | } |
| 9850 | |
| 9851 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9852 | vec_lvlxl(int __a, const unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9853 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9854 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9855 | (vector unsigned int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9856 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9857 | } |
| 9858 | |
| 9859 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9860 | vec_lvlxl(int __a, const vector unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9861 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9862 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9863 | (vector unsigned int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9864 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9865 | } |
| 9866 | |
| 9867 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9868 | vec_lvlxl(int __a, const vector bool int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9869 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9870 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9871 | (vector bool int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9872 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9873 | } |
| 9874 | |
| 9875 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9876 | vec_lvlxl(int __a, const float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9877 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9878 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9879 | (vector float)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9880 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9881 | } |
| 9882 | |
| 9883 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9884 | vec_lvlxl(int __a, vector float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9885 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9886 | return vec_perm(vec_ldl(__a, __b), |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9887 | (vector float)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9888 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9889 | } |
| 9890 | |
| 9891 | /* vec_lvrx */ |
| 9892 | |
| 9893 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9894 | vec_lvrx(int __a, const signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9895 | { |
| 9896 | return vec_perm((vector signed char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9897 | vec_ld(__a, __b), |
| 9898 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9899 | } |
| 9900 | |
| 9901 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9902 | vec_lvrx(int __a, const vector signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9903 | { |
| 9904 | return vec_perm((vector signed char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9905 | vec_ld(__a, __b), |
| 9906 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9907 | } |
| 9908 | |
| 9909 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9910 | vec_lvrx(int __a, const unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9911 | { |
| 9912 | return vec_perm((vector unsigned char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9913 | vec_ld(__a, __b), |
| 9914 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9915 | } |
| 9916 | |
| 9917 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9918 | vec_lvrx(int __a, const vector unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9919 | { |
| 9920 | return vec_perm((vector unsigned char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9921 | vec_ld(__a, __b), |
| 9922 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9923 | } |
| 9924 | |
| 9925 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9926 | vec_lvrx(int __a, const vector bool char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9927 | { |
| 9928 | return vec_perm((vector bool char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9929 | vec_ld(__a, __b), |
| 9930 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9931 | } |
| 9932 | |
| 9933 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9934 | vec_lvrx(int __a, const short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9935 | { |
| 9936 | return vec_perm((vector short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9937 | vec_ld(__a, __b), |
| 9938 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9939 | } |
| 9940 | |
| 9941 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9942 | vec_lvrx(int __a, const vector short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9943 | { |
| 9944 | return vec_perm((vector short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9945 | vec_ld(__a, __b), |
| 9946 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9947 | } |
| 9948 | |
| 9949 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9950 | vec_lvrx(int __a, const unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9951 | { |
| 9952 | return vec_perm((vector unsigned short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9953 | vec_ld(__a, __b), |
| 9954 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9955 | } |
| 9956 | |
| 9957 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9958 | vec_lvrx(int __a, const vector unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9959 | { |
| 9960 | return vec_perm((vector unsigned short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9961 | vec_ld(__a, __b), |
| 9962 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9963 | } |
| 9964 | |
| 9965 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9966 | vec_lvrx(int __a, const vector bool short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9967 | { |
| 9968 | return vec_perm((vector bool short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9969 | vec_ld(__a, __b), |
| 9970 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9971 | } |
| 9972 | |
| 9973 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9974 | vec_lvrx(int __a, const vector pixel *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9975 | { |
| 9976 | return vec_perm((vector pixel)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9977 | vec_ld(__a, __b), |
| 9978 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9979 | } |
| 9980 | |
| 9981 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9982 | vec_lvrx(int __a, const int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9983 | { |
| 9984 | return vec_perm((vector int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9985 | vec_ld(__a, __b), |
| 9986 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9987 | } |
| 9988 | |
| 9989 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9990 | vec_lvrx(int __a, const vector int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9991 | { |
| 9992 | return vec_perm((vector int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9993 | vec_ld(__a, __b), |
| 9994 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9995 | } |
| 9996 | |
| 9997 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 9998 | vec_lvrx(int __a, const unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 9999 | { |
| 10000 | return vec_perm((vector unsigned int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10001 | vec_ld(__a, __b), |
| 10002 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10003 | } |
| 10004 | |
| 10005 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10006 | vec_lvrx(int __a, const vector unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10007 | { |
| 10008 | return vec_perm((vector unsigned int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10009 | vec_ld(__a, __b), |
| 10010 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10011 | } |
| 10012 | |
| 10013 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10014 | vec_lvrx(int __a, const vector bool int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10015 | { |
| 10016 | return vec_perm((vector bool int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10017 | vec_ld(__a, __b), |
| 10018 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10019 | } |
| 10020 | |
| 10021 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10022 | vec_lvrx(int __a, const float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10023 | { |
| 10024 | return vec_perm((vector float)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10025 | vec_ld(__a, __b), |
| 10026 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10027 | } |
| 10028 | |
| 10029 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10030 | vec_lvrx(int __a, const vector float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10031 | { |
| 10032 | return vec_perm((vector float)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10033 | vec_ld(__a, __b), |
| 10034 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10035 | } |
| 10036 | |
| 10037 | /* vec_lvrxl */ |
| 10038 | |
| 10039 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10040 | vec_lvrxl(int __a, const signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10041 | { |
| 10042 | return vec_perm((vector signed char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10043 | vec_ldl(__a, __b), |
| 10044 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10045 | } |
| 10046 | |
| 10047 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10048 | vec_lvrxl(int __a, const vector signed char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10049 | { |
| 10050 | return vec_perm((vector signed char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10051 | vec_ldl(__a, __b), |
| 10052 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10053 | } |
| 10054 | |
| 10055 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10056 | vec_lvrxl(int __a, const unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10057 | { |
| 10058 | return vec_perm((vector unsigned char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10059 | vec_ldl(__a, __b), |
| 10060 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10061 | } |
| 10062 | |
| 10063 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10064 | vec_lvrxl(int __a, const vector unsigned char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10065 | { |
| 10066 | return vec_perm((vector unsigned char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10067 | vec_ldl(__a, __b), |
| 10068 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10069 | } |
| 10070 | |
| 10071 | static vector bool char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10072 | vec_lvrxl(int __a, const vector bool char *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10073 | { |
| 10074 | return vec_perm((vector bool char)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10075 | vec_ldl(__a, __b), |
| 10076 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10077 | } |
| 10078 | |
| 10079 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10080 | vec_lvrxl(int __a, const short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10081 | { |
| 10082 | return vec_perm((vector short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10083 | vec_ldl(__a, __b), |
| 10084 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10085 | } |
| 10086 | |
| 10087 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10088 | vec_lvrxl(int __a, const vector short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10089 | { |
| 10090 | return vec_perm((vector short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10091 | vec_ldl(__a, __b), |
| 10092 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10093 | } |
| 10094 | |
| 10095 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10096 | vec_lvrxl(int __a, const unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10097 | { |
| 10098 | return vec_perm((vector unsigned short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10099 | vec_ldl(__a, __b), |
| 10100 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10101 | } |
| 10102 | |
| 10103 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10104 | vec_lvrxl(int __a, const vector unsigned short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10105 | { |
| 10106 | return vec_perm((vector unsigned short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10107 | vec_ldl(__a, __b), |
| 10108 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10109 | } |
| 10110 | |
| 10111 | static vector bool short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10112 | vec_lvrxl(int __a, const vector bool short *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10113 | { |
| 10114 | return vec_perm((vector bool short)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10115 | vec_ldl(__a, __b), |
| 10116 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10117 | } |
| 10118 | |
| 10119 | static vector pixel __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10120 | vec_lvrxl(int __a, const vector pixel *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10121 | { |
| 10122 | return vec_perm((vector pixel)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10123 | vec_ldl(__a, __b), |
| 10124 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10125 | } |
| 10126 | |
| 10127 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10128 | vec_lvrxl(int __a, const int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10129 | { |
| 10130 | return vec_perm((vector int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10131 | vec_ldl(__a, __b), |
| 10132 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10133 | } |
| 10134 | |
| 10135 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10136 | vec_lvrxl(int __a, const vector int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10137 | { |
| 10138 | return vec_perm((vector int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10139 | vec_ldl(__a, __b), |
| 10140 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10141 | } |
| 10142 | |
| 10143 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10144 | vec_lvrxl(int __a, const unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10145 | { |
| 10146 | return vec_perm((vector unsigned int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10147 | vec_ldl(__a, __b), |
| 10148 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10149 | } |
| 10150 | |
| 10151 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10152 | vec_lvrxl(int __a, const vector unsigned int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10153 | { |
| 10154 | return vec_perm((vector unsigned int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10155 | vec_ldl(__a, __b), |
| 10156 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10157 | } |
| 10158 | |
| 10159 | static vector bool int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10160 | vec_lvrxl(int __a, const vector bool int *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10161 | { |
| 10162 | return vec_perm((vector bool int)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10163 | vec_ldl(__a, __b), |
| 10164 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10165 | } |
| 10166 | |
| 10167 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10168 | vec_lvrxl(int __a, const float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10169 | { |
| 10170 | return vec_perm((vector float)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10171 | vec_ldl(__a, __b), |
| 10172 | vec_lvsl(__a, __b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10173 | } |
| 10174 | |
| 10175 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10176 | vec_lvrxl(int __a, const vector float *__b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10177 | { |
| 10178 | return vec_perm((vector float)(0), |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10179 | vec_ldl(__a, __b), |
| 10180 | vec_lvsl(__a, (unsigned char *)__b)); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10181 | } |
| 10182 | |
| 10183 | /* vec_stvlx */ |
| 10184 | |
| 10185 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10186 | vec_stvlx(vector signed char __a, int __b, signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10187 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10188 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10189 | __a, |
| 10190 | vec_lvsr(__b, __c)), |
| 10191 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10192 | } |
| 10193 | |
| 10194 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10195 | vec_stvlx(vector signed char __a, int __b, vector signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10196 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10197 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10198 | __a, |
| 10199 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10200 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10201 | } |
| 10202 | |
| 10203 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10204 | vec_stvlx(vector unsigned char __a, int __b, unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10205 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10206 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10207 | __a, |
| 10208 | vec_lvsr(__b, __c)), |
| 10209 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10210 | } |
| 10211 | |
| 10212 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10213 | vec_stvlx(vector unsigned char __a, int __b, vector unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10214 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10215 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10216 | __a, |
| 10217 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10218 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10219 | } |
| 10220 | |
| 10221 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10222 | vec_stvlx(vector bool char __a, int __b, vector bool char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10223 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10224 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10225 | __a, |
| 10226 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10227 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10228 | } |
| 10229 | |
| 10230 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10231 | vec_stvlx(vector short __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10232 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10233 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10234 | __a, |
| 10235 | vec_lvsr(__b, __c)), |
| 10236 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10237 | } |
| 10238 | |
| 10239 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10240 | vec_stvlx(vector short __a, int __b, vector short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10241 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10242 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10243 | __a, |
| 10244 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10245 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10246 | } |
| 10247 | |
| 10248 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10249 | vec_stvlx(vector unsigned short __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10250 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10251 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10252 | __a, |
| 10253 | vec_lvsr(__b, __c)), |
| 10254 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10255 | } |
| 10256 | |
| 10257 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10258 | vec_stvlx(vector unsigned short __a, int __b, vector unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10259 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10260 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10261 | __a, |
| 10262 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10263 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10264 | } |
| 10265 | |
| 10266 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10267 | vec_stvlx(vector bool short __a, int __b, vector bool short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10268 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10269 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10270 | __a, |
| 10271 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10272 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10273 | } |
| 10274 | |
| 10275 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10276 | vec_stvlx(vector pixel __a, int __b, vector pixel *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10277 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10278 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10279 | __a, |
| 10280 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10281 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10282 | } |
| 10283 | |
| 10284 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10285 | vec_stvlx(vector int __a, int __b, int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10286 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10287 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10288 | __a, |
| 10289 | vec_lvsr(__b, __c)), |
| 10290 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10291 | } |
| 10292 | |
| 10293 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10294 | vec_stvlx(vector int __a, int __b, vector int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10295 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10296 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10297 | __a, |
| 10298 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10299 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10300 | } |
| 10301 | |
| 10302 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10303 | vec_stvlx(vector unsigned int __a, int __b, unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10304 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10305 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10306 | __a, |
| 10307 | vec_lvsr(__b, __c)), |
| 10308 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10309 | } |
| 10310 | |
| 10311 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10312 | vec_stvlx(vector unsigned int __a, int __b, vector unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10313 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10314 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10315 | __a, |
| 10316 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10317 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10318 | } |
| 10319 | |
| 10320 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10321 | vec_stvlx(vector bool int __a, int __b, vector bool int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10322 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10323 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10324 | __a, |
| 10325 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10326 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10327 | } |
| 10328 | |
| 10329 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10330 | vec_stvlx(vector float __a, int __b, vector float *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10331 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10332 | return vec_st(vec_perm(vec_lvrx(__b, __c), |
| 10333 | __a, |
| 10334 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10335 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10336 | } |
| 10337 | |
| 10338 | /* vec_stvlxl */ |
| 10339 | |
| 10340 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10341 | vec_stvlxl(vector signed char __a, int __b, signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10342 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10343 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10344 | __a, |
| 10345 | vec_lvsr(__b, __c)), |
| 10346 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10347 | } |
| 10348 | |
| 10349 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10350 | vec_stvlxl(vector signed char __a, int __b, vector signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10351 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10352 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10353 | __a, |
| 10354 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10355 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10356 | } |
| 10357 | |
| 10358 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10359 | vec_stvlxl(vector unsigned char __a, int __b, unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10360 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10361 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10362 | __a, |
| 10363 | vec_lvsr(__b, __c)), |
| 10364 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10365 | } |
| 10366 | |
| 10367 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10368 | vec_stvlxl(vector unsigned char __a, int __b, vector unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10369 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10370 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10371 | __a, |
| 10372 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10373 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10374 | } |
| 10375 | |
| 10376 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10377 | vec_stvlxl(vector bool char __a, int __b, vector bool char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10378 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10379 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10380 | __a, |
| 10381 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10382 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10383 | } |
| 10384 | |
| 10385 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10386 | vec_stvlxl(vector short __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10387 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10388 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10389 | __a, |
| 10390 | vec_lvsr(__b, __c)), |
| 10391 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10392 | } |
| 10393 | |
| 10394 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10395 | vec_stvlxl(vector short __a, int __b, vector short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10396 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10397 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10398 | __a, |
| 10399 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10400 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10401 | } |
| 10402 | |
| 10403 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10404 | vec_stvlxl(vector unsigned short __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10405 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10406 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10407 | __a, |
| 10408 | vec_lvsr(__b, __c)), |
| 10409 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10410 | } |
| 10411 | |
| 10412 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10413 | vec_stvlxl(vector unsigned short __a, int __b, vector unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10414 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10415 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10416 | __a, |
| 10417 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10418 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10419 | } |
| 10420 | |
| 10421 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10422 | vec_stvlxl(vector bool short __a, int __b, vector bool short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10423 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10424 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10425 | __a, |
| 10426 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10427 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10428 | } |
| 10429 | |
| 10430 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10431 | vec_stvlxl(vector pixel __a, int __b, vector pixel *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10432 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10433 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10434 | __a, |
| 10435 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10436 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10437 | } |
| 10438 | |
| 10439 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10440 | vec_stvlxl(vector int __a, int __b, int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10441 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10442 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10443 | __a, |
| 10444 | vec_lvsr(__b, __c)), |
| 10445 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10446 | } |
| 10447 | |
| 10448 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10449 | vec_stvlxl(vector int __a, int __b, vector int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10450 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10451 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10452 | __a, |
| 10453 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10454 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10455 | } |
| 10456 | |
| 10457 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10458 | vec_stvlxl(vector unsigned int __a, int __b, unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10459 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10460 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10461 | __a, |
| 10462 | vec_lvsr(__b, __c)), |
| 10463 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10464 | } |
| 10465 | |
| 10466 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10467 | vec_stvlxl(vector unsigned int __a, int __b, vector unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10468 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10469 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10470 | __a, |
| 10471 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10472 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10473 | } |
| 10474 | |
| 10475 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10476 | vec_stvlxl(vector bool int __a, int __b, vector bool int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10477 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10478 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10479 | __a, |
| 10480 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10481 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10482 | } |
| 10483 | |
| 10484 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10485 | vec_stvlxl(vector float __a, int __b, vector float *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10486 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10487 | return vec_stl(vec_perm(vec_lvrx(__b, __c), |
| 10488 | __a, |
| 10489 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10490 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10491 | } |
| 10492 | |
| 10493 | /* vec_stvrx */ |
| 10494 | |
| 10495 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10496 | vec_stvrx(vector signed char __a, int __b, signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10497 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10498 | return vec_st(vec_perm(__a, |
| 10499 | vec_lvlx(__b, __c), |
| 10500 | vec_lvsr(__b, __c)), |
| 10501 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10502 | } |
| 10503 | |
| 10504 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10505 | vec_stvrx(vector signed char __a, int __b, vector signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10506 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10507 | return vec_st(vec_perm(__a, |
| 10508 | vec_lvlx(__b, __c), |
| 10509 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10510 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10511 | } |
| 10512 | |
| 10513 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10514 | vec_stvrx(vector unsigned char __a, int __b, unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10515 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10516 | return vec_st(vec_perm(__a, |
| 10517 | vec_lvlx(__b, __c), |
| 10518 | vec_lvsr(__b, __c)), |
| 10519 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10520 | } |
| 10521 | |
| 10522 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10523 | vec_stvrx(vector unsigned char __a, int __b, vector unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10524 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10525 | return vec_st(vec_perm(__a, |
| 10526 | vec_lvlx(__b, __c), |
| 10527 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10528 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10529 | } |
| 10530 | |
| 10531 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10532 | vec_stvrx(vector bool char __a, int __b, vector bool char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10533 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10534 | return vec_st(vec_perm(__a, |
| 10535 | vec_lvlx(__b, __c), |
| 10536 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10537 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10538 | } |
| 10539 | |
| 10540 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10541 | vec_stvrx(vector short __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10542 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10543 | return vec_st(vec_perm(__a, |
| 10544 | vec_lvlx(__b, __c), |
| 10545 | vec_lvsr(__b, __c)), |
| 10546 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10547 | } |
| 10548 | |
| 10549 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10550 | vec_stvrx(vector short __a, int __b, vector short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10551 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10552 | return vec_st(vec_perm(__a, |
| 10553 | vec_lvlx(__b, __c), |
| 10554 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10555 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10556 | } |
| 10557 | |
| 10558 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10559 | vec_stvrx(vector unsigned short __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10560 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10561 | return vec_st(vec_perm(__a, |
| 10562 | vec_lvlx(__b, __c), |
| 10563 | vec_lvsr(__b, __c)), |
| 10564 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10565 | } |
| 10566 | |
| 10567 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10568 | vec_stvrx(vector unsigned short __a, int __b, vector unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10569 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10570 | return vec_st(vec_perm(__a, |
| 10571 | vec_lvlx(__b, __c), |
| 10572 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10573 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10574 | } |
| 10575 | |
| 10576 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10577 | vec_stvrx(vector bool short __a, int __b, vector bool short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10578 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10579 | return vec_st(vec_perm(__a, |
| 10580 | vec_lvlx(__b, __c), |
| 10581 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10582 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10583 | } |
| 10584 | |
| 10585 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10586 | vec_stvrx(vector pixel __a, int __b, vector pixel *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10587 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10588 | return vec_st(vec_perm(__a, |
| 10589 | vec_lvlx(__b, __c), |
| 10590 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10591 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10592 | } |
| 10593 | |
| 10594 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10595 | vec_stvrx(vector int __a, int __b, int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10596 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10597 | return vec_st(vec_perm(__a, |
| 10598 | vec_lvlx(__b, __c), |
| 10599 | vec_lvsr(__b, __c)), |
| 10600 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10601 | } |
| 10602 | |
| 10603 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10604 | vec_stvrx(vector int __a, int __b, vector int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10605 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10606 | return vec_st(vec_perm(__a, |
| 10607 | vec_lvlx(__b, __c), |
| 10608 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10609 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10610 | } |
| 10611 | |
| 10612 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10613 | vec_stvrx(vector unsigned int __a, int __b, unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10614 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10615 | return vec_st(vec_perm(__a, |
| 10616 | vec_lvlx(__b, __c), |
| 10617 | vec_lvsr(__b, __c)), |
| 10618 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10619 | } |
| 10620 | |
| 10621 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10622 | vec_stvrx(vector unsigned int __a, int __b, vector unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10623 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10624 | return vec_st(vec_perm(__a, |
| 10625 | vec_lvlx(__b, __c), |
| 10626 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10627 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10628 | } |
| 10629 | |
| 10630 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10631 | vec_stvrx(vector bool int __a, int __b, vector bool int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10632 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10633 | return vec_st(vec_perm(__a, |
| 10634 | vec_lvlx(__b, __c), |
| 10635 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10636 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10637 | } |
| 10638 | |
| 10639 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10640 | vec_stvrx(vector float __a, int __b, vector float *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10641 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10642 | return vec_st(vec_perm(__a, |
| 10643 | vec_lvlx(__b, __c), |
| 10644 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10645 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10646 | } |
| 10647 | |
| 10648 | /* vec_stvrxl */ |
| 10649 | |
| 10650 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10651 | vec_stvrxl(vector signed char __a, int __b, signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10652 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10653 | return vec_stl(vec_perm(__a, |
| 10654 | vec_lvlx(__b, __c), |
| 10655 | vec_lvsr(__b, __c)), |
| 10656 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10657 | } |
| 10658 | |
| 10659 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10660 | vec_stvrxl(vector signed char __a, int __b, vector signed char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10661 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10662 | return vec_stl(vec_perm(__a, |
| 10663 | vec_lvlx(__b, __c), |
| 10664 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10665 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10666 | } |
| 10667 | |
| 10668 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10669 | vec_stvrxl(vector unsigned char __a, int __b, unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10670 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10671 | return vec_stl(vec_perm(__a, |
| 10672 | vec_lvlx(__b, __c), |
| 10673 | vec_lvsr(__b, __c)), |
| 10674 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10675 | } |
| 10676 | |
| 10677 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10678 | vec_stvrxl(vector unsigned char __a, int __b, vector unsigned char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10679 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10680 | return vec_stl(vec_perm(__a, |
| 10681 | vec_lvlx(__b, __c), |
| 10682 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10683 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10684 | } |
| 10685 | |
| 10686 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10687 | vec_stvrxl(vector bool char __a, int __b, vector bool char *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10688 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10689 | return vec_stl(vec_perm(__a, |
| 10690 | vec_lvlx(__b, __c), |
| 10691 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10692 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10693 | } |
| 10694 | |
| 10695 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10696 | vec_stvrxl(vector short __a, int __b, short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10697 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10698 | return vec_stl(vec_perm(__a, |
| 10699 | vec_lvlx(__b, __c), |
| 10700 | vec_lvsr(__b, __c)), |
| 10701 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10702 | } |
| 10703 | |
| 10704 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10705 | vec_stvrxl(vector short __a, int __b, vector short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10706 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10707 | return vec_stl(vec_perm(__a, |
| 10708 | vec_lvlx(__b, __c), |
| 10709 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10710 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10711 | } |
| 10712 | |
| 10713 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10714 | vec_stvrxl(vector unsigned short __a, int __b, unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10715 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10716 | return vec_stl(vec_perm(__a, |
| 10717 | vec_lvlx(__b, __c), |
| 10718 | vec_lvsr(__b, __c)), |
| 10719 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10720 | } |
| 10721 | |
| 10722 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10723 | vec_stvrxl(vector unsigned short __a, int __b, vector unsigned short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10724 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10725 | return vec_stl(vec_perm(__a, |
| 10726 | vec_lvlx(__b, __c), |
| 10727 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10728 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10729 | } |
| 10730 | |
| 10731 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10732 | vec_stvrxl(vector bool short __a, int __b, vector bool short *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10733 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10734 | return vec_stl(vec_perm(__a, |
| 10735 | vec_lvlx(__b, __c), |
| 10736 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10737 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10738 | } |
| 10739 | |
| 10740 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10741 | vec_stvrxl(vector pixel __a, int __b, vector pixel *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10742 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10743 | return vec_stl(vec_perm(__a, |
| 10744 | vec_lvlx(__b, __c), |
| 10745 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10746 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10747 | } |
| 10748 | |
| 10749 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10750 | vec_stvrxl(vector int __a, int __b, int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10751 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10752 | return vec_stl(vec_perm(__a, |
| 10753 | vec_lvlx(__b, __c), |
| 10754 | vec_lvsr(__b, __c)), |
| 10755 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10756 | } |
| 10757 | |
| 10758 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10759 | vec_stvrxl(vector int __a, int __b, vector int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10760 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10761 | return vec_stl(vec_perm(__a, |
| 10762 | vec_lvlx(__b, __c), |
| 10763 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10764 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10765 | } |
| 10766 | |
| 10767 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10768 | vec_stvrxl(vector unsigned int __a, int __b, unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10769 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10770 | return vec_stl(vec_perm(__a, |
| 10771 | vec_lvlx(__b, __c), |
| 10772 | vec_lvsr(__b, __c)), |
| 10773 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10774 | } |
| 10775 | |
| 10776 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10777 | vec_stvrxl(vector unsigned int __a, int __b, vector unsigned int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10778 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10779 | return vec_stl(vec_perm(__a, |
| 10780 | vec_lvlx(__b, __c), |
| 10781 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10782 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10783 | } |
| 10784 | |
| 10785 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10786 | vec_stvrxl(vector bool int __a, int __b, vector bool int *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10787 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10788 | return vec_stl(vec_perm(__a, |
| 10789 | vec_lvlx(__b, __c), |
| 10790 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10791 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10792 | } |
| 10793 | |
| 10794 | static void __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10795 | vec_stvrxl(vector float __a, int __b, vector float *__c) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10796 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10797 | return vec_stl(vec_perm(__a, |
| 10798 | vec_lvlx(__b, __c), |
| 10799 | vec_lvsr(__b, (unsigned char *)__c)), |
| 10800 | __b, __c); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10801 | } |
| 10802 | |
| 10803 | /* vec_promote */ |
| 10804 | |
| 10805 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10806 | vec_promote(signed char __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10807 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10808 | vector signed char __res = (vector signed char)(0); |
| 10809 | __res[__b] = __a; |
| 10810 | return __res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10811 | } |
| 10812 | |
| 10813 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10814 | vec_promote(unsigned char __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10815 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10816 | vector unsigned char __res = (vector unsigned char)(0); |
| 10817 | __res[__b] = __a; |
| 10818 | return __res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10819 | } |
| 10820 | |
| 10821 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10822 | vec_promote(short __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10823 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10824 | vector short __res = (vector short)(0); |
| 10825 | __res[__b] = __a; |
| 10826 | return __res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10827 | } |
| 10828 | |
| 10829 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10830 | vec_promote(unsigned short __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10831 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10832 | vector unsigned short __res = (vector unsigned short)(0); |
| 10833 | __res[__b] = __a; |
| 10834 | return __res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10835 | } |
| 10836 | |
| 10837 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10838 | vec_promote(int __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10839 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10840 | vector int __res = (vector int)(0); |
| 10841 | __res[__b] = __a; |
| 10842 | return __res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10843 | } |
| 10844 | |
| 10845 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10846 | vec_promote(unsigned int __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10847 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10848 | vector unsigned int __res = (vector unsigned int)(0); |
| 10849 | __res[__b] = __a; |
| 10850 | return __res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10851 | } |
| 10852 | |
| 10853 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10854 | vec_promote(float __a, int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10855 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10856 | vector float __res = (vector float)(0); |
| 10857 | __res[__b] = __a; |
| 10858 | return __res; |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10859 | } |
| 10860 | |
| 10861 | /* vec_splats */ |
| 10862 | |
| 10863 | static vector signed char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10864 | vec_splats(signed char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10865 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10866 | return (vector signed char)(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10867 | } |
| 10868 | |
| 10869 | static vector unsigned char __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10870 | vec_splats(unsigned char __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10871 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10872 | return (vector unsigned char)(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10873 | } |
| 10874 | |
| 10875 | static vector short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10876 | vec_splats(short __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10877 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10878 | return (vector short)(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10879 | } |
| 10880 | |
| 10881 | static vector unsigned short __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10882 | vec_splats(unsigned short __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10883 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10884 | return (vector unsigned short)(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10885 | } |
| 10886 | |
| 10887 | static vector int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10888 | vec_splats(int __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10889 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10890 | return (vector int)(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10891 | } |
| 10892 | |
| 10893 | static vector unsigned int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10894 | vec_splats(unsigned int __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10895 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10896 | return (vector unsigned int)(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10897 | } |
| 10898 | |
| 10899 | static vector float __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10900 | vec_splats(float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10901 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10902 | return (vector float)(__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10903 | } |
| 10904 | |
| 10905 | /* ----------------------------- predicates --------------------------------- */ |
| 10906 | |
| 10907 | /* vec_all_eq */ |
| 10908 | |
| 10909 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10910 | vec_all_eq(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10911 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10912 | return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10913 | } |
| 10914 | |
| 10915 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10916 | vec_all_eq(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10917 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10918 | return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10919 | } |
| 10920 | |
| 10921 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10922 | vec_all_eq(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10923 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10924 | return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10925 | } |
| 10926 | |
| 10927 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10928 | vec_all_eq(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10929 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10930 | return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10931 | } |
| 10932 | |
| 10933 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10934 | vec_all_eq(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10935 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10936 | return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10937 | } |
| 10938 | |
| 10939 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10940 | vec_all_eq(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10941 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10942 | return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10943 | } |
| 10944 | |
| 10945 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10946 | vec_all_eq(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10947 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10948 | return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10949 | } |
| 10950 | |
| 10951 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10952 | vec_all_eq(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10953 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10954 | return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10955 | } |
| 10956 | |
| 10957 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10958 | vec_all_eq(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10959 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10960 | return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10961 | } |
| 10962 | |
| 10963 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10964 | vec_all_eq(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10965 | { |
| 10966 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10967 | __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10968 | } |
| 10969 | |
| 10970 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10971 | vec_all_eq(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10972 | { |
| 10973 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10974 | __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10975 | } |
| 10976 | |
| 10977 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10978 | vec_all_eq(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10979 | { |
| 10980 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10981 | __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10982 | } |
| 10983 | |
| 10984 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10985 | vec_all_eq(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10986 | { |
| 10987 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10988 | __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10989 | } |
| 10990 | |
| 10991 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10992 | vec_all_eq(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10993 | { |
| 10994 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10995 | __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 10996 | } |
| 10997 | |
| 10998 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 10999 | vec_all_eq(vector pixel __a, vector pixel __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11000 | { |
| 11001 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11002 | __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11003 | } |
| 11004 | |
| 11005 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11006 | vec_all_eq(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11007 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11008 | return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11009 | } |
| 11010 | |
| 11011 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11012 | vec_all_eq(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11013 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11014 | return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11015 | } |
| 11016 | |
| 11017 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11018 | vec_all_eq(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11019 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11020 | return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11021 | } |
| 11022 | |
| 11023 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11024 | vec_all_eq(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11025 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11026 | return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11027 | } |
| 11028 | |
| 11029 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11030 | vec_all_eq(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11031 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11032 | return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11033 | } |
| 11034 | |
| 11035 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11036 | vec_all_eq(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11037 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11038 | return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11039 | } |
| 11040 | |
| 11041 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11042 | vec_all_eq(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11043 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11044 | return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11045 | } |
| 11046 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 11047 | #ifdef __POWER8_VECTOR__ |
| 11048 | static int __ATTRS_o_ai |
| 11049 | vec_all_eq(vector signed long long __a, vector signed long long __b) |
| 11050 | { |
| 11051 | return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b); |
| 11052 | } |
| 11053 | |
| 11054 | static int __ATTRS_o_ai |
| 11055 | vec_all_eq(vector long long __a, vector bool long long __b) |
| 11056 | { |
| 11057 | return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, (vector long long)__b); |
| 11058 | } |
| 11059 | |
| 11060 | static int __ATTRS_o_ai |
| 11061 | vec_all_eq(vector unsigned long long __a, vector unsigned long long __b) |
| 11062 | { |
| 11063 | return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a, |
| 11064 | (vector long long)__b); |
| 11065 | } |
| 11066 | |
| 11067 | static int __ATTRS_o_ai |
| 11068 | vec_all_eq(vector unsigned long long __a, vector bool long long __b) |
| 11069 | { |
| 11070 | return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a, |
| 11071 | (vector long long)__b); |
| 11072 | } |
| 11073 | |
| 11074 | static int __ATTRS_o_ai |
| 11075 | vec_all_eq(vector bool long long __a, vector long long __b) |
| 11076 | { |
| 11077 | return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a, |
| 11078 | (vector long long)__b); |
| 11079 | } |
| 11080 | |
| 11081 | static int __ATTRS_o_ai |
| 11082 | vec_all_eq(vector bool long long __a, vector unsigned long long __b) |
| 11083 | { |
| 11084 | return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a, |
| 11085 | (vector long long)__b); |
| 11086 | } |
| 11087 | |
| 11088 | static int __ATTRS_o_ai |
| 11089 | vec_all_eq(vector bool long long __a, vector bool long long __b) |
| 11090 | { |
| 11091 | return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a, |
| 11092 | (vector long long)__b); |
| 11093 | } |
| 11094 | #endif |
| 11095 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11096 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11097 | vec_all_eq(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11098 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11099 | return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11100 | } |
| 11101 | |
| 11102 | /* vec_all_ge */ |
| 11103 | |
| 11104 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11105 | vec_all_ge(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11106 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11107 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11108 | } |
| 11109 | |
| 11110 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11111 | vec_all_ge(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11112 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11113 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11114 | } |
| 11115 | |
| 11116 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11117 | vec_all_ge(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11118 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11119 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11120 | } |
| 11121 | |
| 11122 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11123 | vec_all_ge(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11124 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11125 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11126 | } |
| 11127 | |
| 11128 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11129 | vec_all_ge(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11130 | { |
| 11131 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11132 | (vector unsigned char)__b, |
| 11133 | (vector unsigned char)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11134 | } |
| 11135 | |
| 11136 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11137 | vec_all_ge(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11138 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11139 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, (vector unsigned char)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11140 | } |
| 11141 | |
| 11142 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11143 | vec_all_ge(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11144 | { |
| 11145 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11146 | (vector unsigned char)__b, |
| 11147 | (vector unsigned char)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11148 | } |
| 11149 | |
| 11150 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11151 | vec_all_ge(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11152 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11153 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11154 | } |
| 11155 | |
| 11156 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11157 | vec_all_ge(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11158 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11159 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11160 | } |
| 11161 | |
| 11162 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11163 | vec_all_ge(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11164 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11165 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11166 | } |
| 11167 | |
| 11168 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11169 | vec_all_ge(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11170 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11171 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11172 | } |
| 11173 | |
| 11174 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11175 | vec_all_ge(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11176 | { |
| 11177 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11178 | (vector unsigned short)__b, |
| 11179 | (vector unsigned short)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11180 | } |
| 11181 | |
| 11182 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11183 | vec_all_ge(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11184 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11185 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, (vector unsigned short)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11186 | } |
| 11187 | |
| 11188 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11189 | vec_all_ge(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11190 | { |
| 11191 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11192 | (vector unsigned short)__b, |
| 11193 | (vector unsigned short)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11194 | } |
| 11195 | |
| 11196 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11197 | vec_all_ge(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11198 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11199 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11200 | } |
| 11201 | |
| 11202 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11203 | vec_all_ge(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11204 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11205 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11206 | } |
| 11207 | |
| 11208 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11209 | vec_all_ge(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11210 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11211 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11212 | } |
| 11213 | |
| 11214 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11215 | vec_all_ge(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11216 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11217 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11218 | } |
| 11219 | |
| 11220 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11221 | vec_all_ge(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11222 | { |
| 11223 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11224 | (vector unsigned int)__b, |
| 11225 | (vector unsigned int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11226 | } |
| 11227 | |
| 11228 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11229 | vec_all_ge(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11230 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11231 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, (vector unsigned int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11232 | } |
| 11233 | |
| 11234 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11235 | vec_all_ge(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11236 | { |
| 11237 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11238 | (vector unsigned int)__b, |
| 11239 | (vector unsigned int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11240 | } |
| 11241 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 11242 | #ifdef __POWER8_VECTOR__ |
| 11243 | static int __ATTRS_o_ai |
| 11244 | vec_all_ge(vector signed long long __a, vector signed long long __b) |
| 11245 | { |
| 11246 | return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a); |
| 11247 | } |
| 11248 | static int __ATTRS_o_ai |
| 11249 | vec_all_ge(vector signed long long __a, vector bool long long __b) |
| 11250 | { |
| 11251 | return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__b, |
| 11252 | __a); |
| 11253 | } |
| 11254 | |
| 11255 | static int __ATTRS_o_ai |
| 11256 | vec_all_ge(vector unsigned long long __a, vector unsigned long long __b) |
| 11257 | { |
| 11258 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b, __a); |
| 11259 | } |
| 11260 | |
| 11261 | static int __ATTRS_o_ai |
| 11262 | vec_all_ge(vector unsigned long long __a, vector bool long long __b) |
| 11263 | { |
| 11264 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b, |
| 11265 | __a); |
| 11266 | } |
| 11267 | |
| 11268 | static int __ATTRS_o_ai |
| 11269 | vec_all_ge(vector bool long long __a, vector signed long long __b) |
| 11270 | { |
| 11271 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ, |
| 11272 | (vector unsigned long long)__b, |
| 11273 | (vector unsigned long long)__a); |
| 11274 | } |
| 11275 | |
| 11276 | static int __ATTRS_o_ai |
| 11277 | vec_all_ge(vector bool long long __a, vector unsigned long long __b) |
| 11278 | { |
| 11279 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b, |
| 11280 | (vector unsigned long long)__a); |
| 11281 | } |
| 11282 | |
| 11283 | static int __ATTRS_o_ai |
| 11284 | vec_all_ge(vector bool long long __a, vector bool long long __b) |
| 11285 | { |
| 11286 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ, |
| 11287 | (vector unsigned long long)__b, |
| 11288 | (vector unsigned long long)__a); |
| 11289 | } |
| 11290 | #endif |
| 11291 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11292 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11293 | vec_all_ge(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11294 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11295 | return __builtin_altivec_vcmpgefp_p(__CR6_LT, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11296 | } |
| 11297 | |
| 11298 | /* vec_all_gt */ |
| 11299 | |
| 11300 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11301 | vec_all_gt(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11302 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11303 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11304 | } |
| 11305 | |
| 11306 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11307 | vec_all_gt(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11308 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11309 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, (vector signed char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11310 | } |
| 11311 | |
| 11312 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11313 | vec_all_gt(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11314 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11315 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11316 | } |
| 11317 | |
| 11318 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11319 | vec_all_gt(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11320 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11321 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11322 | } |
| 11323 | |
| 11324 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11325 | vec_all_gt(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11326 | { |
| 11327 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11328 | (vector unsigned char)__a, |
| 11329 | (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11330 | } |
| 11331 | |
| 11332 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11333 | vec_all_gt(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11334 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11335 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11336 | } |
| 11337 | |
| 11338 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11339 | vec_all_gt(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11340 | { |
| 11341 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11342 | (vector unsigned char)__a, |
| 11343 | (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11344 | } |
| 11345 | |
| 11346 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11347 | vec_all_gt(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11348 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11349 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11350 | } |
| 11351 | |
| 11352 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11353 | vec_all_gt(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11354 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11355 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11356 | } |
| 11357 | |
| 11358 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11359 | vec_all_gt(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11360 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11361 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11362 | } |
| 11363 | |
| 11364 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11365 | vec_all_gt(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11366 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11367 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11368 | } |
| 11369 | |
| 11370 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11371 | vec_all_gt(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11372 | { |
| 11373 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11374 | (vector unsigned short)__a, |
| 11375 | (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11376 | } |
| 11377 | |
| 11378 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11379 | vec_all_gt(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11380 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11381 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11382 | } |
| 11383 | |
| 11384 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11385 | vec_all_gt(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11386 | { |
| 11387 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11388 | (vector unsigned short)__a, |
| 11389 | (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11390 | } |
| 11391 | |
| 11392 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11393 | vec_all_gt(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11394 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11395 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11396 | } |
| 11397 | |
| 11398 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11399 | vec_all_gt(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11400 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11401 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11402 | } |
| 11403 | |
| 11404 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11405 | vec_all_gt(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11406 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11407 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11408 | } |
| 11409 | |
| 11410 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11411 | vec_all_gt(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11412 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11413 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11414 | } |
| 11415 | |
| 11416 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11417 | vec_all_gt(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11418 | { |
| 11419 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11420 | (vector unsigned int)__a, |
| 11421 | (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11422 | } |
| 11423 | |
| 11424 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11425 | vec_all_gt(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11426 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11427 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11428 | } |
| 11429 | |
| 11430 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11431 | vec_all_gt(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11432 | { |
| 11433 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11434 | (vector unsigned int)__a, |
| 11435 | (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11436 | } |
| 11437 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 11438 | #ifdef __POWER8_VECTOR__ |
| 11439 | static int __ATTRS_o_ai |
| 11440 | vec_all_gt(vector signed long long __a, vector signed long long __b) |
| 11441 | { |
| 11442 | return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b); |
| 11443 | } |
| 11444 | static int __ATTRS_o_ai |
| 11445 | vec_all_gt(vector signed long long __a, vector bool long long __b) |
| 11446 | { |
| 11447 | return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, |
| 11448 | (vector signed long long)__b); |
| 11449 | } |
| 11450 | |
| 11451 | static int __ATTRS_o_ai |
| 11452 | vec_all_gt(vector unsigned long long __a, vector unsigned long long __b) |
| 11453 | { |
| 11454 | return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, __b); |
| 11455 | } |
| 11456 | |
| 11457 | static int __ATTRS_o_ai |
| 11458 | vec_all_gt(vector unsigned long long __a, vector bool long long __b) |
| 11459 | { |
| 11460 | return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, |
| 11461 | (vector unsigned long long)__b); |
| 11462 | } |
| 11463 | |
| 11464 | static int __ATTRS_o_ai |
| 11465 | vec_all_gt(vector bool long long __a, vector signed long long __b) |
| 11466 | { |
| 11467 | return __builtin_altivec_vcmpgtud_p(__CR6_LT, |
| 11468 | (vector unsigned long long)__a, |
| 11469 | (vector unsigned long long)__b); |
| 11470 | } |
| 11471 | |
| 11472 | static int __ATTRS_o_ai |
| 11473 | vec_all_gt(vector bool long long __a, vector unsigned long long __b) |
| 11474 | { |
| 11475 | return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a, |
| 11476 | __b); |
| 11477 | } |
| 11478 | |
| 11479 | static int __ATTRS_o_ai |
| 11480 | vec_all_gt(vector bool long long __a, vector bool long long __b) |
| 11481 | { |
| 11482 | return __builtin_altivec_vcmpgtud_p(__CR6_LT, |
| 11483 | (vector unsigned long long)__a, |
| 11484 | (vector unsigned long long)__b); |
| 11485 | } |
| 11486 | #endif |
| 11487 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11488 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11489 | vec_all_gt(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11490 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11491 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11492 | } |
| 11493 | |
| 11494 | /* vec_all_in */ |
| 11495 | |
| 11496 | static int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11497 | vec_all_in(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11498 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11499 | return __builtin_altivec_vcmpbfp_p(__CR6_EQ, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11500 | } |
| 11501 | |
| 11502 | /* vec_all_le */ |
| 11503 | |
| 11504 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11505 | vec_all_le(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11506 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11507 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11508 | } |
| 11509 | |
| 11510 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11511 | vec_all_le(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11512 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11513 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, (vector signed char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11514 | } |
| 11515 | |
| 11516 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11517 | vec_all_le(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11518 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11519 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11520 | } |
| 11521 | |
| 11522 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11523 | vec_all_le(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11524 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11525 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11526 | } |
| 11527 | |
| 11528 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11529 | vec_all_le(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11530 | { |
| 11531 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11532 | (vector unsigned char)__a, |
| 11533 | (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11534 | } |
| 11535 | |
| 11536 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11537 | vec_all_le(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11538 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11539 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11540 | } |
| 11541 | |
| 11542 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11543 | vec_all_le(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11544 | { |
| 11545 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11546 | (vector unsigned char)__a, |
| 11547 | (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11548 | } |
| 11549 | |
| 11550 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11551 | vec_all_le(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11552 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11553 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11554 | } |
| 11555 | |
| 11556 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11557 | vec_all_le(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11558 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11559 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11560 | } |
| 11561 | |
| 11562 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11563 | vec_all_le(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11564 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11565 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11566 | } |
| 11567 | |
| 11568 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11569 | vec_all_le(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11570 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11571 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11572 | } |
| 11573 | |
| 11574 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11575 | vec_all_le(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11576 | { |
| 11577 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11578 | (vector unsigned short)__a, |
| 11579 | (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11580 | } |
| 11581 | |
| 11582 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11583 | vec_all_le(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11584 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11585 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11586 | } |
| 11587 | |
| 11588 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11589 | vec_all_le(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11590 | { |
| 11591 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11592 | (vector unsigned short)__a, |
| 11593 | (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11594 | } |
| 11595 | |
| 11596 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11597 | vec_all_le(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11598 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11599 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11600 | } |
| 11601 | |
| 11602 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11603 | vec_all_le(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11604 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11605 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11606 | } |
| 11607 | |
| 11608 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11609 | vec_all_le(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11610 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11611 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11612 | } |
| 11613 | |
| 11614 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11615 | vec_all_le(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11616 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11617 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11618 | } |
| 11619 | |
| 11620 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11621 | vec_all_le(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11622 | { |
| 11623 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11624 | (vector unsigned int)__a, |
| 11625 | (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11626 | } |
| 11627 | |
| 11628 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11629 | vec_all_le(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11630 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11631 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11632 | } |
| 11633 | |
| 11634 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11635 | vec_all_le(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11636 | { |
| 11637 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11638 | (vector unsigned int)__a, |
| 11639 | (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11640 | } |
| 11641 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 11642 | #ifdef __POWER8_VECTOR__ |
| 11643 | static int __ATTRS_o_ai |
| 11644 | vec_all_le(vector signed long long __a, vector signed long long __b) |
| 11645 | { |
| 11646 | return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b); |
| 11647 | } |
| 11648 | |
| 11649 | static int __ATTRS_o_ai |
| 11650 | vec_all_le(vector unsigned long long __a, vector unsigned long long __b) |
| 11651 | { |
| 11652 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, __b); |
| 11653 | } |
| 11654 | |
| 11655 | static int __ATTRS_o_ai |
| 11656 | vec_all_le(vector signed long long __a, vector bool long long __b) |
| 11657 | { |
| 11658 | return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, |
| 11659 | (vector signed long long)__b); |
| 11660 | } |
| 11661 | |
| 11662 | static int __ATTRS_o_ai |
| 11663 | vec_all_le(vector unsigned long long __a, vector bool long long __b) |
| 11664 | { |
| 11665 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, |
| 11666 | (vector unsigned long long)__b); |
| 11667 | } |
| 11668 | |
| 11669 | static int __ATTRS_o_ai |
| 11670 | vec_all_le(vector bool long long __a, vector signed long long __b) |
| 11671 | { |
| 11672 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ, |
| 11673 | (vector unsigned long long)__a, |
| 11674 | (vector unsigned long long)__b); |
| 11675 | } |
| 11676 | |
| 11677 | static int __ATTRS_o_ai |
| 11678 | vec_all_le(vector bool long long __a, vector unsigned long long __b) |
| 11679 | { |
| 11680 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a, |
| 11681 | __b); |
| 11682 | } |
| 11683 | |
| 11684 | static int __ATTRS_o_ai |
| 11685 | vec_all_le(vector bool long long __a, vector bool long long __b) |
| 11686 | { |
| 11687 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ, |
| 11688 | (vector unsigned long long)__a, |
| 11689 | (vector unsigned long long)__b); |
| 11690 | } |
| 11691 | #endif |
| 11692 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11693 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11694 | vec_all_le(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11695 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11696 | return __builtin_altivec_vcmpgefp_p(__CR6_LT, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11697 | } |
| 11698 | |
| 11699 | /* vec_all_lt */ |
| 11700 | |
| 11701 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11702 | vec_all_lt(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11703 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11704 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11705 | } |
| 11706 | |
| 11707 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11708 | vec_all_lt(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11709 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11710 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11711 | } |
| 11712 | |
| 11713 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11714 | vec_all_lt(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11715 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11716 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11717 | } |
| 11718 | |
| 11719 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11720 | vec_all_lt(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11721 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11722 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11723 | } |
| 11724 | |
| 11725 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11726 | vec_all_lt(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11727 | { |
| 11728 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11729 | (vector unsigned char)__b, |
| 11730 | (vector unsigned char)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11731 | } |
| 11732 | |
| 11733 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11734 | vec_all_lt(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11735 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11736 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, (vector unsigned char)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11737 | } |
| 11738 | |
| 11739 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11740 | vec_all_lt(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11741 | { |
| 11742 | return __builtin_altivec_vcmpgtub_p(__CR6_LT, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11743 | (vector unsigned char)__b, |
| 11744 | (vector unsigned char)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11745 | } |
| 11746 | |
| 11747 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11748 | vec_all_lt(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11749 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11750 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11751 | } |
| 11752 | |
| 11753 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11754 | vec_all_lt(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11755 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11756 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11757 | } |
| 11758 | |
| 11759 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11760 | vec_all_lt(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11761 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11762 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11763 | } |
| 11764 | |
| 11765 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11766 | vec_all_lt(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11767 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11768 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11769 | } |
| 11770 | |
| 11771 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11772 | vec_all_lt(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11773 | { |
| 11774 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11775 | (vector unsigned short)__b, |
| 11776 | (vector unsigned short)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11777 | } |
| 11778 | |
| 11779 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11780 | vec_all_lt(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11781 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11782 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, (vector unsigned short)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11783 | } |
| 11784 | |
| 11785 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11786 | vec_all_lt(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11787 | { |
| 11788 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11789 | (vector unsigned short)__b, |
| 11790 | (vector unsigned short)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11791 | } |
| 11792 | |
| 11793 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11794 | vec_all_lt(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11795 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11796 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11797 | } |
| 11798 | |
| 11799 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11800 | vec_all_lt(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11801 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11802 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11803 | } |
| 11804 | |
| 11805 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11806 | vec_all_lt(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11807 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11808 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11809 | } |
| 11810 | |
| 11811 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11812 | vec_all_lt(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11813 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11814 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11815 | } |
| 11816 | |
| 11817 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11818 | vec_all_lt(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11819 | { |
| 11820 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11821 | (vector unsigned int)__b, |
| 11822 | (vector unsigned int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11823 | } |
| 11824 | |
| 11825 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11826 | vec_all_lt(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11827 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11828 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, (vector unsigned int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11829 | } |
| 11830 | |
| 11831 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11832 | vec_all_lt(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11833 | { |
| 11834 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11835 | (vector unsigned int)__b, |
| 11836 | (vector unsigned int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11837 | } |
| 11838 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 11839 | #ifdef __POWER8_VECTOR__ |
| 11840 | static int __ATTRS_o_ai |
| 11841 | vec_all_lt(vector signed long long __a, vector signed long long __b) |
| 11842 | { |
| 11843 | return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a); |
| 11844 | } |
| 11845 | |
| 11846 | static int __ATTRS_o_ai |
| 11847 | vec_all_lt(vector unsigned long long __a, vector unsigned long long __b) |
| 11848 | { |
| 11849 | return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b, __a); |
| 11850 | } |
| 11851 | |
| 11852 | static int __ATTRS_o_ai |
| 11853 | vec_all_lt(vector signed long long __a, vector bool long long __b) |
| 11854 | { |
| 11855 | return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__b, |
| 11856 | __a); |
| 11857 | } |
| 11858 | |
| 11859 | static int __ATTRS_o_ai |
| 11860 | vec_all_lt(vector unsigned long long __a, vector bool long long __b) |
| 11861 | { |
| 11862 | return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b, |
| 11863 | __a); |
| 11864 | } |
| 11865 | |
| 11866 | static int __ATTRS_o_ai |
| 11867 | vec_all_lt(vector bool long long __a, vector signed long long __b) |
| 11868 | { |
| 11869 | return __builtin_altivec_vcmpgtud_p(__CR6_LT, |
| 11870 | (vector unsigned long long)__b, |
| 11871 | (vector unsigned long long)__a); |
| 11872 | } |
| 11873 | |
| 11874 | static int __ATTRS_o_ai |
| 11875 | vec_all_lt(vector bool long long __a, vector unsigned long long __b) |
| 11876 | { |
| 11877 | return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b, |
| 11878 | (vector unsigned long long)__a); |
| 11879 | } |
| 11880 | |
| 11881 | static int __ATTRS_o_ai |
| 11882 | vec_all_lt(vector bool long long __a, vector bool long long __b) |
| 11883 | { |
| 11884 | return __builtin_altivec_vcmpgtud_p(__CR6_LT, |
| 11885 | (vector unsigned long long)__b, |
| 11886 | (vector unsigned long long)__a); |
| 11887 | } |
| 11888 | #endif |
| 11889 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11890 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11891 | vec_all_lt(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11892 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11893 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11894 | } |
| 11895 | |
| 11896 | /* vec_all_nan */ |
| 11897 | |
| 11898 | static int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11899 | vec_all_nan(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11900 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11901 | return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11902 | } |
| 11903 | |
| 11904 | /* vec_all_ne */ |
| 11905 | |
| 11906 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11907 | vec_all_ne(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11908 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11909 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11910 | } |
| 11911 | |
| 11912 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11913 | vec_all_ne(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11914 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11915 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11916 | } |
| 11917 | |
| 11918 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11919 | vec_all_ne(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11920 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11921 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11922 | } |
| 11923 | |
| 11924 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11925 | vec_all_ne(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11926 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11927 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11928 | } |
| 11929 | |
| 11930 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11931 | vec_all_ne(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11932 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11933 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11934 | } |
| 11935 | |
| 11936 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11937 | vec_all_ne(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11938 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11939 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11940 | } |
| 11941 | |
| 11942 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11943 | vec_all_ne(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11944 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11945 | return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11946 | } |
| 11947 | |
| 11948 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11949 | vec_all_ne(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11950 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11951 | return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11952 | } |
| 11953 | |
| 11954 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11955 | vec_all_ne(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11956 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11957 | return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11958 | } |
| 11959 | |
| 11960 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11961 | vec_all_ne(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11962 | { |
| 11963 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11964 | __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11965 | } |
| 11966 | |
| 11967 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11968 | vec_all_ne(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11969 | { |
| 11970 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11971 | __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11972 | } |
| 11973 | |
| 11974 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11975 | vec_all_ne(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11976 | { |
| 11977 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11978 | __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11979 | } |
| 11980 | |
| 11981 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11982 | vec_all_ne(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11983 | { |
| 11984 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11985 | __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11986 | } |
| 11987 | |
| 11988 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11989 | vec_all_ne(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11990 | { |
| 11991 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11992 | __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11993 | } |
| 11994 | |
| 11995 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11996 | vec_all_ne(vector pixel __a, vector pixel __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 11997 | { |
| 11998 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 11999 | __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12000 | } |
| 12001 | |
| 12002 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12003 | vec_all_ne(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12004 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12005 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12006 | } |
| 12007 | |
| 12008 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12009 | vec_all_ne(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12010 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12011 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12012 | } |
| 12013 | |
| 12014 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12015 | vec_all_ne(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12016 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12017 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12018 | } |
| 12019 | |
| 12020 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12021 | vec_all_ne(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12022 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12023 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12024 | } |
| 12025 | |
| 12026 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12027 | vec_all_ne(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12028 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12029 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12030 | } |
| 12031 | |
| 12032 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12033 | vec_all_ne(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12034 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12035 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12036 | } |
| 12037 | |
| 12038 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12039 | vec_all_ne(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12040 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12041 | return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12042 | } |
| 12043 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 12044 | #ifdef __POWER8_VECTOR__ |
| 12045 | static int __ATTRS_o_ai |
| 12046 | vec_all_ne(vector signed long long __a, vector signed long long __b) |
| 12047 | { |
| 12048 | return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b); |
| 12049 | } |
| 12050 | |
| 12051 | static int __ATTRS_o_ai |
| 12052 | vec_all_ne(vector unsigned long long __a, vector unsigned long long __b) |
| 12053 | { |
| 12054 | return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector long long)__a, |
| 12055 | (vector long long)__b); |
| 12056 | } |
| 12057 | |
| 12058 | static int __ATTRS_o_ai |
| 12059 | vec_all_ne(vector signed long long __a, vector bool long long __b) |
| 12060 | { |
| 12061 | return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, |
| 12062 | (vector signed long long)__b); |
| 12063 | } |
| 12064 | |
| 12065 | static int __ATTRS_o_ai |
| 12066 | vec_all_ne(vector unsigned long long __a, vector bool long long __b) |
| 12067 | { |
| 12068 | return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a, |
| 12069 | (vector signed long long)__b); |
| 12070 | } |
| 12071 | |
| 12072 | static int __ATTRS_o_ai |
| 12073 | vec_all_ne(vector bool long long __a, vector signed long long __b) |
| 12074 | { |
| 12075 | return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a, |
| 12076 | (vector signed long long)__b); |
| 12077 | } |
| 12078 | |
| 12079 | static int __ATTRS_o_ai |
| 12080 | vec_all_ne(vector bool long long __a, vector unsigned long long __b) |
| 12081 | { |
| 12082 | return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a, |
| 12083 | (vector signed long long)__b); |
| 12084 | } |
| 12085 | |
| 12086 | static int __ATTRS_o_ai |
| 12087 | vec_all_ne(vector bool long long __a, vector bool long long __b) |
| 12088 | { |
| 12089 | return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a, |
| 12090 | (vector signed long long)__b); |
| 12091 | } |
| 12092 | #endif |
| 12093 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12094 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12095 | vec_all_ne(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12096 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12097 | return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12098 | } |
| 12099 | |
| 12100 | /* vec_all_nge */ |
| 12101 | |
| 12102 | static int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12103 | vec_all_nge(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12104 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12105 | return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12106 | } |
| 12107 | |
| 12108 | /* vec_all_ngt */ |
| 12109 | |
| 12110 | static int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12111 | vec_all_ngt(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12112 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12113 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12114 | } |
| 12115 | |
| 12116 | /* vec_all_nle */ |
| 12117 | |
| 12118 | static int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12119 | vec_all_nle(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12120 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12121 | return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12122 | } |
| 12123 | |
| 12124 | /* vec_all_nlt */ |
| 12125 | |
| 12126 | static int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12127 | vec_all_nlt(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12128 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12129 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12130 | } |
| 12131 | |
| 12132 | /* vec_all_numeric */ |
| 12133 | |
| 12134 | static int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12135 | vec_all_numeric(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12136 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12137 | return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12138 | } |
| 12139 | |
| 12140 | /* vec_any_eq */ |
| 12141 | |
| 12142 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12143 | vec_any_eq(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12144 | { |
| 12145 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12146 | __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12147 | } |
| 12148 | |
| 12149 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12150 | vec_any_eq(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12151 | { |
| 12152 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12153 | __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12154 | } |
| 12155 | |
| 12156 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12157 | vec_any_eq(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12158 | { |
| 12159 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12160 | __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12161 | } |
| 12162 | |
| 12163 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12164 | vec_any_eq(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12165 | { |
| 12166 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12167 | __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12168 | } |
| 12169 | |
| 12170 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12171 | vec_any_eq(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12172 | { |
| 12173 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12174 | __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12175 | } |
| 12176 | |
| 12177 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12178 | vec_any_eq(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12179 | { |
| 12180 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12181 | __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12182 | } |
| 12183 | |
| 12184 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12185 | vec_any_eq(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12186 | { |
| 12187 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12188 | __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12189 | } |
| 12190 | |
| 12191 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12192 | vec_any_eq(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12193 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12194 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12195 | } |
| 12196 | |
| 12197 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12198 | vec_any_eq(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12199 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12200 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12201 | } |
| 12202 | |
| 12203 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12204 | vec_any_eq(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12205 | { |
| 12206 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12207 | (vector short)__a, |
| 12208 | (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12209 | } |
| 12210 | |
| 12211 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12212 | vec_any_eq(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12213 | { |
| 12214 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12215 | (vector short)__a, |
| 12216 | (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12217 | } |
| 12218 | |
| 12219 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12220 | vec_any_eq(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12221 | { |
| 12222 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12223 | (vector short)__a, |
| 12224 | (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12225 | } |
| 12226 | |
| 12227 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12228 | vec_any_eq(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12229 | { |
| 12230 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12231 | (vector short)__a, |
| 12232 | (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12233 | } |
| 12234 | |
| 12235 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12236 | vec_any_eq(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12237 | { |
| 12238 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12239 | (vector short)__a, |
| 12240 | (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12241 | } |
| 12242 | |
| 12243 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12244 | vec_any_eq(vector pixel __a, vector pixel __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12245 | { |
| 12246 | return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12247 | (vector short)__a, |
| 12248 | (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12249 | } |
| 12250 | |
| 12251 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12252 | vec_any_eq(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12253 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12254 | return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12255 | } |
| 12256 | |
| 12257 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12258 | vec_any_eq(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12259 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12260 | return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12261 | } |
| 12262 | |
| 12263 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12264 | vec_any_eq(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12265 | { |
| 12266 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12267 | __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12268 | } |
| 12269 | |
| 12270 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12271 | vec_any_eq(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12272 | { |
| 12273 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12274 | __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12275 | } |
| 12276 | |
| 12277 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12278 | vec_any_eq(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12279 | { |
| 12280 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12281 | __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12282 | } |
| 12283 | |
| 12284 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12285 | vec_any_eq(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12286 | { |
| 12287 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12288 | __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12289 | } |
| 12290 | |
| 12291 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12292 | vec_any_eq(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12293 | { |
| 12294 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12295 | __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12296 | } |
| 12297 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 12298 | #ifdef __POWER8_VECTOR__ |
| 12299 | static int __ATTRS_o_ai |
| 12300 | vec_any_eq(vector signed long long __a, vector signed long long __b) |
| 12301 | { |
| 12302 | return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b); |
| 12303 | } |
| 12304 | |
| 12305 | static int __ATTRS_o_ai |
| 12306 | vec_any_eq(vector unsigned long long __a, vector unsigned long long __b) |
| 12307 | { |
| 12308 | return |
| 12309 | __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector long long)__a, |
| 12310 | (vector long long)__b); |
| 12311 | } |
| 12312 | |
| 12313 | static int __ATTRS_o_ai |
| 12314 | vec_any_eq(vector signed long long __a, vector bool long long __b) |
| 12315 | { |
| 12316 | return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, |
| 12317 | (vector signed long long)__b); |
| 12318 | } |
| 12319 | |
| 12320 | static int __ATTRS_o_ai |
| 12321 | vec_any_eq(vector unsigned long long __a, vector bool long long __b) |
| 12322 | { |
| 12323 | return |
| 12324 | __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector signed long long)__a, |
| 12325 | (vector signed long long)__b); |
| 12326 | } |
| 12327 | |
| 12328 | static int __ATTRS_o_ai |
| 12329 | vec_any_eq(vector bool long long __a, vector signed long long __b) |
| 12330 | { |
| 12331 | return |
| 12332 | __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector signed long long)__a, |
| 12333 | (vector signed long long)__b); |
| 12334 | } |
| 12335 | |
| 12336 | static int __ATTRS_o_ai |
| 12337 | vec_any_eq(vector bool long long __a, vector unsigned long long __b) |
| 12338 | { |
| 12339 | return |
| 12340 | __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector signed long long)__a, |
| 12341 | (vector signed long long)__b); |
| 12342 | } |
| 12343 | |
| 12344 | static int __ATTRS_o_ai |
| 12345 | vec_any_eq(vector bool long long __a, vector bool long long __b) |
| 12346 | { |
| 12347 | return |
| 12348 | __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector signed long long)__a, |
| 12349 | (vector signed long long)__b); |
| 12350 | } |
| 12351 | #endif |
| 12352 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12353 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12354 | vec_any_eq(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12355 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12356 | return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12357 | } |
| 12358 | |
| 12359 | /* vec_any_ge */ |
| 12360 | |
| 12361 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12362 | vec_any_ge(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12363 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12364 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12365 | } |
| 12366 | |
| 12367 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12368 | vec_any_ge(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12369 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12370 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12371 | } |
| 12372 | |
| 12373 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12374 | vec_any_ge(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12375 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12376 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12377 | } |
| 12378 | |
| 12379 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12380 | vec_any_ge(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12381 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12382 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12383 | } |
| 12384 | |
| 12385 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12386 | vec_any_ge(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12387 | { |
| 12388 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12389 | (vector unsigned char)__b, |
| 12390 | (vector unsigned char)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12391 | } |
| 12392 | |
| 12393 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12394 | vec_any_ge(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12395 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12396 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, (vector unsigned char)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12397 | } |
| 12398 | |
| 12399 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12400 | vec_any_ge(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12401 | { |
| 12402 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12403 | (vector unsigned char)__b, |
| 12404 | (vector unsigned char)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12405 | } |
| 12406 | |
| 12407 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12408 | vec_any_ge(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12409 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12410 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12411 | } |
| 12412 | |
| 12413 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12414 | vec_any_ge(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12415 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12416 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12417 | } |
| 12418 | |
| 12419 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12420 | vec_any_ge(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12421 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12422 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12423 | } |
| 12424 | |
| 12425 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12426 | vec_any_ge(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12427 | { |
| 12428 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12429 | __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12430 | } |
| 12431 | |
| 12432 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12433 | vec_any_ge(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12434 | { |
| 12435 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12436 | (vector unsigned short)__b, |
| 12437 | (vector unsigned short)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12438 | } |
| 12439 | |
| 12440 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12441 | vec_any_ge(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12442 | { |
| 12443 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12444 | __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, (vector unsigned short)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12445 | } |
| 12446 | |
| 12447 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12448 | vec_any_ge(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12449 | { |
| 12450 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12451 | (vector unsigned short)__b, |
| 12452 | (vector unsigned short)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12453 | } |
| 12454 | |
| 12455 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12456 | vec_any_ge(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12457 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12458 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12459 | } |
| 12460 | |
| 12461 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12462 | vec_any_ge(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12463 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12464 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12465 | } |
| 12466 | |
| 12467 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12468 | vec_any_ge(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12469 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12470 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12471 | } |
| 12472 | |
| 12473 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12474 | vec_any_ge(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12475 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12476 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12477 | } |
| 12478 | |
| 12479 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12480 | vec_any_ge(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12481 | { |
| 12482 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12483 | (vector unsigned int)__b, |
| 12484 | (vector unsigned int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12485 | } |
| 12486 | |
| 12487 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12488 | vec_any_ge(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12489 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12490 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, (vector unsigned int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12491 | } |
| 12492 | |
| 12493 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12494 | vec_any_ge(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12495 | { |
| 12496 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12497 | (vector unsigned int)__b, |
| 12498 | (vector unsigned int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12499 | } |
| 12500 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 12501 | #ifdef __POWER8_VECTOR__ |
| 12502 | static int __ATTRS_o_ai |
| 12503 | vec_any_ge(vector signed long long __a, vector signed long long __b) |
| 12504 | { |
| 12505 | return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a); |
| 12506 | } |
| 12507 | |
| 12508 | static int __ATTRS_o_ai |
| 12509 | vec_any_ge(vector unsigned long long __a, vector unsigned long long __b) |
| 12510 | { |
| 12511 | return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b, __a); |
| 12512 | } |
| 12513 | |
| 12514 | static int __ATTRS_o_ai |
| 12515 | vec_any_ge(vector signed long long __a, vector bool long long __b) |
| 12516 | { |
| 12517 | return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, |
| 12518 | (vector signed long long)__b, __a); |
| 12519 | } |
| 12520 | |
| 12521 | static int __ATTRS_o_ai |
| 12522 | vec_any_ge(vector unsigned long long __a, vector bool long long __b) |
| 12523 | { |
| 12524 | return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, |
| 12525 | (vector unsigned long long)__b, __a); |
| 12526 | } |
| 12527 | |
| 12528 | static int __ATTRS_o_ai |
| 12529 | vec_any_ge(vector bool long long __a, vector signed long long __b) |
| 12530 | { |
| 12531 | return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, |
| 12532 | (vector unsigned long long)__b, |
| 12533 | (vector unsigned long long)__a); |
| 12534 | } |
| 12535 | |
| 12536 | static int __ATTRS_o_ai |
| 12537 | vec_any_ge(vector bool long long __a, vector unsigned long long __b) |
| 12538 | { |
| 12539 | return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b, |
| 12540 | (vector unsigned long long)__a); |
| 12541 | } |
| 12542 | |
| 12543 | static int __ATTRS_o_ai |
| 12544 | vec_any_ge(vector bool long long __a, vector bool long long __b) |
| 12545 | { |
| 12546 | return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, |
| 12547 | (vector unsigned long long)__b, |
| 12548 | (vector unsigned long long)__a); |
| 12549 | } |
| 12550 | #endif |
| 12551 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12552 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12553 | vec_any_ge(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12554 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12555 | return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12556 | } |
| 12557 | |
| 12558 | /* vec_any_gt */ |
| 12559 | |
| 12560 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12561 | vec_any_gt(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12562 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12563 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12564 | } |
| 12565 | |
| 12566 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12567 | vec_any_gt(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12568 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12569 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, (vector signed char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12570 | } |
| 12571 | |
| 12572 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12573 | vec_any_gt(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12574 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12575 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12576 | } |
| 12577 | |
| 12578 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12579 | vec_any_gt(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12580 | { |
| 12581 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12582 | __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12583 | } |
| 12584 | |
| 12585 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12586 | vec_any_gt(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12587 | { |
| 12588 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12589 | (vector unsigned char)__a, |
| 12590 | (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12591 | } |
| 12592 | |
| 12593 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12594 | vec_any_gt(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12595 | { |
| 12596 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12597 | __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12598 | } |
| 12599 | |
| 12600 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12601 | vec_any_gt(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12602 | { |
| 12603 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12604 | (vector unsigned char)__a, |
| 12605 | (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12606 | } |
| 12607 | |
| 12608 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12609 | vec_any_gt(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12610 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12611 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12612 | } |
| 12613 | |
| 12614 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12615 | vec_any_gt(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12616 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12617 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12618 | } |
| 12619 | |
| 12620 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12621 | vec_any_gt(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12622 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12623 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12624 | } |
| 12625 | |
| 12626 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12627 | vec_any_gt(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12628 | { |
| 12629 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12630 | __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12631 | } |
| 12632 | |
| 12633 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12634 | vec_any_gt(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12635 | { |
| 12636 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12637 | (vector unsigned short)__a, |
| 12638 | (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12639 | } |
| 12640 | |
| 12641 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12642 | vec_any_gt(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12643 | { |
| 12644 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12645 | __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12646 | } |
| 12647 | |
| 12648 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12649 | vec_any_gt(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12650 | { |
| 12651 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12652 | (vector unsigned short)__a, |
| 12653 | (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12654 | } |
| 12655 | |
| 12656 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12657 | vec_any_gt(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12658 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12659 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12660 | } |
| 12661 | |
| 12662 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12663 | vec_any_gt(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12664 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12665 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12666 | } |
| 12667 | |
| 12668 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12669 | vec_any_gt(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12670 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12671 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12672 | } |
| 12673 | |
| 12674 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12675 | vec_any_gt(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12676 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12677 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12678 | } |
| 12679 | |
| 12680 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12681 | vec_any_gt(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12682 | { |
| 12683 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12684 | (vector unsigned int)__a, |
| 12685 | (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12686 | } |
| 12687 | |
| 12688 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12689 | vec_any_gt(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12690 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12691 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12692 | } |
| 12693 | |
| 12694 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12695 | vec_any_gt(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12696 | { |
| 12697 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12698 | (vector unsigned int)__a, |
| 12699 | (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12700 | } |
| 12701 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 12702 | #ifdef __POWER8_VECTOR__ |
| 12703 | static int __ATTRS_o_ai |
| 12704 | vec_any_gt(vector signed long long __a, vector signed long long __b) |
| 12705 | { |
| 12706 | return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b); |
| 12707 | } |
| 12708 | |
| 12709 | static int __ATTRS_o_ai |
| 12710 | vec_any_gt(vector unsigned long long __a, vector unsigned long long __b) |
| 12711 | { |
| 12712 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, __b); |
| 12713 | } |
| 12714 | |
| 12715 | static int __ATTRS_o_ai |
| 12716 | vec_any_gt(vector signed long long __a, vector bool long long __b) |
| 12717 | { |
| 12718 | return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, |
| 12719 | (vector signed long long)__b); |
| 12720 | } |
| 12721 | |
| 12722 | |
| 12723 | static int __ATTRS_o_ai |
| 12724 | vec_any_gt(vector unsigned long long __a, vector bool long long __b) |
| 12725 | { |
| 12726 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, |
| 12727 | (vector unsigned long long)__b); |
| 12728 | } |
| 12729 | |
| 12730 | static int __ATTRS_o_ai |
| 12731 | vec_any_gt(vector bool long long __a, vector signed long long __b) |
| 12732 | { |
| 12733 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, |
| 12734 | (vector unsigned long long)__a, |
| 12735 | (vector unsigned long long)__b); |
| 12736 | } |
| 12737 | |
| 12738 | static int __ATTRS_o_ai |
| 12739 | vec_any_gt(vector bool long long __a, vector unsigned long long __b) |
| 12740 | { |
| 12741 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, |
| 12742 | (vector unsigned long long)__a, __b); |
| 12743 | } |
| 12744 | |
| 12745 | static int __ATTRS_o_ai |
| 12746 | vec_any_gt(vector bool long long __a, vector bool long long __b) |
| 12747 | { |
| 12748 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, |
| 12749 | (vector unsigned long long)__a, |
| 12750 | (vector unsigned long long)__b); |
| 12751 | } |
| 12752 | #endif |
| 12753 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12754 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12755 | vec_any_gt(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12756 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12757 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12758 | } |
| 12759 | |
| 12760 | /* vec_any_le */ |
| 12761 | |
| 12762 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12763 | vec_any_le(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12764 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12765 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12766 | } |
| 12767 | |
| 12768 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12769 | vec_any_le(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12770 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12771 | return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, (vector signed char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12772 | } |
| 12773 | |
| 12774 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12775 | vec_any_le(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12776 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12777 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12778 | } |
| 12779 | |
| 12780 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12781 | vec_any_le(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12782 | { |
| 12783 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12784 | __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12785 | } |
| 12786 | |
| 12787 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12788 | vec_any_le(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12789 | { |
| 12790 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12791 | (vector unsigned char)__a, |
| 12792 | (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12793 | } |
| 12794 | |
| 12795 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12796 | vec_any_le(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12797 | { |
| 12798 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12799 | __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12800 | } |
| 12801 | |
| 12802 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12803 | vec_any_le(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12804 | { |
| 12805 | return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12806 | (vector unsigned char)__a, |
| 12807 | (vector unsigned char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12808 | } |
| 12809 | |
| 12810 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12811 | vec_any_le(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12812 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12813 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12814 | } |
| 12815 | |
| 12816 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12817 | vec_any_le(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12818 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12819 | return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12820 | } |
| 12821 | |
| 12822 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12823 | vec_any_le(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12824 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12825 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12826 | } |
| 12827 | |
| 12828 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12829 | vec_any_le(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12830 | { |
| 12831 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12832 | __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12833 | } |
| 12834 | |
| 12835 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12836 | vec_any_le(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12837 | { |
| 12838 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12839 | (vector unsigned short)__a, |
| 12840 | (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12841 | } |
| 12842 | |
| 12843 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12844 | vec_any_le(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12845 | { |
| 12846 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12847 | __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12848 | } |
| 12849 | |
| 12850 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12851 | vec_any_le(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12852 | { |
| 12853 | return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12854 | (vector unsigned short)__a, |
| 12855 | (vector unsigned short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12856 | } |
| 12857 | |
| 12858 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12859 | vec_any_le(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12860 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12861 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12862 | } |
| 12863 | |
| 12864 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12865 | vec_any_le(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12866 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12867 | return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12868 | } |
| 12869 | |
| 12870 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12871 | vec_any_le(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12872 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12873 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12874 | } |
| 12875 | |
| 12876 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12877 | vec_any_le(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12878 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12879 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12880 | } |
| 12881 | |
| 12882 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12883 | vec_any_le(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12884 | { |
| 12885 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12886 | (vector unsigned int)__a, |
| 12887 | (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12888 | } |
| 12889 | |
| 12890 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12891 | vec_any_le(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12892 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12893 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12894 | } |
| 12895 | |
| 12896 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12897 | vec_any_le(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12898 | { |
| 12899 | return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12900 | (vector unsigned int)__a, |
| 12901 | (vector unsigned int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12902 | } |
| 12903 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 12904 | #ifdef __POWER8_VECTOR__ |
| 12905 | static int __ATTRS_o_ai |
| 12906 | vec_any_le(vector signed long long __a, vector signed long long __b) |
| 12907 | { |
| 12908 | return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b); |
| 12909 | } |
| 12910 | |
| 12911 | static int __ATTRS_o_ai |
| 12912 | vec_any_le(vector unsigned long long __a, vector unsigned long long __b) |
| 12913 | { |
| 12914 | return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, __b); |
| 12915 | } |
| 12916 | |
| 12917 | static int __ATTRS_o_ai |
| 12918 | vec_any_le(vector signed long long __a, vector bool long long __b) |
| 12919 | { |
| 12920 | return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, |
| 12921 | (vector signed long long)__b); |
| 12922 | } |
| 12923 | |
| 12924 | static int __ATTRS_o_ai |
| 12925 | vec_any_le(vector unsigned long long __a, vector bool long long __b) |
| 12926 | { |
| 12927 | return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, |
| 12928 | (vector unsigned long long)__b); |
| 12929 | } |
| 12930 | |
| 12931 | static int __ATTRS_o_ai |
| 12932 | vec_any_le(vector bool long long __a, vector signed long long __b) |
| 12933 | { |
| 12934 | return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, |
| 12935 | (vector unsigned long long)__a, |
| 12936 | (vector unsigned long long)__b); |
| 12937 | } |
| 12938 | |
| 12939 | static int __ATTRS_o_ai |
| 12940 | vec_any_le(vector bool long long __a, vector unsigned long long __b) |
| 12941 | { |
| 12942 | return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, |
| 12943 | (vector unsigned long long)__a, __b); |
| 12944 | } |
| 12945 | |
| 12946 | static int __ATTRS_o_ai |
| 12947 | vec_any_le(vector bool long long __a, vector bool long long __b) |
| 12948 | { |
| 12949 | return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, |
| 12950 | (vector unsigned long long)__a, |
| 12951 | (vector unsigned long long)__b); |
| 12952 | } |
| 12953 | #endif |
| 12954 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12955 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12956 | vec_any_le(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12957 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12958 | return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12959 | } |
| 12960 | |
| 12961 | /* vec_any_lt */ |
| 12962 | |
| 12963 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12964 | vec_any_lt(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12965 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12966 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12967 | } |
| 12968 | |
| 12969 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12970 | vec_any_lt(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12971 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12972 | return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12973 | } |
| 12974 | |
| 12975 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12976 | vec_any_lt(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12977 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12978 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12979 | } |
| 12980 | |
| 12981 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12982 | vec_any_lt(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12983 | { |
| 12984 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12985 | __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12986 | } |
| 12987 | |
| 12988 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12989 | vec_any_lt(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12990 | { |
| 12991 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12992 | (vector unsigned char)__b, |
| 12993 | (vector unsigned char)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12994 | } |
| 12995 | |
| 12996 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 12997 | vec_any_lt(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 12998 | { |
| 12999 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13000 | __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, (vector unsigned char)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13001 | } |
| 13002 | |
| 13003 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13004 | vec_any_lt(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13005 | { |
| 13006 | return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13007 | (vector unsigned char)__b, |
| 13008 | (vector unsigned char)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13009 | } |
| 13010 | |
| 13011 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13012 | vec_any_lt(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13013 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13014 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13015 | } |
| 13016 | |
| 13017 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13018 | vec_any_lt(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13019 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13020 | return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13021 | } |
| 13022 | |
| 13023 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13024 | vec_any_lt(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13025 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13026 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13027 | } |
| 13028 | |
| 13029 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13030 | vec_any_lt(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13031 | { |
| 13032 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13033 | __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13034 | } |
| 13035 | |
| 13036 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13037 | vec_any_lt(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13038 | { |
| 13039 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13040 | (vector unsigned short)__b, |
| 13041 | (vector unsigned short)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13042 | } |
| 13043 | |
| 13044 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13045 | vec_any_lt(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13046 | { |
| 13047 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13048 | __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, (vector unsigned short)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13049 | } |
| 13050 | |
| 13051 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13052 | vec_any_lt(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13053 | { |
| 13054 | return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13055 | (vector unsigned short)__b, |
| 13056 | (vector unsigned short)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13057 | } |
| 13058 | |
| 13059 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13060 | vec_any_lt(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13061 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13062 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13063 | } |
| 13064 | |
| 13065 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13066 | vec_any_lt(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13067 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13068 | return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13069 | } |
| 13070 | |
| 13071 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13072 | vec_any_lt(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13073 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13074 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13075 | } |
| 13076 | |
| 13077 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13078 | vec_any_lt(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13079 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13080 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13081 | } |
| 13082 | |
| 13083 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13084 | vec_any_lt(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13085 | { |
| 13086 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13087 | (vector unsigned int)__b, |
| 13088 | (vector unsigned int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13089 | } |
| 13090 | |
| 13091 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13092 | vec_any_lt(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13093 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13094 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, (vector unsigned int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13095 | } |
| 13096 | |
| 13097 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13098 | vec_any_lt(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13099 | { |
| 13100 | return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13101 | (vector unsigned int)__b, |
| 13102 | (vector unsigned int)__a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13103 | } |
| 13104 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 13105 | #ifdef __POWER8_VECTOR__ |
| 13106 | static int __ATTRS_o_ai |
| 13107 | vec_any_lt(vector signed long long __a, vector signed long long __b) |
| 13108 | { |
| 13109 | return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a); |
| 13110 | } |
| 13111 | |
| 13112 | static int __ATTRS_o_ai |
| 13113 | vec_any_lt(vector unsigned long long __a, vector unsigned long long __b) |
| 13114 | { |
| 13115 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, __a); |
| 13116 | } |
| 13117 | |
| 13118 | static int __ATTRS_o_ai |
| 13119 | vec_any_lt(vector signed long long __a, vector bool long long __b) |
| 13120 | { |
| 13121 | return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, |
| 13122 | (vector signed long long)__b, __a); |
| 13123 | } |
| 13124 | |
| 13125 | static int __ATTRS_o_ai |
| 13126 | vec_any_lt(vector unsigned long long __a, vector bool long long __b) |
| 13127 | { |
| 13128 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, |
| 13129 | (vector unsigned long long)__b, __a); |
| 13130 | } |
| 13131 | |
| 13132 | static int __ATTRS_o_ai |
| 13133 | vec_any_lt(vector bool long long __a, vector signed long long __b) |
| 13134 | { |
| 13135 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, |
| 13136 | (vector unsigned long long)__b, |
| 13137 | (vector unsigned long long)__a); |
| 13138 | } |
| 13139 | |
| 13140 | static int __ATTRS_o_ai |
| 13141 | vec_any_lt(vector bool long long __a, vector unsigned long long __b) |
| 13142 | { |
| 13143 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, |
| 13144 | (vector unsigned long long)__a); |
| 13145 | } |
| 13146 | |
| 13147 | static int __ATTRS_o_ai |
| 13148 | vec_any_lt(vector bool long long __a, vector bool long long __b) |
| 13149 | { |
| 13150 | return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, |
| 13151 | (vector unsigned long long)__b, |
| 13152 | (vector unsigned long long)__a); |
| 13153 | } |
| 13154 | #endif |
| 13155 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13156 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13157 | vec_any_lt(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13158 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13159 | return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13160 | } |
| 13161 | |
| 13162 | /* vec_any_nan */ |
| 13163 | |
| 13164 | static int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13165 | vec_any_nan(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13166 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13167 | return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13168 | } |
| 13169 | |
| 13170 | /* vec_any_ne */ |
| 13171 | |
| 13172 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13173 | vec_any_ne(vector signed char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13174 | { |
| 13175 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13176 | __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13177 | } |
| 13178 | |
| 13179 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13180 | vec_any_ne(vector signed char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13181 | { |
| 13182 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13183 | __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13184 | } |
| 13185 | |
| 13186 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13187 | vec_any_ne(vector unsigned char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13188 | { |
| 13189 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13190 | __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13191 | } |
| 13192 | |
| 13193 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13194 | vec_any_ne(vector unsigned char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13195 | { |
| 13196 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13197 | __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13198 | } |
| 13199 | |
| 13200 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13201 | vec_any_ne(vector bool char __a, vector signed char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13202 | { |
| 13203 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13204 | __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13205 | } |
| 13206 | |
| 13207 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13208 | vec_any_ne(vector bool char __a, vector unsigned char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13209 | { |
| 13210 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13211 | __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13212 | } |
| 13213 | |
| 13214 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13215 | vec_any_ne(vector bool char __a, vector bool char __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13216 | { |
| 13217 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13218 | __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a, (vector char)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13219 | } |
| 13220 | |
| 13221 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13222 | vec_any_ne(vector short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13223 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13224 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13225 | } |
| 13226 | |
| 13227 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13228 | vec_any_ne(vector short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13229 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13230 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13231 | } |
| 13232 | |
| 13233 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13234 | vec_any_ne(vector unsigned short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13235 | { |
| 13236 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13237 | (vector short)__a, |
| 13238 | (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13239 | } |
| 13240 | |
| 13241 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13242 | vec_any_ne(vector unsigned short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13243 | { |
| 13244 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13245 | (vector short)__a, |
| 13246 | (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13247 | } |
| 13248 | |
| 13249 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13250 | vec_any_ne(vector bool short __a, vector short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13251 | { |
| 13252 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13253 | (vector short)__a, |
| 13254 | (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13255 | } |
| 13256 | |
| 13257 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13258 | vec_any_ne(vector bool short __a, vector unsigned short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13259 | { |
| 13260 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13261 | (vector short)__a, |
| 13262 | (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13263 | } |
| 13264 | |
| 13265 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13266 | vec_any_ne(vector bool short __a, vector bool short __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13267 | { |
| 13268 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13269 | (vector short)__a, |
| 13270 | (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13271 | } |
| 13272 | |
| 13273 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13274 | vec_any_ne(vector pixel __a, vector pixel __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13275 | { |
| 13276 | return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13277 | (vector short)__a, |
| 13278 | (vector short)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13279 | } |
| 13280 | |
| 13281 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13282 | vec_any_ne(vector int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13283 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13284 | return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13285 | } |
| 13286 | |
| 13287 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13288 | vec_any_ne(vector int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13289 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13290 | return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13291 | } |
| 13292 | |
| 13293 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13294 | vec_any_ne(vector unsigned int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13295 | { |
| 13296 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13297 | __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13298 | } |
| 13299 | |
| 13300 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13301 | vec_any_ne(vector unsigned int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13302 | { |
| 13303 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13304 | __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13305 | } |
| 13306 | |
| 13307 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13308 | vec_any_ne(vector bool int __a, vector int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13309 | { |
| 13310 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13311 | __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13312 | } |
| 13313 | |
| 13314 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13315 | vec_any_ne(vector bool int __a, vector unsigned int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13316 | { |
| 13317 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13318 | __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13319 | } |
| 13320 | |
| 13321 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13322 | vec_any_ne(vector bool int __a, vector bool int __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13323 | { |
| 13324 | return |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13325 | __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a, (vector int)__b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13326 | } |
| 13327 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 13328 | #ifdef __POWER8_VECTOR__ |
| 13329 | static int __ATTRS_o_ai |
| 13330 | vec_any_ne(vector signed long long __a, vector signed long long __b) |
| 13331 | { |
| 13332 | return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b); |
| 13333 | } |
| 13334 | |
| 13335 | static int __ATTRS_o_ai |
| 13336 | vec_any_ne(vector unsigned long long __a, vector unsigned long long __b) |
| 13337 | { |
| 13338 | return |
| 13339 | __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector long long)__a, |
| 13340 | (vector long long)__b); |
| 13341 | } |
| 13342 | |
| 13343 | static int __ATTRS_o_ai |
| 13344 | vec_any_ne(vector signed long long __a, vector bool long long __b) |
| 13345 | { |
| 13346 | return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, |
| 13347 | (vector signed long long)__b); |
| 13348 | } |
| 13349 | |
| 13350 | static int __ATTRS_o_ai |
| 13351 | vec_any_ne(vector unsigned long long __a, vector bool long long __b) |
| 13352 | { |
| 13353 | return |
| 13354 | __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector signed long long)__a, |
| 13355 | (vector signed long long)__b); |
| 13356 | } |
| 13357 | |
| 13358 | static int __ATTRS_o_ai |
| 13359 | vec_any_ne(vector bool long long __a, vector signed long long __b) |
| 13360 | { |
| 13361 | return |
| 13362 | __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector signed long long)__a, |
| 13363 | (vector signed long long)__b); |
| 13364 | } |
| 13365 | |
| 13366 | static int __ATTRS_o_ai |
| 13367 | vec_any_ne(vector bool long long __a, vector unsigned long long __b) |
| 13368 | { |
| 13369 | return |
| 13370 | __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector signed long long)__a, |
| 13371 | (vector signed long long)__b); |
| 13372 | } |
| 13373 | |
| 13374 | static int __ATTRS_o_ai |
| 13375 | vec_any_ne(vector bool long long __a, vector bool long long __b) |
| 13376 | { |
| 13377 | return |
| 13378 | __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector signed long long)__a, |
| 13379 | (vector signed long long)__b); |
| 13380 | } |
| 13381 | #endif |
| 13382 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13383 | static int __ATTRS_o_ai |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13384 | vec_any_ne(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13385 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13386 | return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13387 | } |
| 13388 | |
| 13389 | /* vec_any_nge */ |
| 13390 | |
| 13391 | static int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13392 | vec_any_nge(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13393 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13394 | return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13395 | } |
| 13396 | |
| 13397 | /* vec_any_ngt */ |
| 13398 | |
| 13399 | static int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13400 | vec_any_ngt(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13401 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13402 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13403 | } |
| 13404 | |
| 13405 | /* vec_any_nle */ |
| 13406 | |
| 13407 | static int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13408 | vec_any_nle(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13409 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13410 | return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13411 | } |
| 13412 | |
| 13413 | /* vec_any_nlt */ |
| 13414 | |
| 13415 | static int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13416 | vec_any_nlt(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13417 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13418 | return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13419 | } |
| 13420 | |
| 13421 | /* vec_any_numeric */ |
| 13422 | |
| 13423 | static int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13424 | vec_any_numeric(vector float __a) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13425 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13426 | return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13427 | } |
| 13428 | |
| 13429 | /* vec_any_out */ |
| 13430 | |
| 13431 | static int __attribute__((__always_inline__)) |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13432 | vec_any_out(vector float __a, vector float __b) |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13433 | { |
Stephen Hines | c6ee7df | 2013-04-02 18:41:57 -0700 | [diff] [blame] | 13434 | return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, __a, __b); |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13435 | } |
| 13436 | |
Stephen Hines | 3f86823 | 2015-04-10 09:22:19 -0700 | [diff] [blame] | 13437 | /* Power 8 Crypto functions |
| 13438 | Note: We diverge from the current GCC implementation with regard |
| 13439 | to cryptography and related functions as follows: |
| 13440 | - Only the SHA and AES instructions and builtins are disabled by -mno-crypto |
| 13441 | - The remaining ones are only available on Power8 and up so |
| 13442 | require -mpower8-vector |
| 13443 | The justification for this is that export requirements require that |
| 13444 | Category:Vector.Crypto is optional (i.e. compliant hardware may not provide |
| 13445 | support). As a result, we need to be able to turn off support for those. |
| 13446 | The remaining ones (currently controlled by -mcrypto for GCC) still |
| 13447 | need to be provided on compliant hardware even if Vector.Crypto is not |
| 13448 | provided. |
| 13449 | FIXME: the naming convention for the builtins will be adjusted due |
| 13450 | to the inconsistency (__builtin_crypto_ prefix on builtins that cannot be |
| 13451 | removed with -mno-crypto). This is under development. |
| 13452 | */ |
| 13453 | #ifdef __CRYPTO__ |
| 13454 | static vector unsigned long long __attribute__((__always_inline__)) |
| 13455 | __builtin_crypto_vsbox (vector unsigned long long __a) |
| 13456 | { |
| 13457 | return __builtin_altivec_crypto_vsbox(__a); |
| 13458 | } |
| 13459 | |
| 13460 | static vector unsigned long long __attribute__((__always_inline__)) |
| 13461 | __builtin_crypto_vcipher (vector unsigned long long __a, |
| 13462 | vector unsigned long long __b) |
| 13463 | { |
| 13464 | return __builtin_altivec_crypto_vcipher(__a, __b); |
| 13465 | } |
| 13466 | |
| 13467 | static vector unsigned long long __attribute__((__always_inline__)) |
| 13468 | __builtin_crypto_vcipherlast (vector unsigned long long __a, |
| 13469 | vector unsigned long long __b) |
| 13470 | { |
| 13471 | return __builtin_altivec_crypto_vcipherlast(__a, __b); |
| 13472 | } |
| 13473 | |
| 13474 | static vector unsigned long long __attribute__((__always_inline__)) |
| 13475 | __builtin_crypto_vncipher (vector unsigned long long __a, |
| 13476 | vector unsigned long long __b) |
| 13477 | { |
| 13478 | return __builtin_altivec_crypto_vncipher(__a, __b); |
| 13479 | } |
| 13480 | |
| 13481 | static vector unsigned long long __attribute__((__always_inline__)) |
| 13482 | __builtin_crypto_vncipherlast (vector unsigned long long __a, |
| 13483 | vector unsigned long long __b) |
| 13484 | { |
| 13485 | return __builtin_altivec_crypto_vncipherlast(__a, __b); |
| 13486 | } |
| 13487 | |
| 13488 | |
| 13489 | #define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad |
| 13490 | #define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw |
| 13491 | #endif |
| 13492 | |
| 13493 | #ifdef __POWER8_VECTOR__ |
| 13494 | static vector unsigned char __ATTRS_o_ai |
| 13495 | __builtin_crypto_vpermxor (vector unsigned char __a, |
| 13496 | vector unsigned char __b, |
| 13497 | vector unsigned char __c) |
| 13498 | { |
| 13499 | return __builtin_altivec_crypto_vpermxor(__a, __b, __c); |
| 13500 | } |
| 13501 | |
| 13502 | static vector unsigned short __ATTRS_o_ai |
| 13503 | __builtin_crypto_vpermxor (vector unsigned short __a, |
| 13504 | vector unsigned short __b, |
| 13505 | vector unsigned short __c) |
| 13506 | { |
| 13507 | return (vector unsigned short) |
| 13508 | __builtin_altivec_crypto_vpermxor((vector unsigned char) __a, |
| 13509 | (vector unsigned char) __b, |
| 13510 | (vector unsigned char) __c); |
| 13511 | } |
| 13512 | |
| 13513 | static vector unsigned int __ATTRS_o_ai |
| 13514 | __builtin_crypto_vpermxor (vector unsigned int __a, |
| 13515 | vector unsigned int __b, |
| 13516 | vector unsigned int __c) |
| 13517 | { |
| 13518 | return (vector unsigned int) |
| 13519 | __builtin_altivec_crypto_vpermxor((vector unsigned char) __a, |
| 13520 | (vector unsigned char) __b, |
| 13521 | (vector unsigned char) __c); |
| 13522 | } |
| 13523 | |
| 13524 | static vector unsigned long long __ATTRS_o_ai |
| 13525 | __builtin_crypto_vpermxor (vector unsigned long long __a, |
| 13526 | vector unsigned long long __b, |
| 13527 | vector unsigned long long __c) |
| 13528 | { |
| 13529 | return (vector unsigned long long) |
| 13530 | __builtin_altivec_crypto_vpermxor((vector unsigned char) __a, |
| 13531 | (vector unsigned char) __b, |
| 13532 | (vector unsigned char) __c); |
| 13533 | } |
| 13534 | |
| 13535 | static vector unsigned char __ATTRS_o_ai |
| 13536 | __builtin_crypto_vpmsumb (vector unsigned char __a, |
| 13537 | vector unsigned char __b) |
| 13538 | { |
| 13539 | return __builtin_altivec_crypto_vpmsumb(__a, __b); |
| 13540 | } |
| 13541 | |
| 13542 | static vector unsigned short __ATTRS_o_ai |
| 13543 | __builtin_crypto_vpmsumb (vector unsigned short __a, |
| 13544 | vector unsigned short __b) |
| 13545 | { |
| 13546 | return __builtin_altivec_crypto_vpmsumh(__a, __b); |
| 13547 | } |
| 13548 | |
| 13549 | static vector unsigned int __ATTRS_o_ai |
| 13550 | __builtin_crypto_vpmsumb (vector unsigned int __a, |
| 13551 | vector unsigned int __b) |
| 13552 | { |
| 13553 | return __builtin_altivec_crypto_vpmsumw(__a, __b); |
| 13554 | } |
| 13555 | |
| 13556 | static vector unsigned long long __ATTRS_o_ai |
| 13557 | __builtin_crypto_vpmsumb (vector unsigned long long __a, |
| 13558 | vector unsigned long long __b) |
| 13559 | { |
| 13560 | return __builtin_altivec_crypto_vpmsumd(__a, __b); |
| 13561 | } |
| 13562 | #endif |
| 13563 | |
Ying Wang | b335bb0 | 2011-11-29 10:23:55 -0800 | [diff] [blame] | 13564 | #undef __ATTRS_o_ai |
| 13565 | |
| 13566 | #endif /* __ALTIVEC_H */ |