1*344a7f5eSAndroid Build Coastguard Worker /*===---- xmmintrin.h - SSE intrinsics -------------------------------------===
2*344a7f5eSAndroid Build Coastguard Worker *
3*344a7f5eSAndroid Build Coastguard Worker * Permission is hereby granted, free of charge, to any person obtaining a copy
4*344a7f5eSAndroid Build Coastguard Worker * of this software and associated documentation files (the "Software"), to deal
5*344a7f5eSAndroid Build Coastguard Worker * in the Software without restriction, including without limitation the rights
6*344a7f5eSAndroid Build Coastguard Worker * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7*344a7f5eSAndroid Build Coastguard Worker * copies of the Software, and to permit persons to whom the Software is
8*344a7f5eSAndroid Build Coastguard Worker * furnished to do so, subject to the following conditions:
9*344a7f5eSAndroid Build Coastguard Worker *
10*344a7f5eSAndroid Build Coastguard Worker * The above copyright notice and this permission notice shall be included in
11*344a7f5eSAndroid Build Coastguard Worker * all copies or substantial portions of the Software.
12*344a7f5eSAndroid Build Coastguard Worker *
13*344a7f5eSAndroid Build Coastguard Worker * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14*344a7f5eSAndroid Build Coastguard Worker * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15*344a7f5eSAndroid Build Coastguard Worker * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16*344a7f5eSAndroid Build Coastguard Worker * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17*344a7f5eSAndroid Build Coastguard Worker * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18*344a7f5eSAndroid Build Coastguard Worker * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19*344a7f5eSAndroid Build Coastguard Worker * THE SOFTWARE.
20*344a7f5eSAndroid Build Coastguard Worker *
21*344a7f5eSAndroid Build Coastguard Worker *===-----------------------------------------------------------------------===
22*344a7f5eSAndroid Build Coastguard Worker */
23*344a7f5eSAndroid Build Coastguard Worker
24*344a7f5eSAndroid Build Coastguard Worker #ifndef __XMMINTRIN_H
25*344a7f5eSAndroid Build Coastguard Worker #define __XMMINTRIN_H
26*344a7f5eSAndroid Build Coastguard Worker
27*344a7f5eSAndroid Build Coastguard Worker #include <mmintrin.h>
28*344a7f5eSAndroid Build Coastguard Worker
29*344a7f5eSAndroid Build Coastguard Worker typedef int __v4si __attribute__((__vector_size__(16)));
30*344a7f5eSAndroid Build Coastguard Worker typedef float __v4sf __attribute__((__vector_size__(16)));
31*344a7f5eSAndroid Build Coastguard Worker typedef float __m128 __attribute__((__vector_size__(16)));
32*344a7f5eSAndroid Build Coastguard Worker
33*344a7f5eSAndroid Build Coastguard Worker /* Unsigned types */
34*344a7f5eSAndroid Build Coastguard Worker typedef unsigned int __v4su __attribute__((__vector_size__(16)));
35*344a7f5eSAndroid Build Coastguard Worker
36*344a7f5eSAndroid Build Coastguard Worker /* This header should only be included in a hosted environment as it depends on
37*344a7f5eSAndroid Build Coastguard Worker * a standard library to provide allocation routines. */
38*344a7f5eSAndroid Build Coastguard Worker #if __STDC_HOSTED__
39*344a7f5eSAndroid Build Coastguard Worker #include <mm_malloc.h>
40*344a7f5eSAndroid Build Coastguard Worker #endif
41*344a7f5eSAndroid Build Coastguard Worker
42*344a7f5eSAndroid Build Coastguard Worker /* Define the default attributes for the functions in this file. */
43*344a7f5eSAndroid Build Coastguard Worker #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sse")))
44*344a7f5eSAndroid Build Coastguard Worker
45*344a7f5eSAndroid Build Coastguard Worker /// \brief Adds the 32-bit float values in the low-order bits of the operands.
46*344a7f5eSAndroid Build Coastguard Worker ///
47*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
48*344a7f5eSAndroid Build Coastguard Worker ///
49*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VADDSS / ADDSS instructions.
50*344a7f5eSAndroid Build Coastguard Worker ///
51*344a7f5eSAndroid Build Coastguard Worker /// \param __a
52*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the source operands.
53*344a7f5eSAndroid Build Coastguard Worker /// The lower 32 bits of this operand are used in the calculation.
54*344a7f5eSAndroid Build Coastguard Worker /// \param __b
55*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the source operands.
56*344a7f5eSAndroid Build Coastguard Worker /// The lower 32 bits of this operand are used in the calculation.
57*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the sum
58*344a7f5eSAndroid Build Coastguard Worker /// of the lower 32 bits of both operands. The upper 96 bits are copied from
59*344a7f5eSAndroid Build Coastguard Worker /// the upper 96 bits of the first source operand.
60*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_add_ss(__m128 __a,__m128 __b)61*344a7f5eSAndroid Build Coastguard Worker _mm_add_ss(__m128 __a, __m128 __b)
62*344a7f5eSAndroid Build Coastguard Worker {
63*344a7f5eSAndroid Build Coastguard Worker __a[0] += __b[0];
64*344a7f5eSAndroid Build Coastguard Worker return __a;
65*344a7f5eSAndroid Build Coastguard Worker }
66*344a7f5eSAndroid Build Coastguard Worker
67*344a7f5eSAndroid Build Coastguard Worker /// \brief Adds two 128-bit vectors of [4 x float], and returns the results of
68*344a7f5eSAndroid Build Coastguard Worker /// the addition.
69*344a7f5eSAndroid Build Coastguard Worker ///
70*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
71*344a7f5eSAndroid Build Coastguard Worker ///
72*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VADDPS / ADDPS instructions.
73*344a7f5eSAndroid Build Coastguard Worker ///
74*344a7f5eSAndroid Build Coastguard Worker /// \param __a
75*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the source operands.
76*344a7f5eSAndroid Build Coastguard Worker /// \param __b
77*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the source operands.
78*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the sums of both
79*344a7f5eSAndroid Build Coastguard Worker /// operands.
80*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_add_ps(__m128 __a,__m128 __b)81*344a7f5eSAndroid Build Coastguard Worker _mm_add_ps(__m128 __a, __m128 __b)
82*344a7f5eSAndroid Build Coastguard Worker {
83*344a7f5eSAndroid Build Coastguard Worker return (__m128)((__v4sf)__a + (__v4sf)__b);
84*344a7f5eSAndroid Build Coastguard Worker }
85*344a7f5eSAndroid Build Coastguard Worker
86*344a7f5eSAndroid Build Coastguard Worker /// \brief Subtracts the 32-bit float value in the low-order bits of the second
87*344a7f5eSAndroid Build Coastguard Worker /// operand from the corresponding value in the first operand.
88*344a7f5eSAndroid Build Coastguard Worker ///
89*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
90*344a7f5eSAndroid Build Coastguard Worker ///
91*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VSUBSS / SUBSS instructions.
92*344a7f5eSAndroid Build Coastguard Worker ///
93*344a7f5eSAndroid Build Coastguard Worker /// \param __a
94*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the minuend. The lower 32 bits
95*344a7f5eSAndroid Build Coastguard Worker /// of this operand are used in the calculation.
96*344a7f5eSAndroid Build Coastguard Worker /// \param __b
97*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the subtrahend. The lower 32
98*344a7f5eSAndroid Build Coastguard Worker /// bits of this operand are used in the calculation.
99*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the
100*344a7f5eSAndroid Build Coastguard Worker /// difference of the lower 32 bits of both operands. The upper 96 bits are
101*344a7f5eSAndroid Build Coastguard Worker /// copied from the upper 96 bits of the first source operand.
102*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_sub_ss(__m128 __a,__m128 __b)103*344a7f5eSAndroid Build Coastguard Worker _mm_sub_ss(__m128 __a, __m128 __b)
104*344a7f5eSAndroid Build Coastguard Worker {
105*344a7f5eSAndroid Build Coastguard Worker __a[0] -= __b[0];
106*344a7f5eSAndroid Build Coastguard Worker return __a;
107*344a7f5eSAndroid Build Coastguard Worker }
108*344a7f5eSAndroid Build Coastguard Worker
109*344a7f5eSAndroid Build Coastguard Worker /// \brief Subtracts each of the values of the second operand from the first
110*344a7f5eSAndroid Build Coastguard Worker /// operand, both of which are 128-bit vectors of [4 x float] and returns
111*344a7f5eSAndroid Build Coastguard Worker /// the results of the subtraction.
112*344a7f5eSAndroid Build Coastguard Worker ///
113*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
114*344a7f5eSAndroid Build Coastguard Worker ///
115*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VSUBPS / SUBPS instructions.
116*344a7f5eSAndroid Build Coastguard Worker ///
117*344a7f5eSAndroid Build Coastguard Worker /// \param __a
118*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the minuend.
119*344a7f5eSAndroid Build Coastguard Worker /// \param __b
120*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the subtrahend.
121*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the differences between
122*344a7f5eSAndroid Build Coastguard Worker /// both operands.
123*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_sub_ps(__m128 __a,__m128 __b)124*344a7f5eSAndroid Build Coastguard Worker _mm_sub_ps(__m128 __a, __m128 __b)
125*344a7f5eSAndroid Build Coastguard Worker {
126*344a7f5eSAndroid Build Coastguard Worker return (__m128)((__v4sf)__a - (__v4sf)__b);
127*344a7f5eSAndroid Build Coastguard Worker }
128*344a7f5eSAndroid Build Coastguard Worker
129*344a7f5eSAndroid Build Coastguard Worker /// \brief Multiplies two 32-bit float values in the low-order bits of the
130*344a7f5eSAndroid Build Coastguard Worker /// operands.
131*344a7f5eSAndroid Build Coastguard Worker ///
132*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
133*344a7f5eSAndroid Build Coastguard Worker ///
134*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMULSS / MULSS instructions.
135*344a7f5eSAndroid Build Coastguard Worker ///
136*344a7f5eSAndroid Build Coastguard Worker /// \param __a
137*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the source operands.
138*344a7f5eSAndroid Build Coastguard Worker /// The lower 32 bits of this operand are used in the calculation.
139*344a7f5eSAndroid Build Coastguard Worker /// \param __b
140*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the source operands.
141*344a7f5eSAndroid Build Coastguard Worker /// The lower 32 bits of this operand are used in the calculation.
142*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the product of the lower
143*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of both operands. The upper 96 bits are copied from the upper 96
144*344a7f5eSAndroid Build Coastguard Worker /// bits of the first source operand.
145*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_mul_ss(__m128 __a,__m128 __b)146*344a7f5eSAndroid Build Coastguard Worker _mm_mul_ss(__m128 __a, __m128 __b)
147*344a7f5eSAndroid Build Coastguard Worker {
148*344a7f5eSAndroid Build Coastguard Worker __a[0] *= __b[0];
149*344a7f5eSAndroid Build Coastguard Worker return __a;
150*344a7f5eSAndroid Build Coastguard Worker }
151*344a7f5eSAndroid Build Coastguard Worker
152*344a7f5eSAndroid Build Coastguard Worker /// \brief Multiplies two 128-bit vectors of [4 x float] and returns the
153*344a7f5eSAndroid Build Coastguard Worker /// results of the multiplication.
154*344a7f5eSAndroid Build Coastguard Worker ///
155*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
156*344a7f5eSAndroid Build Coastguard Worker ///
157*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMULPS / MULPS instructions.
158*344a7f5eSAndroid Build Coastguard Worker ///
159*344a7f5eSAndroid Build Coastguard Worker /// \param __a
160*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the source operands.
161*344a7f5eSAndroid Build Coastguard Worker /// \param __b
162*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the source operands.
163*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the products of both
164*344a7f5eSAndroid Build Coastguard Worker /// operands.
165*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_mul_ps(__m128 __a,__m128 __b)166*344a7f5eSAndroid Build Coastguard Worker _mm_mul_ps(__m128 __a, __m128 __b)
167*344a7f5eSAndroid Build Coastguard Worker {
168*344a7f5eSAndroid Build Coastguard Worker return (__m128)((__v4sf)__a * (__v4sf)__b);
169*344a7f5eSAndroid Build Coastguard Worker }
170*344a7f5eSAndroid Build Coastguard Worker
171*344a7f5eSAndroid Build Coastguard Worker /// \brief Divides the value in the low-order 32 bits of the first operand by
172*344a7f5eSAndroid Build Coastguard Worker /// the corresponding value in the second operand.
173*344a7f5eSAndroid Build Coastguard Worker ///
174*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
175*344a7f5eSAndroid Build Coastguard Worker ///
176*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VDIVSS / DIVSS instructions.
177*344a7f5eSAndroid Build Coastguard Worker ///
178*344a7f5eSAndroid Build Coastguard Worker /// \param __a
179*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the dividend. The lower 32
180*344a7f5eSAndroid Build Coastguard Worker /// bits of this operand are used in the calculation.
181*344a7f5eSAndroid Build Coastguard Worker /// \param __b
182*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the divisor. The lower 32 bits
183*344a7f5eSAndroid Build Coastguard Worker /// of this operand are used in the calculation.
184*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the quotients of the
185*344a7f5eSAndroid Build Coastguard Worker /// lower 32 bits of both operands. The upper 96 bits are copied from the
186*344a7f5eSAndroid Build Coastguard Worker /// upper 96 bits of the first source operand.
187*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_div_ss(__m128 __a,__m128 __b)188*344a7f5eSAndroid Build Coastguard Worker _mm_div_ss(__m128 __a, __m128 __b)
189*344a7f5eSAndroid Build Coastguard Worker {
190*344a7f5eSAndroid Build Coastguard Worker __a[0] /= __b[0];
191*344a7f5eSAndroid Build Coastguard Worker return __a;
192*344a7f5eSAndroid Build Coastguard Worker }
193*344a7f5eSAndroid Build Coastguard Worker
194*344a7f5eSAndroid Build Coastguard Worker /// \brief Divides two 128-bit vectors of [4 x float].
195*344a7f5eSAndroid Build Coastguard Worker ///
196*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
197*344a7f5eSAndroid Build Coastguard Worker ///
198*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VDIVPS / DIVPS instructions.
199*344a7f5eSAndroid Build Coastguard Worker ///
200*344a7f5eSAndroid Build Coastguard Worker /// \param __a
201*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the dividend.
202*344a7f5eSAndroid Build Coastguard Worker /// \param __b
203*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the divisor.
204*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the quotients of both
205*344a7f5eSAndroid Build Coastguard Worker /// operands.
206*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_div_ps(__m128 __a,__m128 __b)207*344a7f5eSAndroid Build Coastguard Worker _mm_div_ps(__m128 __a, __m128 __b)
208*344a7f5eSAndroid Build Coastguard Worker {
209*344a7f5eSAndroid Build Coastguard Worker return (__m128)((__v4sf)__a / (__v4sf)__b);
210*344a7f5eSAndroid Build Coastguard Worker }
211*344a7f5eSAndroid Build Coastguard Worker
212*344a7f5eSAndroid Build Coastguard Worker /// \brief Calculates the square root of the value stored in the low-order bits
213*344a7f5eSAndroid Build Coastguard Worker /// of a 128-bit vector of [4 x float].
214*344a7f5eSAndroid Build Coastguard Worker ///
215*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
216*344a7f5eSAndroid Build Coastguard Worker ///
217*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VSQRTSS / SQRTSS instructions.
218*344a7f5eSAndroid Build Coastguard Worker ///
219*344a7f5eSAndroid Build Coastguard Worker /// \param __a
220*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
221*344a7f5eSAndroid Build Coastguard Worker /// used in the calculation.
222*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the square root of the
223*344a7f5eSAndroid Build Coastguard Worker /// value in the low-order bits of the operand.
224*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_sqrt_ss(__m128 __a)225*344a7f5eSAndroid Build Coastguard Worker _mm_sqrt_ss(__m128 __a)
226*344a7f5eSAndroid Build Coastguard Worker {
227*344a7f5eSAndroid Build Coastguard Worker __m128 __c = __builtin_ia32_sqrtss((__v4sf)__a);
228*344a7f5eSAndroid Build Coastguard Worker return (__m128) { __c[0], __a[1], __a[2], __a[3] };
229*344a7f5eSAndroid Build Coastguard Worker }
230*344a7f5eSAndroid Build Coastguard Worker
231*344a7f5eSAndroid Build Coastguard Worker /// \brief Calculates the square roots of the values stored in a 128-bit vector
232*344a7f5eSAndroid Build Coastguard Worker /// of [4 x float].
233*344a7f5eSAndroid Build Coastguard Worker ///
234*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
235*344a7f5eSAndroid Build Coastguard Worker ///
236*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VSQRTPS / SQRTPS instructions.
237*344a7f5eSAndroid Build Coastguard Worker ///
238*344a7f5eSAndroid Build Coastguard Worker /// \param __a
239*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
240*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the square roots of the
241*344a7f5eSAndroid Build Coastguard Worker /// values in the operand.
242*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_sqrt_ps(__m128 __a)243*344a7f5eSAndroid Build Coastguard Worker _mm_sqrt_ps(__m128 __a)
244*344a7f5eSAndroid Build Coastguard Worker {
245*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_sqrtps((__v4sf)__a);
246*344a7f5eSAndroid Build Coastguard Worker }
247*344a7f5eSAndroid Build Coastguard Worker
248*344a7f5eSAndroid Build Coastguard Worker /// \brief Calculates the approximate reciprocal of the value stored in the
249*344a7f5eSAndroid Build Coastguard Worker /// low-order bits of a 128-bit vector of [4 x float].
250*344a7f5eSAndroid Build Coastguard Worker ///
251*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
252*344a7f5eSAndroid Build Coastguard Worker ///
253*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VRCPSS / RCPSS instructions.
254*344a7f5eSAndroid Build Coastguard Worker ///
255*344a7f5eSAndroid Build Coastguard Worker /// \param __a
256*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
257*344a7f5eSAndroid Build Coastguard Worker /// used in the calculation.
258*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the approximate
259*344a7f5eSAndroid Build Coastguard Worker /// reciprocal of the value in the low-order bits of the operand.
260*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_rcp_ss(__m128 __a)261*344a7f5eSAndroid Build Coastguard Worker _mm_rcp_ss(__m128 __a)
262*344a7f5eSAndroid Build Coastguard Worker {
263*344a7f5eSAndroid Build Coastguard Worker __m128 __c = __builtin_ia32_rcpss((__v4sf)__a);
264*344a7f5eSAndroid Build Coastguard Worker return (__m128) { __c[0], __a[1], __a[2], __a[3] };
265*344a7f5eSAndroid Build Coastguard Worker }
266*344a7f5eSAndroid Build Coastguard Worker
267*344a7f5eSAndroid Build Coastguard Worker /// \brief Calculates the approximate reciprocals of the values stored in a
268*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vector of [4 x float].
269*344a7f5eSAndroid Build Coastguard Worker ///
270*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
271*344a7f5eSAndroid Build Coastguard Worker ///
272*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VRCPPS / RCPPS instructions.
273*344a7f5eSAndroid Build Coastguard Worker ///
274*344a7f5eSAndroid Build Coastguard Worker /// \param __a
275*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
276*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the approximate
277*344a7f5eSAndroid Build Coastguard Worker /// reciprocals of the values in the operand.
278*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_rcp_ps(__m128 __a)279*344a7f5eSAndroid Build Coastguard Worker _mm_rcp_ps(__m128 __a)
280*344a7f5eSAndroid Build Coastguard Worker {
281*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_rcpps((__v4sf)__a);
282*344a7f5eSAndroid Build Coastguard Worker }
283*344a7f5eSAndroid Build Coastguard Worker
284*344a7f5eSAndroid Build Coastguard Worker /// \brief Calculates the approximate reciprocal of the square root of the value
285*344a7f5eSAndroid Build Coastguard Worker /// stored in the low-order bits of a 128-bit vector of [4 x float].
286*344a7f5eSAndroid Build Coastguard Worker ///
287*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
288*344a7f5eSAndroid Build Coastguard Worker ///
289*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VRSQRTSS / RSQRTSS instructions.
290*344a7f5eSAndroid Build Coastguard Worker ///
291*344a7f5eSAndroid Build Coastguard Worker /// \param __a
292*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
293*344a7f5eSAndroid Build Coastguard Worker /// used in the calculation.
294*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the approximate
295*344a7f5eSAndroid Build Coastguard Worker /// reciprocal of the square root of the value in the low-order bits of the
296*344a7f5eSAndroid Build Coastguard Worker /// operand.
297*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_rsqrt_ss(__m128 __a)298*344a7f5eSAndroid Build Coastguard Worker _mm_rsqrt_ss(__m128 __a)
299*344a7f5eSAndroid Build Coastguard Worker {
300*344a7f5eSAndroid Build Coastguard Worker __m128 __c = __builtin_ia32_rsqrtss((__v4sf)__a);
301*344a7f5eSAndroid Build Coastguard Worker return (__m128) { __c[0], __a[1], __a[2], __a[3] };
302*344a7f5eSAndroid Build Coastguard Worker }
303*344a7f5eSAndroid Build Coastguard Worker
304*344a7f5eSAndroid Build Coastguard Worker /// \brief Calculates the approximate reciprocals of the square roots of the
305*344a7f5eSAndroid Build Coastguard Worker /// values stored in a 128-bit vector of [4 x float].
306*344a7f5eSAndroid Build Coastguard Worker ///
307*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
308*344a7f5eSAndroid Build Coastguard Worker ///
309*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VRSQRTPS / RSQRTPS instructions.
310*344a7f5eSAndroid Build Coastguard Worker ///
311*344a7f5eSAndroid Build Coastguard Worker /// \param __a
312*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
313*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the approximate
314*344a7f5eSAndroid Build Coastguard Worker /// reciprocals of the square roots of the values in the operand.
315*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_rsqrt_ps(__m128 __a)316*344a7f5eSAndroid Build Coastguard Worker _mm_rsqrt_ps(__m128 __a)
317*344a7f5eSAndroid Build Coastguard Worker {
318*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_rsqrtps((__v4sf)__a);
319*344a7f5eSAndroid Build Coastguard Worker }
320*344a7f5eSAndroid Build Coastguard Worker
321*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
322*344a7f5eSAndroid Build Coastguard Worker /// operands and returns the lesser value in the low-order bits of the
323*344a7f5eSAndroid Build Coastguard Worker /// vector of [4 x float].
324*344a7f5eSAndroid Build Coastguard Worker ///
325*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
326*344a7f5eSAndroid Build Coastguard Worker ///
327*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMINSS / MINSS instructions.
328*344a7f5eSAndroid Build Coastguard Worker ///
329*344a7f5eSAndroid Build Coastguard Worker /// \param __a
330*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
331*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
332*344a7f5eSAndroid Build Coastguard Worker /// \param __b
333*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
334*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
335*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the
336*344a7f5eSAndroid Build Coastguard Worker /// minimum value between both operands. The upper 96 bits are copied from
337*344a7f5eSAndroid Build Coastguard Worker /// the upper 96 bits of the first source operand.
338*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_min_ss(__m128 __a,__m128 __b)339*344a7f5eSAndroid Build Coastguard Worker _mm_min_ss(__m128 __a, __m128 __b)
340*344a7f5eSAndroid Build Coastguard Worker {
341*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_minss((__v4sf)__a, (__v4sf)__b);
342*344a7f5eSAndroid Build Coastguard Worker }
343*344a7f5eSAndroid Build Coastguard Worker
344*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 128-bit vectors of [4 x float] and returns the
345*344a7f5eSAndroid Build Coastguard Worker /// lesser of each pair of values.
346*344a7f5eSAndroid Build Coastguard Worker ///
347*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
348*344a7f5eSAndroid Build Coastguard Worker ///
349*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMINPS / MINPS instructions.
350*344a7f5eSAndroid Build Coastguard Worker ///
351*344a7f5eSAndroid Build Coastguard Worker /// \param __a
352*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands.
353*344a7f5eSAndroid Build Coastguard Worker /// \param __b
354*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands.
355*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the minimum values
356*344a7f5eSAndroid Build Coastguard Worker /// between both operands.
357*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_min_ps(__m128 __a,__m128 __b)358*344a7f5eSAndroid Build Coastguard Worker _mm_min_ps(__m128 __a, __m128 __b)
359*344a7f5eSAndroid Build Coastguard Worker {
360*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_minps((__v4sf)__a, (__v4sf)__b);
361*344a7f5eSAndroid Build Coastguard Worker }
362*344a7f5eSAndroid Build Coastguard Worker
363*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
364*344a7f5eSAndroid Build Coastguard Worker /// operands and returns the greater value in the low-order bits of
365*344a7f5eSAndroid Build Coastguard Worker /// a vector [4 x float].
366*344a7f5eSAndroid Build Coastguard Worker ///
367*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
368*344a7f5eSAndroid Build Coastguard Worker ///
369*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMAXSS / MAXSS instructions.
370*344a7f5eSAndroid Build Coastguard Worker ///
371*344a7f5eSAndroid Build Coastguard Worker /// \param __a
372*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
373*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
374*344a7f5eSAndroid Build Coastguard Worker /// \param __b
375*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
376*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
377*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the
378*344a7f5eSAndroid Build Coastguard Worker /// maximum value between both operands. The upper 96 bits are copied from
379*344a7f5eSAndroid Build Coastguard Worker /// the upper 96 bits of the first source operand.
380*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_max_ss(__m128 __a,__m128 __b)381*344a7f5eSAndroid Build Coastguard Worker _mm_max_ss(__m128 __a, __m128 __b)
382*344a7f5eSAndroid Build Coastguard Worker {
383*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_maxss((__v4sf)__a, (__v4sf)__b);
384*344a7f5eSAndroid Build Coastguard Worker }
385*344a7f5eSAndroid Build Coastguard Worker
386*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 128-bit vectors of [4 x float] and returns the greater
387*344a7f5eSAndroid Build Coastguard Worker /// of each pair of values.
388*344a7f5eSAndroid Build Coastguard Worker ///
389*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
390*344a7f5eSAndroid Build Coastguard Worker ///
391*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMAXPS / MAXPS instructions.
392*344a7f5eSAndroid Build Coastguard Worker ///
393*344a7f5eSAndroid Build Coastguard Worker /// \param __a
394*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands.
395*344a7f5eSAndroid Build Coastguard Worker /// \param __b
396*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands.
397*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the maximum values
398*344a7f5eSAndroid Build Coastguard Worker /// between both operands.
399*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_max_ps(__m128 __a,__m128 __b)400*344a7f5eSAndroid Build Coastguard Worker _mm_max_ps(__m128 __a, __m128 __b)
401*344a7f5eSAndroid Build Coastguard Worker {
402*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_maxps((__v4sf)__a, (__v4sf)__b);
403*344a7f5eSAndroid Build Coastguard Worker }
404*344a7f5eSAndroid Build Coastguard Worker
405*344a7f5eSAndroid Build Coastguard Worker /// \brief Performs a bitwise AND of two 128-bit vectors of [4 x float].
406*344a7f5eSAndroid Build Coastguard Worker ///
407*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
408*344a7f5eSAndroid Build Coastguard Worker ///
409*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VANDPS / ANDPS instructions.
410*344a7f5eSAndroid Build Coastguard Worker ///
411*344a7f5eSAndroid Build Coastguard Worker /// \param __a
412*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector containing one of the source operands.
413*344a7f5eSAndroid Build Coastguard Worker /// \param __b
414*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector containing one of the source operands.
415*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the bitwise AND of the
416*344a7f5eSAndroid Build Coastguard Worker /// values between both operands.
417*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_and_ps(__m128 __a,__m128 __b)418*344a7f5eSAndroid Build Coastguard Worker _mm_and_ps(__m128 __a, __m128 __b)
419*344a7f5eSAndroid Build Coastguard Worker {
420*344a7f5eSAndroid Build Coastguard Worker return (__m128)((__v4su)__a & (__v4su)__b);
421*344a7f5eSAndroid Build Coastguard Worker }
422*344a7f5eSAndroid Build Coastguard Worker
423*344a7f5eSAndroid Build Coastguard Worker /// \brief Performs a bitwise AND of two 128-bit vectors of [4 x float], using
424*344a7f5eSAndroid Build Coastguard Worker /// the one's complement of the values contained in the first source
425*344a7f5eSAndroid Build Coastguard Worker /// operand.
426*344a7f5eSAndroid Build Coastguard Worker ///
427*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
428*344a7f5eSAndroid Build Coastguard Worker ///
429*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VANDNPS / ANDNPS instructions.
430*344a7f5eSAndroid Build Coastguard Worker ///
431*344a7f5eSAndroid Build Coastguard Worker /// \param __a
432*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the first source operand. The
433*344a7f5eSAndroid Build Coastguard Worker /// one's complement of this value is used in the bitwise AND.
434*344a7f5eSAndroid Build Coastguard Worker /// \param __b
435*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the second source operand.
436*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the bitwise AND of the
437*344a7f5eSAndroid Build Coastguard Worker /// one's complement of the first operand and the values in the second
438*344a7f5eSAndroid Build Coastguard Worker /// operand.
439*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_andnot_ps(__m128 __a,__m128 __b)440*344a7f5eSAndroid Build Coastguard Worker _mm_andnot_ps(__m128 __a, __m128 __b)
441*344a7f5eSAndroid Build Coastguard Worker {
442*344a7f5eSAndroid Build Coastguard Worker return (__m128)(~(__v4su)__a & (__v4su)__b);
443*344a7f5eSAndroid Build Coastguard Worker }
444*344a7f5eSAndroid Build Coastguard Worker
445*344a7f5eSAndroid Build Coastguard Worker /// \brief Performs a bitwise OR of two 128-bit vectors of [4 x float].
446*344a7f5eSAndroid Build Coastguard Worker ///
447*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
448*344a7f5eSAndroid Build Coastguard Worker ///
449*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VORPS / ORPS instructions.
450*344a7f5eSAndroid Build Coastguard Worker ///
451*344a7f5eSAndroid Build Coastguard Worker /// \param __a
452*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the source operands.
453*344a7f5eSAndroid Build Coastguard Worker /// \param __b
454*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the source operands.
455*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the bitwise OR of the
456*344a7f5eSAndroid Build Coastguard Worker /// values between both operands.
457*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_or_ps(__m128 __a,__m128 __b)458*344a7f5eSAndroid Build Coastguard Worker _mm_or_ps(__m128 __a, __m128 __b)
459*344a7f5eSAndroid Build Coastguard Worker {
460*344a7f5eSAndroid Build Coastguard Worker return (__m128)((__v4su)__a | (__v4su)__b);
461*344a7f5eSAndroid Build Coastguard Worker }
462*344a7f5eSAndroid Build Coastguard Worker
463*344a7f5eSAndroid Build Coastguard Worker /// \brief Performs a bitwise exclusive OR of two 128-bit vectors of
464*344a7f5eSAndroid Build Coastguard Worker /// [4 x float].
465*344a7f5eSAndroid Build Coastguard Worker ///
466*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
467*344a7f5eSAndroid Build Coastguard Worker ///
468*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VXORPS / XORPS instructions.
469*344a7f5eSAndroid Build Coastguard Worker ///
470*344a7f5eSAndroid Build Coastguard Worker /// \param __a
471*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the source operands.
472*344a7f5eSAndroid Build Coastguard Worker /// \param __b
473*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the source operands.
474*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the bitwise exclusive OR
475*344a7f5eSAndroid Build Coastguard Worker /// of the values between both operands.
476*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_xor_ps(__m128 __a,__m128 __b)477*344a7f5eSAndroid Build Coastguard Worker _mm_xor_ps(__m128 __a, __m128 __b)
478*344a7f5eSAndroid Build Coastguard Worker {
479*344a7f5eSAndroid Build Coastguard Worker return (__m128)((__v4su)__a ^ (__v4su)__b);
480*344a7f5eSAndroid Build Coastguard Worker }
481*344a7f5eSAndroid Build Coastguard Worker
482*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
483*344a7f5eSAndroid Build Coastguard Worker /// operands for equality and returns the result of the comparison in the
484*344a7f5eSAndroid Build Coastguard Worker /// low-order bits of a vector [4 x float].
485*344a7f5eSAndroid Build Coastguard Worker ///
486*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
487*344a7f5eSAndroid Build Coastguard Worker ///
488*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPEQSS / CMPEQSS instructions.
489*344a7f5eSAndroid Build Coastguard Worker ///
490*344a7f5eSAndroid Build Coastguard Worker /// \param __a
491*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
492*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
493*344a7f5eSAndroid Build Coastguard Worker /// \param __b
494*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
495*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
496*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results
497*344a7f5eSAndroid Build Coastguard Worker /// in the low-order bits.
498*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpeq_ss(__m128 __a,__m128 __b)499*344a7f5eSAndroid Build Coastguard Worker _mm_cmpeq_ss(__m128 __a, __m128 __b)
500*344a7f5eSAndroid Build Coastguard Worker {
501*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpeqss((__v4sf)__a, (__v4sf)__b);
502*344a7f5eSAndroid Build Coastguard Worker }
503*344a7f5eSAndroid Build Coastguard Worker
504*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares each of the corresponding 32-bit float values of the
505*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vectors of [4 x float] for equality.
506*344a7f5eSAndroid Build Coastguard Worker ///
507*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
508*344a7f5eSAndroid Build Coastguard Worker ///
509*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPEQPS / CMPEQPS instructions.
510*344a7f5eSAndroid Build Coastguard Worker ///
511*344a7f5eSAndroid Build Coastguard Worker /// \param __a
512*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
513*344a7f5eSAndroid Build Coastguard Worker /// \param __b
514*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
515*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results.
516*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpeq_ps(__m128 __a,__m128 __b)517*344a7f5eSAndroid Build Coastguard Worker _mm_cmpeq_ps(__m128 __a, __m128 __b)
518*344a7f5eSAndroid Build Coastguard Worker {
519*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpeqps((__v4sf)__a, (__v4sf)__b);
520*344a7f5eSAndroid Build Coastguard Worker }
521*344a7f5eSAndroid Build Coastguard Worker
522*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
523*344a7f5eSAndroid Build Coastguard Worker /// operands to determine if the value in the first operand is less than the
524*344a7f5eSAndroid Build Coastguard Worker /// corresponding value in the second operand and returns the result of the
525*344a7f5eSAndroid Build Coastguard Worker /// comparison in the low-order bits of a vector of [4 x float].
526*344a7f5eSAndroid Build Coastguard Worker ///
527*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
528*344a7f5eSAndroid Build Coastguard Worker ///
529*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPLTSS / CMPLTSS instructions.
530*344a7f5eSAndroid Build Coastguard Worker ///
531*344a7f5eSAndroid Build Coastguard Worker /// \param __a
532*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
533*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
534*344a7f5eSAndroid Build Coastguard Worker /// \param __b
535*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
536*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
537*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results
538*344a7f5eSAndroid Build Coastguard Worker /// in the low-order bits.
539*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmplt_ss(__m128 __a,__m128 __b)540*344a7f5eSAndroid Build Coastguard Worker _mm_cmplt_ss(__m128 __a, __m128 __b)
541*344a7f5eSAndroid Build Coastguard Worker {
542*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpltss((__v4sf)__a, (__v4sf)__b);
543*344a7f5eSAndroid Build Coastguard Worker }
544*344a7f5eSAndroid Build Coastguard Worker
545*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares each of the corresponding 32-bit float values of the
546*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vectors of [4 x float] to determine if the values in the first
547*344a7f5eSAndroid Build Coastguard Worker /// operand are less than those in the second operand.
548*344a7f5eSAndroid Build Coastguard Worker ///
549*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
550*344a7f5eSAndroid Build Coastguard Worker ///
551*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPLTPS / CMPLTPS instructions.
552*344a7f5eSAndroid Build Coastguard Worker ///
553*344a7f5eSAndroid Build Coastguard Worker /// \param __a
554*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
555*344a7f5eSAndroid Build Coastguard Worker /// \param __b
556*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
557*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results.
558*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmplt_ps(__m128 __a,__m128 __b)559*344a7f5eSAndroid Build Coastguard Worker _mm_cmplt_ps(__m128 __a, __m128 __b)
560*344a7f5eSAndroid Build Coastguard Worker {
561*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpltps((__v4sf)__a, (__v4sf)__b);
562*344a7f5eSAndroid Build Coastguard Worker }
563*344a7f5eSAndroid Build Coastguard Worker
564*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
565*344a7f5eSAndroid Build Coastguard Worker /// operands to determine if the value in the first operand is less than or
566*344a7f5eSAndroid Build Coastguard Worker /// equal to the corresponding value in the second operand and returns the
567*344a7f5eSAndroid Build Coastguard Worker /// result of the comparison in the low-order bits of a vector of
568*344a7f5eSAndroid Build Coastguard Worker /// [4 x float].
569*344a7f5eSAndroid Build Coastguard Worker ///
570*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
571*344a7f5eSAndroid Build Coastguard Worker ///
572*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPLESS / CMPLESS instructions.
573*344a7f5eSAndroid Build Coastguard Worker ///
574*344a7f5eSAndroid Build Coastguard Worker /// \param __a
575*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
576*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
577*344a7f5eSAndroid Build Coastguard Worker /// \param __b
578*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
579*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
580*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results
581*344a7f5eSAndroid Build Coastguard Worker /// in the low-order bits.
582*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmple_ss(__m128 __a,__m128 __b)583*344a7f5eSAndroid Build Coastguard Worker _mm_cmple_ss(__m128 __a, __m128 __b)
584*344a7f5eSAndroid Build Coastguard Worker {
585*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpless((__v4sf)__a, (__v4sf)__b);
586*344a7f5eSAndroid Build Coastguard Worker }
587*344a7f5eSAndroid Build Coastguard Worker
588*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares each of the corresponding 32-bit float values of the
589*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vectors of [4 x float] to determine if the values in the first
590*344a7f5eSAndroid Build Coastguard Worker /// operand are less than or equal to those in the second operand.
591*344a7f5eSAndroid Build Coastguard Worker ///
592*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
593*344a7f5eSAndroid Build Coastguard Worker ///
594*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPLEPS / CMPLEPS instructions.
595*344a7f5eSAndroid Build Coastguard Worker ///
596*344a7f5eSAndroid Build Coastguard Worker /// \param __a
597*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
598*344a7f5eSAndroid Build Coastguard Worker /// \param __b
599*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
600*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results.
601*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmple_ps(__m128 __a,__m128 __b)602*344a7f5eSAndroid Build Coastguard Worker _mm_cmple_ps(__m128 __a, __m128 __b)
603*344a7f5eSAndroid Build Coastguard Worker {
604*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpleps((__v4sf)__a, (__v4sf)__b);
605*344a7f5eSAndroid Build Coastguard Worker }
606*344a7f5eSAndroid Build Coastguard Worker
607*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
608*344a7f5eSAndroid Build Coastguard Worker /// operands to determine if the value in the first operand is greater than
609*344a7f5eSAndroid Build Coastguard Worker /// the corresponding value in the second operand and returns the result of
610*344a7f5eSAndroid Build Coastguard Worker /// the comparison in the low-order bits of a vector of [4 x float].
611*344a7f5eSAndroid Build Coastguard Worker ///
612*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
613*344a7f5eSAndroid Build Coastguard Worker ///
614*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPLTSS / CMPLTSS instructions.
615*344a7f5eSAndroid Build Coastguard Worker ///
616*344a7f5eSAndroid Build Coastguard Worker /// \param __a
617*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
618*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
619*344a7f5eSAndroid Build Coastguard Worker /// \param __b
620*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
621*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
622*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results
623*344a7f5eSAndroid Build Coastguard Worker /// in the low-order bits.
624*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpgt_ss(__m128 __a,__m128 __b)625*344a7f5eSAndroid Build Coastguard Worker _mm_cmpgt_ss(__m128 __a, __m128 __b)
626*344a7f5eSAndroid Build Coastguard Worker {
627*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_shufflevector((__v4sf)__a,
628*344a7f5eSAndroid Build Coastguard Worker (__v4sf)__builtin_ia32_cmpltss((__v4sf)__b, (__v4sf)__a),
629*344a7f5eSAndroid Build Coastguard Worker 4, 1, 2, 3);
630*344a7f5eSAndroid Build Coastguard Worker }
631*344a7f5eSAndroid Build Coastguard Worker
632*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares each of the corresponding 32-bit float values of the
633*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vectors of [4 x float] to determine if the values in the first
634*344a7f5eSAndroid Build Coastguard Worker /// operand are greater than those in the second operand.
635*344a7f5eSAndroid Build Coastguard Worker ///
636*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
637*344a7f5eSAndroid Build Coastguard Worker ///
638*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPLTPS / CMPLTPS instructions.
639*344a7f5eSAndroid Build Coastguard Worker ///
640*344a7f5eSAndroid Build Coastguard Worker /// \param __a
641*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
642*344a7f5eSAndroid Build Coastguard Worker /// \param __b
643*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
644*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results.
645*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpgt_ps(__m128 __a,__m128 __b)646*344a7f5eSAndroid Build Coastguard Worker _mm_cmpgt_ps(__m128 __a, __m128 __b)
647*344a7f5eSAndroid Build Coastguard Worker {
648*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpltps((__v4sf)__b, (__v4sf)__a);
649*344a7f5eSAndroid Build Coastguard Worker }
650*344a7f5eSAndroid Build Coastguard Worker
651*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
652*344a7f5eSAndroid Build Coastguard Worker /// operands to determine if the value in the first operand is greater than
653*344a7f5eSAndroid Build Coastguard Worker /// or equal to the corresponding value in the second operand and returns
654*344a7f5eSAndroid Build Coastguard Worker /// the result of the comparison in the low-order bits of a vector of
655*344a7f5eSAndroid Build Coastguard Worker /// [4 x float].
656*344a7f5eSAndroid Build Coastguard Worker ///
657*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
658*344a7f5eSAndroid Build Coastguard Worker ///
659*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPLESS / CMPLESS instructions.
660*344a7f5eSAndroid Build Coastguard Worker ///
661*344a7f5eSAndroid Build Coastguard Worker /// \param __a
662*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
663*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
664*344a7f5eSAndroid Build Coastguard Worker /// \param __b
665*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
666*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
667*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results
668*344a7f5eSAndroid Build Coastguard Worker /// in the low-order bits.
669*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpge_ss(__m128 __a,__m128 __b)670*344a7f5eSAndroid Build Coastguard Worker _mm_cmpge_ss(__m128 __a, __m128 __b)
671*344a7f5eSAndroid Build Coastguard Worker {
672*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_shufflevector((__v4sf)__a,
673*344a7f5eSAndroid Build Coastguard Worker (__v4sf)__builtin_ia32_cmpless((__v4sf)__b, (__v4sf)__a),
674*344a7f5eSAndroid Build Coastguard Worker 4, 1, 2, 3);
675*344a7f5eSAndroid Build Coastguard Worker }
676*344a7f5eSAndroid Build Coastguard Worker
677*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares each of the corresponding 32-bit float values of the
678*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vectors of [4 x float] to determine if the values in the first
679*344a7f5eSAndroid Build Coastguard Worker /// operand are greater than or equal to those in the second operand.
680*344a7f5eSAndroid Build Coastguard Worker ///
681*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
682*344a7f5eSAndroid Build Coastguard Worker ///
683*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPLEPS / CMPLEPS instructions.
684*344a7f5eSAndroid Build Coastguard Worker ///
685*344a7f5eSAndroid Build Coastguard Worker /// \param __a
686*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
687*344a7f5eSAndroid Build Coastguard Worker /// \param __b
688*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
689*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results.
690*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpge_ps(__m128 __a,__m128 __b)691*344a7f5eSAndroid Build Coastguard Worker _mm_cmpge_ps(__m128 __a, __m128 __b)
692*344a7f5eSAndroid Build Coastguard Worker {
693*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpleps((__v4sf)__b, (__v4sf)__a);
694*344a7f5eSAndroid Build Coastguard Worker }
695*344a7f5eSAndroid Build Coastguard Worker
696*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
697*344a7f5eSAndroid Build Coastguard Worker /// operands for inequality and returns the result of the comparison in the
698*344a7f5eSAndroid Build Coastguard Worker /// low-order bits of a vector of [4 x float].
699*344a7f5eSAndroid Build Coastguard Worker ///
700*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
701*344a7f5eSAndroid Build Coastguard Worker ///
702*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPNEQSS / CMPNEQSS instructions.
703*344a7f5eSAndroid Build Coastguard Worker ///
704*344a7f5eSAndroid Build Coastguard Worker /// \param __a
705*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
706*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
707*344a7f5eSAndroid Build Coastguard Worker /// \param __b
708*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
709*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
710*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results
711*344a7f5eSAndroid Build Coastguard Worker /// in the low-order bits.
712*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpneq_ss(__m128 __a,__m128 __b)713*344a7f5eSAndroid Build Coastguard Worker _mm_cmpneq_ss(__m128 __a, __m128 __b)
714*344a7f5eSAndroid Build Coastguard Worker {
715*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpneqss((__v4sf)__a, (__v4sf)__b);
716*344a7f5eSAndroid Build Coastguard Worker }
717*344a7f5eSAndroid Build Coastguard Worker
718*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares each of the corresponding 32-bit float values of the
719*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vectors of [4 x float] for inequality.
720*344a7f5eSAndroid Build Coastguard Worker ///
721*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
722*344a7f5eSAndroid Build Coastguard Worker ///
723*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPNEQPS / CMPNEQPS instructions.
724*344a7f5eSAndroid Build Coastguard Worker ///
725*344a7f5eSAndroid Build Coastguard Worker /// \param __a
726*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
727*344a7f5eSAndroid Build Coastguard Worker /// \param __b
728*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
729*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results.
730*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpneq_ps(__m128 __a,__m128 __b)731*344a7f5eSAndroid Build Coastguard Worker _mm_cmpneq_ps(__m128 __a, __m128 __b)
732*344a7f5eSAndroid Build Coastguard Worker {
733*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpneqps((__v4sf)__a, (__v4sf)__b);
734*344a7f5eSAndroid Build Coastguard Worker }
735*344a7f5eSAndroid Build Coastguard Worker
736*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
737*344a7f5eSAndroid Build Coastguard Worker /// operands to determine if the value in the first operand is not less than
738*344a7f5eSAndroid Build Coastguard Worker /// the corresponding value in the second operand and returns the result of
739*344a7f5eSAndroid Build Coastguard Worker /// the comparison in the low-order bits of a vector of [4 x float].
740*344a7f5eSAndroid Build Coastguard Worker ///
741*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
742*344a7f5eSAndroid Build Coastguard Worker ///
743*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPNLTSS / CMPNLTSS instructions.
744*344a7f5eSAndroid Build Coastguard Worker ///
745*344a7f5eSAndroid Build Coastguard Worker /// \param __a
746*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
747*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
748*344a7f5eSAndroid Build Coastguard Worker /// \param __b
749*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
750*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
751*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results
752*344a7f5eSAndroid Build Coastguard Worker /// in the low-order bits.
753*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpnlt_ss(__m128 __a,__m128 __b)754*344a7f5eSAndroid Build Coastguard Worker _mm_cmpnlt_ss(__m128 __a, __m128 __b)
755*344a7f5eSAndroid Build Coastguard Worker {
756*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpnltss((__v4sf)__a, (__v4sf)__b);
757*344a7f5eSAndroid Build Coastguard Worker }
758*344a7f5eSAndroid Build Coastguard Worker
759*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares each of the corresponding 32-bit float values of the
760*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vectors of [4 x float] to determine if the values in the first
761*344a7f5eSAndroid Build Coastguard Worker /// operand are not less than those in the second operand.
762*344a7f5eSAndroid Build Coastguard Worker ///
763*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
764*344a7f5eSAndroid Build Coastguard Worker ///
765*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPNLTPS / CMPNLTPS instructions.
766*344a7f5eSAndroid Build Coastguard Worker ///
767*344a7f5eSAndroid Build Coastguard Worker /// \param __a
768*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
769*344a7f5eSAndroid Build Coastguard Worker /// \param __b
770*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
771*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results.
772*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpnlt_ps(__m128 __a,__m128 __b)773*344a7f5eSAndroid Build Coastguard Worker _mm_cmpnlt_ps(__m128 __a, __m128 __b)
774*344a7f5eSAndroid Build Coastguard Worker {
775*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpnltps((__v4sf)__a, (__v4sf)__b);
776*344a7f5eSAndroid Build Coastguard Worker }
777*344a7f5eSAndroid Build Coastguard Worker
778*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
779*344a7f5eSAndroid Build Coastguard Worker /// operands to determine if the value in the first operand is not less than
780*344a7f5eSAndroid Build Coastguard Worker /// or equal to the corresponding value in the second operand and returns
781*344a7f5eSAndroid Build Coastguard Worker /// the result of the comparison in the low-order bits of a vector of
782*344a7f5eSAndroid Build Coastguard Worker /// [4 x float].
783*344a7f5eSAndroid Build Coastguard Worker ///
784*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
785*344a7f5eSAndroid Build Coastguard Worker ///
786*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPNLESS / CMPNLESS instructions.
787*344a7f5eSAndroid Build Coastguard Worker ///
788*344a7f5eSAndroid Build Coastguard Worker /// \param __a
789*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
790*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
791*344a7f5eSAndroid Build Coastguard Worker /// \param __b
792*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
793*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
794*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results
795*344a7f5eSAndroid Build Coastguard Worker /// in the low-order bits.
796*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpnle_ss(__m128 __a,__m128 __b)797*344a7f5eSAndroid Build Coastguard Worker _mm_cmpnle_ss(__m128 __a, __m128 __b)
798*344a7f5eSAndroid Build Coastguard Worker {
799*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpnless((__v4sf)__a, (__v4sf)__b);
800*344a7f5eSAndroid Build Coastguard Worker }
801*344a7f5eSAndroid Build Coastguard Worker
802*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares each of the corresponding 32-bit float values of the
803*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vectors of [4 x float] to determine if the values in the first
804*344a7f5eSAndroid Build Coastguard Worker /// operand are not less than or equal to those in the second operand.
805*344a7f5eSAndroid Build Coastguard Worker ///
806*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
807*344a7f5eSAndroid Build Coastguard Worker ///
808*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPNLEPS / CMPNLEPS instructions.
809*344a7f5eSAndroid Build Coastguard Worker ///
810*344a7f5eSAndroid Build Coastguard Worker /// \param __a
811*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
812*344a7f5eSAndroid Build Coastguard Worker /// \param __b
813*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
814*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results.
815*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpnle_ps(__m128 __a,__m128 __b)816*344a7f5eSAndroid Build Coastguard Worker _mm_cmpnle_ps(__m128 __a, __m128 __b)
817*344a7f5eSAndroid Build Coastguard Worker {
818*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpnleps((__v4sf)__a, (__v4sf)__b);
819*344a7f5eSAndroid Build Coastguard Worker }
820*344a7f5eSAndroid Build Coastguard Worker
821*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
822*344a7f5eSAndroid Build Coastguard Worker /// operands to determine if the value in the first operand is not greater
823*344a7f5eSAndroid Build Coastguard Worker /// than the corresponding value in the second operand and returns the
824*344a7f5eSAndroid Build Coastguard Worker /// result of the comparison in the low-order bits of a vector of
825*344a7f5eSAndroid Build Coastguard Worker /// [4 x float].
826*344a7f5eSAndroid Build Coastguard Worker ///
827*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
828*344a7f5eSAndroid Build Coastguard Worker ///
829*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPNLTSS / CMPNLTSS instructions.
830*344a7f5eSAndroid Build Coastguard Worker ///
831*344a7f5eSAndroid Build Coastguard Worker /// \param __a
832*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
833*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
834*344a7f5eSAndroid Build Coastguard Worker /// \param __b
835*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
836*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
837*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results
838*344a7f5eSAndroid Build Coastguard Worker /// in the low-order bits.
839*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpngt_ss(__m128 __a,__m128 __b)840*344a7f5eSAndroid Build Coastguard Worker _mm_cmpngt_ss(__m128 __a, __m128 __b)
841*344a7f5eSAndroid Build Coastguard Worker {
842*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_shufflevector((__v4sf)__a,
843*344a7f5eSAndroid Build Coastguard Worker (__v4sf)__builtin_ia32_cmpnltss((__v4sf)__b, (__v4sf)__a),
844*344a7f5eSAndroid Build Coastguard Worker 4, 1, 2, 3);
845*344a7f5eSAndroid Build Coastguard Worker }
846*344a7f5eSAndroid Build Coastguard Worker
847*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares each of the corresponding 32-bit float values of the
848*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vectors of [4 x float] to determine if the values in the first
849*344a7f5eSAndroid Build Coastguard Worker /// operand are not greater than those in the second operand.
850*344a7f5eSAndroid Build Coastguard Worker ///
851*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
852*344a7f5eSAndroid Build Coastguard Worker ///
853*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPNLTPS / CMPNLTPS instructions.
854*344a7f5eSAndroid Build Coastguard Worker ///
855*344a7f5eSAndroid Build Coastguard Worker /// \param __a
856*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
857*344a7f5eSAndroid Build Coastguard Worker /// \param __b
858*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
859*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results.
860*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpngt_ps(__m128 __a,__m128 __b)861*344a7f5eSAndroid Build Coastguard Worker _mm_cmpngt_ps(__m128 __a, __m128 __b)
862*344a7f5eSAndroid Build Coastguard Worker {
863*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpnltps((__v4sf)__b, (__v4sf)__a);
864*344a7f5eSAndroid Build Coastguard Worker }
865*344a7f5eSAndroid Build Coastguard Worker
866*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
867*344a7f5eSAndroid Build Coastguard Worker /// operands to determine if the value in the first operand is not greater
868*344a7f5eSAndroid Build Coastguard Worker /// than or equal to the corresponding value in the second operand and
869*344a7f5eSAndroid Build Coastguard Worker /// returns the result of the comparison in the low-order bits of a vector
870*344a7f5eSAndroid Build Coastguard Worker /// of [4 x float].
871*344a7f5eSAndroid Build Coastguard Worker ///
872*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
873*344a7f5eSAndroid Build Coastguard Worker ///
874*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPNLESS / CMPNLESS instructions.
875*344a7f5eSAndroid Build Coastguard Worker ///
876*344a7f5eSAndroid Build Coastguard Worker /// \param __a
877*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
878*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
879*344a7f5eSAndroid Build Coastguard Worker /// \param __b
880*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
881*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
882*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results
883*344a7f5eSAndroid Build Coastguard Worker /// in the low-order bits.
884*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpnge_ss(__m128 __a,__m128 __b)885*344a7f5eSAndroid Build Coastguard Worker _mm_cmpnge_ss(__m128 __a, __m128 __b)
886*344a7f5eSAndroid Build Coastguard Worker {
887*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_shufflevector((__v4sf)__a,
888*344a7f5eSAndroid Build Coastguard Worker (__v4sf)__builtin_ia32_cmpnless((__v4sf)__b, (__v4sf)__a),
889*344a7f5eSAndroid Build Coastguard Worker 4, 1, 2, 3);
890*344a7f5eSAndroid Build Coastguard Worker }
891*344a7f5eSAndroid Build Coastguard Worker
892*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares each of the corresponding 32-bit float values of the
893*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vectors of [4 x float] to determine if the values in the first
894*344a7f5eSAndroid Build Coastguard Worker /// operand are not greater than or equal to those in the second operand.
895*344a7f5eSAndroid Build Coastguard Worker ///
896*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
897*344a7f5eSAndroid Build Coastguard Worker ///
898*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPNLEPS / CMPNLEPS instructions.
899*344a7f5eSAndroid Build Coastguard Worker ///
900*344a7f5eSAndroid Build Coastguard Worker /// \param __a
901*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
902*344a7f5eSAndroid Build Coastguard Worker /// \param __b
903*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
904*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results.
905*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpnge_ps(__m128 __a,__m128 __b)906*344a7f5eSAndroid Build Coastguard Worker _mm_cmpnge_ps(__m128 __a, __m128 __b)
907*344a7f5eSAndroid Build Coastguard Worker {
908*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpnleps((__v4sf)__b, (__v4sf)__a);
909*344a7f5eSAndroid Build Coastguard Worker }
910*344a7f5eSAndroid Build Coastguard Worker
911*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
912*344a7f5eSAndroid Build Coastguard Worker /// operands to determine if the value in the first operand is ordered with
913*344a7f5eSAndroid Build Coastguard Worker /// respect to the corresponding value in the second operand and returns the
914*344a7f5eSAndroid Build Coastguard Worker /// result of the comparison in the low-order bits of a vector of
915*344a7f5eSAndroid Build Coastguard Worker /// [4 x float].
916*344a7f5eSAndroid Build Coastguard Worker ///
917*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
918*344a7f5eSAndroid Build Coastguard Worker ///
919*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPORDSS / CMPORDSS instructions.
920*344a7f5eSAndroid Build Coastguard Worker ///
921*344a7f5eSAndroid Build Coastguard Worker /// \param __a
922*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
923*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
924*344a7f5eSAndroid Build Coastguard Worker /// \param __b
925*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
926*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
927*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results
928*344a7f5eSAndroid Build Coastguard Worker /// in the low-order bits.
929*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpord_ss(__m128 __a,__m128 __b)930*344a7f5eSAndroid Build Coastguard Worker _mm_cmpord_ss(__m128 __a, __m128 __b)
931*344a7f5eSAndroid Build Coastguard Worker {
932*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpordss((__v4sf)__a, (__v4sf)__b);
933*344a7f5eSAndroid Build Coastguard Worker }
934*344a7f5eSAndroid Build Coastguard Worker
935*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares each of the corresponding 32-bit float values of the
936*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vectors of [4 x float] to determine if the values in the first
937*344a7f5eSAndroid Build Coastguard Worker /// operand are ordered with respect to those in the second operand.
938*344a7f5eSAndroid Build Coastguard Worker ///
939*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
940*344a7f5eSAndroid Build Coastguard Worker ///
941*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPORDPS / CMPORDPS instructions.
942*344a7f5eSAndroid Build Coastguard Worker ///
943*344a7f5eSAndroid Build Coastguard Worker /// \param __a
944*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
945*344a7f5eSAndroid Build Coastguard Worker /// \param __b
946*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
947*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results.
948*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpord_ps(__m128 __a,__m128 __b)949*344a7f5eSAndroid Build Coastguard Worker _mm_cmpord_ps(__m128 __a, __m128 __b)
950*344a7f5eSAndroid Build Coastguard Worker {
951*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpordps((__v4sf)__a, (__v4sf)__b);
952*344a7f5eSAndroid Build Coastguard Worker }
953*344a7f5eSAndroid Build Coastguard Worker
954*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
955*344a7f5eSAndroid Build Coastguard Worker /// operands to determine if the value in the first operand is unordered
956*344a7f5eSAndroid Build Coastguard Worker /// with respect to the corresponding value in the second operand and
957*344a7f5eSAndroid Build Coastguard Worker /// returns the result of the comparison in the low-order bits of a vector
958*344a7f5eSAndroid Build Coastguard Worker /// of [4 x float].
959*344a7f5eSAndroid Build Coastguard Worker ///
960*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
961*344a7f5eSAndroid Build Coastguard Worker ///
962*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPUNORDSS / CMPUNORDSS instructions.
963*344a7f5eSAndroid Build Coastguard Worker ///
964*344a7f5eSAndroid Build Coastguard Worker /// \param __a
965*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
966*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
967*344a7f5eSAndroid Build Coastguard Worker /// \param __b
968*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the operands. The lower
969*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of this operand are used in the comparison.
970*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results
971*344a7f5eSAndroid Build Coastguard Worker /// in the low-order bits.
972*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpunord_ss(__m128 __a,__m128 __b)973*344a7f5eSAndroid Build Coastguard Worker _mm_cmpunord_ss(__m128 __a, __m128 __b)
974*344a7f5eSAndroid Build Coastguard Worker {
975*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpunordss((__v4sf)__a, (__v4sf)__b);
976*344a7f5eSAndroid Build Coastguard Worker }
977*344a7f5eSAndroid Build Coastguard Worker
978*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares each of the corresponding 32-bit float values of the
979*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vectors of [4 x float] to determine if the values in the first
980*344a7f5eSAndroid Build Coastguard Worker /// operand are unordered with respect to those in the second operand.
981*344a7f5eSAndroid Build Coastguard Worker ///
982*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
983*344a7f5eSAndroid Build Coastguard Worker ///
984*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCMPUNORDPS / CMPUNORDPS instructions.
985*344a7f5eSAndroid Build Coastguard Worker ///
986*344a7f5eSAndroid Build Coastguard Worker /// \param __a
987*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
988*344a7f5eSAndroid Build Coastguard Worker /// \param __b
989*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
990*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the comparison results.
991*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cmpunord_ps(__m128 __a,__m128 __b)992*344a7f5eSAndroid Build Coastguard Worker _mm_cmpunord_ps(__m128 __a, __m128 __b)
993*344a7f5eSAndroid Build Coastguard Worker {
994*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_cmpunordps((__v4sf)__a, (__v4sf)__b);
995*344a7f5eSAndroid Build Coastguard Worker }
996*344a7f5eSAndroid Build Coastguard Worker
997*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
998*344a7f5eSAndroid Build Coastguard Worker /// operands for equality and returns the result of the comparison.
999*344a7f5eSAndroid Build Coastguard Worker ///
1000*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1001*344a7f5eSAndroid Build Coastguard Worker ///
1002*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCOMISS / COMISS instructions.
1003*344a7f5eSAndroid Build Coastguard Worker ///
1004*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1005*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1006*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1007*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1008*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1009*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1010*344a7f5eSAndroid Build Coastguard Worker /// \returns An integer containing the comparison results.
1011*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_comieq_ss(__m128 __a,__m128 __b)1012*344a7f5eSAndroid Build Coastguard Worker _mm_comieq_ss(__m128 __a, __m128 __b)
1013*344a7f5eSAndroid Build Coastguard Worker {
1014*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_comieq((__v4sf)__a, (__v4sf)__b);
1015*344a7f5eSAndroid Build Coastguard Worker }
1016*344a7f5eSAndroid Build Coastguard Worker
1017*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
1018*344a7f5eSAndroid Build Coastguard Worker /// operands to determine if the first operand is less than the second
1019*344a7f5eSAndroid Build Coastguard Worker /// operand and returns the result of the comparison.
1020*344a7f5eSAndroid Build Coastguard Worker ///
1021*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1022*344a7f5eSAndroid Build Coastguard Worker ///
1023*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCOMISS / COMISS instructions.
1024*344a7f5eSAndroid Build Coastguard Worker ///
1025*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1026*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1027*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1028*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1029*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1030*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1031*344a7f5eSAndroid Build Coastguard Worker /// \returns An integer containing the comparison results.
1032*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_comilt_ss(__m128 __a,__m128 __b)1033*344a7f5eSAndroid Build Coastguard Worker _mm_comilt_ss(__m128 __a, __m128 __b)
1034*344a7f5eSAndroid Build Coastguard Worker {
1035*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_comilt((__v4sf)__a, (__v4sf)__b);
1036*344a7f5eSAndroid Build Coastguard Worker }
1037*344a7f5eSAndroid Build Coastguard Worker
1038*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
1039*344a7f5eSAndroid Build Coastguard Worker /// operands to determine if the first operand is less than or equal to the
1040*344a7f5eSAndroid Build Coastguard Worker /// second operand and returns the result of the comparison.
1041*344a7f5eSAndroid Build Coastguard Worker ///
1042*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1043*344a7f5eSAndroid Build Coastguard Worker ///
1044*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCOMISS / COMISS instructions.
1045*344a7f5eSAndroid Build Coastguard Worker ///
1046*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1047*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1048*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1049*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1050*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1051*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1052*344a7f5eSAndroid Build Coastguard Worker /// \returns An integer containing the comparison results.
1053*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_comile_ss(__m128 __a,__m128 __b)1054*344a7f5eSAndroid Build Coastguard Worker _mm_comile_ss(__m128 __a, __m128 __b)
1055*344a7f5eSAndroid Build Coastguard Worker {
1056*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_comile((__v4sf)__a, (__v4sf)__b);
1057*344a7f5eSAndroid Build Coastguard Worker }
1058*344a7f5eSAndroid Build Coastguard Worker
1059*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
1060*344a7f5eSAndroid Build Coastguard Worker /// operands to determine if the first operand is greater than the second
1061*344a7f5eSAndroid Build Coastguard Worker /// operand and returns the result of the comparison.
1062*344a7f5eSAndroid Build Coastguard Worker ///
1063*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1064*344a7f5eSAndroid Build Coastguard Worker ///
1065*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCOMISS / COMISS instructions.
1066*344a7f5eSAndroid Build Coastguard Worker ///
1067*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1068*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1069*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1070*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1071*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1072*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1073*344a7f5eSAndroid Build Coastguard Worker /// \returns An integer containing the comparison results.
1074*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_comigt_ss(__m128 __a,__m128 __b)1075*344a7f5eSAndroid Build Coastguard Worker _mm_comigt_ss(__m128 __a, __m128 __b)
1076*344a7f5eSAndroid Build Coastguard Worker {
1077*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_comigt((__v4sf)__a, (__v4sf)__b);
1078*344a7f5eSAndroid Build Coastguard Worker }
1079*344a7f5eSAndroid Build Coastguard Worker
1080*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
1081*344a7f5eSAndroid Build Coastguard Worker /// operands to determine if the first operand is greater than or equal to
1082*344a7f5eSAndroid Build Coastguard Worker /// the second operand and returns the result of the comparison.
1083*344a7f5eSAndroid Build Coastguard Worker ///
1084*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1085*344a7f5eSAndroid Build Coastguard Worker ///
1086*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCOMISS / COMISS instructions.
1087*344a7f5eSAndroid Build Coastguard Worker ///
1088*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1089*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1090*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1091*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1092*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1093*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1094*344a7f5eSAndroid Build Coastguard Worker /// \returns An integer containing the comparison results.
1095*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_comige_ss(__m128 __a,__m128 __b)1096*344a7f5eSAndroid Build Coastguard Worker _mm_comige_ss(__m128 __a, __m128 __b)
1097*344a7f5eSAndroid Build Coastguard Worker {
1098*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_comige((__v4sf)__a, (__v4sf)__b);
1099*344a7f5eSAndroid Build Coastguard Worker }
1100*344a7f5eSAndroid Build Coastguard Worker
1101*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares two 32-bit float values in the low-order bits of both
1102*344a7f5eSAndroid Build Coastguard Worker /// operands to determine if the first operand is not equal to the second
1103*344a7f5eSAndroid Build Coastguard Worker /// operand and returns the result of the comparison.
1104*344a7f5eSAndroid Build Coastguard Worker ///
1105*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1106*344a7f5eSAndroid Build Coastguard Worker ///
1107*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCOMISS / COMISS instructions.
1108*344a7f5eSAndroid Build Coastguard Worker ///
1109*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1110*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1111*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1112*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1113*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1114*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1115*344a7f5eSAndroid Build Coastguard Worker /// \returns An integer containing the comparison results.
1116*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_comineq_ss(__m128 __a,__m128 __b)1117*344a7f5eSAndroid Build Coastguard Worker _mm_comineq_ss(__m128 __a, __m128 __b)
1118*344a7f5eSAndroid Build Coastguard Worker {
1119*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_comineq((__v4sf)__a, (__v4sf)__b);
1120*344a7f5eSAndroid Build Coastguard Worker }
1121*344a7f5eSAndroid Build Coastguard Worker
1122*344a7f5eSAndroid Build Coastguard Worker /// \brief Performs an unordered comparison of two 32-bit float values using
1123*344a7f5eSAndroid Build Coastguard Worker /// the low-order bits of both operands to determine equality and returns
1124*344a7f5eSAndroid Build Coastguard Worker /// the result of the comparison.
1125*344a7f5eSAndroid Build Coastguard Worker ///
1126*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1127*344a7f5eSAndroid Build Coastguard Worker ///
1128*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VUCOMISS / UCOMISS instructions.
1129*344a7f5eSAndroid Build Coastguard Worker ///
1130*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1131*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1132*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1133*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1134*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1135*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1136*344a7f5eSAndroid Build Coastguard Worker /// \returns An integer containing the comparison results.
1137*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_ucomieq_ss(__m128 __a,__m128 __b)1138*344a7f5eSAndroid Build Coastguard Worker _mm_ucomieq_ss(__m128 __a, __m128 __b)
1139*344a7f5eSAndroid Build Coastguard Worker {
1140*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_ucomieq((__v4sf)__a, (__v4sf)__b);
1141*344a7f5eSAndroid Build Coastguard Worker }
1142*344a7f5eSAndroid Build Coastguard Worker
1143*344a7f5eSAndroid Build Coastguard Worker /// \brief Performs an unordered comparison of two 32-bit float values using
1144*344a7f5eSAndroid Build Coastguard Worker /// the low-order bits of both operands to determine if the first operand is
1145*344a7f5eSAndroid Build Coastguard Worker /// less than the second operand and returns the result of the comparison.
1146*344a7f5eSAndroid Build Coastguard Worker ///
1147*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1148*344a7f5eSAndroid Build Coastguard Worker ///
1149*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VUCOMISS / UCOMISS instructions.
1150*344a7f5eSAndroid Build Coastguard Worker ///
1151*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1152*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1153*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1154*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1155*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1156*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1157*344a7f5eSAndroid Build Coastguard Worker /// \returns An integer containing the comparison results.
1158*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_ucomilt_ss(__m128 __a,__m128 __b)1159*344a7f5eSAndroid Build Coastguard Worker _mm_ucomilt_ss(__m128 __a, __m128 __b)
1160*344a7f5eSAndroid Build Coastguard Worker {
1161*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_ucomilt((__v4sf)__a, (__v4sf)__b);
1162*344a7f5eSAndroid Build Coastguard Worker }
1163*344a7f5eSAndroid Build Coastguard Worker
1164*344a7f5eSAndroid Build Coastguard Worker /// \brief Performs an unordered comparison of two 32-bit float values using
1165*344a7f5eSAndroid Build Coastguard Worker /// the low-order bits of both operands to determine if the first operand
1166*344a7f5eSAndroid Build Coastguard Worker /// is less than or equal to the second operand and returns the result of
1167*344a7f5eSAndroid Build Coastguard Worker /// the comparison.
1168*344a7f5eSAndroid Build Coastguard Worker ///
1169*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1170*344a7f5eSAndroid Build Coastguard Worker ///
1171*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VUCOMISS / UCOMISS instructions.
1172*344a7f5eSAndroid Build Coastguard Worker ///
1173*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1174*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1175*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1176*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1177*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1178*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1179*344a7f5eSAndroid Build Coastguard Worker /// \returns An integer containing the comparison results.
1180*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_ucomile_ss(__m128 __a,__m128 __b)1181*344a7f5eSAndroid Build Coastguard Worker _mm_ucomile_ss(__m128 __a, __m128 __b)
1182*344a7f5eSAndroid Build Coastguard Worker {
1183*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_ucomile((__v4sf)__a, (__v4sf)__b);
1184*344a7f5eSAndroid Build Coastguard Worker }
1185*344a7f5eSAndroid Build Coastguard Worker
1186*344a7f5eSAndroid Build Coastguard Worker /// \brief Performs an unordered comparison of two 32-bit float values using
1187*344a7f5eSAndroid Build Coastguard Worker /// the low-order bits of both operands to determine if the first operand
1188*344a7f5eSAndroid Build Coastguard Worker /// is greater than the second operand and returns the result of the
1189*344a7f5eSAndroid Build Coastguard Worker /// comparison.
1190*344a7f5eSAndroid Build Coastguard Worker ///
1191*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1192*344a7f5eSAndroid Build Coastguard Worker ///
1193*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VUCOMISS / UCOMISS instructions.
1194*344a7f5eSAndroid Build Coastguard Worker ///
1195*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1196*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1197*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1198*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1199*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1200*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1201*344a7f5eSAndroid Build Coastguard Worker /// \returns An integer containing the comparison results.
1202*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_ucomigt_ss(__m128 __a,__m128 __b)1203*344a7f5eSAndroid Build Coastguard Worker _mm_ucomigt_ss(__m128 __a, __m128 __b)
1204*344a7f5eSAndroid Build Coastguard Worker {
1205*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_ucomigt((__v4sf)__a, (__v4sf)__b);
1206*344a7f5eSAndroid Build Coastguard Worker }
1207*344a7f5eSAndroid Build Coastguard Worker
1208*344a7f5eSAndroid Build Coastguard Worker /// \brief Performs an unordered comparison of two 32-bit float values using
1209*344a7f5eSAndroid Build Coastguard Worker /// the low-order bits of both operands to determine if the first operand is
1210*344a7f5eSAndroid Build Coastguard Worker /// greater than or equal to the second operand and returns the result of
1211*344a7f5eSAndroid Build Coastguard Worker /// the comparison.
1212*344a7f5eSAndroid Build Coastguard Worker ///
1213*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1214*344a7f5eSAndroid Build Coastguard Worker ///
1215*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VUCOMISS / UCOMISS instructions.
1216*344a7f5eSAndroid Build Coastguard Worker ///
1217*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1218*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1219*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1220*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1221*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1222*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1223*344a7f5eSAndroid Build Coastguard Worker /// \returns An integer containing the comparison results.
1224*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_ucomige_ss(__m128 __a,__m128 __b)1225*344a7f5eSAndroid Build Coastguard Worker _mm_ucomige_ss(__m128 __a, __m128 __b)
1226*344a7f5eSAndroid Build Coastguard Worker {
1227*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_ucomige((__v4sf)__a, (__v4sf)__b);
1228*344a7f5eSAndroid Build Coastguard Worker }
1229*344a7f5eSAndroid Build Coastguard Worker
1230*344a7f5eSAndroid Build Coastguard Worker /// \brief Performs an unordered comparison of two 32-bit float values using
1231*344a7f5eSAndroid Build Coastguard Worker /// the low-order bits of both operands to determine inequality and returns
1232*344a7f5eSAndroid Build Coastguard Worker /// the result of the comparison.
1233*344a7f5eSAndroid Build Coastguard Worker ///
1234*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1235*344a7f5eSAndroid Build Coastguard Worker ///
1236*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VUCOMISS / UCOMISS instructions.
1237*344a7f5eSAndroid Build Coastguard Worker ///
1238*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1239*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1240*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1241*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1242*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1243*344a7f5eSAndroid Build Coastguard Worker /// used in the comparison.
1244*344a7f5eSAndroid Build Coastguard Worker /// \returns An integer containing the comparison results.
1245*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_ucomineq_ss(__m128 __a,__m128 __b)1246*344a7f5eSAndroid Build Coastguard Worker _mm_ucomineq_ss(__m128 __a, __m128 __b)
1247*344a7f5eSAndroid Build Coastguard Worker {
1248*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_ucomineq((__v4sf)__a, (__v4sf)__b);
1249*344a7f5eSAndroid Build Coastguard Worker }
1250*344a7f5eSAndroid Build Coastguard Worker
1251*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts a float value contained in the lower 32 bits of a vector of
1252*344a7f5eSAndroid Build Coastguard Worker /// [4 x float] into a 32-bit integer.
1253*344a7f5eSAndroid Build Coastguard Worker ///
1254*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1255*344a7f5eSAndroid Build Coastguard Worker ///
1256*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCVTSS2SI / CVTSS2SI instructions.
1257*344a7f5eSAndroid Build Coastguard Worker ///
1258*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1259*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1260*344a7f5eSAndroid Build Coastguard Worker /// used in the conversion.
1261*344a7f5eSAndroid Build Coastguard Worker /// \returns A 32-bit integer containing the converted value.
1262*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_cvtss_si32(__m128 __a)1263*344a7f5eSAndroid Build Coastguard Worker _mm_cvtss_si32(__m128 __a)
1264*344a7f5eSAndroid Build Coastguard Worker {
1265*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_cvtss2si((__v4sf)__a);
1266*344a7f5eSAndroid Build Coastguard Worker }
1267*344a7f5eSAndroid Build Coastguard Worker
1268*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts a float value contained in the lower 32 bits of a vector of
1269*344a7f5eSAndroid Build Coastguard Worker /// [4 x float] into a 32-bit integer.
1270*344a7f5eSAndroid Build Coastguard Worker ///
1271*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1272*344a7f5eSAndroid Build Coastguard Worker ///
1273*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCVTSS2SI / CVTSS2SI instructions.
1274*344a7f5eSAndroid Build Coastguard Worker ///
1275*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1276*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1277*344a7f5eSAndroid Build Coastguard Worker /// used in the conversion.
1278*344a7f5eSAndroid Build Coastguard Worker /// \returns A 32-bit integer containing the converted value.
1279*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_cvt_ss2si(__m128 __a)1280*344a7f5eSAndroid Build Coastguard Worker _mm_cvt_ss2si(__m128 __a)
1281*344a7f5eSAndroid Build Coastguard Worker {
1282*344a7f5eSAndroid Build Coastguard Worker return _mm_cvtss_si32(__a);
1283*344a7f5eSAndroid Build Coastguard Worker }
1284*344a7f5eSAndroid Build Coastguard Worker
1285*344a7f5eSAndroid Build Coastguard Worker #ifdef __x86_64__
1286*344a7f5eSAndroid Build Coastguard Worker
1287*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts a float value contained in the lower 32 bits of a vector of
1288*344a7f5eSAndroid Build Coastguard Worker /// [4 x float] into a 64-bit integer.
1289*344a7f5eSAndroid Build Coastguard Worker ///
1290*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1291*344a7f5eSAndroid Build Coastguard Worker ///
1292*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCVTSS2SI / CVTSS2SI instructions.
1293*344a7f5eSAndroid Build Coastguard Worker ///
1294*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1295*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1296*344a7f5eSAndroid Build Coastguard Worker /// used in the conversion.
1297*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer containing the converted value.
1298*344a7f5eSAndroid Build Coastguard Worker static __inline__ long long __DEFAULT_FN_ATTRS
_mm_cvtss_si64(__m128 __a)1299*344a7f5eSAndroid Build Coastguard Worker _mm_cvtss_si64(__m128 __a)
1300*344a7f5eSAndroid Build Coastguard Worker {
1301*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_cvtss2si64((__v4sf)__a);
1302*344a7f5eSAndroid Build Coastguard Worker }
1303*344a7f5eSAndroid Build Coastguard Worker
1304*344a7f5eSAndroid Build Coastguard Worker #endif
1305*344a7f5eSAndroid Build Coastguard Worker
1306*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts two low-order float values in a 128-bit vector of
1307*344a7f5eSAndroid Build Coastguard Worker /// [4 x float] into a 64-bit vector of [2 x i32].
1308*344a7f5eSAndroid Build Coastguard Worker ///
1309*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1310*344a7f5eSAndroid Build Coastguard Worker ///
1311*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c CVTPS2PI instruction.
1312*344a7f5eSAndroid Build Coastguard Worker ///
1313*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1314*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
1315*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer vector containing the converted values.
1316*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m64 __DEFAULT_FN_ATTRS
_mm_cvtps_pi32(__m128 __a)1317*344a7f5eSAndroid Build Coastguard Worker _mm_cvtps_pi32(__m128 __a)
1318*344a7f5eSAndroid Build Coastguard Worker {
1319*344a7f5eSAndroid Build Coastguard Worker return (__m64)__builtin_ia32_cvtps2pi((__v4sf)__a);
1320*344a7f5eSAndroid Build Coastguard Worker }
1321*344a7f5eSAndroid Build Coastguard Worker
1322*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts two low-order float values in a 128-bit vector of
1323*344a7f5eSAndroid Build Coastguard Worker /// [4 x float] into a 64-bit vector of [2 x i32].
1324*344a7f5eSAndroid Build Coastguard Worker ///
1325*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1326*344a7f5eSAndroid Build Coastguard Worker ///
1327*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c CVTPS2PI instruction.
1328*344a7f5eSAndroid Build Coastguard Worker ///
1329*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1330*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
1331*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer vector containing the converted values.
1332*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m64 __DEFAULT_FN_ATTRS
_mm_cvt_ps2pi(__m128 __a)1333*344a7f5eSAndroid Build Coastguard Worker _mm_cvt_ps2pi(__m128 __a)
1334*344a7f5eSAndroid Build Coastguard Worker {
1335*344a7f5eSAndroid Build Coastguard Worker return _mm_cvtps_pi32(__a);
1336*344a7f5eSAndroid Build Coastguard Worker }
1337*344a7f5eSAndroid Build Coastguard Worker
1338*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts a float value contained in the lower 32 bits of a vector of
1339*344a7f5eSAndroid Build Coastguard Worker /// [4 x float] into a 32-bit integer, truncating the result when it is
1340*344a7f5eSAndroid Build Coastguard Worker /// inexact.
1341*344a7f5eSAndroid Build Coastguard Worker ///
1342*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1343*344a7f5eSAndroid Build Coastguard Worker ///
1344*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCVTTSS2SI / CVTTSS2SI instructions.
1345*344a7f5eSAndroid Build Coastguard Worker ///
1346*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1347*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1348*344a7f5eSAndroid Build Coastguard Worker /// used in the conversion.
1349*344a7f5eSAndroid Build Coastguard Worker /// \returns A 32-bit integer containing the converted value.
1350*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_cvttss_si32(__m128 __a)1351*344a7f5eSAndroid Build Coastguard Worker _mm_cvttss_si32(__m128 __a)
1352*344a7f5eSAndroid Build Coastguard Worker {
1353*344a7f5eSAndroid Build Coastguard Worker return __a[0];
1354*344a7f5eSAndroid Build Coastguard Worker }
1355*344a7f5eSAndroid Build Coastguard Worker
1356*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts a float value contained in the lower 32 bits of a vector of
1357*344a7f5eSAndroid Build Coastguard Worker /// [4 x float] into a 32-bit integer, truncating the result when it is
1358*344a7f5eSAndroid Build Coastguard Worker /// inexact.
1359*344a7f5eSAndroid Build Coastguard Worker ///
1360*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1361*344a7f5eSAndroid Build Coastguard Worker ///
1362*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCVTTSS2SI / CVTTSS2SI instructions.
1363*344a7f5eSAndroid Build Coastguard Worker ///
1364*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1365*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1366*344a7f5eSAndroid Build Coastguard Worker /// used in the conversion.
1367*344a7f5eSAndroid Build Coastguard Worker /// \returns A 32-bit integer containing the converted value.
1368*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_cvtt_ss2si(__m128 __a)1369*344a7f5eSAndroid Build Coastguard Worker _mm_cvtt_ss2si(__m128 __a)
1370*344a7f5eSAndroid Build Coastguard Worker {
1371*344a7f5eSAndroid Build Coastguard Worker return _mm_cvttss_si32(__a);
1372*344a7f5eSAndroid Build Coastguard Worker }
1373*344a7f5eSAndroid Build Coastguard Worker
1374*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts a float value contained in the lower 32 bits of a vector of
1375*344a7f5eSAndroid Build Coastguard Worker /// [4 x float] into a 64-bit integer, truncating the result when it is
1376*344a7f5eSAndroid Build Coastguard Worker /// inexact.
1377*344a7f5eSAndroid Build Coastguard Worker ///
1378*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1379*344a7f5eSAndroid Build Coastguard Worker ///
1380*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCVTTSS2SI / CVTTSS2SI instructions.
1381*344a7f5eSAndroid Build Coastguard Worker ///
1382*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1383*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1384*344a7f5eSAndroid Build Coastguard Worker /// used in the conversion.
1385*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer containing the converted value.
1386*344a7f5eSAndroid Build Coastguard Worker static __inline__ long long __DEFAULT_FN_ATTRS
_mm_cvttss_si64(__m128 __a)1387*344a7f5eSAndroid Build Coastguard Worker _mm_cvttss_si64(__m128 __a)
1388*344a7f5eSAndroid Build Coastguard Worker {
1389*344a7f5eSAndroid Build Coastguard Worker return __a[0];
1390*344a7f5eSAndroid Build Coastguard Worker }
1391*344a7f5eSAndroid Build Coastguard Worker
1392*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts two low-order float values in a 128-bit vector of
1393*344a7f5eSAndroid Build Coastguard Worker /// [4 x float] into a 64-bit vector of [2 x i32], truncating the result
1394*344a7f5eSAndroid Build Coastguard Worker /// when it is inexact.
1395*344a7f5eSAndroid Build Coastguard Worker ///
1396*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1397*344a7f5eSAndroid Build Coastguard Worker ///
1398*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c CVTTPS2PI / VTTPS2PI instructions.
1399*344a7f5eSAndroid Build Coastguard Worker ///
1400*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1401*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
1402*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer vector containing the converted values.
1403*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m64 __DEFAULT_FN_ATTRS
_mm_cvttps_pi32(__m128 __a)1404*344a7f5eSAndroid Build Coastguard Worker _mm_cvttps_pi32(__m128 __a)
1405*344a7f5eSAndroid Build Coastguard Worker {
1406*344a7f5eSAndroid Build Coastguard Worker return (__m64)__builtin_ia32_cvttps2pi((__v4sf)__a);
1407*344a7f5eSAndroid Build Coastguard Worker }
1408*344a7f5eSAndroid Build Coastguard Worker
1409*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts two low-order float values in a 128-bit vector of [4 x
1410*344a7f5eSAndroid Build Coastguard Worker /// float] into a 64-bit vector of [2 x i32], truncating the result when it
1411*344a7f5eSAndroid Build Coastguard Worker /// is inexact.
1412*344a7f5eSAndroid Build Coastguard Worker ///
1413*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1414*344a7f5eSAndroid Build Coastguard Worker ///
1415*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c CVTTPS2PI instruction.
1416*344a7f5eSAndroid Build Coastguard Worker ///
1417*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1418*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
1419*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer vector containing the converted values.
1420*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m64 __DEFAULT_FN_ATTRS
_mm_cvtt_ps2pi(__m128 __a)1421*344a7f5eSAndroid Build Coastguard Worker _mm_cvtt_ps2pi(__m128 __a)
1422*344a7f5eSAndroid Build Coastguard Worker {
1423*344a7f5eSAndroid Build Coastguard Worker return _mm_cvttps_pi32(__a);
1424*344a7f5eSAndroid Build Coastguard Worker }
1425*344a7f5eSAndroid Build Coastguard Worker
1426*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts a 32-bit signed integer value into a floating point value
1427*344a7f5eSAndroid Build Coastguard Worker /// and writes it to the lower 32 bits of the destination. The remaining
1428*344a7f5eSAndroid Build Coastguard Worker /// higher order elements of the destination vector are copied from the
1429*344a7f5eSAndroid Build Coastguard Worker /// corresponding elements in the first operand.
1430*344a7f5eSAndroid Build Coastguard Worker ///
1431*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1432*344a7f5eSAndroid Build Coastguard Worker ///
1433*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCVTSI2SS / CVTSI2SS instruction.
1434*344a7f5eSAndroid Build Coastguard Worker ///
1435*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1436*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
1437*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1438*344a7f5eSAndroid Build Coastguard Worker /// A 32-bit signed integer operand containing the value to be converted.
1439*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the
1440*344a7f5eSAndroid Build Coastguard Worker /// converted value of the second operand. The upper 96 bits are copied from
1441*344a7f5eSAndroid Build Coastguard Worker /// the upper 96 bits of the first operand.
1442*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cvtsi32_ss(__m128 __a,int __b)1443*344a7f5eSAndroid Build Coastguard Worker _mm_cvtsi32_ss(__m128 __a, int __b)
1444*344a7f5eSAndroid Build Coastguard Worker {
1445*344a7f5eSAndroid Build Coastguard Worker __a[0] = __b;
1446*344a7f5eSAndroid Build Coastguard Worker return __a;
1447*344a7f5eSAndroid Build Coastguard Worker }
1448*344a7f5eSAndroid Build Coastguard Worker
1449*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts a 32-bit signed integer value into a floating point value
1450*344a7f5eSAndroid Build Coastguard Worker /// and writes it to the lower 32 bits of the destination. The remaining
1451*344a7f5eSAndroid Build Coastguard Worker /// higher order elements of the destination are copied from the
1452*344a7f5eSAndroid Build Coastguard Worker /// corresponding elements in the first operand.
1453*344a7f5eSAndroid Build Coastguard Worker ///
1454*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1455*344a7f5eSAndroid Build Coastguard Worker ///
1456*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCVTSI2SS / CVTSI2SS instruction.
1457*344a7f5eSAndroid Build Coastguard Worker ///
1458*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1459*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
1460*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1461*344a7f5eSAndroid Build Coastguard Worker /// A 32-bit signed integer operand containing the value to be converted.
1462*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the
1463*344a7f5eSAndroid Build Coastguard Worker /// converted value of the second operand. The upper 96 bits are copied from
1464*344a7f5eSAndroid Build Coastguard Worker /// the upper 96 bits of the first operand.
1465*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cvt_si2ss(__m128 __a,int __b)1466*344a7f5eSAndroid Build Coastguard Worker _mm_cvt_si2ss(__m128 __a, int __b)
1467*344a7f5eSAndroid Build Coastguard Worker {
1468*344a7f5eSAndroid Build Coastguard Worker return _mm_cvtsi32_ss(__a, __b);
1469*344a7f5eSAndroid Build Coastguard Worker }
1470*344a7f5eSAndroid Build Coastguard Worker
1471*344a7f5eSAndroid Build Coastguard Worker #ifdef __x86_64__
1472*344a7f5eSAndroid Build Coastguard Worker
1473*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts a 64-bit signed integer value into a floating point value
1474*344a7f5eSAndroid Build Coastguard Worker /// and writes it to the lower 32 bits of the destination. The remaining
1475*344a7f5eSAndroid Build Coastguard Worker /// higher order elements of the destination are copied from the
1476*344a7f5eSAndroid Build Coastguard Worker /// corresponding elements in the first operand.
1477*344a7f5eSAndroid Build Coastguard Worker ///
1478*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1479*344a7f5eSAndroid Build Coastguard Worker ///
1480*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VCVTSI2SS / CVTSI2SS instruction.
1481*344a7f5eSAndroid Build Coastguard Worker ///
1482*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1483*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
1484*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1485*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit signed integer operand containing the value to be converted.
1486*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] whose lower 32 bits contain the
1487*344a7f5eSAndroid Build Coastguard Worker /// converted value of the second operand. The upper 96 bits are copied from
1488*344a7f5eSAndroid Build Coastguard Worker /// the upper 96 bits of the first operand.
1489*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cvtsi64_ss(__m128 __a,long long __b)1490*344a7f5eSAndroid Build Coastguard Worker _mm_cvtsi64_ss(__m128 __a, long long __b)
1491*344a7f5eSAndroid Build Coastguard Worker {
1492*344a7f5eSAndroid Build Coastguard Worker __a[0] = __b;
1493*344a7f5eSAndroid Build Coastguard Worker return __a;
1494*344a7f5eSAndroid Build Coastguard Worker }
1495*344a7f5eSAndroid Build Coastguard Worker
1496*344a7f5eSAndroid Build Coastguard Worker #endif
1497*344a7f5eSAndroid Build Coastguard Worker
1498*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts two elements of a 64-bit vector of [2 x i32] into two
1499*344a7f5eSAndroid Build Coastguard Worker /// floating point values and writes them to the lower 64-bits of the
1500*344a7f5eSAndroid Build Coastguard Worker /// destination. The remaining higher order elements of the destination are
1501*344a7f5eSAndroid Build Coastguard Worker /// copied from the corresponding elements in the first operand.
1502*344a7f5eSAndroid Build Coastguard Worker ///
1503*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1504*344a7f5eSAndroid Build Coastguard Worker ///
1505*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c CVTPI2PS instruction.
1506*344a7f5eSAndroid Build Coastguard Worker ///
1507*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1508*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
1509*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1510*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit vector of [2 x i32]. The elements in this vector are converted
1511*344a7f5eSAndroid Build Coastguard Worker /// and written to the corresponding low-order elements in the destination.
1512*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the
1513*344a7f5eSAndroid Build Coastguard Worker /// converted value of the second operand. The upper 64 bits are copied from
1514*344a7f5eSAndroid Build Coastguard Worker /// the upper 64 bits of the first operand.
1515*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cvtpi32_ps(__m128 __a,__m64 __b)1516*344a7f5eSAndroid Build Coastguard Worker _mm_cvtpi32_ps(__m128 __a, __m64 __b)
1517*344a7f5eSAndroid Build Coastguard Worker {
1518*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_cvtpi2ps((__v4sf)__a, (__v2si)__b);
1519*344a7f5eSAndroid Build Coastguard Worker }
1520*344a7f5eSAndroid Build Coastguard Worker
1521*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts two elements of a 64-bit vector of [2 x i32] into two
1522*344a7f5eSAndroid Build Coastguard Worker /// floating point values and writes them to the lower 64-bits of the
1523*344a7f5eSAndroid Build Coastguard Worker /// destination. The remaining higher order elements of the destination are
1524*344a7f5eSAndroid Build Coastguard Worker /// copied from the corresponding elements in the first operand.
1525*344a7f5eSAndroid Build Coastguard Worker ///
1526*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1527*344a7f5eSAndroid Build Coastguard Worker ///
1528*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c CVTPI2PS instruction.
1529*344a7f5eSAndroid Build Coastguard Worker ///
1530*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1531*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
1532*344a7f5eSAndroid Build Coastguard Worker /// \param __b
1533*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit vector of [2 x i32]. The elements in this vector are converted
1534*344a7f5eSAndroid Build Coastguard Worker /// and written to the corresponding low-order elements in the destination.
1535*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the
1536*344a7f5eSAndroid Build Coastguard Worker /// converted value from the second operand. The upper 64 bits are copied
1537*344a7f5eSAndroid Build Coastguard Worker /// from the upper 64 bits of the first operand.
1538*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cvt_pi2ps(__m128 __a,__m64 __b)1539*344a7f5eSAndroid Build Coastguard Worker _mm_cvt_pi2ps(__m128 __a, __m64 __b)
1540*344a7f5eSAndroid Build Coastguard Worker {
1541*344a7f5eSAndroid Build Coastguard Worker return _mm_cvtpi32_ps(__a, __b);
1542*344a7f5eSAndroid Build Coastguard Worker }
1543*344a7f5eSAndroid Build Coastguard Worker
1544*344a7f5eSAndroid Build Coastguard Worker /// \brief Extracts a float value contained in the lower 32 bits of a vector of
1545*344a7f5eSAndroid Build Coastguard Worker /// [4 x float].
1546*344a7f5eSAndroid Build Coastguard Worker ///
1547*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1548*344a7f5eSAndroid Build Coastguard Worker ///
1549*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVSS / MOVSS instruction.
1550*344a7f5eSAndroid Build Coastguard Worker ///
1551*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1552*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. The lower 32 bits of this operand are
1553*344a7f5eSAndroid Build Coastguard Worker /// used in the extraction.
1554*344a7f5eSAndroid Build Coastguard Worker /// \returns A 32-bit float containing the extracted value.
1555*344a7f5eSAndroid Build Coastguard Worker static __inline__ float __DEFAULT_FN_ATTRS
_mm_cvtss_f32(__m128 __a)1556*344a7f5eSAndroid Build Coastguard Worker _mm_cvtss_f32(__m128 __a)
1557*344a7f5eSAndroid Build Coastguard Worker {
1558*344a7f5eSAndroid Build Coastguard Worker return __a[0];
1559*344a7f5eSAndroid Build Coastguard Worker }
1560*344a7f5eSAndroid Build Coastguard Worker
1561*344a7f5eSAndroid Build Coastguard Worker /// \brief Loads two packed float values from the address __p into the
1562*344a7f5eSAndroid Build Coastguard Worker /// high-order bits of a 128-bit vector of [4 x float]. The low-order bits
1563*344a7f5eSAndroid Build Coastguard Worker /// are copied from the low-order bits of the first operand.
1564*344a7f5eSAndroid Build Coastguard Worker ///
1565*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1566*344a7f5eSAndroid Build Coastguard Worker ///
1567*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVHPD / MOVHPD instruction.
1568*344a7f5eSAndroid Build Coastguard Worker ///
1569*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1570*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. Bits [63:0] are written to bits [63:0]
1571*344a7f5eSAndroid Build Coastguard Worker /// of the destination.
1572*344a7f5eSAndroid Build Coastguard Worker /// \param __p
1573*344a7f5eSAndroid Build Coastguard Worker /// A pointer to two packed float values. Bits [63:0] are written to bits
1574*344a7f5eSAndroid Build Coastguard Worker /// [127:64] of the destination.
1575*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the moved values.
1576*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_loadh_pi(__m128 __a,const __m64 * __p)1577*344a7f5eSAndroid Build Coastguard Worker _mm_loadh_pi(__m128 __a, const __m64 *__p)
1578*344a7f5eSAndroid Build Coastguard Worker {
1579*344a7f5eSAndroid Build Coastguard Worker typedef float __mm_loadh_pi_v2f32 __attribute__((__vector_size__(8)));
1580*344a7f5eSAndroid Build Coastguard Worker struct __mm_loadh_pi_struct {
1581*344a7f5eSAndroid Build Coastguard Worker __mm_loadh_pi_v2f32 __u;
1582*344a7f5eSAndroid Build Coastguard Worker } __attribute__((__packed__, __may_alias__));
1583*344a7f5eSAndroid Build Coastguard Worker __mm_loadh_pi_v2f32 __b = ((struct __mm_loadh_pi_struct*)__p)->__u;
1584*344a7f5eSAndroid Build Coastguard Worker __m128 __bb = __builtin_shufflevector(__b, __b, 0, 1, 0, 1);
1585*344a7f5eSAndroid Build Coastguard Worker return __builtin_shufflevector(__a, __bb, 0, 1, 4, 5);
1586*344a7f5eSAndroid Build Coastguard Worker }
1587*344a7f5eSAndroid Build Coastguard Worker
1588*344a7f5eSAndroid Build Coastguard Worker /// \brief Loads two packed float values from the address __p into the low-order
1589*344a7f5eSAndroid Build Coastguard Worker /// bits of a 128-bit vector of [4 x float]. The high-order bits are copied
1590*344a7f5eSAndroid Build Coastguard Worker /// from the high-order bits of the first operand.
1591*344a7f5eSAndroid Build Coastguard Worker ///
1592*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1593*344a7f5eSAndroid Build Coastguard Worker ///
1594*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVLPD / MOVLPD instruction.
1595*344a7f5eSAndroid Build Coastguard Worker ///
1596*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1597*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float]. Bits [127:64] are written to bits
1598*344a7f5eSAndroid Build Coastguard Worker /// [127:64] of the destination.
1599*344a7f5eSAndroid Build Coastguard Worker /// \param __p
1600*344a7f5eSAndroid Build Coastguard Worker /// A pointer to two packed float values. Bits [63:0] are written to bits
1601*344a7f5eSAndroid Build Coastguard Worker /// [63:0] of the destination.
1602*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the moved values.
1603*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_loadl_pi(__m128 __a,const __m64 * __p)1604*344a7f5eSAndroid Build Coastguard Worker _mm_loadl_pi(__m128 __a, const __m64 *__p)
1605*344a7f5eSAndroid Build Coastguard Worker {
1606*344a7f5eSAndroid Build Coastguard Worker typedef float __mm_loadl_pi_v2f32 __attribute__((__vector_size__(8)));
1607*344a7f5eSAndroid Build Coastguard Worker struct __mm_loadl_pi_struct {
1608*344a7f5eSAndroid Build Coastguard Worker __mm_loadl_pi_v2f32 __u;
1609*344a7f5eSAndroid Build Coastguard Worker } __attribute__((__packed__, __may_alias__));
1610*344a7f5eSAndroid Build Coastguard Worker __mm_loadl_pi_v2f32 __b = ((struct __mm_loadl_pi_struct*)__p)->__u;
1611*344a7f5eSAndroid Build Coastguard Worker __m128 __bb = __builtin_shufflevector(__b, __b, 0, 1, 0, 1);
1612*344a7f5eSAndroid Build Coastguard Worker return __builtin_shufflevector(__a, __bb, 4, 5, 2, 3);
1613*344a7f5eSAndroid Build Coastguard Worker }
1614*344a7f5eSAndroid Build Coastguard Worker
1615*344a7f5eSAndroid Build Coastguard Worker /// \brief Constructs a 128-bit floating-point vector of [4 x float]. The lower
1616*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of the vector are initialized with the single-precision
1617*344a7f5eSAndroid Build Coastguard Worker /// floating-point value loaded from a specified memory location. The upper
1618*344a7f5eSAndroid Build Coastguard Worker /// 96 bits are set to zero.
1619*344a7f5eSAndroid Build Coastguard Worker ///
1620*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1621*344a7f5eSAndroid Build Coastguard Worker ///
1622*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVSS / MOVSS instruction.
1623*344a7f5eSAndroid Build Coastguard Worker ///
1624*344a7f5eSAndroid Build Coastguard Worker /// \param __p
1625*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a 32-bit memory location containing a single-precision
1626*344a7f5eSAndroid Build Coastguard Worker /// floating-point value.
1627*344a7f5eSAndroid Build Coastguard Worker /// \returns An initialized 128-bit floating-point vector of [4 x float]. The
1628*344a7f5eSAndroid Build Coastguard Worker /// lower 32 bits contain the value loaded from the memory location. The
1629*344a7f5eSAndroid Build Coastguard Worker /// upper 96 bits are set to zero.
1630*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_load_ss(const float * __p)1631*344a7f5eSAndroid Build Coastguard Worker _mm_load_ss(const float *__p)
1632*344a7f5eSAndroid Build Coastguard Worker {
1633*344a7f5eSAndroid Build Coastguard Worker struct __mm_load_ss_struct {
1634*344a7f5eSAndroid Build Coastguard Worker float __u;
1635*344a7f5eSAndroid Build Coastguard Worker } __attribute__((__packed__, __may_alias__));
1636*344a7f5eSAndroid Build Coastguard Worker float __u = ((struct __mm_load_ss_struct*)__p)->__u;
1637*344a7f5eSAndroid Build Coastguard Worker return (__m128){ __u, 0, 0, 0 };
1638*344a7f5eSAndroid Build Coastguard Worker }
1639*344a7f5eSAndroid Build Coastguard Worker
1640*344a7f5eSAndroid Build Coastguard Worker /// \brief Loads a 32-bit float value and duplicates it to all four vector
1641*344a7f5eSAndroid Build Coastguard Worker /// elements of a 128-bit vector of [4 x float].
1642*344a7f5eSAndroid Build Coastguard Worker ///
1643*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1644*344a7f5eSAndroid Build Coastguard Worker ///
1645*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVSS / MOVSS + \c shuffling
1646*344a7f5eSAndroid Build Coastguard Worker /// instruction.
1647*344a7f5eSAndroid Build Coastguard Worker ///
1648*344a7f5eSAndroid Build Coastguard Worker /// \param __p
1649*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a float value to be loaded and duplicated.
1650*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the loaded
1651*344a7f5eSAndroid Build Coastguard Worker /// and duplicated values.
1652*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_load1_ps(const float * __p)1653*344a7f5eSAndroid Build Coastguard Worker _mm_load1_ps(const float *__p)
1654*344a7f5eSAndroid Build Coastguard Worker {
1655*344a7f5eSAndroid Build Coastguard Worker struct __mm_load1_ps_struct {
1656*344a7f5eSAndroid Build Coastguard Worker float __u;
1657*344a7f5eSAndroid Build Coastguard Worker } __attribute__((__packed__, __may_alias__));
1658*344a7f5eSAndroid Build Coastguard Worker float __u = ((struct __mm_load1_ps_struct*)__p)->__u;
1659*344a7f5eSAndroid Build Coastguard Worker return (__m128){ __u, __u, __u, __u };
1660*344a7f5eSAndroid Build Coastguard Worker }
1661*344a7f5eSAndroid Build Coastguard Worker
1662*344a7f5eSAndroid Build Coastguard Worker #define _mm_load_ps1(p) _mm_load1_ps(p)
1663*344a7f5eSAndroid Build Coastguard Worker
1664*344a7f5eSAndroid Build Coastguard Worker /// \brief Loads a 128-bit floating-point vector of [4 x float] from an aligned
1665*344a7f5eSAndroid Build Coastguard Worker /// memory location.
1666*344a7f5eSAndroid Build Coastguard Worker ///
1667*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1668*344a7f5eSAndroid Build Coastguard Worker ///
1669*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVAPS / MOVAPS instruction.
1670*344a7f5eSAndroid Build Coastguard Worker ///
1671*344a7f5eSAndroid Build Coastguard Worker /// \param __p
1672*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a 128-bit memory location. The address of the memory
1673*344a7f5eSAndroid Build Coastguard Worker /// location has to be 128-bit aligned.
1674*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the loaded valus.
1675*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_load_ps(const float * __p)1676*344a7f5eSAndroid Build Coastguard Worker _mm_load_ps(const float *__p)
1677*344a7f5eSAndroid Build Coastguard Worker {
1678*344a7f5eSAndroid Build Coastguard Worker return *(__m128*)__p;
1679*344a7f5eSAndroid Build Coastguard Worker }
1680*344a7f5eSAndroid Build Coastguard Worker
1681*344a7f5eSAndroid Build Coastguard Worker /// \brief Loads a 128-bit floating-point vector of [4 x float] from an
1682*344a7f5eSAndroid Build Coastguard Worker /// unaligned memory location.
1683*344a7f5eSAndroid Build Coastguard Worker ///
1684*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1685*344a7f5eSAndroid Build Coastguard Worker ///
1686*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVUPS / MOVUPS instruction.
1687*344a7f5eSAndroid Build Coastguard Worker ///
1688*344a7f5eSAndroid Build Coastguard Worker /// \param __p
1689*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a 128-bit memory location. The address of the memory
1690*344a7f5eSAndroid Build Coastguard Worker /// location does not have to be aligned.
1691*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the loaded values.
1692*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_loadu_ps(const float * __p)1693*344a7f5eSAndroid Build Coastguard Worker _mm_loadu_ps(const float *__p)
1694*344a7f5eSAndroid Build Coastguard Worker {
1695*344a7f5eSAndroid Build Coastguard Worker struct __loadu_ps {
1696*344a7f5eSAndroid Build Coastguard Worker __m128 __v;
1697*344a7f5eSAndroid Build Coastguard Worker } __attribute__((__packed__, __may_alias__));
1698*344a7f5eSAndroid Build Coastguard Worker return ((struct __loadu_ps*)__p)->__v;
1699*344a7f5eSAndroid Build Coastguard Worker }
1700*344a7f5eSAndroid Build Coastguard Worker
1701*344a7f5eSAndroid Build Coastguard Worker /// \brief Loads four packed float values, in reverse order, from an aligned
1702*344a7f5eSAndroid Build Coastguard Worker /// memory location to 32-bit elements in a 128-bit vector of [4 x float].
1703*344a7f5eSAndroid Build Coastguard Worker ///
1704*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1705*344a7f5eSAndroid Build Coastguard Worker ///
1706*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVAPS / MOVAPS + \c shuffling
1707*344a7f5eSAndroid Build Coastguard Worker /// instruction.
1708*344a7f5eSAndroid Build Coastguard Worker ///
1709*344a7f5eSAndroid Build Coastguard Worker /// \param __p
1710*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a 128-bit memory location. The address of the memory
1711*344a7f5eSAndroid Build Coastguard Worker /// location has to be 128-bit aligned.
1712*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the moved values, loaded
1713*344a7f5eSAndroid Build Coastguard Worker /// in reverse order.
1714*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_loadr_ps(const float * __p)1715*344a7f5eSAndroid Build Coastguard Worker _mm_loadr_ps(const float *__p)
1716*344a7f5eSAndroid Build Coastguard Worker {
1717*344a7f5eSAndroid Build Coastguard Worker __m128 __a = _mm_load_ps(__p);
1718*344a7f5eSAndroid Build Coastguard Worker return __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 3, 2, 1, 0);
1719*344a7f5eSAndroid Build Coastguard Worker }
1720*344a7f5eSAndroid Build Coastguard Worker
1721*344a7f5eSAndroid Build Coastguard Worker /// \brief Create a 128-bit vector of [4 x float] with undefined values.
1722*344a7f5eSAndroid Build Coastguard Worker ///
1723*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1724*344a7f5eSAndroid Build Coastguard Worker ///
1725*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic has no corresponding instruction.
1726*344a7f5eSAndroid Build Coastguard Worker ///
1727*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing undefined values.
1728*344a7f5eSAndroid Build Coastguard Worker
1729*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_undefined_ps(void)1730*344a7f5eSAndroid Build Coastguard Worker _mm_undefined_ps(void)
1731*344a7f5eSAndroid Build Coastguard Worker {
1732*344a7f5eSAndroid Build Coastguard Worker return (__m128)__builtin_ia32_undef128();
1733*344a7f5eSAndroid Build Coastguard Worker }
1734*344a7f5eSAndroid Build Coastguard Worker
1735*344a7f5eSAndroid Build Coastguard Worker /// \brief Constructs a 128-bit floating-point vector of [4 x float]. The lower
1736*344a7f5eSAndroid Build Coastguard Worker /// 32 bits of the vector are initialized with the specified single-precision
1737*344a7f5eSAndroid Build Coastguard Worker /// floating-point value. The upper 96 bits are set to zero.
1738*344a7f5eSAndroid Build Coastguard Worker ///
1739*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1740*344a7f5eSAndroid Build Coastguard Worker ///
1741*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVSS / MOVSS instruction.
1742*344a7f5eSAndroid Build Coastguard Worker ///
1743*344a7f5eSAndroid Build Coastguard Worker /// \param __w
1744*344a7f5eSAndroid Build Coastguard Worker /// A single-precision floating-point value used to initialize the lower 32
1745*344a7f5eSAndroid Build Coastguard Worker /// bits of the result.
1746*344a7f5eSAndroid Build Coastguard Worker /// \returns An initialized 128-bit floating-point vector of [4 x float]. The
1747*344a7f5eSAndroid Build Coastguard Worker /// lower 32 bits contain the value provided in the source operand. The
1748*344a7f5eSAndroid Build Coastguard Worker /// upper 96 bits are set to zero.
1749*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_set_ss(float __w)1750*344a7f5eSAndroid Build Coastguard Worker _mm_set_ss(float __w)
1751*344a7f5eSAndroid Build Coastguard Worker {
1752*344a7f5eSAndroid Build Coastguard Worker return (__m128){ __w, 0, 0, 0 };
1753*344a7f5eSAndroid Build Coastguard Worker }
1754*344a7f5eSAndroid Build Coastguard Worker
1755*344a7f5eSAndroid Build Coastguard Worker /// \brief Constructs a 128-bit floating-point vector of [4 x float], with each
1756*344a7f5eSAndroid Build Coastguard Worker /// of the four single-precision floating-point vector elements set to the
1757*344a7f5eSAndroid Build Coastguard Worker /// specified single-precision floating-point value.
1758*344a7f5eSAndroid Build Coastguard Worker ///
1759*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1760*344a7f5eSAndroid Build Coastguard Worker ///
1761*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VPERMILPS / PERMILPS instruction.
1762*344a7f5eSAndroid Build Coastguard Worker ///
1763*344a7f5eSAndroid Build Coastguard Worker /// \param __w
1764*344a7f5eSAndroid Build Coastguard Worker /// A single-precision floating-point value used to initialize each vector
1765*344a7f5eSAndroid Build Coastguard Worker /// element of the result.
1766*344a7f5eSAndroid Build Coastguard Worker /// \returns An initialized 128-bit floating-point vector of [4 x float].
1767*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_set1_ps(float __w)1768*344a7f5eSAndroid Build Coastguard Worker _mm_set1_ps(float __w)
1769*344a7f5eSAndroid Build Coastguard Worker {
1770*344a7f5eSAndroid Build Coastguard Worker return (__m128){ __w, __w, __w, __w };
1771*344a7f5eSAndroid Build Coastguard Worker }
1772*344a7f5eSAndroid Build Coastguard Worker
1773*344a7f5eSAndroid Build Coastguard Worker /* Microsoft specific. */
1774*344a7f5eSAndroid Build Coastguard Worker /// \brief Constructs a 128-bit floating-point vector of [4 x float], with each
1775*344a7f5eSAndroid Build Coastguard Worker /// of the four single-precision floating-point vector elements set to the
1776*344a7f5eSAndroid Build Coastguard Worker /// specified single-precision floating-point value.
1777*344a7f5eSAndroid Build Coastguard Worker ///
1778*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1779*344a7f5eSAndroid Build Coastguard Worker ///
1780*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VPERMILPS / PERMILPS instruction.
1781*344a7f5eSAndroid Build Coastguard Worker ///
1782*344a7f5eSAndroid Build Coastguard Worker /// \param __w
1783*344a7f5eSAndroid Build Coastguard Worker /// A single-precision floating-point value used to initialize each vector
1784*344a7f5eSAndroid Build Coastguard Worker /// element of the result.
1785*344a7f5eSAndroid Build Coastguard Worker /// \returns An initialized 128-bit floating-point vector of [4 x float].
1786*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_set_ps1(float __w)1787*344a7f5eSAndroid Build Coastguard Worker _mm_set_ps1(float __w)
1788*344a7f5eSAndroid Build Coastguard Worker {
1789*344a7f5eSAndroid Build Coastguard Worker return _mm_set1_ps(__w);
1790*344a7f5eSAndroid Build Coastguard Worker }
1791*344a7f5eSAndroid Build Coastguard Worker
1792*344a7f5eSAndroid Build Coastguard Worker /// \brief Constructs a 128-bit floating-point vector of [4 x float]
1793*344a7f5eSAndroid Build Coastguard Worker /// initialized with the specified single-precision floating-point values.
1794*344a7f5eSAndroid Build Coastguard Worker ///
1795*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1796*344a7f5eSAndroid Build Coastguard Worker ///
1797*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic is a utility function and does not correspond to a specific
1798*344a7f5eSAndroid Build Coastguard Worker /// instruction.
1799*344a7f5eSAndroid Build Coastguard Worker ///
1800*344a7f5eSAndroid Build Coastguard Worker /// \param __z
1801*344a7f5eSAndroid Build Coastguard Worker /// A single-precision floating-point value used to initialize bits [127:96]
1802*344a7f5eSAndroid Build Coastguard Worker /// of the result.
1803*344a7f5eSAndroid Build Coastguard Worker /// \param __y
1804*344a7f5eSAndroid Build Coastguard Worker /// A single-precision floating-point value used to initialize bits [95:64]
1805*344a7f5eSAndroid Build Coastguard Worker /// of the result.
1806*344a7f5eSAndroid Build Coastguard Worker /// \param __x
1807*344a7f5eSAndroid Build Coastguard Worker /// A single-precision floating-point value used to initialize bits [63:32]
1808*344a7f5eSAndroid Build Coastguard Worker /// of the result.
1809*344a7f5eSAndroid Build Coastguard Worker /// \param __w
1810*344a7f5eSAndroid Build Coastguard Worker /// A single-precision floating-point value used to initialize bits [31:0]
1811*344a7f5eSAndroid Build Coastguard Worker /// of the result.
1812*344a7f5eSAndroid Build Coastguard Worker /// \returns An initialized 128-bit floating-point vector of [4 x float].
1813*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_set_ps(float __z,float __y,float __x,float __w)1814*344a7f5eSAndroid Build Coastguard Worker _mm_set_ps(float __z, float __y, float __x, float __w)
1815*344a7f5eSAndroid Build Coastguard Worker {
1816*344a7f5eSAndroid Build Coastguard Worker return (__m128){ __w, __x, __y, __z };
1817*344a7f5eSAndroid Build Coastguard Worker }
1818*344a7f5eSAndroid Build Coastguard Worker
1819*344a7f5eSAndroid Build Coastguard Worker /// \brief Constructs a 128-bit floating-point vector of [4 x float],
1820*344a7f5eSAndroid Build Coastguard Worker /// initialized in reverse order with the specified 32-bit single-precision
1821*344a7f5eSAndroid Build Coastguard Worker /// float-point values.
1822*344a7f5eSAndroid Build Coastguard Worker ///
1823*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1824*344a7f5eSAndroid Build Coastguard Worker ///
1825*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic is a utility function and does not correspond to a specific
1826*344a7f5eSAndroid Build Coastguard Worker /// instruction.
1827*344a7f5eSAndroid Build Coastguard Worker ///
1828*344a7f5eSAndroid Build Coastguard Worker /// \param __z
1829*344a7f5eSAndroid Build Coastguard Worker /// A single-precision floating-point value used to initialize bits [31:0]
1830*344a7f5eSAndroid Build Coastguard Worker /// of the result.
1831*344a7f5eSAndroid Build Coastguard Worker /// \param __y
1832*344a7f5eSAndroid Build Coastguard Worker /// A single-precision floating-point value used to initialize bits [63:32]
1833*344a7f5eSAndroid Build Coastguard Worker /// of the result.
1834*344a7f5eSAndroid Build Coastguard Worker /// \param __x
1835*344a7f5eSAndroid Build Coastguard Worker /// A single-precision floating-point value used to initialize bits [95:64]
1836*344a7f5eSAndroid Build Coastguard Worker /// of the result.
1837*344a7f5eSAndroid Build Coastguard Worker /// \param __w
1838*344a7f5eSAndroid Build Coastguard Worker /// A single-precision floating-point value used to initialize bits [127:96]
1839*344a7f5eSAndroid Build Coastguard Worker /// of the result.
1840*344a7f5eSAndroid Build Coastguard Worker /// \returns An initialized 128-bit floating-point vector of [4 x float].
1841*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_setr_ps(float __z,float __y,float __x,float __w)1842*344a7f5eSAndroid Build Coastguard Worker _mm_setr_ps(float __z, float __y, float __x, float __w)
1843*344a7f5eSAndroid Build Coastguard Worker {
1844*344a7f5eSAndroid Build Coastguard Worker return (__m128){ __z, __y, __x, __w };
1845*344a7f5eSAndroid Build Coastguard Worker }
1846*344a7f5eSAndroid Build Coastguard Worker
1847*344a7f5eSAndroid Build Coastguard Worker /// \brief Constructs a 128-bit floating-point vector of [4 x float] initialized
1848*344a7f5eSAndroid Build Coastguard Worker /// to zero.
1849*344a7f5eSAndroid Build Coastguard Worker ///
1850*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1851*344a7f5eSAndroid Build Coastguard Worker ///
1852*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VXORPS / XORPS instruction.
1853*344a7f5eSAndroid Build Coastguard Worker ///
1854*344a7f5eSAndroid Build Coastguard Worker /// \returns An initialized 128-bit floating-point vector of [4 x float] with
1855*344a7f5eSAndroid Build Coastguard Worker /// all elements set to zero.
1856*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_setzero_ps(void)1857*344a7f5eSAndroid Build Coastguard Worker _mm_setzero_ps(void)
1858*344a7f5eSAndroid Build Coastguard Worker {
1859*344a7f5eSAndroid Build Coastguard Worker return (__m128){ 0, 0, 0, 0 };
1860*344a7f5eSAndroid Build Coastguard Worker }
1861*344a7f5eSAndroid Build Coastguard Worker
1862*344a7f5eSAndroid Build Coastguard Worker /// \brief Stores the upper 64 bits of a 128-bit vector of [4 x float] to a
1863*344a7f5eSAndroid Build Coastguard Worker /// memory location.
1864*344a7f5eSAndroid Build Coastguard Worker ///
1865*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1866*344a7f5eSAndroid Build Coastguard Worker ///
1867*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VPEXTRQ / MOVQ instruction.
1868*344a7f5eSAndroid Build Coastguard Worker ///
1869*344a7f5eSAndroid Build Coastguard Worker /// \param __p
1870*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a 64-bit memory location.
1871*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1872*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the values to be stored.
1873*344a7f5eSAndroid Build Coastguard Worker static __inline__ void __DEFAULT_FN_ATTRS
_mm_storeh_pi(__m64 * __p,__m128 __a)1874*344a7f5eSAndroid Build Coastguard Worker _mm_storeh_pi(__m64 *__p, __m128 __a)
1875*344a7f5eSAndroid Build Coastguard Worker {
1876*344a7f5eSAndroid Build Coastguard Worker __builtin_ia32_storehps((__v2si *)__p, (__v4sf)__a);
1877*344a7f5eSAndroid Build Coastguard Worker }
1878*344a7f5eSAndroid Build Coastguard Worker
1879*344a7f5eSAndroid Build Coastguard Worker /// \brief Stores the lower 64 bits of a 128-bit vector of [4 x float] to a
1880*344a7f5eSAndroid Build Coastguard Worker /// memory location.
1881*344a7f5eSAndroid Build Coastguard Worker ///
1882*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1883*344a7f5eSAndroid Build Coastguard Worker ///
1884*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVLPS / MOVLPS instruction.
1885*344a7f5eSAndroid Build Coastguard Worker ///
1886*344a7f5eSAndroid Build Coastguard Worker /// \param __p
1887*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a memory location that will receive the float values.
1888*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1889*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the values to be stored.
1890*344a7f5eSAndroid Build Coastguard Worker static __inline__ void __DEFAULT_FN_ATTRS
_mm_storel_pi(__m64 * __p,__m128 __a)1891*344a7f5eSAndroid Build Coastguard Worker _mm_storel_pi(__m64 *__p, __m128 __a)
1892*344a7f5eSAndroid Build Coastguard Worker {
1893*344a7f5eSAndroid Build Coastguard Worker __builtin_ia32_storelps((__v2si *)__p, (__v4sf)__a);
1894*344a7f5eSAndroid Build Coastguard Worker }
1895*344a7f5eSAndroid Build Coastguard Worker
1896*344a7f5eSAndroid Build Coastguard Worker /// \brief Stores the lower 32 bits of a 128-bit vector of [4 x float] to a
1897*344a7f5eSAndroid Build Coastguard Worker /// memory location.
1898*344a7f5eSAndroid Build Coastguard Worker ///
1899*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1900*344a7f5eSAndroid Build Coastguard Worker ///
1901*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVSS / MOVSS instruction.
1902*344a7f5eSAndroid Build Coastguard Worker ///
1903*344a7f5eSAndroid Build Coastguard Worker /// \param __p
1904*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a 32-bit memory location.
1905*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1906*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the value to be stored.
1907*344a7f5eSAndroid Build Coastguard Worker static __inline__ void __DEFAULT_FN_ATTRS
_mm_store_ss(float * __p,__m128 __a)1908*344a7f5eSAndroid Build Coastguard Worker _mm_store_ss(float *__p, __m128 __a)
1909*344a7f5eSAndroid Build Coastguard Worker {
1910*344a7f5eSAndroid Build Coastguard Worker struct __mm_store_ss_struct {
1911*344a7f5eSAndroid Build Coastguard Worker float __u;
1912*344a7f5eSAndroid Build Coastguard Worker } __attribute__((__packed__, __may_alias__));
1913*344a7f5eSAndroid Build Coastguard Worker ((struct __mm_store_ss_struct*)__p)->__u = __a[0];
1914*344a7f5eSAndroid Build Coastguard Worker }
1915*344a7f5eSAndroid Build Coastguard Worker
1916*344a7f5eSAndroid Build Coastguard Worker /// \brief Stores float values from a 128-bit vector of [4 x float] to an
1917*344a7f5eSAndroid Build Coastguard Worker /// unaligned memory location.
1918*344a7f5eSAndroid Build Coastguard Worker ///
1919*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1920*344a7f5eSAndroid Build Coastguard Worker ///
1921*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVUPS / MOVUPS instruction.
1922*344a7f5eSAndroid Build Coastguard Worker ///
1923*344a7f5eSAndroid Build Coastguard Worker /// \param __p
1924*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a 128-bit memory location. The address of the memory
1925*344a7f5eSAndroid Build Coastguard Worker /// location does not have to be aligned.
1926*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1927*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the values to be stored.
1928*344a7f5eSAndroid Build Coastguard Worker static __inline__ void __DEFAULT_FN_ATTRS
_mm_storeu_ps(float * __p,__m128 __a)1929*344a7f5eSAndroid Build Coastguard Worker _mm_storeu_ps(float *__p, __m128 __a)
1930*344a7f5eSAndroid Build Coastguard Worker {
1931*344a7f5eSAndroid Build Coastguard Worker struct __storeu_ps {
1932*344a7f5eSAndroid Build Coastguard Worker __m128 __v;
1933*344a7f5eSAndroid Build Coastguard Worker } __attribute__((__packed__, __may_alias__));
1934*344a7f5eSAndroid Build Coastguard Worker ((struct __storeu_ps*)__p)->__v = __a;
1935*344a7f5eSAndroid Build Coastguard Worker }
1936*344a7f5eSAndroid Build Coastguard Worker
1937*344a7f5eSAndroid Build Coastguard Worker /// \brief Stores the lower 32 bits of a 128-bit vector of [4 x float] into
1938*344a7f5eSAndroid Build Coastguard Worker /// four contiguous elements in an aligned memory location.
1939*344a7f5eSAndroid Build Coastguard Worker ///
1940*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1941*344a7f5eSAndroid Build Coastguard Worker ///
1942*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to \c VMOVAPS / MOVAPS + \c shuffling
1943*344a7f5eSAndroid Build Coastguard Worker /// instruction.
1944*344a7f5eSAndroid Build Coastguard Worker ///
1945*344a7f5eSAndroid Build Coastguard Worker /// \param __p
1946*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a 128-bit memory location.
1947*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1948*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] whose lower 32 bits are stored to each
1949*344a7f5eSAndroid Build Coastguard Worker /// of the four contiguous elements pointed by __p.
1950*344a7f5eSAndroid Build Coastguard Worker static __inline__ void __DEFAULT_FN_ATTRS
_mm_store_ps(float * __p,__m128 __a)1951*344a7f5eSAndroid Build Coastguard Worker _mm_store_ps(float *__p, __m128 __a)
1952*344a7f5eSAndroid Build Coastguard Worker {
1953*344a7f5eSAndroid Build Coastguard Worker *(__m128*)__p = __a;
1954*344a7f5eSAndroid Build Coastguard Worker }
1955*344a7f5eSAndroid Build Coastguard Worker
1956*344a7f5eSAndroid Build Coastguard Worker /// \brief Stores the lower 32 bits of a 128-bit vector of [4 x float] into
1957*344a7f5eSAndroid Build Coastguard Worker /// four contiguous elements in an aligned memory location.
1958*344a7f5eSAndroid Build Coastguard Worker ///
1959*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1960*344a7f5eSAndroid Build Coastguard Worker ///
1961*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to \c VMOVAPS / MOVAPS + \c shuffling
1962*344a7f5eSAndroid Build Coastguard Worker /// instruction.
1963*344a7f5eSAndroid Build Coastguard Worker ///
1964*344a7f5eSAndroid Build Coastguard Worker /// \param __p
1965*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a 128-bit memory location.
1966*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1967*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] whose lower 32 bits are stored to each
1968*344a7f5eSAndroid Build Coastguard Worker /// of the four contiguous elements pointed by __p.
1969*344a7f5eSAndroid Build Coastguard Worker static __inline__ void __DEFAULT_FN_ATTRS
_mm_store1_ps(float * __p,__m128 __a)1970*344a7f5eSAndroid Build Coastguard Worker _mm_store1_ps(float *__p, __m128 __a)
1971*344a7f5eSAndroid Build Coastguard Worker {
1972*344a7f5eSAndroid Build Coastguard Worker __a = __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 0, 0, 0, 0);
1973*344a7f5eSAndroid Build Coastguard Worker _mm_store_ps(__p, __a);
1974*344a7f5eSAndroid Build Coastguard Worker }
1975*344a7f5eSAndroid Build Coastguard Worker
1976*344a7f5eSAndroid Build Coastguard Worker /// \brief Stores float values from a 128-bit vector of [4 x float] to an
1977*344a7f5eSAndroid Build Coastguard Worker /// aligned memory location.
1978*344a7f5eSAndroid Build Coastguard Worker ///
1979*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1980*344a7f5eSAndroid Build Coastguard Worker ///
1981*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVAPS / MOVAPS instruction.
1982*344a7f5eSAndroid Build Coastguard Worker ///
1983*344a7f5eSAndroid Build Coastguard Worker /// \param __p
1984*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a 128-bit memory location. The address of the memory
1985*344a7f5eSAndroid Build Coastguard Worker /// location has to be 128-bit aligned.
1986*344a7f5eSAndroid Build Coastguard Worker /// \param __a
1987*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the values to be stored.
1988*344a7f5eSAndroid Build Coastguard Worker static __inline__ void __DEFAULT_FN_ATTRS
_mm_store_ps1(float * __p,__m128 __a)1989*344a7f5eSAndroid Build Coastguard Worker _mm_store_ps1(float *__p, __m128 __a)
1990*344a7f5eSAndroid Build Coastguard Worker {
1991*344a7f5eSAndroid Build Coastguard Worker return _mm_store1_ps(__p, __a);
1992*344a7f5eSAndroid Build Coastguard Worker }
1993*344a7f5eSAndroid Build Coastguard Worker
1994*344a7f5eSAndroid Build Coastguard Worker /// \brief Stores float values from a 128-bit vector of [4 x float] to an
1995*344a7f5eSAndroid Build Coastguard Worker /// aligned memory location in reverse order.
1996*344a7f5eSAndroid Build Coastguard Worker ///
1997*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
1998*344a7f5eSAndroid Build Coastguard Worker ///
1999*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVAPS / MOVAPS + \c shuffling
2000*344a7f5eSAndroid Build Coastguard Worker /// instruction.
2001*344a7f5eSAndroid Build Coastguard Worker ///
2002*344a7f5eSAndroid Build Coastguard Worker /// \param __p
2003*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a 128-bit memory location. The address of the memory
2004*344a7f5eSAndroid Build Coastguard Worker /// location has to be 128-bit aligned.
2005*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2006*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the values to be stored.
2007*344a7f5eSAndroid Build Coastguard Worker static __inline__ void __DEFAULT_FN_ATTRS
_mm_storer_ps(float * __p,__m128 __a)2008*344a7f5eSAndroid Build Coastguard Worker _mm_storer_ps(float *__p, __m128 __a)
2009*344a7f5eSAndroid Build Coastguard Worker {
2010*344a7f5eSAndroid Build Coastguard Worker __a = __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 3, 2, 1, 0);
2011*344a7f5eSAndroid Build Coastguard Worker _mm_store_ps(__p, __a);
2012*344a7f5eSAndroid Build Coastguard Worker }
2013*344a7f5eSAndroid Build Coastguard Worker
2014*344a7f5eSAndroid Build Coastguard Worker #define _MM_HINT_T0 3
2015*344a7f5eSAndroid Build Coastguard Worker #define _MM_HINT_T1 2
2016*344a7f5eSAndroid Build Coastguard Worker #define _MM_HINT_T2 1
2017*344a7f5eSAndroid Build Coastguard Worker #define _MM_HINT_NTA 0
2018*344a7f5eSAndroid Build Coastguard Worker
2019*344a7f5eSAndroid Build Coastguard Worker #ifndef _MSC_VER
2020*344a7f5eSAndroid Build Coastguard Worker /* FIXME: We have to #define this because "sel" must be a constant integer, and
2021*344a7f5eSAndroid Build Coastguard Worker Sema doesn't do any form of constant propagation yet. */
2022*344a7f5eSAndroid Build Coastguard Worker
2023*344a7f5eSAndroid Build Coastguard Worker /// \brief Loads one cache line of data from the specified address to a location
2024*344a7f5eSAndroid Build Coastguard Worker /// closer to the processor.
2025*344a7f5eSAndroid Build Coastguard Worker ///
2026*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2027*344a7f5eSAndroid Build Coastguard Worker ///
2028*344a7f5eSAndroid Build Coastguard Worker /// \code
2029*344a7f5eSAndroid Build Coastguard Worker /// void _mm_prefetch(const void * a, const int sel);
2030*344a7f5eSAndroid Build Coastguard Worker /// \endcode
2031*344a7f5eSAndroid Build Coastguard Worker ///
2032*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c PREFETCHNTA instruction.
2033*344a7f5eSAndroid Build Coastguard Worker ///
2034*344a7f5eSAndroid Build Coastguard Worker /// \param a
2035*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a memory location containing a cache line of data.
2036*344a7f5eSAndroid Build Coastguard Worker /// \param sel
2037*344a7f5eSAndroid Build Coastguard Worker /// A predefined integer constant specifying the type of prefetch operation:
2038*344a7f5eSAndroid Build Coastguard Worker /// _MM_HINT_NTA: Move data using the non-temporal access (NTA) hint.
2039*344a7f5eSAndroid Build Coastguard Worker /// The PREFETCHNTA instruction will be generated.
2040*344a7f5eSAndroid Build Coastguard Worker /// _MM_HINT_T0: Move data using the T0 hint. The PREFETCHT0 instruction will
2041*344a7f5eSAndroid Build Coastguard Worker /// be generated.
2042*344a7f5eSAndroid Build Coastguard Worker /// _MM_HINT_T1: Move data using the T1 hint. The PREFETCHT1 instruction will
2043*344a7f5eSAndroid Build Coastguard Worker /// be generated.
2044*344a7f5eSAndroid Build Coastguard Worker /// _MM_HINT_T2: Move data using the T2 hint. The PREFETCHT2 instruction will
2045*344a7f5eSAndroid Build Coastguard Worker /// be generated.
2046*344a7f5eSAndroid Build Coastguard Worker #define _mm_prefetch(a, sel) (__builtin_prefetch((void *)(a), 0, (sel)))
2047*344a7f5eSAndroid Build Coastguard Worker #endif
2048*344a7f5eSAndroid Build Coastguard Worker
2049*344a7f5eSAndroid Build Coastguard Worker /// \brief Stores a 64-bit integer in the specified aligned memory location. To
2050*344a7f5eSAndroid Build Coastguard Worker /// minimize caching, the data is flagged as non-temporal (unlikely to be
2051*344a7f5eSAndroid Build Coastguard Worker /// used again soon).
2052*344a7f5eSAndroid Build Coastguard Worker ///
2053*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2054*344a7f5eSAndroid Build Coastguard Worker ///
2055*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c MOVNTQ instruction.
2056*344a7f5eSAndroid Build Coastguard Worker ///
2057*344a7f5eSAndroid Build Coastguard Worker /// \param __p
2058*344a7f5eSAndroid Build Coastguard Worker /// A pointer to an aligned memory location used to store the register value.
2059*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2060*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer containing the value to be stored.
2061*344a7f5eSAndroid Build Coastguard Worker static __inline__ void __DEFAULT_FN_ATTRS
_mm_stream_pi(__m64 * __p,__m64 __a)2062*344a7f5eSAndroid Build Coastguard Worker _mm_stream_pi(__m64 *__p, __m64 __a)
2063*344a7f5eSAndroid Build Coastguard Worker {
2064*344a7f5eSAndroid Build Coastguard Worker __builtin_ia32_movntq(__p, __a);
2065*344a7f5eSAndroid Build Coastguard Worker }
2066*344a7f5eSAndroid Build Coastguard Worker
2067*344a7f5eSAndroid Build Coastguard Worker /// \brief Moves packed float values from a 128-bit vector of [4 x float] to a
2068*344a7f5eSAndroid Build Coastguard Worker /// 128-bit aligned memory location. To minimize caching, the data is flagged
2069*344a7f5eSAndroid Build Coastguard Worker /// as non-temporal (unlikely to be used again soon).
2070*344a7f5eSAndroid Build Coastguard Worker ///
2071*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2072*344a7f5eSAndroid Build Coastguard Worker ///
2073*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVNTPS / MOVNTPS instruction.
2074*344a7f5eSAndroid Build Coastguard Worker ///
2075*344a7f5eSAndroid Build Coastguard Worker /// \param __p
2076*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a 128-bit aligned memory location that will receive the
2077*344a7f5eSAndroid Build Coastguard Worker /// integer values.
2078*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2079*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the values to be moved.
2080*344a7f5eSAndroid Build Coastguard Worker static __inline__ void __DEFAULT_FN_ATTRS
_mm_stream_ps(float * __p,__m128 __a)2081*344a7f5eSAndroid Build Coastguard Worker _mm_stream_ps(float *__p, __m128 __a)
2082*344a7f5eSAndroid Build Coastguard Worker {
2083*344a7f5eSAndroid Build Coastguard Worker __builtin_nontemporal_store((__v4sf)__a, (__v4sf*)__p);
2084*344a7f5eSAndroid Build Coastguard Worker }
2085*344a7f5eSAndroid Build Coastguard Worker
2086*344a7f5eSAndroid Build Coastguard Worker /// \brief Forces strong memory ordering (serialization) between store
2087*344a7f5eSAndroid Build Coastguard Worker /// instructions preceding this instruction and store instructions following
2088*344a7f5eSAndroid Build Coastguard Worker /// this instruction, ensuring the system completes all previous stores
2089*344a7f5eSAndroid Build Coastguard Worker /// before executing subsequent stores.
2090*344a7f5eSAndroid Build Coastguard Worker ///
2091*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2092*344a7f5eSAndroid Build Coastguard Worker ///
2093*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c SFENCE instruction.
2094*344a7f5eSAndroid Build Coastguard Worker ///
2095*344a7f5eSAndroid Build Coastguard Worker static __inline__ void __DEFAULT_FN_ATTRS
_mm_sfence(void)2096*344a7f5eSAndroid Build Coastguard Worker _mm_sfence(void)
2097*344a7f5eSAndroid Build Coastguard Worker {
2098*344a7f5eSAndroid Build Coastguard Worker __builtin_ia32_sfence();
2099*344a7f5eSAndroid Build Coastguard Worker }
2100*344a7f5eSAndroid Build Coastguard Worker
2101*344a7f5eSAndroid Build Coastguard Worker /// \brief Extracts 16-bit element from a 64-bit vector of [4 x i16] and
2102*344a7f5eSAndroid Build Coastguard Worker /// returns it, as specified by the immediate integer operand.
2103*344a7f5eSAndroid Build Coastguard Worker ///
2104*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2105*344a7f5eSAndroid Build Coastguard Worker ///
2106*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VPEXTRW / PEXTRW instruction.
2107*344a7f5eSAndroid Build Coastguard Worker ///
2108*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2109*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit vector of [4 x i16].
2110*344a7f5eSAndroid Build Coastguard Worker /// \param __n
2111*344a7f5eSAndroid Build Coastguard Worker /// An immediate integer operand that determines which bits are extracted:
2112*344a7f5eSAndroid Build Coastguard Worker /// 0: Bits [15:0] are copied to the destination.
2113*344a7f5eSAndroid Build Coastguard Worker /// 1: Bits [31:16] are copied to the destination.
2114*344a7f5eSAndroid Build Coastguard Worker /// 2: Bits [47:32] are copied to the destination.
2115*344a7f5eSAndroid Build Coastguard Worker /// 3: Bits [63:48] are copied to the destination.
2116*344a7f5eSAndroid Build Coastguard Worker /// \returns A 16-bit integer containing the extracted 16 bits of packed data.
2117*344a7f5eSAndroid Build Coastguard Worker #define _mm_extract_pi16(a, n) __extension__ ({ \
2118*344a7f5eSAndroid Build Coastguard Worker (int)__builtin_ia32_vec_ext_v4hi((__m64)a, (int)n); })
2119*344a7f5eSAndroid Build Coastguard Worker
2120*344a7f5eSAndroid Build Coastguard Worker /// \brief Copies data from the 64-bit vector of [4 x i16] to the destination,
2121*344a7f5eSAndroid Build Coastguard Worker /// and inserts the lower 16-bits of an integer operand at the 16-bit offset
2122*344a7f5eSAndroid Build Coastguard Worker /// specified by the immediate operand __n.
2123*344a7f5eSAndroid Build Coastguard Worker ///
2124*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2125*344a7f5eSAndroid Build Coastguard Worker ///
2126*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VPINSRW / PINSRW instruction.
2127*344a7f5eSAndroid Build Coastguard Worker ///
2128*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2129*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit vector of [4 x i16].
2130*344a7f5eSAndroid Build Coastguard Worker /// \param __d
2131*344a7f5eSAndroid Build Coastguard Worker /// An integer. The lower 16-bit value from this operand is written to the
2132*344a7f5eSAndroid Build Coastguard Worker /// destination at the offset specified by operand __n.
2133*344a7f5eSAndroid Build Coastguard Worker /// \param __n
2134*344a7f5eSAndroid Build Coastguard Worker /// An immediate integer operant that determines which the bits to be used
2135*344a7f5eSAndroid Build Coastguard Worker /// in the destination.
2136*344a7f5eSAndroid Build Coastguard Worker /// 0: Bits [15:0] are copied to the destination.
2137*344a7f5eSAndroid Build Coastguard Worker /// 1: Bits [31:16] are copied to the destination.
2138*344a7f5eSAndroid Build Coastguard Worker /// 2: Bits [47:32] are copied to the destination.
2139*344a7f5eSAndroid Build Coastguard Worker /// 3: Bits [63:48] are copied to the destination.
2140*344a7f5eSAndroid Build Coastguard Worker /// The remaining bits in the destination are copied from the corresponding
2141*344a7f5eSAndroid Build Coastguard Worker /// bits in operand __a.
2142*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer vector containing the copied packed data from the
2143*344a7f5eSAndroid Build Coastguard Worker /// operands.
2144*344a7f5eSAndroid Build Coastguard Worker #define _mm_insert_pi16(a, d, n) __extension__ ({ \
2145*344a7f5eSAndroid Build Coastguard Worker (__m64)__builtin_ia32_vec_set_v4hi((__m64)a, (int)d, (int)n); })
2146*344a7f5eSAndroid Build Coastguard Worker
2147*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares each of the corresponding packed 16-bit integer values of
2148*344a7f5eSAndroid Build Coastguard Worker /// the 64-bit integer vectors, and writes the greater value to the
2149*344a7f5eSAndroid Build Coastguard Worker /// corresponding bits in the destination.
2150*344a7f5eSAndroid Build Coastguard Worker ///
2151*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2152*344a7f5eSAndroid Build Coastguard Worker ///
2153*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c PMAXSW instruction.
2154*344a7f5eSAndroid Build Coastguard Worker ///
2155*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2156*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing one of the source operands.
2157*344a7f5eSAndroid Build Coastguard Worker /// \param __b
2158*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing one of the source operands.
2159*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer vector containing the comparison results.
2160*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m64 __DEFAULT_FN_ATTRS
_mm_max_pi16(__m64 __a,__m64 __b)2161*344a7f5eSAndroid Build Coastguard Worker _mm_max_pi16(__m64 __a, __m64 __b)
2162*344a7f5eSAndroid Build Coastguard Worker {
2163*344a7f5eSAndroid Build Coastguard Worker return (__m64)__builtin_ia32_pmaxsw((__v4hi)__a, (__v4hi)__b);
2164*344a7f5eSAndroid Build Coastguard Worker }
2165*344a7f5eSAndroid Build Coastguard Worker
2166*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares each of the corresponding packed 8-bit unsigned integer
2167*344a7f5eSAndroid Build Coastguard Worker /// values of the 64-bit integer vectors, and writes the greater value to the
2168*344a7f5eSAndroid Build Coastguard Worker /// corresponding bits in the destination.
2169*344a7f5eSAndroid Build Coastguard Worker ///
2170*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2171*344a7f5eSAndroid Build Coastguard Worker ///
2172*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c PMAXUB instruction.
2173*344a7f5eSAndroid Build Coastguard Worker ///
2174*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2175*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing one of the source operands.
2176*344a7f5eSAndroid Build Coastguard Worker /// \param __b
2177*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing one of the source operands.
2178*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer vector containing the comparison results.
2179*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m64 __DEFAULT_FN_ATTRS
_mm_max_pu8(__m64 __a,__m64 __b)2180*344a7f5eSAndroid Build Coastguard Worker _mm_max_pu8(__m64 __a, __m64 __b)
2181*344a7f5eSAndroid Build Coastguard Worker {
2182*344a7f5eSAndroid Build Coastguard Worker return (__m64)__builtin_ia32_pmaxub((__v8qi)__a, (__v8qi)__b);
2183*344a7f5eSAndroid Build Coastguard Worker }
2184*344a7f5eSAndroid Build Coastguard Worker
2185*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares each of the corresponding packed 16-bit integer values of
2186*344a7f5eSAndroid Build Coastguard Worker /// the 64-bit integer vectors, and writes the lesser value to the
2187*344a7f5eSAndroid Build Coastguard Worker /// corresponding bits in the destination.
2188*344a7f5eSAndroid Build Coastguard Worker ///
2189*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2190*344a7f5eSAndroid Build Coastguard Worker ///
2191*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c PMINSW instruction.
2192*344a7f5eSAndroid Build Coastguard Worker ///
2193*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2194*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing one of the source operands.
2195*344a7f5eSAndroid Build Coastguard Worker /// \param __b
2196*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing one of the source operands.
2197*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer vector containing the comparison results.
2198*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m64 __DEFAULT_FN_ATTRS
_mm_min_pi16(__m64 __a,__m64 __b)2199*344a7f5eSAndroid Build Coastguard Worker _mm_min_pi16(__m64 __a, __m64 __b)
2200*344a7f5eSAndroid Build Coastguard Worker {
2201*344a7f5eSAndroid Build Coastguard Worker return (__m64)__builtin_ia32_pminsw((__v4hi)__a, (__v4hi)__b);
2202*344a7f5eSAndroid Build Coastguard Worker }
2203*344a7f5eSAndroid Build Coastguard Worker
2204*344a7f5eSAndroid Build Coastguard Worker /// \brief Compares each of the corresponding packed 8-bit unsigned integer
2205*344a7f5eSAndroid Build Coastguard Worker /// values of the 64-bit integer vectors, and writes the lesser value to the
2206*344a7f5eSAndroid Build Coastguard Worker /// corresponding bits in the destination.
2207*344a7f5eSAndroid Build Coastguard Worker ///
2208*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2209*344a7f5eSAndroid Build Coastguard Worker ///
2210*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c PMINUB instruction.
2211*344a7f5eSAndroid Build Coastguard Worker ///
2212*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2213*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing one of the source operands.
2214*344a7f5eSAndroid Build Coastguard Worker /// \param __b
2215*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing one of the source operands.
2216*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer vector containing the comparison results.
2217*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m64 __DEFAULT_FN_ATTRS
_mm_min_pu8(__m64 __a,__m64 __b)2218*344a7f5eSAndroid Build Coastguard Worker _mm_min_pu8(__m64 __a, __m64 __b)
2219*344a7f5eSAndroid Build Coastguard Worker {
2220*344a7f5eSAndroid Build Coastguard Worker return (__m64)__builtin_ia32_pminub((__v8qi)__a, (__v8qi)__b);
2221*344a7f5eSAndroid Build Coastguard Worker }
2222*344a7f5eSAndroid Build Coastguard Worker
2223*344a7f5eSAndroid Build Coastguard Worker /// \brief Takes the most significant bit from each 8-bit element in a 64-bit
2224*344a7f5eSAndroid Build Coastguard Worker /// integer vector to create a 16-bit mask value. Zero-extends the value to
2225*344a7f5eSAndroid Build Coastguard Worker /// 32-bit integer and writes it to the destination.
2226*344a7f5eSAndroid Build Coastguard Worker ///
2227*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2228*344a7f5eSAndroid Build Coastguard Worker ///
2229*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c PMOVMSKB instruction.
2230*344a7f5eSAndroid Build Coastguard Worker ///
2231*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2232*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing the values with bits to be extracted.
2233*344a7f5eSAndroid Build Coastguard Worker /// \returns The most significant bit from each 8-bit element in the operand,
2234*344a7f5eSAndroid Build Coastguard Worker /// written to bits [15:0].
2235*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_movemask_pi8(__m64 __a)2236*344a7f5eSAndroid Build Coastguard Worker _mm_movemask_pi8(__m64 __a)
2237*344a7f5eSAndroid Build Coastguard Worker {
2238*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_pmovmskb((__v8qi)__a);
2239*344a7f5eSAndroid Build Coastguard Worker }
2240*344a7f5eSAndroid Build Coastguard Worker
2241*344a7f5eSAndroid Build Coastguard Worker /// \brief Multiplies packed 16-bit unsigned integer values and writes the
2242*344a7f5eSAndroid Build Coastguard Worker /// high-order 16 bits of each 32-bit product to the corresponding bits in
2243*344a7f5eSAndroid Build Coastguard Worker /// the destination.
2244*344a7f5eSAndroid Build Coastguard Worker ///
2245*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2246*344a7f5eSAndroid Build Coastguard Worker ///
2247*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c PMULHUW instruction.
2248*344a7f5eSAndroid Build Coastguard Worker ///
2249*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2250*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing one of the source operands.
2251*344a7f5eSAndroid Build Coastguard Worker /// \param __b
2252*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing one of the source operands.
2253*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer vector containing the products of both operands.
2254*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m64 __DEFAULT_FN_ATTRS
_mm_mulhi_pu16(__m64 __a,__m64 __b)2255*344a7f5eSAndroid Build Coastguard Worker _mm_mulhi_pu16(__m64 __a, __m64 __b)
2256*344a7f5eSAndroid Build Coastguard Worker {
2257*344a7f5eSAndroid Build Coastguard Worker return (__m64)__builtin_ia32_pmulhuw((__v4hi)__a, (__v4hi)__b);
2258*344a7f5eSAndroid Build Coastguard Worker }
2259*344a7f5eSAndroid Build Coastguard Worker
2260*344a7f5eSAndroid Build Coastguard Worker /// \brief Shuffles the 4 16-bit integers from a 64-bit integer vector to the
2261*344a7f5eSAndroid Build Coastguard Worker /// destination, as specified by the immediate value operand.
2262*344a7f5eSAndroid Build Coastguard Worker ///
2263*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2264*344a7f5eSAndroid Build Coastguard Worker ///
2265*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c PSHUFW instruction.
2266*344a7f5eSAndroid Build Coastguard Worker ///
2267*344a7f5eSAndroid Build Coastguard Worker /// \code
2268*344a7f5eSAndroid Build Coastguard Worker /// __m64 _mm_shuffle_pi16(__m64 a, const int n);
2269*344a7f5eSAndroid Build Coastguard Worker /// \endcode
2270*344a7f5eSAndroid Build Coastguard Worker ///
2271*344a7f5eSAndroid Build Coastguard Worker /// \param a
2272*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing the values to be shuffled.
2273*344a7f5eSAndroid Build Coastguard Worker /// \param n
2274*344a7f5eSAndroid Build Coastguard Worker /// An immediate value containing an 8-bit value specifying which elements to
2275*344a7f5eSAndroid Build Coastguard Worker /// copy from a. The destinations within the 64-bit destination are assigned
2276*344a7f5eSAndroid Build Coastguard Worker /// values as follows:
2277*344a7f5eSAndroid Build Coastguard Worker /// Bits [1:0] are used to assign values to bits [15:0] in the destination.
2278*344a7f5eSAndroid Build Coastguard Worker /// Bits [3:2] are used to assign values to bits [31:16] in the destination.
2279*344a7f5eSAndroid Build Coastguard Worker /// Bits [5:4] are used to assign values to bits [47:32] in the destination.
2280*344a7f5eSAndroid Build Coastguard Worker /// Bits [7:6] are used to assign values to bits [63:48] in the destination.
2281*344a7f5eSAndroid Build Coastguard Worker /// Bit value assignments:
2282*344a7f5eSAndroid Build Coastguard Worker /// 00: assigned from bits [15:0] of a.
2283*344a7f5eSAndroid Build Coastguard Worker /// 01: assigned from bits [31:16] of a.
2284*344a7f5eSAndroid Build Coastguard Worker /// 10: assigned from bits [47:32] of a.
2285*344a7f5eSAndroid Build Coastguard Worker /// 11: assigned from bits [63:48] of a.
2286*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer vector containing the shuffled values.
2287*344a7f5eSAndroid Build Coastguard Worker #define _mm_shuffle_pi16(a, n) __extension__ ({ \
2288*344a7f5eSAndroid Build Coastguard Worker (__m64)__builtin_ia32_pshufw((__v4hi)(__m64)(a), (n)); })
2289*344a7f5eSAndroid Build Coastguard Worker
2290*344a7f5eSAndroid Build Coastguard Worker /// \brief Conditionally copies the values from each 8-bit element in the first
2291*344a7f5eSAndroid Build Coastguard Worker /// 64-bit integer vector operand to the specified memory location, as
2292*344a7f5eSAndroid Build Coastguard Worker /// specified by the most significant bit in the corresponding element in the
2293*344a7f5eSAndroid Build Coastguard Worker /// second 64-bit integer vector operand. To minimize caching, the data is
2294*344a7f5eSAndroid Build Coastguard Worker /// flagged as non-temporal (unlikely to be used again soon).
2295*344a7f5eSAndroid Build Coastguard Worker ///
2296*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2297*344a7f5eSAndroid Build Coastguard Worker ///
2298*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c MASKMOVQ instruction.
2299*344a7f5eSAndroid Build Coastguard Worker ///
2300*344a7f5eSAndroid Build Coastguard Worker /// \param __d
2301*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing the values with elements to be copied.
2302*344a7f5eSAndroid Build Coastguard Worker /// \param __n
2303*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector operand. The most significant bit from each 8-bit
2304*344a7f5eSAndroid Build Coastguard Worker /// element determines whether the corresponding element in operand __d is
2305*344a7f5eSAndroid Build Coastguard Worker /// copied. If the most significant bit of a given element is 1, the
2306*344a7f5eSAndroid Build Coastguard Worker /// corresponding element in operand __d is copied.
2307*344a7f5eSAndroid Build Coastguard Worker /// \param __p
2308*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a 64-bit memory location that will receive the conditionally
2309*344a7f5eSAndroid Build Coastguard Worker /// copied integer values. The address of the memory location does not have
2310*344a7f5eSAndroid Build Coastguard Worker /// to be aligned.
2311*344a7f5eSAndroid Build Coastguard Worker static __inline__ void __DEFAULT_FN_ATTRS
_mm_maskmove_si64(__m64 __d,__m64 __n,char * __p)2312*344a7f5eSAndroid Build Coastguard Worker _mm_maskmove_si64(__m64 __d, __m64 __n, char *__p)
2313*344a7f5eSAndroid Build Coastguard Worker {
2314*344a7f5eSAndroid Build Coastguard Worker __builtin_ia32_maskmovq((__v8qi)__d, (__v8qi)__n, __p);
2315*344a7f5eSAndroid Build Coastguard Worker }
2316*344a7f5eSAndroid Build Coastguard Worker
2317*344a7f5eSAndroid Build Coastguard Worker /// \brief Computes the rounded averages of the packed unsigned 8-bit integer
2318*344a7f5eSAndroid Build Coastguard Worker /// values and writes the averages to the corresponding bits in the
2319*344a7f5eSAndroid Build Coastguard Worker /// destination.
2320*344a7f5eSAndroid Build Coastguard Worker ///
2321*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2322*344a7f5eSAndroid Build Coastguard Worker ///
2323*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c PAVGB instruction.
2324*344a7f5eSAndroid Build Coastguard Worker ///
2325*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2326*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing one of the source operands.
2327*344a7f5eSAndroid Build Coastguard Worker /// \param __b
2328*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing one of the source operands.
2329*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer vector containing the averages of both operands.
2330*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m64 __DEFAULT_FN_ATTRS
_mm_avg_pu8(__m64 __a,__m64 __b)2331*344a7f5eSAndroid Build Coastguard Worker _mm_avg_pu8(__m64 __a, __m64 __b)
2332*344a7f5eSAndroid Build Coastguard Worker {
2333*344a7f5eSAndroid Build Coastguard Worker return (__m64)__builtin_ia32_pavgb((__v8qi)__a, (__v8qi)__b);
2334*344a7f5eSAndroid Build Coastguard Worker }
2335*344a7f5eSAndroid Build Coastguard Worker
2336*344a7f5eSAndroid Build Coastguard Worker /// \brief Computes the rounded averages of the packed unsigned 16-bit integer
2337*344a7f5eSAndroid Build Coastguard Worker /// values and writes the averages to the corresponding bits in the
2338*344a7f5eSAndroid Build Coastguard Worker /// destination.
2339*344a7f5eSAndroid Build Coastguard Worker ///
2340*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2341*344a7f5eSAndroid Build Coastguard Worker ///
2342*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c PAVGW instruction.
2343*344a7f5eSAndroid Build Coastguard Worker ///
2344*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2345*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing one of the source operands.
2346*344a7f5eSAndroid Build Coastguard Worker /// \param __b
2347*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing one of the source operands.
2348*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer vector containing the averages of both operands.
2349*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m64 __DEFAULT_FN_ATTRS
_mm_avg_pu16(__m64 __a,__m64 __b)2350*344a7f5eSAndroid Build Coastguard Worker _mm_avg_pu16(__m64 __a, __m64 __b)
2351*344a7f5eSAndroid Build Coastguard Worker {
2352*344a7f5eSAndroid Build Coastguard Worker return (__m64)__builtin_ia32_pavgw((__v4hi)__a, (__v4hi)__b);
2353*344a7f5eSAndroid Build Coastguard Worker }
2354*344a7f5eSAndroid Build Coastguard Worker
2355*344a7f5eSAndroid Build Coastguard Worker /// \brief Subtracts the corresponding 8-bit unsigned integer values of the two
2356*344a7f5eSAndroid Build Coastguard Worker /// 64-bit vector operands and computes the absolute value for each of the
2357*344a7f5eSAndroid Build Coastguard Worker /// difference. Then sum of the 8 absolute differences is written to the
2358*344a7f5eSAndroid Build Coastguard Worker /// bits [15:0] of the destination; the remaining bits [63:16] are cleared.
2359*344a7f5eSAndroid Build Coastguard Worker ///
2360*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2361*344a7f5eSAndroid Build Coastguard Worker ///
2362*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c PSADBW instruction.
2363*344a7f5eSAndroid Build Coastguard Worker ///
2364*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2365*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing one of the source operands.
2366*344a7f5eSAndroid Build Coastguard Worker /// \param __b
2367*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit integer vector containing one of the source operands.
2368*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer vector whose lower 16 bits contain the sums of the
2369*344a7f5eSAndroid Build Coastguard Worker /// sets of absolute differences between both operands. The upper bits are
2370*344a7f5eSAndroid Build Coastguard Worker /// cleared.
2371*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m64 __DEFAULT_FN_ATTRS
_mm_sad_pu8(__m64 __a,__m64 __b)2372*344a7f5eSAndroid Build Coastguard Worker _mm_sad_pu8(__m64 __a, __m64 __b)
2373*344a7f5eSAndroid Build Coastguard Worker {
2374*344a7f5eSAndroid Build Coastguard Worker return (__m64)__builtin_ia32_psadbw((__v8qi)__a, (__v8qi)__b);
2375*344a7f5eSAndroid Build Coastguard Worker }
2376*344a7f5eSAndroid Build Coastguard Worker
2377*344a7f5eSAndroid Build Coastguard Worker /// \brief Returns the contents of the MXCSR register as a 32-bit unsigned
2378*344a7f5eSAndroid Build Coastguard Worker /// integer value. There are several groups of macros associated with this
2379*344a7f5eSAndroid Build Coastguard Worker /// intrinsic, including:
2380*344a7f5eSAndroid Build Coastguard Worker /// * For checking exception states: _MM_EXCEPT_INVALID, _MM_EXCEPT_DIV_ZERO,
2381*344a7f5eSAndroid Build Coastguard Worker /// _MM_EXCEPT_DENORM, _MM_EXCEPT_OVERFLOW, _MM_EXCEPT_UNDERFLOW,
2382*344a7f5eSAndroid Build Coastguard Worker /// _MM_EXCEPT_INEXACT. There is a convenience wrapper
2383*344a7f5eSAndroid Build Coastguard Worker /// _MM_GET_EXCEPTION_STATE().
2384*344a7f5eSAndroid Build Coastguard Worker /// * For checking exception masks: _MM_MASK_UNDERFLOW, _MM_MASK_OVERFLOW,
2385*344a7f5eSAndroid Build Coastguard Worker /// _MM_MASK_INVALID, _MM_MASK_DENORM, _MM_MASK_DIV_ZERO, _MM_MASK_INEXACT.
2386*344a7f5eSAndroid Build Coastguard Worker /// There is a convenience wrapper _MM_GET_EXCEPTION_MASK().
2387*344a7f5eSAndroid Build Coastguard Worker /// * For checking rounding modes: _MM_ROUND_NEAREST, _MM_ROUND_DOWN,
2388*344a7f5eSAndroid Build Coastguard Worker /// _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO. There is a convenience wrapper
2389*344a7f5eSAndroid Build Coastguard Worker /// _MM_GET_ROUNDING_MODE(x) where x is one of these macros.
2390*344a7f5eSAndroid Build Coastguard Worker /// * For checking flush-to-zero mode: _MM_FLUSH_ZERO_ON, _MM_FLUSH_ZERO_OFF.
2391*344a7f5eSAndroid Build Coastguard Worker /// There is a convenience wrapper _MM_GET_FLUSH_ZERO_MODE().
2392*344a7f5eSAndroid Build Coastguard Worker /// * For checking denormals-are-zero mode: _MM_DENORMALS_ZERO_ON,
2393*344a7f5eSAndroid Build Coastguard Worker /// _MM_DENORMALS_ZERO_OFF. There is a convenience wrapper
2394*344a7f5eSAndroid Build Coastguard Worker /// _MM_GET_DENORMALS_ZERO_MODE().
2395*344a7f5eSAndroid Build Coastguard Worker ///
2396*344a7f5eSAndroid Build Coastguard Worker /// For example, the expression below checks if an overflow exception has
2397*344a7f5eSAndroid Build Coastguard Worker /// occurred:
2398*344a7f5eSAndroid Build Coastguard Worker /// ( _mm_getcsr() & _MM_EXCEPT_OVERFLOW )
2399*344a7f5eSAndroid Build Coastguard Worker ///
2400*344a7f5eSAndroid Build Coastguard Worker /// The following example gets the current rounding mode:
2401*344a7f5eSAndroid Build Coastguard Worker /// _MM_GET_ROUNDING_MODE()
2402*344a7f5eSAndroid Build Coastguard Worker ///
2403*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2404*344a7f5eSAndroid Build Coastguard Worker ///
2405*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VSTMXCSR / STMXCSR instruction.
2406*344a7f5eSAndroid Build Coastguard Worker ///
2407*344a7f5eSAndroid Build Coastguard Worker /// \returns A 32-bit unsigned integer containing the contents of the MXCSR
2408*344a7f5eSAndroid Build Coastguard Worker /// register.
2409*344a7f5eSAndroid Build Coastguard Worker static __inline__ unsigned int __DEFAULT_FN_ATTRS
_mm_getcsr(void)2410*344a7f5eSAndroid Build Coastguard Worker _mm_getcsr(void)
2411*344a7f5eSAndroid Build Coastguard Worker {
2412*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_stmxcsr();
2413*344a7f5eSAndroid Build Coastguard Worker }
2414*344a7f5eSAndroid Build Coastguard Worker
2415*344a7f5eSAndroid Build Coastguard Worker /// \brief Sets the MXCSR register with the 32-bit unsigned integer value. There
2416*344a7f5eSAndroid Build Coastguard Worker /// are several groups of macros associated with this intrinsic, including:
2417*344a7f5eSAndroid Build Coastguard Worker /// * For setting exception states: _MM_EXCEPT_INVALID, _MM_EXCEPT_DIV_ZERO,
2418*344a7f5eSAndroid Build Coastguard Worker /// _MM_EXCEPT_DENORM, _MM_EXCEPT_OVERFLOW, _MM_EXCEPT_UNDERFLOW,
2419*344a7f5eSAndroid Build Coastguard Worker /// _MM_EXCEPT_INEXACT. There is a convenience wrapper
2420*344a7f5eSAndroid Build Coastguard Worker /// _MM_SET_EXCEPTION_STATE(x) where x is one of these macros.
2421*344a7f5eSAndroid Build Coastguard Worker /// * For setting exception masks: _MM_MASK_UNDERFLOW, _MM_MASK_OVERFLOW,
2422*344a7f5eSAndroid Build Coastguard Worker /// _MM_MASK_INVALID, _MM_MASK_DENORM, _MM_MASK_DIV_ZERO, _MM_MASK_INEXACT.
2423*344a7f5eSAndroid Build Coastguard Worker /// There is a convenience wrapper _MM_SET_EXCEPTION_MASK(x) where x is one
2424*344a7f5eSAndroid Build Coastguard Worker /// of these macros.
2425*344a7f5eSAndroid Build Coastguard Worker /// * For setting rounding modes: _MM_ROUND_NEAREST, _MM_ROUND_DOWN,
2426*344a7f5eSAndroid Build Coastguard Worker /// _MM_ROUND_UP, _MM_ROUND_TOWARD_ZERO. There is a convenience wrapper
2427*344a7f5eSAndroid Build Coastguard Worker /// _MM_SET_ROUNDING_MODE(x) where x is one of these macros.
2428*344a7f5eSAndroid Build Coastguard Worker /// * For setting flush-to-zero mode: _MM_FLUSH_ZERO_ON, _MM_FLUSH_ZERO_OFF.
2429*344a7f5eSAndroid Build Coastguard Worker /// There is a convenience wrapper _MM_SET_FLUSH_ZERO_MODE(x) where x is
2430*344a7f5eSAndroid Build Coastguard Worker /// one of these macros.
2431*344a7f5eSAndroid Build Coastguard Worker /// * For setting denormals-are-zero mode: _MM_DENORMALS_ZERO_ON,
2432*344a7f5eSAndroid Build Coastguard Worker /// _MM_DENORMALS_ZERO_OFF. There is a convenience wrapper
2433*344a7f5eSAndroid Build Coastguard Worker /// _MM_SET_DENORMALS_ZERO_MODE(x) where x is one of these macros.
2434*344a7f5eSAndroid Build Coastguard Worker ///
2435*344a7f5eSAndroid Build Coastguard Worker /// For example, the following expression causes subsequent floating-point
2436*344a7f5eSAndroid Build Coastguard Worker /// operations to round up:
2437*344a7f5eSAndroid Build Coastguard Worker /// _mm_setcsr(_mm_getcsr() | _MM_ROUND_UP)
2438*344a7f5eSAndroid Build Coastguard Worker ///
2439*344a7f5eSAndroid Build Coastguard Worker /// The following example sets the DAZ and FTZ flags:
2440*344a7f5eSAndroid Build Coastguard Worker /// void setFlags() {
2441*344a7f5eSAndroid Build Coastguard Worker /// _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON)
2442*344a7f5eSAndroid Build Coastguard Worker /// _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON)
2443*344a7f5eSAndroid Build Coastguard Worker /// }
2444*344a7f5eSAndroid Build Coastguard Worker ///
2445*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2446*344a7f5eSAndroid Build Coastguard Worker ///
2447*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VLDMXCSR / LDMXCSR instruction.
2448*344a7f5eSAndroid Build Coastguard Worker ///
2449*344a7f5eSAndroid Build Coastguard Worker /// \param __i
2450*344a7f5eSAndroid Build Coastguard Worker /// A 32-bit unsigned integer value to be written to the MXCSR register.
2451*344a7f5eSAndroid Build Coastguard Worker static __inline__ void __DEFAULT_FN_ATTRS
_mm_setcsr(unsigned int __i)2452*344a7f5eSAndroid Build Coastguard Worker _mm_setcsr(unsigned int __i)
2453*344a7f5eSAndroid Build Coastguard Worker {
2454*344a7f5eSAndroid Build Coastguard Worker __builtin_ia32_ldmxcsr(__i);
2455*344a7f5eSAndroid Build Coastguard Worker }
2456*344a7f5eSAndroid Build Coastguard Worker
2457*344a7f5eSAndroid Build Coastguard Worker /// \brief Selects 4 float values from the 128-bit operands of [4 x float], as
2458*344a7f5eSAndroid Build Coastguard Worker /// specified by the immediate value operand.
2459*344a7f5eSAndroid Build Coastguard Worker ///
2460*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2461*344a7f5eSAndroid Build Coastguard Worker ///
2462*344a7f5eSAndroid Build Coastguard Worker /// \code
2463*344a7f5eSAndroid Build Coastguard Worker /// __m128 _mm_shuffle_ps(__m128 a, __m128 b, const int mask);
2464*344a7f5eSAndroid Build Coastguard Worker /// \endcode
2465*344a7f5eSAndroid Build Coastguard Worker ///
2466*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VSHUFPS / SHUFPS instruction.
2467*344a7f5eSAndroid Build Coastguard Worker ///
2468*344a7f5eSAndroid Build Coastguard Worker /// \param a
2469*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
2470*344a7f5eSAndroid Build Coastguard Worker /// \param b
2471*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
2472*344a7f5eSAndroid Build Coastguard Worker /// \param mask
2473*344a7f5eSAndroid Build Coastguard Worker /// An immediate value containing an 8-bit value specifying which elements to
2474*344a7f5eSAndroid Build Coastguard Worker /// copy from a and b.
2475*344a7f5eSAndroid Build Coastguard Worker /// Bits [3:0] specify the values copied from operand a.
2476*344a7f5eSAndroid Build Coastguard Worker /// Bits [7:4] specify the values copied from operand b. The destinations
2477*344a7f5eSAndroid Build Coastguard Worker /// within the 128-bit destination are assigned values as follows:
2478*344a7f5eSAndroid Build Coastguard Worker /// Bits [1:0] are used to assign values to bits [31:0] in the destination.
2479*344a7f5eSAndroid Build Coastguard Worker /// Bits [3:2] are used to assign values to bits [63:32] in the destination.
2480*344a7f5eSAndroid Build Coastguard Worker /// Bits [5:4] are used to assign values to bits [95:64] in the destination.
2481*344a7f5eSAndroid Build Coastguard Worker /// Bits [7:6] are used to assign values to bits [127:96] in the destination.
2482*344a7f5eSAndroid Build Coastguard Worker /// Bit value assignments:
2483*344a7f5eSAndroid Build Coastguard Worker /// 00: Bits [31:0] copied from the specified operand.
2484*344a7f5eSAndroid Build Coastguard Worker /// 01: Bits [63:32] copied from the specified operand.
2485*344a7f5eSAndroid Build Coastguard Worker /// 10: Bits [95:64] copied from the specified operand.
2486*344a7f5eSAndroid Build Coastguard Worker /// 11: Bits [127:96] copied from the specified operand.
2487*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the shuffled values.
2488*344a7f5eSAndroid Build Coastguard Worker #define _mm_shuffle_ps(a, b, mask) __extension__ ({ \
2489*344a7f5eSAndroid Build Coastguard Worker (__m128)__builtin_shufflevector((__v4sf)(__m128)(a), (__v4sf)(__m128)(b), \
2490*344a7f5eSAndroid Build Coastguard Worker 0 + (((mask) >> 0) & 0x3), \
2491*344a7f5eSAndroid Build Coastguard Worker 0 + (((mask) >> 2) & 0x3), \
2492*344a7f5eSAndroid Build Coastguard Worker 4 + (((mask) >> 4) & 0x3), \
2493*344a7f5eSAndroid Build Coastguard Worker 4 + (((mask) >> 6) & 0x3)); })
2494*344a7f5eSAndroid Build Coastguard Worker
2495*344a7f5eSAndroid Build Coastguard Worker /// \brief Unpacks the high-order (index 2,3) values from two 128-bit vectors of
2496*344a7f5eSAndroid Build Coastguard Worker /// [4 x float] and interleaves them into a 128-bit vector of [4 x
2497*344a7f5eSAndroid Build Coastguard Worker /// float].
2498*344a7f5eSAndroid Build Coastguard Worker ///
2499*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2500*344a7f5eSAndroid Build Coastguard Worker ///
2501*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VUNPCKHPS / UNPCKHPS instruction.
2502*344a7f5eSAndroid Build Coastguard Worker ///
2503*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2504*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
2505*344a7f5eSAndroid Build Coastguard Worker /// Bits [95:64] are written to bits [31:0] of the destination.
2506*344a7f5eSAndroid Build Coastguard Worker /// Bits [127:96] are written to bits [95:64] of the destination.
2507*344a7f5eSAndroid Build Coastguard Worker /// \param __b
2508*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
2509*344a7f5eSAndroid Build Coastguard Worker /// Bits [95:64] are written to bits [63:32] of the destination.
2510*344a7f5eSAndroid Build Coastguard Worker /// Bits [127:96] are written to bits [127:96] of the destination.
2511*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the interleaved values.
2512*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_unpackhi_ps(__m128 __a,__m128 __b)2513*344a7f5eSAndroid Build Coastguard Worker _mm_unpackhi_ps(__m128 __a, __m128 __b)
2514*344a7f5eSAndroid Build Coastguard Worker {
2515*344a7f5eSAndroid Build Coastguard Worker return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 2, 6, 3, 7);
2516*344a7f5eSAndroid Build Coastguard Worker }
2517*344a7f5eSAndroid Build Coastguard Worker
2518*344a7f5eSAndroid Build Coastguard Worker /// \brief Unpacks the low-order (index 0,1) values from two 128-bit vectors of
2519*344a7f5eSAndroid Build Coastguard Worker /// [4 x float] and interleaves them into a 128-bit vector of [4 x
2520*344a7f5eSAndroid Build Coastguard Worker /// float].
2521*344a7f5eSAndroid Build Coastguard Worker ///
2522*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2523*344a7f5eSAndroid Build Coastguard Worker ///
2524*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VUNPCKLPS / UNPCKLPS instruction.
2525*344a7f5eSAndroid Build Coastguard Worker ///
2526*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2527*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
2528*344a7f5eSAndroid Build Coastguard Worker /// Bits [31:0] are written to bits [31:0] of the destination.
2529*344a7f5eSAndroid Build Coastguard Worker /// Bits [63:32] are written to bits [95:64] of the destination.
2530*344a7f5eSAndroid Build Coastguard Worker /// \param __b
2531*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
2532*344a7f5eSAndroid Build Coastguard Worker /// Bits [31:0] are written to bits [63:32] of the destination.
2533*344a7f5eSAndroid Build Coastguard Worker /// Bits [63:32] are written to bits [127:96] of the destination.
2534*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the interleaved values.
2535*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_unpacklo_ps(__m128 __a,__m128 __b)2536*344a7f5eSAndroid Build Coastguard Worker _mm_unpacklo_ps(__m128 __a, __m128 __b)
2537*344a7f5eSAndroid Build Coastguard Worker {
2538*344a7f5eSAndroid Build Coastguard Worker return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 0, 4, 1, 5);
2539*344a7f5eSAndroid Build Coastguard Worker }
2540*344a7f5eSAndroid Build Coastguard Worker
2541*344a7f5eSAndroid Build Coastguard Worker /// \brief Constructs a 128-bit floating-point vector of [4 x float]. The lower
2542*344a7f5eSAndroid Build Coastguard Worker /// 32 bits are set to the lower 32 bits of the second parameter. The upper
2543*344a7f5eSAndroid Build Coastguard Worker /// 96 bits are set to the upper 96 bits of the first parameter.
2544*344a7f5eSAndroid Build Coastguard Worker ///
2545*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2546*344a7f5eSAndroid Build Coastguard Worker ///
2547*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVSS / MOVSS instruction.
2548*344a7f5eSAndroid Build Coastguard Worker ///
2549*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2550*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit floating-point vector of [4 x float]. The upper 96 bits are
2551*344a7f5eSAndroid Build Coastguard Worker /// written to the upper 96 bits of the result.
2552*344a7f5eSAndroid Build Coastguard Worker /// \param __b
2553*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit floating-point vector of [4 x float]. The lower 32 bits are
2554*344a7f5eSAndroid Build Coastguard Worker /// written to the lower 32 bits of the result.
2555*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit floating-point vector of [4 x float].
2556*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_move_ss(__m128 __a,__m128 __b)2557*344a7f5eSAndroid Build Coastguard Worker _mm_move_ss(__m128 __a, __m128 __b)
2558*344a7f5eSAndroid Build Coastguard Worker {
2559*344a7f5eSAndroid Build Coastguard Worker return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 4, 1, 2, 3);
2560*344a7f5eSAndroid Build Coastguard Worker }
2561*344a7f5eSAndroid Build Coastguard Worker
2562*344a7f5eSAndroid Build Coastguard Worker /// \brief Constructs a 128-bit floating-point vector of [4 x float]. The lower
2563*344a7f5eSAndroid Build Coastguard Worker /// 64 bits are set to the upper 64 bits of the second parameter. The upper
2564*344a7f5eSAndroid Build Coastguard Worker /// 64 bits are set to the upper 64 bits of the first parameter.
2565*344a7f5eSAndroid Build Coastguard Worker ///
2566*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2567*344a7f5eSAndroid Build Coastguard Worker ///
2568*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VUNPCKHPD / UNPCKHPD instruction.
2569*344a7f5eSAndroid Build Coastguard Worker ///
2570*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2571*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit floating-point vector of [4 x float]. The upper 64 bits are
2572*344a7f5eSAndroid Build Coastguard Worker /// written to the upper 64 bits of the result.
2573*344a7f5eSAndroid Build Coastguard Worker /// \param __b
2574*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit floating-point vector of [4 x float]. The upper 64 bits are
2575*344a7f5eSAndroid Build Coastguard Worker /// written to the lower 64 bits of the result.
2576*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit floating-point vector of [4 x float].
2577*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_movehl_ps(__m128 __a,__m128 __b)2578*344a7f5eSAndroid Build Coastguard Worker _mm_movehl_ps(__m128 __a, __m128 __b)
2579*344a7f5eSAndroid Build Coastguard Worker {
2580*344a7f5eSAndroid Build Coastguard Worker return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 6, 7, 2, 3);
2581*344a7f5eSAndroid Build Coastguard Worker }
2582*344a7f5eSAndroid Build Coastguard Worker
2583*344a7f5eSAndroid Build Coastguard Worker /// \brief Constructs a 128-bit floating-point vector of [4 x float]. The lower
2584*344a7f5eSAndroid Build Coastguard Worker /// 64 bits are set to the lower 64 bits of the first parameter. The upper
2585*344a7f5eSAndroid Build Coastguard Worker /// 64 bits are set to the lower 64 bits of the second parameter.
2586*344a7f5eSAndroid Build Coastguard Worker ///
2587*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2588*344a7f5eSAndroid Build Coastguard Worker ///
2589*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VUNPCKLPD / UNPCKLPD instruction.
2590*344a7f5eSAndroid Build Coastguard Worker ///
2591*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2592*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit floating-point vector of [4 x float]. The lower 64 bits are
2593*344a7f5eSAndroid Build Coastguard Worker /// written to the lower 64 bits of the result.
2594*344a7f5eSAndroid Build Coastguard Worker /// \param __b
2595*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit floating-point vector of [4 x float]. The lower 64 bits are
2596*344a7f5eSAndroid Build Coastguard Worker /// written to the upper 64 bits of the result.
2597*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit floating-point vector of [4 x float].
2598*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_movelh_ps(__m128 __a,__m128 __b)2599*344a7f5eSAndroid Build Coastguard Worker _mm_movelh_ps(__m128 __a, __m128 __b)
2600*344a7f5eSAndroid Build Coastguard Worker {
2601*344a7f5eSAndroid Build Coastguard Worker return __builtin_shufflevector((__v4sf)__a, (__v4sf)__b, 0, 1, 4, 5);
2602*344a7f5eSAndroid Build Coastguard Worker }
2603*344a7f5eSAndroid Build Coastguard Worker
2604*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts a 64-bit vector of [4 x i16] into a 128-bit vector of [4 x
2605*344a7f5eSAndroid Build Coastguard Worker /// float].
2606*344a7f5eSAndroid Build Coastguard Worker ///
2607*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2608*344a7f5eSAndroid Build Coastguard Worker ///
2609*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c CVTPI2PS + \c COMPOSITE instruction.
2610*344a7f5eSAndroid Build Coastguard Worker ///
2611*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2612*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit vector of [4 x i16]. The elements of the destination are copied
2613*344a7f5eSAndroid Build Coastguard Worker /// from the corresponding elements in this operand.
2614*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the copied and converted
2615*344a7f5eSAndroid Build Coastguard Worker /// values from the operand.
2616*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cvtpi16_ps(__m64 __a)2617*344a7f5eSAndroid Build Coastguard Worker _mm_cvtpi16_ps(__m64 __a)
2618*344a7f5eSAndroid Build Coastguard Worker {
2619*344a7f5eSAndroid Build Coastguard Worker __m64 __b, __c;
2620*344a7f5eSAndroid Build Coastguard Worker __m128 __r;
2621*344a7f5eSAndroid Build Coastguard Worker
2622*344a7f5eSAndroid Build Coastguard Worker __b = _mm_setzero_si64();
2623*344a7f5eSAndroid Build Coastguard Worker __b = _mm_cmpgt_pi16(__b, __a);
2624*344a7f5eSAndroid Build Coastguard Worker __c = _mm_unpackhi_pi16(__a, __b);
2625*344a7f5eSAndroid Build Coastguard Worker __r = _mm_setzero_ps();
2626*344a7f5eSAndroid Build Coastguard Worker __r = _mm_cvtpi32_ps(__r, __c);
2627*344a7f5eSAndroid Build Coastguard Worker __r = _mm_movelh_ps(__r, __r);
2628*344a7f5eSAndroid Build Coastguard Worker __c = _mm_unpacklo_pi16(__a, __b);
2629*344a7f5eSAndroid Build Coastguard Worker __r = _mm_cvtpi32_ps(__r, __c);
2630*344a7f5eSAndroid Build Coastguard Worker
2631*344a7f5eSAndroid Build Coastguard Worker return __r;
2632*344a7f5eSAndroid Build Coastguard Worker }
2633*344a7f5eSAndroid Build Coastguard Worker
2634*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts a 64-bit vector of 16-bit unsigned integer values into a
2635*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vector of [4 x float].
2636*344a7f5eSAndroid Build Coastguard Worker ///
2637*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2638*344a7f5eSAndroid Build Coastguard Worker ///
2639*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c CVTPI2PS + \c COMPOSITE instruction.
2640*344a7f5eSAndroid Build Coastguard Worker ///
2641*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2642*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit vector of 16-bit unsigned integer values. The elements of the
2643*344a7f5eSAndroid Build Coastguard Worker /// destination are copied from the corresponding elements in this operand.
2644*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the copied and converted
2645*344a7f5eSAndroid Build Coastguard Worker /// values from the operand.
2646*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cvtpu16_ps(__m64 __a)2647*344a7f5eSAndroid Build Coastguard Worker _mm_cvtpu16_ps(__m64 __a)
2648*344a7f5eSAndroid Build Coastguard Worker {
2649*344a7f5eSAndroid Build Coastguard Worker __m64 __b, __c;
2650*344a7f5eSAndroid Build Coastguard Worker __m128 __r;
2651*344a7f5eSAndroid Build Coastguard Worker
2652*344a7f5eSAndroid Build Coastguard Worker __b = _mm_setzero_si64();
2653*344a7f5eSAndroid Build Coastguard Worker __c = _mm_unpackhi_pi16(__a, __b);
2654*344a7f5eSAndroid Build Coastguard Worker __r = _mm_setzero_ps();
2655*344a7f5eSAndroid Build Coastguard Worker __r = _mm_cvtpi32_ps(__r, __c);
2656*344a7f5eSAndroid Build Coastguard Worker __r = _mm_movelh_ps(__r, __r);
2657*344a7f5eSAndroid Build Coastguard Worker __c = _mm_unpacklo_pi16(__a, __b);
2658*344a7f5eSAndroid Build Coastguard Worker __r = _mm_cvtpi32_ps(__r, __c);
2659*344a7f5eSAndroid Build Coastguard Worker
2660*344a7f5eSAndroid Build Coastguard Worker return __r;
2661*344a7f5eSAndroid Build Coastguard Worker }
2662*344a7f5eSAndroid Build Coastguard Worker
2663*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts the lower four 8-bit values from a 64-bit vector of [8 x i8]
2664*344a7f5eSAndroid Build Coastguard Worker /// into a 128-bit vector of [4 x float].
2665*344a7f5eSAndroid Build Coastguard Worker ///
2666*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2667*344a7f5eSAndroid Build Coastguard Worker ///
2668*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c CVTPI2PS + \c COMPOSITE instruction.
2669*344a7f5eSAndroid Build Coastguard Worker ///
2670*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2671*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit vector of [8 x i8]. The elements of the destination are copied
2672*344a7f5eSAndroid Build Coastguard Worker /// from the corresponding lower 4 elements in this operand.
2673*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the copied and converted
2674*344a7f5eSAndroid Build Coastguard Worker /// values from the operand.
2675*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cvtpi8_ps(__m64 __a)2676*344a7f5eSAndroid Build Coastguard Worker _mm_cvtpi8_ps(__m64 __a)
2677*344a7f5eSAndroid Build Coastguard Worker {
2678*344a7f5eSAndroid Build Coastguard Worker __m64 __b;
2679*344a7f5eSAndroid Build Coastguard Worker
2680*344a7f5eSAndroid Build Coastguard Worker __b = _mm_setzero_si64();
2681*344a7f5eSAndroid Build Coastguard Worker __b = _mm_cmpgt_pi8(__b, __a);
2682*344a7f5eSAndroid Build Coastguard Worker __b = _mm_unpacklo_pi8(__a, __b);
2683*344a7f5eSAndroid Build Coastguard Worker
2684*344a7f5eSAndroid Build Coastguard Worker return _mm_cvtpi16_ps(__b);
2685*344a7f5eSAndroid Build Coastguard Worker }
2686*344a7f5eSAndroid Build Coastguard Worker
2687*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts the lower four unsigned 8-bit integer values from a 64-bit
2688*344a7f5eSAndroid Build Coastguard Worker /// vector of [8 x u8] into a 128-bit vector of [4 x float].
2689*344a7f5eSAndroid Build Coastguard Worker ///
2690*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2691*344a7f5eSAndroid Build Coastguard Worker ///
2692*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c CVTPI2PS + \c COMPOSITE instruction.
2693*344a7f5eSAndroid Build Coastguard Worker ///
2694*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2695*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit vector of unsigned 8-bit integer values. The elements of the
2696*344a7f5eSAndroid Build Coastguard Worker /// destination are copied from the corresponding lower 4 elements in this
2697*344a7f5eSAndroid Build Coastguard Worker /// operand.
2698*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the copied and converted
2699*344a7f5eSAndroid Build Coastguard Worker /// values from the source operand.
2700*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cvtpu8_ps(__m64 __a)2701*344a7f5eSAndroid Build Coastguard Worker _mm_cvtpu8_ps(__m64 __a)
2702*344a7f5eSAndroid Build Coastguard Worker {
2703*344a7f5eSAndroid Build Coastguard Worker __m64 __b;
2704*344a7f5eSAndroid Build Coastguard Worker
2705*344a7f5eSAndroid Build Coastguard Worker __b = _mm_setzero_si64();
2706*344a7f5eSAndroid Build Coastguard Worker __b = _mm_unpacklo_pi8(__a, __b);
2707*344a7f5eSAndroid Build Coastguard Worker
2708*344a7f5eSAndroid Build Coastguard Worker return _mm_cvtpi16_ps(__b);
2709*344a7f5eSAndroid Build Coastguard Worker }
2710*344a7f5eSAndroid Build Coastguard Worker
2711*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts the two 32-bit signed integer values from each 64-bit vector
2712*344a7f5eSAndroid Build Coastguard Worker /// operand of [2 x i32] into a 128-bit vector of [4 x float].
2713*344a7f5eSAndroid Build Coastguard Worker ///
2714*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2715*344a7f5eSAndroid Build Coastguard Worker ///
2716*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c CVTPI2PS + \c COMPOSITE instruction.
2717*344a7f5eSAndroid Build Coastguard Worker ///
2718*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2719*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit vector of [2 x i32]. The lower elements of the destination are
2720*344a7f5eSAndroid Build Coastguard Worker /// copied from the elements in this operand.
2721*344a7f5eSAndroid Build Coastguard Worker /// \param __b
2722*344a7f5eSAndroid Build Coastguard Worker /// A 64-bit vector of [2 x i32]. The upper elements of the destination are
2723*344a7f5eSAndroid Build Coastguard Worker /// copied from the elements in this operand.
2724*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] whose lower 64 bits contain the
2725*344a7f5eSAndroid Build Coastguard Worker /// copied and converted values from the first operand. The upper 64 bits
2726*344a7f5eSAndroid Build Coastguard Worker /// contain the copied and converted values from the second operand.
2727*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_cvtpi32x2_ps(__m64 __a,__m64 __b)2728*344a7f5eSAndroid Build Coastguard Worker _mm_cvtpi32x2_ps(__m64 __a, __m64 __b)
2729*344a7f5eSAndroid Build Coastguard Worker {
2730*344a7f5eSAndroid Build Coastguard Worker __m128 __c;
2731*344a7f5eSAndroid Build Coastguard Worker
2732*344a7f5eSAndroid Build Coastguard Worker __c = _mm_setzero_ps();
2733*344a7f5eSAndroid Build Coastguard Worker __c = _mm_cvtpi32_ps(__c, __b);
2734*344a7f5eSAndroid Build Coastguard Worker __c = _mm_movelh_ps(__c, __c);
2735*344a7f5eSAndroid Build Coastguard Worker
2736*344a7f5eSAndroid Build Coastguard Worker return _mm_cvtpi32_ps(__c, __a);
2737*344a7f5eSAndroid Build Coastguard Worker }
2738*344a7f5eSAndroid Build Coastguard Worker
2739*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts each single-precision floating-point element of a 128-bit
2740*344a7f5eSAndroid Build Coastguard Worker /// floating-point vector of [4 x float] into a 16-bit signed integer, and
2741*344a7f5eSAndroid Build Coastguard Worker /// packs the results into a 64-bit integer vector of [4 x i16]. If the
2742*344a7f5eSAndroid Build Coastguard Worker /// floating-point element is NaN or infinity, or if the floating-point
2743*344a7f5eSAndroid Build Coastguard Worker /// element is greater than 0x7FFFFFFF or less than -0x8000, it is converted
2744*344a7f5eSAndroid Build Coastguard Worker /// to 0x8000. Otherwise if the floating-point element is greater
2745*344a7f5eSAndroid Build Coastguard Worker /// than 0x7FFF, it is converted to 0x7FFF.
2746*344a7f5eSAndroid Build Coastguard Worker ///
2747*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2748*344a7f5eSAndroid Build Coastguard Worker ///
2749*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c CVTPS2PI + \c COMPOSITE instruction.
2750*344a7f5eSAndroid Build Coastguard Worker ///
2751*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2752*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit floating-point vector of [4 x float].
2753*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer vector of [4 x i16] containing the converted
2754*344a7f5eSAndroid Build Coastguard Worker /// values.
2755*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m64 __DEFAULT_FN_ATTRS
_mm_cvtps_pi16(__m128 __a)2756*344a7f5eSAndroid Build Coastguard Worker _mm_cvtps_pi16(__m128 __a)
2757*344a7f5eSAndroid Build Coastguard Worker {
2758*344a7f5eSAndroid Build Coastguard Worker __m64 __b, __c;
2759*344a7f5eSAndroid Build Coastguard Worker
2760*344a7f5eSAndroid Build Coastguard Worker __b = _mm_cvtps_pi32(__a);
2761*344a7f5eSAndroid Build Coastguard Worker __a = _mm_movehl_ps(__a, __a);
2762*344a7f5eSAndroid Build Coastguard Worker __c = _mm_cvtps_pi32(__a);
2763*344a7f5eSAndroid Build Coastguard Worker
2764*344a7f5eSAndroid Build Coastguard Worker return _mm_packs_pi32(__b, __c);
2765*344a7f5eSAndroid Build Coastguard Worker }
2766*344a7f5eSAndroid Build Coastguard Worker
2767*344a7f5eSAndroid Build Coastguard Worker /// \brief Converts each single-precision floating-point element of a 128-bit
2768*344a7f5eSAndroid Build Coastguard Worker /// floating-point vector of [4 x float] into an 8-bit signed integer, and
2769*344a7f5eSAndroid Build Coastguard Worker /// packs the results into the lower 32 bits of a 64-bit integer vector of
2770*344a7f5eSAndroid Build Coastguard Worker /// [8 x i8]. The upper 32 bits of the vector are set to 0. If the
2771*344a7f5eSAndroid Build Coastguard Worker /// floating-point element is NaN or infinity, or if the floating-point
2772*344a7f5eSAndroid Build Coastguard Worker /// element is greater than 0x7FFFFFFF or less than -0x80, it is converted
2773*344a7f5eSAndroid Build Coastguard Worker /// to 0x80. Otherwise if the floating-point element is greater
2774*344a7f5eSAndroid Build Coastguard Worker /// than 0x7F, it is converted to 0x7F.
2775*344a7f5eSAndroid Build Coastguard Worker ///
2776*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2777*344a7f5eSAndroid Build Coastguard Worker ///
2778*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c CVTPS2PI + \c COMPOSITE instruction.
2779*344a7f5eSAndroid Build Coastguard Worker ///
2780*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2781*344a7f5eSAndroid Build Coastguard Worker /// 128-bit floating-point vector of [4 x float].
2782*344a7f5eSAndroid Build Coastguard Worker /// \returns A 64-bit integer vector of [8 x i8]. The lower 32 bits contain the
2783*344a7f5eSAndroid Build Coastguard Worker /// converted values and the uppper 32 bits are set to zero.
2784*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m64 __DEFAULT_FN_ATTRS
_mm_cvtps_pi8(__m128 __a)2785*344a7f5eSAndroid Build Coastguard Worker _mm_cvtps_pi8(__m128 __a)
2786*344a7f5eSAndroid Build Coastguard Worker {
2787*344a7f5eSAndroid Build Coastguard Worker __m64 __b, __c;
2788*344a7f5eSAndroid Build Coastguard Worker
2789*344a7f5eSAndroid Build Coastguard Worker __b = _mm_cvtps_pi16(__a);
2790*344a7f5eSAndroid Build Coastguard Worker __c = _mm_setzero_si64();
2791*344a7f5eSAndroid Build Coastguard Worker
2792*344a7f5eSAndroid Build Coastguard Worker return _mm_packs_pi16(__b, __c);
2793*344a7f5eSAndroid Build Coastguard Worker }
2794*344a7f5eSAndroid Build Coastguard Worker
2795*344a7f5eSAndroid Build Coastguard Worker /// \brief Extracts the sign bits from each single-precision floating-point
2796*344a7f5eSAndroid Build Coastguard Worker /// element of a 128-bit floating-point vector of [4 x float] and returns the
2797*344a7f5eSAndroid Build Coastguard Worker /// sign bits in bits [0:3] of the result. Bits [31:4] of the result are set
2798*344a7f5eSAndroid Build Coastguard Worker /// to zero.
2799*344a7f5eSAndroid Build Coastguard Worker ///
2800*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
2801*344a7f5eSAndroid Build Coastguard Worker ///
2802*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVMSKPS / MOVMSKPS instruction.
2803*344a7f5eSAndroid Build Coastguard Worker ///
2804*344a7f5eSAndroid Build Coastguard Worker /// \param __a
2805*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit floating-point vector of [4 x float].
2806*344a7f5eSAndroid Build Coastguard Worker /// \returns A 32-bit integer value. Bits [3:0] contain the sign bits from each
2807*344a7f5eSAndroid Build Coastguard Worker /// single-precision floating-point element of the parameter. Bits [31:4] are
2808*344a7f5eSAndroid Build Coastguard Worker /// set to zero.
2809*344a7f5eSAndroid Build Coastguard Worker static __inline__ int __DEFAULT_FN_ATTRS
_mm_movemask_ps(__m128 __a)2810*344a7f5eSAndroid Build Coastguard Worker _mm_movemask_ps(__m128 __a)
2811*344a7f5eSAndroid Build Coastguard Worker {
2812*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_movmskps((__v4sf)__a);
2813*344a7f5eSAndroid Build Coastguard Worker }
2814*344a7f5eSAndroid Build Coastguard Worker
2815*344a7f5eSAndroid Build Coastguard Worker
2816*344a7f5eSAndroid Build Coastguard Worker #define _MM_ALIGN16 __attribute__((aligned(16)))
2817*344a7f5eSAndroid Build Coastguard Worker
2818*344a7f5eSAndroid Build Coastguard Worker #define _MM_SHUFFLE(z, y, x, w) (((z) << 6) | ((y) << 4) | ((x) << 2) | (w))
2819*344a7f5eSAndroid Build Coastguard Worker
2820*344a7f5eSAndroid Build Coastguard Worker #define _MM_EXCEPT_INVALID (0x0001)
2821*344a7f5eSAndroid Build Coastguard Worker #define _MM_EXCEPT_DENORM (0x0002)
2822*344a7f5eSAndroid Build Coastguard Worker #define _MM_EXCEPT_DIV_ZERO (0x0004)
2823*344a7f5eSAndroid Build Coastguard Worker #define _MM_EXCEPT_OVERFLOW (0x0008)
2824*344a7f5eSAndroid Build Coastguard Worker #define _MM_EXCEPT_UNDERFLOW (0x0010)
2825*344a7f5eSAndroid Build Coastguard Worker #define _MM_EXCEPT_INEXACT (0x0020)
2826*344a7f5eSAndroid Build Coastguard Worker #define _MM_EXCEPT_MASK (0x003f)
2827*344a7f5eSAndroid Build Coastguard Worker
2828*344a7f5eSAndroid Build Coastguard Worker #define _MM_MASK_INVALID (0x0080)
2829*344a7f5eSAndroid Build Coastguard Worker #define _MM_MASK_DENORM (0x0100)
2830*344a7f5eSAndroid Build Coastguard Worker #define _MM_MASK_DIV_ZERO (0x0200)
2831*344a7f5eSAndroid Build Coastguard Worker #define _MM_MASK_OVERFLOW (0x0400)
2832*344a7f5eSAndroid Build Coastguard Worker #define _MM_MASK_UNDERFLOW (0x0800)
2833*344a7f5eSAndroid Build Coastguard Worker #define _MM_MASK_INEXACT (0x1000)
2834*344a7f5eSAndroid Build Coastguard Worker #define _MM_MASK_MASK (0x1f80)
2835*344a7f5eSAndroid Build Coastguard Worker
2836*344a7f5eSAndroid Build Coastguard Worker #define _MM_ROUND_NEAREST (0x0000)
2837*344a7f5eSAndroid Build Coastguard Worker #define _MM_ROUND_DOWN (0x2000)
2838*344a7f5eSAndroid Build Coastguard Worker #define _MM_ROUND_UP (0x4000)
2839*344a7f5eSAndroid Build Coastguard Worker #define _MM_ROUND_TOWARD_ZERO (0x6000)
2840*344a7f5eSAndroid Build Coastguard Worker #define _MM_ROUND_MASK (0x6000)
2841*344a7f5eSAndroid Build Coastguard Worker
2842*344a7f5eSAndroid Build Coastguard Worker #define _MM_FLUSH_ZERO_MASK (0x8000)
2843*344a7f5eSAndroid Build Coastguard Worker #define _MM_FLUSH_ZERO_ON (0x8000)
2844*344a7f5eSAndroid Build Coastguard Worker #define _MM_FLUSH_ZERO_OFF (0x0000)
2845*344a7f5eSAndroid Build Coastguard Worker
2846*344a7f5eSAndroid Build Coastguard Worker #define _MM_GET_EXCEPTION_MASK() (_mm_getcsr() & _MM_MASK_MASK)
2847*344a7f5eSAndroid Build Coastguard Worker #define _MM_GET_EXCEPTION_STATE() (_mm_getcsr() & _MM_EXCEPT_MASK)
2848*344a7f5eSAndroid Build Coastguard Worker #define _MM_GET_FLUSH_ZERO_MODE() (_mm_getcsr() & _MM_FLUSH_ZERO_MASK)
2849*344a7f5eSAndroid Build Coastguard Worker #define _MM_GET_ROUNDING_MODE() (_mm_getcsr() & _MM_ROUND_MASK)
2850*344a7f5eSAndroid Build Coastguard Worker
2851*344a7f5eSAndroid Build Coastguard Worker #define _MM_SET_EXCEPTION_MASK(x) (_mm_setcsr((_mm_getcsr() & ~_MM_MASK_MASK) | (x)))
2852*344a7f5eSAndroid Build Coastguard Worker #define _MM_SET_EXCEPTION_STATE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_EXCEPT_MASK) | (x)))
2853*344a7f5eSAndroid Build Coastguard Worker #define _MM_SET_FLUSH_ZERO_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_FLUSH_ZERO_MASK) | (x)))
2854*344a7f5eSAndroid Build Coastguard Worker #define _MM_SET_ROUNDING_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_ROUND_MASK) | (x)))
2855*344a7f5eSAndroid Build Coastguard Worker
2856*344a7f5eSAndroid Build Coastguard Worker #define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \
2857*344a7f5eSAndroid Build Coastguard Worker do { \
2858*344a7f5eSAndroid Build Coastguard Worker __m128 tmp3, tmp2, tmp1, tmp0; \
2859*344a7f5eSAndroid Build Coastguard Worker tmp0 = _mm_unpacklo_ps((row0), (row1)); \
2860*344a7f5eSAndroid Build Coastguard Worker tmp2 = _mm_unpacklo_ps((row2), (row3)); \
2861*344a7f5eSAndroid Build Coastguard Worker tmp1 = _mm_unpackhi_ps((row0), (row1)); \
2862*344a7f5eSAndroid Build Coastguard Worker tmp3 = _mm_unpackhi_ps((row2), (row3)); \
2863*344a7f5eSAndroid Build Coastguard Worker (row0) = _mm_movelh_ps(tmp0, tmp2); \
2864*344a7f5eSAndroid Build Coastguard Worker (row1) = _mm_movehl_ps(tmp2, tmp0); \
2865*344a7f5eSAndroid Build Coastguard Worker (row2) = _mm_movelh_ps(tmp1, tmp3); \
2866*344a7f5eSAndroid Build Coastguard Worker (row3) = _mm_movehl_ps(tmp3, tmp1); \
2867*344a7f5eSAndroid Build Coastguard Worker } while (0)
2868*344a7f5eSAndroid Build Coastguard Worker
2869*344a7f5eSAndroid Build Coastguard Worker /* Aliases for compatibility. */
2870*344a7f5eSAndroid Build Coastguard Worker #define _m_pextrw _mm_extract_pi16
2871*344a7f5eSAndroid Build Coastguard Worker #define _m_pinsrw _mm_insert_pi16
2872*344a7f5eSAndroid Build Coastguard Worker #define _m_pmaxsw _mm_max_pi16
2873*344a7f5eSAndroid Build Coastguard Worker #define _m_pmaxub _mm_max_pu8
2874*344a7f5eSAndroid Build Coastguard Worker #define _m_pminsw _mm_min_pi16
2875*344a7f5eSAndroid Build Coastguard Worker #define _m_pminub _mm_min_pu8
2876*344a7f5eSAndroid Build Coastguard Worker #define _m_pmovmskb _mm_movemask_pi8
2877*344a7f5eSAndroid Build Coastguard Worker #define _m_pmulhuw _mm_mulhi_pu16
2878*344a7f5eSAndroid Build Coastguard Worker #define _m_pshufw _mm_shuffle_pi16
2879*344a7f5eSAndroid Build Coastguard Worker #define _m_maskmovq _mm_maskmove_si64
2880*344a7f5eSAndroid Build Coastguard Worker #define _m_pavgb _mm_avg_pu8
2881*344a7f5eSAndroid Build Coastguard Worker #define _m_pavgw _mm_avg_pu16
2882*344a7f5eSAndroid Build Coastguard Worker #define _m_psadbw _mm_sad_pu8
2883*344a7f5eSAndroid Build Coastguard Worker #define _m_ _mm_
2884*344a7f5eSAndroid Build Coastguard Worker #define _m_ _mm_
2885*344a7f5eSAndroid Build Coastguard Worker
2886*344a7f5eSAndroid Build Coastguard Worker #undef __DEFAULT_FN_ATTRS
2887*344a7f5eSAndroid Build Coastguard Worker
2888*344a7f5eSAndroid Build Coastguard Worker /* Ugly hack for backwards-compatibility (compatible with gcc) */
2889*344a7f5eSAndroid Build Coastguard Worker #if defined(__SSE2__) && !__building_module(_Builtin_intrinsics)
2890*344a7f5eSAndroid Build Coastguard Worker #include <emmintrin.h>
2891*344a7f5eSAndroid Build Coastguard Worker #endif
2892*344a7f5eSAndroid Build Coastguard Worker
2893*344a7f5eSAndroid Build Coastguard Worker #endif /* __XMMINTRIN_H */
2894