Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 1 | /*===---- xmmintrin.h - SSE intrinsics -------------------------------------=== |
| 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 | |
| 24 | #ifndef __XMMINTRIN_H |
| 25 | #define __XMMINTRIN_H |
| 26 | |
| 27 | #ifndef __SSE__ |
Anders Carlsson | 4fd3e63 | 2008-12-26 00:57:11 +0000 | [diff] [blame] | 28 | #error "SSE instruction set not enabled" |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 29 | #else |
| 30 | |
Anders Carlsson | 4fcc313 | 2008-12-22 00:48:30 +0000 | [diff] [blame] | 31 | #include <mmintrin.h> |
| 32 | |
Eric Christopher | 020f1ed | 2010-03-20 01:08:47 +0000 | [diff] [blame] | 33 | typedef int __v4si __attribute__((__vector_size__(16))); |
Anders Carlsson | 398082e | 2008-12-22 17:42:23 +0000 | [diff] [blame] | 34 | typedef float __v4sf __attribute__((__vector_size__(16))); |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 35 | typedef float __m128 __attribute__((__vector_size__(16))); |
| 36 | |
Chandler Carruth | 7acb953 | 2010-11-22 08:06:31 +0000 | [diff] [blame^] | 37 | // This header should only be included in a hosted environment as it depends on |
| 38 | // a standard library to provide allocation routines. |
| 39 | #if __STDC_HOSTED__ |
Anders Carlsson | 398082e | 2008-12-22 17:42:23 +0000 | [diff] [blame] | 40 | #include <mm_malloc.h> |
Chandler Carruth | 7acb953 | 2010-11-22 08:06:31 +0000 | [diff] [blame^] | 41 | #endif |
Anders Carlsson | 398082e | 2008-12-22 17:42:23 +0000 | [diff] [blame] | 42 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 43 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 44 | _mm_add_ss(__m128 a, __m128 b) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 45 | { |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 46 | a[0] += b[0]; |
| 47 | return a; |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 48 | } |
| 49 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 50 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 51 | _mm_add_ps(__m128 a, __m128 b) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 52 | { |
| 53 | return a + b; |
| 54 | } |
| 55 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 56 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 57 | _mm_sub_ss(__m128 a, __m128 b) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 58 | { |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 59 | a[0] -= b[0]; |
| 60 | return a; |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 61 | } |
| 62 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 63 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 64 | _mm_sub_ps(__m128 a, __m128 b) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 65 | { |
| 66 | return a - b; |
| 67 | } |
| 68 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 69 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 70 | _mm_mul_ss(__m128 a, __m128 b) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 71 | { |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 72 | a[0] *= b[0]; |
| 73 | return a; |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 74 | } |
| 75 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 76 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 77 | _mm_mul_ps(__m128 a, __m128 b) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 78 | { |
| 79 | return a * b; |
| 80 | } |
| 81 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 82 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 83 | _mm_div_ss(__m128 a, __m128 b) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 84 | { |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 85 | a[0] /= b[0]; |
| 86 | return a; |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 87 | } |
| 88 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 89 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 90 | _mm_div_ps(__m128 a, __m128 b) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 91 | { |
| 92 | return a / b; |
| 93 | } |
| 94 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 95 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 96 | _mm_sqrt_ss(__m128 a) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 97 | { |
| 98 | return __builtin_ia32_sqrtss(a); |
| 99 | } |
| 100 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 101 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 102 | _mm_sqrt_ps(__m128 a) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 103 | { |
| 104 | return __builtin_ia32_sqrtps(a); |
| 105 | } |
| 106 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 107 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 108 | _mm_rcp_ss(__m128 a) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 109 | { |
| 110 | return __builtin_ia32_rcpss(a); |
| 111 | } |
| 112 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 113 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 114 | _mm_rcp_ps(__m128 a) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 115 | { |
| 116 | return __builtin_ia32_rcpps(a); |
| 117 | } |
| 118 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 119 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 120 | _mm_rsqrt_ss(__m128 a) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 121 | { |
| 122 | return __builtin_ia32_rsqrtss(a); |
| 123 | } |
| 124 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 125 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 126 | _mm_rsqrt_ps(__m128 a) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 127 | { |
| 128 | return __builtin_ia32_rsqrtps(a); |
| 129 | } |
| 130 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 131 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 132 | _mm_min_ss(__m128 a, __m128 b) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 133 | { |
| 134 | return __builtin_ia32_minss(a, b); |
| 135 | } |
| 136 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 137 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 138 | _mm_min_ps(__m128 a, __m128 b) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 139 | { |
| 140 | return __builtin_ia32_minps(a, b); |
| 141 | } |
| 142 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 143 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 144 | _mm_max_ss(__m128 a, __m128 b) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 145 | { |
| 146 | return __builtin_ia32_maxss(a, b); |
| 147 | } |
| 148 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 149 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 150 | _mm_max_ps(__m128 a, __m128 b) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 151 | { |
| 152 | return __builtin_ia32_maxps(a, b); |
| 153 | } |
| 154 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 155 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 156 | _mm_and_ps(__m128 a, __m128 b) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 157 | { |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 158 | return (__m128)((__v4si)a & (__v4si)b); |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 159 | } |
| 160 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 161 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 162 | _mm_andnot_ps(__m128 a, __m128 b) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 163 | { |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 164 | return (__m128)(~(__v4si)a & (__v4si)b); |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 165 | } |
| 166 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 167 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 168 | _mm_or_ps(__m128 a, __m128 b) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 169 | { |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 170 | return (__m128)((__v4si)a | (__v4si)b); |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 171 | } |
| 172 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 173 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 174 | _mm_xor_ps(__m128 a, __m128 b) |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 175 | { |
Chris Lattner | 2c48345 | 2010-01-07 00:36:41 +0000 | [diff] [blame] | 176 | return (__m128)((__v4si)a ^ (__v4si)b); |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 177 | } |
| 178 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 179 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 180 | _mm_cmpeq_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 181 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 182 | return (__m128)__builtin_ia32_cmpss(a, b, 0); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 183 | } |
| 184 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 185 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 186 | _mm_cmpeq_ps(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 187 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 188 | return (__m128)__builtin_ia32_cmpps(a, b, 0); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 189 | } |
| 190 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 191 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 192 | _mm_cmplt_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 193 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 194 | return (__m128)__builtin_ia32_cmpss(a, b, 1); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 195 | } |
| 196 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 197 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 198 | _mm_cmplt_ps(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 199 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 200 | return (__m128)__builtin_ia32_cmpps(a, b, 1); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 201 | } |
| 202 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 203 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 204 | _mm_cmple_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 205 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 206 | return (__m128)__builtin_ia32_cmpss(a, b, 2); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 207 | } |
| 208 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 209 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 210 | _mm_cmple_ps(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 211 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 212 | return (__m128)__builtin_ia32_cmpps(a, b, 2); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 213 | } |
| 214 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 215 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 216 | _mm_cmpgt_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 217 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 218 | return (__m128)__builtin_ia32_cmpss(b, a, 1); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 219 | } |
| 220 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 221 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 222 | _mm_cmpgt_ps(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 223 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 224 | return (__m128)__builtin_ia32_cmpps(b, a, 1); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 225 | } |
| 226 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 227 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 228 | _mm_cmpge_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 229 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 230 | return (__m128)__builtin_ia32_cmpss(b, a, 2); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 231 | } |
| 232 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 233 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 234 | _mm_cmpge_ps(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 235 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 236 | return (__m128)__builtin_ia32_cmpps(b, a, 2); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 237 | } |
| 238 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 239 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 240 | _mm_cmpneq_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 241 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 242 | return (__m128)__builtin_ia32_cmpss(a, b, 4); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 243 | } |
| 244 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 245 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 246 | _mm_cmpneq_ps(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 247 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 248 | return (__m128)__builtin_ia32_cmpps(a, b, 4); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 249 | } |
| 250 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 251 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 252 | _mm_cmpnlt_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 253 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 254 | return (__m128)__builtin_ia32_cmpss(a, b, 5); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 255 | } |
| 256 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 257 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 258 | _mm_cmpnlt_ps(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 259 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 260 | return (__m128)__builtin_ia32_cmpps(a, b, 5); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 261 | } |
| 262 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 263 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 264 | _mm_cmpnle_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 265 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 266 | return (__m128)__builtin_ia32_cmpss(a, b, 6); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 267 | } |
| 268 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 269 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 270 | _mm_cmpnle_ps(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 271 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 272 | return (__m128)__builtin_ia32_cmpps(a, b, 6); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 273 | } |
| 274 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 275 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 276 | _mm_cmpngt_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 277 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 278 | return (__m128)__builtin_ia32_cmpss(b, a, 5); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 279 | } |
| 280 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 281 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 282 | _mm_cmpngt_ps(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 283 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 284 | return (__m128)__builtin_ia32_cmpps(b, a, 5); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 285 | } |
| 286 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 287 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 288 | _mm_cmpnge_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 289 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 290 | return (__m128)__builtin_ia32_cmpss(b, a, 6); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 291 | } |
| 292 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 293 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 294 | _mm_cmpnge_ps(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 295 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 296 | return (__m128)__builtin_ia32_cmpps(b, a, 6); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 297 | } |
| 298 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 299 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 300 | _mm_cmpord_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 301 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 302 | return (__m128)__builtin_ia32_cmpss(a, b, 7); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 303 | } |
| 304 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 305 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 306 | _mm_cmpord_ps(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 307 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 308 | return (__m128)__builtin_ia32_cmpps(a, b, 7); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 309 | } |
| 310 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 311 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 312 | _mm_cmpunord_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 313 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 314 | return (__m128)__builtin_ia32_cmpss(a, b, 3); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 315 | } |
| 316 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 317 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 318 | _mm_cmpunord_ps(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 319 | { |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 320 | return (__m128)__builtin_ia32_cmpps(a, b, 3); |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 321 | } |
| 322 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 323 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 324 | _mm_comieq_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 325 | { |
| 326 | return __builtin_ia32_comieq(a, b); |
| 327 | } |
| 328 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 329 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 330 | _mm_comilt_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 331 | { |
| 332 | return __builtin_ia32_comilt(a, b); |
| 333 | } |
| 334 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 335 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 336 | _mm_comile_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 337 | { |
| 338 | return __builtin_ia32_comile(a, b); |
| 339 | } |
| 340 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 341 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 342 | _mm_comigt_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 343 | { |
| 344 | return __builtin_ia32_comigt(a, b); |
| 345 | } |
| 346 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 347 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 348 | _mm_comige_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 349 | { |
| 350 | return __builtin_ia32_comige(a, b); |
| 351 | } |
| 352 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 353 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 354 | _mm_comineq_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 355 | { |
| 356 | return __builtin_ia32_comineq(a, b); |
| 357 | } |
| 358 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 359 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 360 | _mm_ucomieq_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 361 | { |
| 362 | return __builtin_ia32_ucomieq(a, b); |
| 363 | } |
| 364 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 365 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 366 | _mm_ucomilt_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 367 | { |
| 368 | return __builtin_ia32_ucomilt(a, b); |
| 369 | } |
| 370 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 371 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 372 | _mm_ucomile_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 373 | { |
| 374 | return __builtin_ia32_ucomile(a, b); |
| 375 | } |
| 376 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 377 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 378 | _mm_ucomigt_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 379 | { |
| 380 | return __builtin_ia32_ucomigt(a, b); |
| 381 | } |
| 382 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 383 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 384 | _mm_ucomige_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 385 | { |
| 386 | return __builtin_ia32_ucomige(a, b); |
| 387 | } |
| 388 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 389 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 390 | _mm_ucomineq_ss(__m128 a, __m128 b) |
Anders Carlsson | f62c681 | 2008-12-22 00:28:39 +0000 | [diff] [blame] | 391 | { |
| 392 | return __builtin_ia32_ucomineq(a, b); |
| 393 | } |
| 394 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 395 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 396 | _mm_cvtss_si32(__m128 a) |
Anders Carlsson | 4fcc313 | 2008-12-22 00:48:30 +0000 | [diff] [blame] | 397 | { |
| 398 | return __builtin_ia32_cvtss2si(a); |
| 399 | } |
| 400 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 401 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Chris Lattner | ef5ebf6 | 2010-02-16 18:21:25 +0000 | [diff] [blame] | 402 | _mm_cvt_ss2si(__m128 a) |
| 403 | { |
| 404 | return _mm_cvtss_si32(a); |
| 405 | } |
| 406 | |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 407 | #ifdef __x86_64__ |
| 408 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 409 | static __inline__ long long __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 410 | _mm_cvtss_si64(__m128 a) |
Anders Carlsson | 4fcc313 | 2008-12-22 00:48:30 +0000 | [diff] [blame] | 411 | { |
| 412 | return __builtin_ia32_cvtss2si64(a); |
| 413 | } |
| 414 | |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 415 | #endif |
| 416 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 417 | static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 418 | _mm_cvtps_pi32(__m128 a) |
Anders Carlsson | 4fcc313 | 2008-12-22 00:48:30 +0000 | [diff] [blame] | 419 | { |
| 420 | return (__m64)__builtin_ia32_cvtps2pi(a); |
| 421 | } |
| 422 | |
Chandler Carruth | fa38c81 | 2010-07-22 06:47:28 +0000 | [diff] [blame] | 423 | static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
| 424 | _mm_cvt_ps2pi(__m128 a) |
| 425 | { |
| 426 | return _mm_cvtps_pi32(a); |
| 427 | } |
| 428 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 429 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 430 | _mm_cvttss_si32(__m128 a) |
Anders Carlsson | 4fcc313 | 2008-12-22 00:48:30 +0000 | [diff] [blame] | 431 | { |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 432 | return a[0]; |
Anders Carlsson | 4fcc313 | 2008-12-22 00:48:30 +0000 | [diff] [blame] | 433 | } |
| 434 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 435 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Chris Lattner | ef5ebf6 | 2010-02-16 18:21:25 +0000 | [diff] [blame] | 436 | _mm_cvtt_ss2si(__m128 a) |
| 437 | { |
| 438 | return _mm_cvttss_si32(a); |
| 439 | } |
| 440 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 441 | static __inline__ long long __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 442 | _mm_cvttss_si64(__m128 a) |
Anders Carlsson | 4fcc313 | 2008-12-22 00:48:30 +0000 | [diff] [blame] | 443 | { |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 444 | return a[0]; |
Anders Carlsson | 4fcc313 | 2008-12-22 00:48:30 +0000 | [diff] [blame] | 445 | } |
| 446 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 447 | static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 448 | _mm_cvttps_pi32(__m128 a) |
Anders Carlsson | 4fcc313 | 2008-12-22 00:48:30 +0000 | [diff] [blame] | 449 | { |
| 450 | return (__m64)__builtin_ia32_cvttps2pi(a); |
| 451 | } |
| 452 | |
Chandler Carruth | fa38c81 | 2010-07-22 06:47:28 +0000 | [diff] [blame] | 453 | static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
| 454 | _mm_cvtt_ps2pi(__m128 a) |
| 455 | { |
| 456 | return _mm_cvttps_pi32(a); |
| 457 | } |
| 458 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 459 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 460 | _mm_cvtsi32_ss(__m128 a, int b) |
Anders Carlsson | 4fcc313 | 2008-12-22 00:48:30 +0000 | [diff] [blame] | 461 | { |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 462 | a[0] = b; |
| 463 | return a; |
Anders Carlsson | 4fcc313 | 2008-12-22 00:48:30 +0000 | [diff] [blame] | 464 | } |
| 465 | |
Chandler Carruth | fa38c81 | 2010-07-22 06:47:28 +0000 | [diff] [blame] | 466 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Chandler Carruth | d74e398 | 2010-08-08 08:30:05 +0000 | [diff] [blame] | 467 | _mm_cvt_si2ss(__m128 a, int b) |
Chandler Carruth | fa38c81 | 2010-07-22 06:47:28 +0000 | [diff] [blame] | 468 | { |
| 469 | return _mm_cvtsi32_ss(a, b); |
| 470 | } |
| 471 | |
Anders Carlsson | 1b76b80 | 2008-12-22 01:26:50 +0000 | [diff] [blame] | 472 | #ifdef __x86_64__ |
| 473 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 474 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 475 | _mm_cvtsi64_ss(__m128 a, long long b) |
Anders Carlsson | 4fcc313 | 2008-12-22 00:48:30 +0000 | [diff] [blame] | 476 | { |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 477 | a[0] = b; |
| 478 | return a; |
Anders Carlsson | 4fcc313 | 2008-12-22 00:48:30 +0000 | [diff] [blame] | 479 | } |
| 480 | |
Anders Carlsson | 1b76b80 | 2008-12-22 01:26:50 +0000 | [diff] [blame] | 481 | #endif |
| 482 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 483 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 484 | _mm_cvtpi32_ps(__m128 a, __m64 b) |
Anders Carlsson | 4fcc313 | 2008-12-22 00:48:30 +0000 | [diff] [blame] | 485 | { |
| 486 | return __builtin_ia32_cvtpi2ps(a, (__v2si)b); |
| 487 | } |
| 488 | |
Chandler Carruth | fa38c81 | 2010-07-22 06:47:28 +0000 | [diff] [blame] | 489 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Chandler Carruth | d74e398 | 2010-08-08 08:30:05 +0000 | [diff] [blame] | 490 | _mm_cvt_pi2ps(__m128 a, __m64 b) |
Chandler Carruth | fa38c81 | 2010-07-22 06:47:28 +0000 | [diff] [blame] | 491 | { |
| 492 | return _mm_cvtpi32_ps(a, b); |
| 493 | } |
| 494 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 495 | static __inline__ float __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 496 | _mm_cvtss_f32(__m128 a) |
Anders Carlsson | 1b76b80 | 2008-12-22 01:26:50 +0000 | [diff] [blame] | 497 | { |
Anders Carlsson | a6431dc | 2008-12-22 07:08:03 +0000 | [diff] [blame] | 498 | return a[0]; |
Anders Carlsson | 1b76b80 | 2008-12-22 01:26:50 +0000 | [diff] [blame] | 499 | } |
| 500 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 501 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Chris Lattner | 21b91a3 | 2010-02-01 20:14:14 +0000 | [diff] [blame] | 502 | _mm_loadh_pi(__m128 a, const __m64 *p) |
Anders Carlsson | 9770086 | 2008-12-22 02:43:30 +0000 | [diff] [blame] | 503 | { |
Eli Friedman | e0ae8bd | 2009-06-07 07:12:56 +0000 | [diff] [blame] | 504 | __m128 b; |
| 505 | b[0] = *(float*)p; |
| 506 | b[1] = *((float*)p+1); |
| 507 | return __builtin_shufflevector(a, b, 0, 1, 4, 5); |
Anders Carlsson | 9770086 | 2008-12-22 02:43:30 +0000 | [diff] [blame] | 508 | } |
| 509 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 510 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Chris Lattner | 21b91a3 | 2010-02-01 20:14:14 +0000 | [diff] [blame] | 511 | _mm_loadl_pi(__m128 a, const __m64 *p) |
Anders Carlsson | 9770086 | 2008-12-22 02:43:30 +0000 | [diff] [blame] | 512 | { |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 513 | __m128 b; |
| 514 | b[0] = *(float*)p; |
| 515 | b[1] = *((float*)p+1); |
Eli Friedman | e0ae8bd | 2009-06-07 07:12:56 +0000 | [diff] [blame] | 516 | return __builtin_shufflevector(a, b, 4, 5, 2, 3); |
Anders Carlsson | 9770086 | 2008-12-22 02:43:30 +0000 | [diff] [blame] | 517 | } |
| 518 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 519 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Chris Lattner | 21b91a3 | 2010-02-01 20:14:14 +0000 | [diff] [blame] | 520 | _mm_load_ss(const float *p) |
Anders Carlsson | 9770086 | 2008-12-22 02:43:30 +0000 | [diff] [blame] | 521 | { |
| 522 | return (__m128){ *p, 0, 0, 0 }; |
| 523 | } |
| 524 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 525 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Chris Lattner | 21b91a3 | 2010-02-01 20:14:14 +0000 | [diff] [blame] | 526 | _mm_load1_ps(const float *p) |
Anders Carlsson | 9770086 | 2008-12-22 02:43:30 +0000 | [diff] [blame] | 527 | { |
| 528 | return (__m128){ *p, *p, *p, *p }; |
| 529 | } |
| 530 | |
Eli Friedman | db7351a | 2009-06-02 05:55:48 +0000 | [diff] [blame] | 531 | #define _mm_load_ps1(p) _mm_load1_ps(p) |
| 532 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 533 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Chris Lattner | 21b91a3 | 2010-02-01 20:14:14 +0000 | [diff] [blame] | 534 | _mm_load_ps(const float *p) |
Anders Carlsson | 9770086 | 2008-12-22 02:43:30 +0000 | [diff] [blame] | 535 | { |
| 536 | return *(__m128*)p; |
| 537 | } |
| 538 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 539 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Chris Lattner | 21b91a3 | 2010-02-01 20:14:14 +0000 | [diff] [blame] | 540 | _mm_loadu_ps(const float *p) |
Anders Carlsson | 9770086 | 2008-12-22 02:43:30 +0000 | [diff] [blame] | 541 | { |
| 542 | return __builtin_ia32_loadups(p); |
| 543 | } |
| 544 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 545 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Chris Lattner | 21b91a3 | 2010-02-01 20:14:14 +0000 | [diff] [blame] | 546 | _mm_loadr_ps(const float *p) |
Anders Carlsson | 9770086 | 2008-12-22 02:43:30 +0000 | [diff] [blame] | 547 | { |
| 548 | __m128 a = _mm_load_ps(p); |
| 549 | return __builtin_shufflevector(a, a, 3, 2, 1, 0); |
| 550 | } |
| 551 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 552 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 553 | _mm_set_ss(float w) |
Anders Carlsson | a6ba001 | 2008-12-22 02:51:35 +0000 | [diff] [blame] | 554 | { |
| 555 | return (__m128){ w, 0, 0, 0 }; |
| 556 | } |
| 557 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 558 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 559 | _mm_set1_ps(float w) |
Anders Carlsson | a6ba001 | 2008-12-22 02:51:35 +0000 | [diff] [blame] | 560 | { |
| 561 | return (__m128){ w, w, w, w }; |
| 562 | } |
| 563 | |
Anders Carlsson | 12868cc | 2008-12-27 04:26:15 +0000 | [diff] [blame] | 564 | // Microsoft specific. |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 565 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 566 | _mm_set_ps1(float w) |
Anders Carlsson | 12868cc | 2008-12-27 04:26:15 +0000 | [diff] [blame] | 567 | { |
| 568 | return _mm_set1_ps(w); |
| 569 | } |
| 570 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 571 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 572 | _mm_set_ps(float z, float y, float x, float w) |
Anders Carlsson | a6ba001 | 2008-12-22 02:51:35 +0000 | [diff] [blame] | 573 | { |
| 574 | return (__m128){ w, x, y, z }; |
| 575 | } |
| 576 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 577 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 578 | _mm_setr_ps(float z, float y, float x, float w) |
Anders Carlsson | a6ba001 | 2008-12-22 02:51:35 +0000 | [diff] [blame] | 579 | { |
| 580 | return (__m128){ z, y, x, w }; |
| 581 | } |
| 582 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 583 | static __inline__ __m128 __attribute__((__always_inline__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 584 | _mm_setzero_ps(void) |
Anders Carlsson | a6ba001 | 2008-12-22 02:51:35 +0000 | [diff] [blame] | 585 | { |
| 586 | return (__m128){ 0, 0, 0, 0 }; |
| 587 | } |
| 588 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 589 | static __inline__ void __attribute__((__always_inline__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 590 | _mm_storeh_pi(__m64 *p, __m128 a) |
Anders Carlsson | 09b9305 | 2008-12-22 03:16:40 +0000 | [diff] [blame] | 591 | { |
| 592 | __builtin_ia32_storehps((__v2si *)p, a); |
| 593 | } |
| 594 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 595 | static __inline__ void __attribute__((__always_inline__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 596 | _mm_storel_pi(__m64 *p, __m128 a) |
Anders Carlsson | 09b9305 | 2008-12-22 03:16:40 +0000 | [diff] [blame] | 597 | { |
| 598 | __builtin_ia32_storelps((__v2si *)p, a); |
| 599 | } |
| 600 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 601 | static __inline__ void __attribute__((__always_inline__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 602 | _mm_store_ss(float *p, __m128 a) |
Anders Carlsson | 09b9305 | 2008-12-22 03:16:40 +0000 | [diff] [blame] | 603 | { |
| 604 | *p = a[0]; |
| 605 | } |
| 606 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 607 | static __inline__ void __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 608 | _mm_storeu_ps(float *p, __m128 a) |
Anders Carlsson | 09b9305 | 2008-12-22 03:16:40 +0000 | [diff] [blame] | 609 | { |
| 610 | __builtin_ia32_storeups(p, a); |
| 611 | } |
| 612 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 613 | static __inline__ void __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 614 | _mm_store1_ps(float *p, __m128 a) |
Anders Carlsson | 09b9305 | 2008-12-22 03:16:40 +0000 | [diff] [blame] | 615 | { |
| 616 | a = __builtin_shufflevector(a, a, 0, 0, 0, 0); |
| 617 | _mm_storeu_ps(p, a); |
| 618 | } |
| 619 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 620 | static __inline__ void __attribute__((__always_inline__, __nodebug__)) |
Chandler Carruth | fa38c81 | 2010-07-22 06:47:28 +0000 | [diff] [blame] | 621 | _mm_store_ps1(float *p, __m128 a) |
| 622 | { |
| 623 | return _mm_store1_ps(p, a); |
| 624 | } |
| 625 | |
| 626 | static __inline__ void __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 627 | _mm_store_ps(float *p, __m128 a) |
Anders Carlsson | 09b9305 | 2008-12-22 03:16:40 +0000 | [diff] [blame] | 628 | { |
| 629 | *(__m128 *)p = a; |
| 630 | } |
| 631 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 632 | static __inline__ void __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 633 | _mm_storer_ps(float *p, __m128 a) |
Anders Carlsson | 09b9305 | 2008-12-22 03:16:40 +0000 | [diff] [blame] | 634 | { |
| 635 | a = __builtin_shufflevector(a, a, 3, 2, 1, 0); |
| 636 | _mm_store_ps(p, a); |
| 637 | } |
| 638 | |
Chris Lattner | 551f37c | 2010-08-27 20:10:06 +0000 | [diff] [blame] | 639 | #define _MM_HINT_T0 3 |
Anders Carlsson | dedad4e | 2008-12-22 03:50:21 +0000 | [diff] [blame] | 640 | #define _MM_HINT_T1 2 |
Chris Lattner | 551f37c | 2010-08-27 20:10:06 +0000 | [diff] [blame] | 641 | #define _MM_HINT_T2 1 |
Anders Carlsson | dedad4e | 2008-12-22 03:50:21 +0000 | [diff] [blame] | 642 | #define _MM_HINT_NTA 0 |
| 643 | |
Nick Lewycky | c2b9b36 | 2010-05-30 18:26:21 +0000 | [diff] [blame] | 644 | /* FIXME: We have to #define this because "sel" must be a constant integer, and |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 645 | Sema doesn't do any form of constant propagation yet. */ |
Anders Carlsson | dedad4e | 2008-12-22 03:50:21 +0000 | [diff] [blame] | 646 | |
Nick Lewycky | c2b9b36 | 2010-05-30 18:26:21 +0000 | [diff] [blame] | 647 | #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a), 0, sel)) |
Anders Carlsson | dedad4e | 2008-12-22 03:50:21 +0000 | [diff] [blame] | 648 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 649 | static __inline__ void __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 650 | _mm_stream_pi(__m64 *p, __m64 a) |
Anders Carlsson | dedad4e | 2008-12-22 03:50:21 +0000 | [diff] [blame] | 651 | { |
| 652 | __builtin_ia32_movntq(p, a); |
| 653 | } |
| 654 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 655 | static __inline__ void __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 656 | _mm_stream_ps(float *p, __m128 a) |
Anders Carlsson | dedad4e | 2008-12-22 03:50:21 +0000 | [diff] [blame] | 657 | { |
| 658 | __builtin_ia32_movntps(p, a); |
| 659 | } |
| 660 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 661 | static __inline__ void __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 662 | _mm_sfence(void) |
Anders Carlsson | dedad4e | 2008-12-22 03:50:21 +0000 | [diff] [blame] | 663 | { |
| 664 | __builtin_ia32_sfence(); |
| 665 | } |
| 666 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 667 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 668 | _mm_extract_pi16(__m64 a, int n) |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 669 | { |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 670 | __v4hi b = (__v4hi)a; |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 671 | return (unsigned short)b[n & 3]; |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 672 | } |
| 673 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 674 | static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 675 | _mm_insert_pi16(__m64 a, int d, int n) |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 676 | { |
Eli Friedman | 80c8004 | 2009-06-06 02:13:04 +0000 | [diff] [blame] | 677 | __v4hi b = (__v4hi)a; |
| 678 | b[n & 3] = d; |
Eli Friedman | 17d2e3a | 2009-06-06 03:45:06 +0000 | [diff] [blame] | 679 | return (__m64)b; |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 680 | } |
| 681 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 682 | static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 683 | _mm_max_pi16(__m64 a, __m64 b) |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 684 | { |
| 685 | return (__m64)__builtin_ia32_pmaxsw((__v4hi)a, (__v4hi)b); |
| 686 | } |
| 687 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 688 | static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 689 | _mm_max_pu8(__m64 a, __m64 b) |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 690 | { |
| 691 | return (__m64)__builtin_ia32_pmaxub((__v8qi)a, (__v8qi)b); |
| 692 | } |
| 693 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 694 | static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 695 | _mm_min_pi16(__m64 a, __m64 b) |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 696 | { |
| 697 | return (__m64)__builtin_ia32_pminsw((__v4hi)a, (__v4hi)b); |
| 698 | } |
| 699 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 700 | static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 701 | _mm_min_pu8(__m64 a, __m64 b) |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 702 | { |
| 703 | return (__m64)__builtin_ia32_pminub((__v8qi)a, (__v8qi)b); |
| 704 | } |
| 705 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 706 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 707 | _mm_movemask_pi8(__m64 a) |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 708 | { |
| 709 | return __builtin_ia32_pmovmskb((__v8qi)a); |
| 710 | } |
| 711 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 712 | static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 713 | _mm_mulhi_pu16(__m64 a, __m64 b) |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 714 | { |
| 715 | return (__m64)__builtin_ia32_pmulhuw((__v4hi)a, (__v4hi)b); |
| 716 | } |
| 717 | |
Eli Friedman | 098136a | 2009-06-06 08:08:06 +0000 | [diff] [blame] | 718 | #define _mm_shuffle_pi16(a, n) \ |
Chris Lattner | 6999339 | 2010-10-02 21:32:59 +0000 | [diff] [blame] | 719 | ((__m64)__builtin_ia32_pshufw(a, n)) |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 720 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 721 | static __inline__ void __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 722 | _mm_maskmove_si64(__m64 d, __m64 n, char *p) |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 723 | { |
| 724 | __builtin_ia32_maskmovq((__v8qi)d, (__v8qi)n, p); |
| 725 | } |
| 726 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 727 | static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 728 | _mm_avg_pu8(__m64 a, __m64 b) |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 729 | { |
| 730 | return (__m64)__builtin_ia32_pavgb((__v8qi)a, (__v8qi)b); |
| 731 | } |
| 732 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 733 | static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 734 | _mm_avg_pu16(__m64 a, __m64 b) |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 735 | { |
| 736 | return (__m64)__builtin_ia32_pavgw((__v4hi)a, (__v4hi)b); |
| 737 | } |
| 738 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 739 | static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 740 | _mm_sad_pu8(__m64 a, __m64 b) |
Anders Carlsson | 62af71c | 2008-12-22 04:55:36 +0000 | [diff] [blame] | 741 | { |
| 742 | return (__m64)__builtin_ia32_psadbw((__v8qi)a, (__v8qi)b); |
| 743 | } |
Anders Carlsson | c1f9afd | 2008-12-22 05:00:07 +0000 | [diff] [blame] | 744 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 745 | static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 746 | _mm_getcsr(void) |
Anders Carlsson | c1f9afd | 2008-12-22 05:00:07 +0000 | [diff] [blame] | 747 | { |
| 748 | return __builtin_ia32_stmxcsr(); |
| 749 | } |
| 750 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 751 | static __inline__ void __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 752 | _mm_setcsr(unsigned int i) |
Anders Carlsson | c1f9afd | 2008-12-22 05:00:07 +0000 | [diff] [blame] | 753 | { |
| 754 | __builtin_ia32_ldmxcsr(i); |
| 755 | } |
| 756 | |
Eli Friedman | 098136a | 2009-06-06 08:08:06 +0000 | [diff] [blame] | 757 | #define _mm_shuffle_ps(a, b, mask) \ |
Daniel Dunbar | 79e5ab7 | 2010-06-02 16:35:01 +0000 | [diff] [blame] | 758 | (__builtin_shufflevector((__v4sf)(a), (__v4sf)(b), \ |
Chris Lattner | f805a6c | 2010-05-15 05:53:53 +0000 | [diff] [blame] | 759 | (mask) & 0x3, ((mask) & 0xc) >> 2, \ |
Eli Friedman | 098136a | 2009-06-06 08:08:06 +0000 | [diff] [blame] | 760 | (((mask) & 0x30) >> 4) + 4, \ |
| 761 | (((mask) & 0xc0) >> 6) + 4)) |
Anders Carlsson | 50099cb | 2008-12-22 05:20:34 +0000 | [diff] [blame] | 762 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 763 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 764 | _mm_unpackhi_ps(__m128 a, __m128 b) |
Anders Carlsson | 50099cb | 2008-12-22 05:20:34 +0000 | [diff] [blame] | 765 | { |
| 766 | return __builtin_shufflevector(a, b, 2, 6, 3, 7); |
| 767 | } |
| 768 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 769 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 770 | _mm_unpacklo_ps(__m128 a, __m128 b) |
Anders Carlsson | 50099cb | 2008-12-22 05:20:34 +0000 | [diff] [blame] | 771 | { |
| 772 | return __builtin_shufflevector(a, b, 0, 4, 1, 5); |
| 773 | } |
| 774 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 775 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 776 | _mm_move_ss(__m128 a, __m128 b) |
Anders Carlsson | 50099cb | 2008-12-22 05:20:34 +0000 | [diff] [blame] | 777 | { |
| 778 | return __builtin_shufflevector(a, b, 4, 1, 2, 3); |
| 779 | } |
| 780 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 781 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 782 | _mm_movehl_ps(__m128 a, __m128 b) |
Anders Carlsson | 50099cb | 2008-12-22 05:20:34 +0000 | [diff] [blame] | 783 | { |
| 784 | return __builtin_shufflevector(a, b, 6, 7, 2, 3); |
| 785 | } |
| 786 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 787 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 788 | _mm_movelh_ps(__m128 a, __m128 b) |
Anders Carlsson | 50099cb | 2008-12-22 05:20:34 +0000 | [diff] [blame] | 789 | { |
| 790 | return __builtin_shufflevector(a, b, 0, 1, 4, 5); |
| 791 | } |
| 792 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 793 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 794 | _mm_cvtpi16_ps(__m64 a) |
Anders Carlsson | a6431dc | 2008-12-22 07:08:03 +0000 | [diff] [blame] | 795 | { |
| 796 | __m64 b, c; |
| 797 | __m128 r; |
| 798 | |
| 799 | b = _mm_setzero_si64(); |
| 800 | b = _mm_cmpgt_pi16(b, a); |
| 801 | c = _mm_unpackhi_pi16(a, b); |
| 802 | r = _mm_setzero_ps(); |
| 803 | r = _mm_cvtpi32_ps(r, c); |
| 804 | r = _mm_movelh_ps(r, r); |
| 805 | c = _mm_unpacklo_pi16(a, b); |
| 806 | r = _mm_cvtpi32_ps(r, c); |
| 807 | |
| 808 | return r; |
| 809 | } |
| 810 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 811 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 812 | _mm_cvtpu16_ps(__m64 a) |
Anders Carlsson | a6431dc | 2008-12-22 07:08:03 +0000 | [diff] [blame] | 813 | { |
| 814 | __m64 b, c; |
| 815 | __m128 r; |
| 816 | |
| 817 | b = _mm_setzero_si64(); |
| 818 | c = _mm_unpackhi_pi16(a, b); |
| 819 | r = _mm_setzero_ps(); |
| 820 | r = _mm_cvtpi32_ps(r, c); |
| 821 | r = _mm_movelh_ps(r, r); |
| 822 | c = _mm_unpacklo_pi16(a, b); |
| 823 | r = _mm_cvtpi32_ps(r, c); |
| 824 | |
| 825 | return r; |
| 826 | } |
| 827 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 828 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 829 | _mm_cvtpi8_ps(__m64 a) |
Anders Carlsson | a6431dc | 2008-12-22 07:08:03 +0000 | [diff] [blame] | 830 | { |
| 831 | __m64 b; |
| 832 | |
| 833 | b = _mm_setzero_si64(); |
| 834 | b = _mm_cmpgt_pi8(b, a); |
| 835 | b = _mm_unpacklo_pi8(a, b); |
| 836 | |
| 837 | return _mm_cvtpi16_ps(b); |
| 838 | } |
| 839 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 840 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 841 | _mm_cvtpu8_ps(__m64 a) |
Anders Carlsson | a6431dc | 2008-12-22 07:08:03 +0000 | [diff] [blame] | 842 | { |
| 843 | __m64 b; |
| 844 | |
| 845 | b = _mm_setzero_si64(); |
| 846 | b = _mm_unpacklo_pi8(a, b); |
| 847 | |
| 848 | return _mm_cvtpi16_ps(b); |
| 849 | } |
| 850 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 851 | static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 852 | _mm_cvtpi32x2_ps(__m64 a, __m64 b) |
Anders Carlsson | a6431dc | 2008-12-22 07:08:03 +0000 | [diff] [blame] | 853 | { |
| 854 | __m128 c; |
| 855 | |
| 856 | c = _mm_setzero_ps(); |
| 857 | c = _mm_cvtpi32_ps(c, b); |
| 858 | c = _mm_movelh_ps(c, c); |
| 859 | |
| 860 | return _mm_cvtpi32_ps(c, a); |
| 861 | } |
| 862 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 863 | static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 864 | _mm_cvtps_pi16(__m128 a) |
Anders Carlsson | a6431dc | 2008-12-22 07:08:03 +0000 | [diff] [blame] | 865 | { |
| 866 | __m64 b, c; |
| 867 | |
| 868 | b = _mm_cvtps_pi32(a); |
| 869 | a = _mm_movehl_ps(a, a); |
| 870 | c = _mm_cvtps_pi32(a); |
| 871 | |
| 872 | return _mm_packs_pi16(b, c); |
| 873 | } |
| 874 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 875 | static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 876 | _mm_cvtps_pi8(__m128 a) |
Anders Carlsson | a6431dc | 2008-12-22 07:08:03 +0000 | [diff] [blame] | 877 | { |
| 878 | __m64 b, c; |
| 879 | |
| 880 | b = _mm_cvtps_pi16(a); |
| 881 | c = _mm_setzero_si64(); |
| 882 | |
| 883 | return _mm_packs_pi16(b, c); |
| 884 | } |
| 885 | |
Chris Lattner | 1bddbcb | 2010-03-22 18:14:12 +0000 | [diff] [blame] | 886 | static __inline__ int __attribute__((__always_inline__, __nodebug__)) |
Mike Stump | dae4413 | 2009-02-13 14:24:50 +0000 | [diff] [blame] | 887 | _mm_movemask_ps(__m128 a) |
Anders Carlsson | 50099cb | 2008-12-22 05:20:34 +0000 | [diff] [blame] | 888 | { |
| 889 | return __builtin_ia32_movmskps(a); |
| 890 | } |
| 891 | |
Anders Carlsson | b595509 | 2008-12-22 05:42:03 +0000 | [diff] [blame] | 892 | #define _MM_SHUFFLE(z, y, x, w) (((z) << 6) | ((y) << 4) | ((x) << 2) | (w)) |
| 893 | |
Anders Carlsson | 4cc4427 | 2009-02-11 06:29:32 +0000 | [diff] [blame] | 894 | #define _MM_EXCEPT_INVALID (0x0001) |
| 895 | #define _MM_EXCEPT_DENORM (0x0002) |
| 896 | #define _MM_EXCEPT_DIV_ZERO (0x0004) |
| 897 | #define _MM_EXCEPT_OVERFLOW (0x0008) |
| 898 | #define _MM_EXCEPT_UNDERFLOW (0x0010) |
| 899 | #define _MM_EXCEPT_INEXACT (0x0020) |
Anders Carlsson | bbd1fa2 | 2009-01-21 01:49:39 +0000 | [diff] [blame] | 900 | #define _MM_EXCEPT_MASK (0x003f) |
Anders Carlsson | 4cc4427 | 2009-02-11 06:29:32 +0000 | [diff] [blame] | 901 | |
Anders Carlsson | bbd1fa2 | 2009-01-21 01:49:39 +0000 | [diff] [blame] | 902 | #define _MM_MASK_INVALID (0x0080) |
| 903 | #define _MM_MASK_DENORM (0x0100) |
Anders Carlsson | a837a07 | 2009-02-14 04:01:38 +0000 | [diff] [blame] | 904 | #define _MM_MASK_DIV_ZERO (0x0200) |
| 905 | #define _MM_MASK_OVERFLOW (0x0400) |
| 906 | #define _MM_MASK_UNDERFLOW (0x0800) |
| 907 | #define _MM_MASK_INEXACT (0x1000) |
Anders Carlsson | bbd1fa2 | 2009-01-21 01:49:39 +0000 | [diff] [blame] | 908 | #define _MM_MASK_MASK (0x1f80) |
| 909 | |
Anders Carlsson | bbd1fa2 | 2009-01-21 01:49:39 +0000 | [diff] [blame] | 910 | #define _MM_ROUND_NEAREST (0x0000) |
| 911 | #define _MM_ROUND_DOWN (0x2000) |
| 912 | #define _MM_ROUND_UP (0x4000) |
| 913 | #define _MM_ROUND_TOWARD_ZERO (0x6000) |
Anders Carlsson | 4cc4427 | 2009-02-11 06:29:32 +0000 | [diff] [blame] | 914 | #define _MM_ROUND_MASK (0x6000) |
Anders Carlsson | bbd1fa2 | 2009-01-21 01:49:39 +0000 | [diff] [blame] | 915 | |
| 916 | #define _MM_FLUSH_ZERO_MASK (0x8000) |
| 917 | #define _MM_FLUSH_ZERO_ON (0x8000) |
| 918 | #define _MM_FLUSH_ZERO_OFF (0x8000) |
Anders Carlsson | b595509 | 2008-12-22 05:42:03 +0000 | [diff] [blame] | 919 | |
| 920 | #define _MM_GET_EXCEPTION_MASK() (_mm_getcsr() & _MM_MASK_MASK) |
| 921 | #define _MM_GET_EXCEPTION_STATE() (_mm_getcsr() & _MM_EXCEPT_MASK) |
Anders Carlsson | 62005c1 | 2009-01-20 21:51:44 +0000 | [diff] [blame] | 922 | #define _MM_GET_FLUSH_ZERO_MODE() (_mm_getcsr() & _MM_FLUSH_ZERO_MASK) |
Anders Carlsson | b595509 | 2008-12-22 05:42:03 +0000 | [diff] [blame] | 923 | #define _MM_GET_ROUNDING_MODE() (_mm_getcsr() & _MM_ROUND_MASK) |
| 924 | |
Anders Carlsson | 62005c1 | 2009-01-20 21:51:44 +0000 | [diff] [blame] | 925 | #define _MM_SET_EXCEPTION_MASK(x) (_mm_setcsr((_mm_getcsr() & ~_MM_MASK_MASK) | (x))) |
Anders Carlsson | b595509 | 2008-12-22 05:42:03 +0000 | [diff] [blame] | 926 | #define _MM_SET_EXCEPTION_STATE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_EXCEPT_MASK) | (x))) |
Anders Carlsson | 62005c1 | 2009-01-20 21:51:44 +0000 | [diff] [blame] | 927 | #define _MM_SET_FLUSH_ZERO_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_FLUSH_ZERO_MASK) | (x))) |
Anders Carlsson | b595509 | 2008-12-22 05:42:03 +0000 | [diff] [blame] | 928 | #define _MM_SET_ROUNDING_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_ROUND_MASK) | (x))) |
| 929 | |
| 930 | #define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ |
| 931 | do { \ |
| 932 | __m128 tmp3, tmp2, tmp1, tmp0; \ |
| 933 | tmp0 = _mm_unpacklo_ps((row0), (row1)); \ |
| 934 | tmp2 = _mm_unpacklo_ps((row2), (row3)); \ |
| 935 | tmp1 = _mm_unpackhi_ps((row0), (row1)); \ |
| 936 | tmp3 = _mm_unpackhi_ps((row2), (row3)); \ |
| 937 | (row0) = _mm_movelh_ps(tmp0, tmp2); \ |
| 938 | (row1) = _mm_movehl_ps(tmp2, tmp0); \ |
| 939 | (row2) = _mm_movelh_ps(tmp1, tmp3); \ |
Chris Lattner | 9afb227 | 2010-01-27 07:54:50 +0000 | [diff] [blame] | 940 | (row3) = _mm_movehl_ps(tmp3, tmp1); \ |
Anders Carlsson | b595509 | 2008-12-22 05:42:03 +0000 | [diff] [blame] | 941 | } while (0) |
| 942 | |
Chandler Carruth | fa38c81 | 2010-07-22 06:47:28 +0000 | [diff] [blame] | 943 | /* Aliases for compatibility. */ |
| 944 | #define _m_pextrw _mm_extract_pi16 |
| 945 | #define _m_pinsrw _mm_insert_pi16 |
| 946 | #define _m_pmaxsw _mm_max_pi16 |
| 947 | #define _m_pmaxub _mm_max_pu8 |
| 948 | #define _m_pminsw _mm_min_pi16 |
| 949 | #define _m_pminub _mm_min_pu8 |
| 950 | #define _m_pmovmskb _mm_movemask_pi8 |
| 951 | #define _m_pmulhuw _mm_mulhi_pu16 |
| 952 | #define _m_pshufw _mm_shuffle_pi16 |
| 953 | #define _m_maskmovq _mm_maskmove_si64 |
| 954 | #define _m_pavgb _mm_avg_pu8 |
| 955 | #define _m_pavgw _mm_avg_pu16 |
| 956 | #define _m_psadbw _mm_sad_pu8 |
| 957 | #define _m_ _mm_ |
| 958 | #define _m_ _mm_ |
| 959 | |
Eli Friedman | c7d95dc | 2009-06-11 18:50:02 +0000 | [diff] [blame] | 960 | /* Ugly hack for backwards-compatibility (compatible with gcc) */ |
| 961 | #ifdef __SSE2__ |
Daniel Dunbar | 3eef3e1 | 2009-06-07 08:33:23 +0000 | [diff] [blame] | 962 | #include <emmintrin.h> |
Eli Friedman | c7d95dc | 2009-06-11 18:50:02 +0000 | [diff] [blame] | 963 | #endif |
Daniel Dunbar | 3eef3e1 | 2009-06-07 08:33:23 +0000 | [diff] [blame] | 964 | |
Anders Carlsson | 566d8da | 2008-12-22 00:01:20 +0000 | [diff] [blame] | 965 | #endif /* __SSE__ */ |
| 966 | |
| 967 | #endif /* __XMMINTRIN_H */ |