Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 1 | /*===---- mmintrin.h - MMX intrinsics --------------------------------------=== |
| 2 | * |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 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 | |
| 24 | #ifndef __MMINTRIN_H |
| 25 | #define __MMINTRIN_H |
| 26 | |
| 27 | #ifndef __MMX__ |
| 28 | #error "MMX instruction set not enabled" |
| 29 | #else |
| 30 | |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 31 | typedef long long __m64 __attribute__((__vector_size__(8))); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 32 | |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 33 | typedef int __v2si __attribute__((__vector_size__(8))); |
| 34 | typedef short __v4hi __attribute__((__vector_size__(8))); |
Anders Carlsson | 4bf4e30 | 2009-09-18 19:18:19 +0000 | [diff] [blame] | 35 | typedef char __v8qi __attribute__((__vector_size__(8))); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 36 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 37 | static inline void __attribute__((__always_inline__, __nodebug__)) |
| 38 | _mm_empty(void) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 39 | { |
| 40 | __builtin_ia32_emms(); |
| 41 | } |
| 42 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 43 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 44 | _mm_cvtsi32_si64(int __i) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 45 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 46 | return (__m64)(__v2si){__i, 0}; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 47 | } |
| 48 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 49 | static inline int __attribute__((__always_inline__, __nodebug__)) |
| 50 | _mm_cvtsi64_si32(__m64 __m) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 51 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 52 | __v2si __mmx_var2 = (__v2si)__m; |
Eli Friedman | 1e6d14f | 2008-05-14 20:11:29 +0000 | [diff] [blame] | 53 | return __mmx_var2[0]; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 54 | } |
| 55 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 56 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 57 | _mm_cvtsi64_m64(long long __i) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 58 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 59 | return (__m64)__i; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 60 | } |
| 61 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 62 | static inline long long __attribute__((__always_inline__, __nodebug__)) |
| 63 | _mm_cvtm64_si64(__m64 __m) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 64 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 65 | return (long long)__m; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 66 | } |
| 67 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 68 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 69 | _mm_packs_pi16(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 70 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 71 | return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 72 | } |
| 73 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 74 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 75 | _mm_packs_pi32(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 76 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 77 | return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 78 | } |
| 79 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 80 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 81 | _mm_packs_pu16(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 82 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 83 | return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 84 | } |
| 85 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 86 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 87 | _mm_unpackhi_pi8(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 88 | { |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 89 | return (__m64)__builtin_shufflevector((__v8qi)__m1, (__v8qi)__m2, 4, 8+4, 5, |
| 90 | 8+5, 6, 8+6, 7, 8+7); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 91 | } |
| 92 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 93 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 94 | _mm_unpackhi_pi16(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 95 | { |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 96 | return (__m64)__builtin_shufflevector((__v4hi)__m1, (__v4hi)__m2, 2, 4+2, 3, |
| 97 | 4+3); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 98 | } |
| 99 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 100 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 101 | _mm_unpackhi_pi32(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 102 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 103 | return (__m64)__builtin_shufflevector((__v2si)__m1, (__v2si)__m2, 1, 2+1); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 104 | } |
| 105 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 106 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 107 | _mm_unpacklo_pi8(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 108 | { |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 109 | return (__m64)__builtin_shufflevector((__v8qi)__m1, (__v8qi)__m2, 0, 8+0, 1, |
| 110 | 8+1, 2, 8+2, 3, 8+3); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 111 | } |
| 112 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 113 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 114 | _mm_unpacklo_pi16(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 115 | { |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 116 | return (__m64)__builtin_shufflevector((__v4hi)__m1, (__v4hi)__m2, 0, 4+0, 1, |
| 117 | 4+1); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 118 | } |
| 119 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 120 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 121 | _mm_unpacklo_pi32(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 122 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 123 | return (__m64)__builtin_shufflevector((__v2si)__m1, (__v2si)__m2, 0, 2+0); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 124 | } |
| 125 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 126 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 127 | _mm_add_pi8(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 128 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 129 | return (__m64)((__v8qi)__m1 + (__v8qi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 130 | } |
| 131 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 132 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 133 | _mm_add_pi16(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 134 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 135 | return (__m64)((__v4hi)__m1 + (__v4hi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 136 | } |
| 137 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 138 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 139 | _mm_add_pi32(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 140 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 141 | return (__m64)((__v2si)__m1 + (__v2si)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 142 | } |
| 143 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 144 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 145 | _mm_adds_pi8(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 146 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 147 | return (__m64)__builtin_ia32_paddsb((__v8qi)__m1, (__v8qi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 148 | } |
| 149 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 150 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 151 | _mm_adds_pi16(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 152 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 153 | return (__m64)__builtin_ia32_paddsw((__v4hi)__m1, (__v4hi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 154 | } |
| 155 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 156 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 157 | _mm_adds_pu8(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 158 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 159 | return (__m64)__builtin_ia32_paddusb((__v8qi)__m1, (__v8qi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 160 | } |
| 161 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 162 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 163 | _mm_adds_pu16(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 164 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 165 | return (__m64)__builtin_ia32_paddusw((__v4hi)__m1, (__v4hi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 166 | } |
| 167 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 168 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 169 | _mm_sub_pi8(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 170 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 171 | return (__m64)((__v8qi)__m1 - (__v8qi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 172 | } |
| 173 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 174 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 175 | _mm_sub_pi16(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 176 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 177 | return (__m64)((__v4hi)__m1 - (__v4hi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 178 | } |
| 179 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 180 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 181 | _mm_sub_pi32(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 182 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 183 | return (__m64)((__v2si)__m1 - (__v2si)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 184 | } |
| 185 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 186 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 187 | _mm_subs_pi8(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 188 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 189 | return (__m64)__builtin_ia32_psubsb((__v8qi)__m1, (__v8qi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 190 | } |
| 191 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 192 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 193 | _mm_subs_pi16(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 194 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 195 | return (__m64)__builtin_ia32_psubsw((__v4hi)__m1, (__v4hi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 196 | } |
| 197 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 198 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 199 | _mm_subs_pu8(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 200 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 201 | return (__m64)__builtin_ia32_psubusb((__v8qi)__m1, (__v8qi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 202 | } |
| 203 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 204 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 205 | _mm_subs_pu16(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 206 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 207 | return (__m64)__builtin_ia32_psubusw((__v4hi)__m1, (__v4hi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 208 | } |
| 209 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 210 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 211 | _mm_madd_pi16(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 212 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 213 | return (__m64)__builtin_ia32_pmaddwd((__v4hi)__m1, (__v4hi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 214 | } |
| 215 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 216 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 217 | _mm_mulhi_pi16(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 218 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 219 | return (__m64)__builtin_ia32_pmulhw((__v4hi)__m1, (__v4hi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 220 | } |
| 221 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 222 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 223 | _mm_mullo_pi16(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 224 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 225 | return (__m64)((__v4hi)__m1 * (__v4hi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 226 | } |
| 227 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 228 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 229 | _mm_sll_pi16(__m64 __m, __m64 __count) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 230 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 231 | return (__m64)__builtin_ia32_psllw((__v4hi)__m, __count); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 232 | } |
| 233 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 234 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 235 | _mm_slli_pi16(__m64 __m, int __count) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 236 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 237 | return (__m64)__builtin_ia32_psllwi((__v4hi)__m, __count); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 238 | } |
| 239 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 240 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 241 | _mm_sll_pi32(__m64 __m, __m64 __count) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 242 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 243 | return (__m64)__builtin_ia32_pslld((__v2si)__m, __count); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 244 | } |
| 245 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 246 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 247 | _mm_slli_pi32(__m64 __m, int __count) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 248 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 249 | return (__m64)__builtin_ia32_pslldi((__v2si)__m, __count); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 250 | } |
| 251 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 252 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 253 | _mm_sll_si64(__m64 __m, __m64 __count) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 254 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 255 | return __builtin_ia32_psllq(__m, __count); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 256 | } |
| 257 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 258 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 259 | _mm_slli_si64(__m64 __m, int __count) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 260 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 261 | return __builtin_ia32_psllqi(__m, __count); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 262 | } |
| 263 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 264 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 265 | _mm_sra_pi16(__m64 __m, __m64 __count) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 266 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 267 | return (__m64)__builtin_ia32_psraw((__v4hi)__m, __count); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 268 | } |
| 269 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 270 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 271 | _mm_srai_pi16(__m64 __m, int __count) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 272 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 273 | return (__m64)__builtin_ia32_psrawi((__v4hi)__m, __count); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 274 | } |
| 275 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 276 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 277 | _mm_sra_pi32(__m64 __m, __m64 __count) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 278 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 279 | return (__m64)__builtin_ia32_psrad((__v2si)__m, __count); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 280 | } |
| 281 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 282 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 283 | _mm_srai_pi32(__m64 __m, int __count) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 284 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 285 | return (__m64)__builtin_ia32_psradi((__v2si)__m, __count); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 286 | } |
| 287 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 288 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 289 | _mm_srl_pi16(__m64 __m, __m64 __count) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 290 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 291 | return (__m64)__builtin_ia32_psrlw((__v4hi)__m, __count); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 292 | } |
| 293 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 294 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 295 | _mm_srli_pi16(__m64 __m, int __count) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 296 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 297 | return (__m64)__builtin_ia32_psrlwi((__v4hi)__m, __count); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 298 | } |
| 299 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 300 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 301 | _mm_srl_pi32(__m64 __m, __m64 __count) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 302 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 303 | return (__m64)__builtin_ia32_psrld((__v2si)__m, __count); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 304 | } |
| 305 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 306 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 307 | _mm_srli_pi32(__m64 __m, int __count) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 308 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 309 | return (__m64)__builtin_ia32_psrldi((__v2si)__m, __count); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 310 | } |
| 311 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 312 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 313 | _mm_srl_si64(__m64 __m, __m64 __count) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 314 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 315 | return (__m64)__builtin_ia32_psrlq(__m, __count); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 316 | } |
| 317 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 318 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 319 | _mm_srli_si64(__m64 __m, int __count) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 320 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 321 | return __builtin_ia32_psrlqi(__m, __count); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 322 | } |
| 323 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 324 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 325 | _mm_and_si64(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 326 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 327 | return __m1 & __m2; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 328 | } |
| 329 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 330 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 331 | _mm_andnot_si64(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 332 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 333 | return ~__m1 & __m2; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 334 | } |
| 335 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 336 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 337 | _mm_or_si64(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 338 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 339 | return __m1 | __m2; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 340 | } |
| 341 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 342 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 343 | _mm_xor_si64(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 344 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 345 | return __m1 ^ __m2; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 346 | } |
| 347 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 348 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 349 | _mm_cmpeq_pi8(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 350 | { |
Eli Friedman | 3a266f2 | 2009-07-22 17:08:01 +0000 | [diff] [blame] | 351 | return (__m64)((__v8qi)__m1 == (__v8qi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 352 | } |
| 353 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 354 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 355 | _mm_cmpeq_pi16(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 356 | { |
Eli Friedman | 3a266f2 | 2009-07-22 17:08:01 +0000 | [diff] [blame] | 357 | return (__m64)((__v4hi)__m1 == (__v4hi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 358 | } |
| 359 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 360 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 361 | _mm_cmpeq_pi32(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 362 | { |
Eli Friedman | 3a266f2 | 2009-07-22 17:08:01 +0000 | [diff] [blame] | 363 | return (__m64)((__v2si)__m1 == (__v2si)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 364 | } |
| 365 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 366 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 367 | _mm_cmpgt_pi8(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 368 | { |
Eli Friedman | 3a266f2 | 2009-07-22 17:08:01 +0000 | [diff] [blame] | 369 | return (__m64)((__v8qi)__m1 > (__v8qi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 370 | } |
| 371 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 372 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 373 | _mm_cmpgt_pi16(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 374 | { |
Eli Friedman | 3a266f2 | 2009-07-22 17:08:01 +0000 | [diff] [blame] | 375 | return (__m64)((__v4hi)__m1 > (__v4hi)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 376 | } |
| 377 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 378 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 379 | _mm_cmpgt_pi32(__m64 __m1, __m64 __m2) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 380 | { |
Eli Friedman | 3a266f2 | 2009-07-22 17:08:01 +0000 | [diff] [blame] | 381 | return (__m64)((__v2si)__m1 > (__v2si)__m2); |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 382 | } |
| 383 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 384 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 385 | _mm_setzero_si64(void) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 386 | { |
| 387 | return (__m64){ 0LL }; |
| 388 | } |
| 389 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 390 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 391 | _mm_set_pi32(int __i1, int __i0) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 392 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 393 | return (__m64)(__v2si){ __i0, __i1 }; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 394 | } |
| 395 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 396 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 397 | _mm_set_pi16(short __s3, short __s2, short __s1, short __s0) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 398 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 399 | return (__m64)(__v4hi){ __s0, __s1, __s2, __s3 }; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 400 | } |
| 401 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 402 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 403 | _mm_set_pi8(char __b7, char __b6, char __b5, char __b4, char __b3, char __b2, |
| 404 | char __b1, char __b0) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 405 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 406 | return (__m64)(__v8qi){ __b0, __b1, __b2, __b3, __b4, __b5, __b6, __b7 }; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 407 | } |
| 408 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 409 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 410 | _mm_set1_pi32(int __i) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 411 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 412 | return (__m64)(__v2si){ __i, __i }; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 413 | } |
| 414 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 415 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 416 | _mm_set1_pi16(short __s) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 417 | { |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 418 | return (__m64)(__v4hi){ __s, __s, __s, __s }; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 419 | } |
| 420 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 421 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 422 | _mm_set1_pi8(char __b) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 423 | { |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 424 | return (__m64)(__v8qi){ __b, __b, __b, __b, __b, __b, __b, __b }; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 425 | } |
| 426 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 427 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 428 | _mm_setr_pi32(int __i1, int __i0) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 429 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 430 | return (__m64)(__v2si){ __i1, __i0 }; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 431 | } |
| 432 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 433 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 434 | _mm_setr_pi16(short __s3, short __s2, short __s1, short __s0) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 435 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 436 | return (__m64)(__v4hi){ __s3, __s2, __s1, __s0 }; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 437 | } |
| 438 | |
Mike Stump | e308c41 | 2009-02-14 18:02:21 +0000 | [diff] [blame] | 439 | static inline __m64 __attribute__((__always_inline__, __nodebug__)) |
| 440 | _mm_setr_pi8(char __b7, char __b6, char __b5, char __b4, char __b3, char __b2, |
| 441 | char __b1, char __b0) |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 442 | { |
Eli Friedman | edbd928 | 2008-05-14 20:32:22 +0000 | [diff] [blame] | 443 | return (__m64)(__v8qi){ __b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0 }; |
Anders Carlsson | 37958ee | 2008-03-03 19:29:06 +0000 | [diff] [blame] | 444 | } |
| 445 | |
| 446 | #endif /* __MMX__ */ |
| 447 | |
| 448 | #endif /* __MMINTRIN_H */ |
| 449 | |