1*344a7f5eSAndroid Build Coastguard Worker /*===---- pmmintrin.h - SSE3 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 __PMMINTRIN_H
25*344a7f5eSAndroid Build Coastguard Worker #define __PMMINTRIN_H
26*344a7f5eSAndroid Build Coastguard Worker
27*344a7f5eSAndroid Build Coastguard Worker #include <emmintrin.h>
28*344a7f5eSAndroid Build Coastguard Worker
29*344a7f5eSAndroid Build Coastguard Worker /* Define the default attributes for the functions in this file. */
30*344a7f5eSAndroid Build Coastguard Worker #define __DEFAULT_FN_ATTRS \
31*344a7f5eSAndroid Build Coastguard Worker __attribute__((__always_inline__, __nodebug__, __target__("sse3")))
32*344a7f5eSAndroid Build Coastguard Worker
33*344a7f5eSAndroid Build Coastguard Worker /// \brief Loads data from an unaligned memory location to elements in a 128-bit
34*344a7f5eSAndroid Build Coastguard Worker /// vector. If the address of the data is not 16-byte aligned, the
35*344a7f5eSAndroid Build Coastguard Worker /// instruction may read two adjacent aligned blocks of memory to retrieve
36*344a7f5eSAndroid Build Coastguard Worker /// the requested data.
37*344a7f5eSAndroid Build Coastguard Worker ///
38*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
39*344a7f5eSAndroid Build Coastguard Worker ///
40*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VLDDQU instruction.
41*344a7f5eSAndroid Build Coastguard Worker ///
42*344a7f5eSAndroid Build Coastguard Worker /// \param __p
43*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a 128-bit integer vector containing integer values.
44*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector containing the moved values.
45*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128i __DEFAULT_FN_ATTRS
_mm_lddqu_si128(__m128i const * __p)46*344a7f5eSAndroid Build Coastguard Worker _mm_lddqu_si128(__m128i const *__p)
47*344a7f5eSAndroid Build Coastguard Worker {
48*344a7f5eSAndroid Build Coastguard Worker return (__m128i)__builtin_ia32_lddqu((char const *)__p);
49*344a7f5eSAndroid Build Coastguard Worker }
50*344a7f5eSAndroid Build Coastguard Worker
51*344a7f5eSAndroid Build Coastguard Worker /// \brief Adds the even-indexed values and subtracts the odd-indexed values of
52*344a7f5eSAndroid Build Coastguard Worker /// two 128-bit vectors of [4 x float].
53*344a7f5eSAndroid Build Coastguard Worker ///
54*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
55*344a7f5eSAndroid Build Coastguard Worker ///
56*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VADDSUBPS instruction.
57*344a7f5eSAndroid Build Coastguard Worker ///
58*344a7f5eSAndroid Build Coastguard Worker /// \param __a
59*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the left source operand.
60*344a7f5eSAndroid Build Coastguard Worker /// \param __b
61*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing the right source operand.
62*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the alternating sums and
63*344a7f5eSAndroid Build Coastguard Worker /// differences of both operands.
64*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_addsub_ps(__m128 __a,__m128 __b)65*344a7f5eSAndroid Build Coastguard Worker _mm_addsub_ps(__m128 __a, __m128 __b)
66*344a7f5eSAndroid Build Coastguard Worker {
67*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_addsubps((__v4sf)__a, (__v4sf)__b);
68*344a7f5eSAndroid Build Coastguard Worker }
69*344a7f5eSAndroid Build Coastguard Worker
70*344a7f5eSAndroid Build Coastguard Worker /// \brief Horizontally adds the adjacent pairs of values contained in two
71*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vectors of [4 x float].
72*344a7f5eSAndroid Build Coastguard Worker ///
73*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
74*344a7f5eSAndroid Build Coastguard Worker ///
75*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VHADDPS instruction.
76*344a7f5eSAndroid Build Coastguard Worker ///
77*344a7f5eSAndroid Build Coastguard Worker /// \param __a
78*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the source operands.
79*344a7f5eSAndroid Build Coastguard Worker /// The horizontal sums of the values are stored in the lower bits of the
80*344a7f5eSAndroid Build Coastguard Worker /// destination.
81*344a7f5eSAndroid Build Coastguard Worker /// \param __b
82*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the source operands.
83*344a7f5eSAndroid Build Coastguard Worker /// The horizontal sums of the values are stored in the upper bits of the
84*344a7f5eSAndroid Build Coastguard Worker /// destination.
85*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the horizontal sums of
86*344a7f5eSAndroid Build Coastguard Worker /// both operands.
87*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_hadd_ps(__m128 __a,__m128 __b)88*344a7f5eSAndroid Build Coastguard Worker _mm_hadd_ps(__m128 __a, __m128 __b)
89*344a7f5eSAndroid Build Coastguard Worker {
90*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_haddps((__v4sf)__a, (__v4sf)__b);
91*344a7f5eSAndroid Build Coastguard Worker }
92*344a7f5eSAndroid Build Coastguard Worker
93*344a7f5eSAndroid Build Coastguard Worker /// \brief Horizontally subtracts the adjacent pairs of values contained in two
94*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vectors of [4 x float].
95*344a7f5eSAndroid Build Coastguard Worker ///
96*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
97*344a7f5eSAndroid Build Coastguard Worker ///
98*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VHSUBPS instruction.
99*344a7f5eSAndroid Build Coastguard Worker ///
100*344a7f5eSAndroid Build Coastguard Worker /// \param __a
101*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the source operands.
102*344a7f5eSAndroid Build Coastguard Worker /// The horizontal differences between the values are stored in the lower
103*344a7f5eSAndroid Build Coastguard Worker /// bits of the destination.
104*344a7f5eSAndroid Build Coastguard Worker /// \param __b
105*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float] containing one of the source operands.
106*344a7f5eSAndroid Build Coastguard Worker /// The horizontal differences between the values are stored in the upper
107*344a7f5eSAndroid Build Coastguard Worker /// bits of the destination.
108*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the horizontal
109*344a7f5eSAndroid Build Coastguard Worker /// differences of both operands.
110*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_hsub_ps(__m128 __a,__m128 __b)111*344a7f5eSAndroid Build Coastguard Worker _mm_hsub_ps(__m128 __a, __m128 __b)
112*344a7f5eSAndroid Build Coastguard Worker {
113*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_hsubps((__v4sf)__a, (__v4sf)__b);
114*344a7f5eSAndroid Build Coastguard Worker }
115*344a7f5eSAndroid Build Coastguard Worker
116*344a7f5eSAndroid Build Coastguard Worker /// \brief Moves and duplicates high-order (odd-indexed) values from a 128-bit
117*344a7f5eSAndroid Build Coastguard Worker /// vector of [4 x float] to float values stored in a 128-bit vector of
118*344a7f5eSAndroid Build Coastguard Worker /// [4 x float].
119*344a7f5eSAndroid Build Coastguard Worker /// Bits [127:96] of the source are written to bits [127:96] and [95:64] of
120*344a7f5eSAndroid Build Coastguard Worker /// the destination.
121*344a7f5eSAndroid Build Coastguard Worker /// Bits [63:32] of the source are written to bits [63:32] and [31:0] of the
122*344a7f5eSAndroid Build Coastguard Worker /// destination.
123*344a7f5eSAndroid Build Coastguard Worker ///
124*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
125*344a7f5eSAndroid Build Coastguard Worker ///
126*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVSHDUP instruction.
127*344a7f5eSAndroid Build Coastguard Worker ///
128*344a7f5eSAndroid Build Coastguard Worker /// \param __a
129*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
130*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the moved and duplicated
131*344a7f5eSAndroid Build Coastguard Worker /// values.
132*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_movehdup_ps(__m128 __a)133*344a7f5eSAndroid Build Coastguard Worker _mm_movehdup_ps(__m128 __a)
134*344a7f5eSAndroid Build Coastguard Worker {
135*344a7f5eSAndroid Build Coastguard Worker return __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 1, 1, 3, 3);
136*344a7f5eSAndroid Build Coastguard Worker }
137*344a7f5eSAndroid Build Coastguard Worker
138*344a7f5eSAndroid Build Coastguard Worker /// \brief Duplicates low-order (even-indexed) values from a 128-bit
139*344a7f5eSAndroid Build Coastguard Worker /// vector of [4 x float] to float values stored in a 128-bit vector of
140*344a7f5eSAndroid Build Coastguard Worker /// [4 x float].
141*344a7f5eSAndroid Build Coastguard Worker /// Bits [95:64] of the source are written to bits [127:96] and [95:64] of
142*344a7f5eSAndroid Build Coastguard Worker /// the destination.
143*344a7f5eSAndroid Build Coastguard Worker /// Bits [31:0] of the source are written to bits [63:32] and [31:0] of the
144*344a7f5eSAndroid Build Coastguard Worker /// destination.
145*344a7f5eSAndroid Build Coastguard Worker ///
146*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
147*344a7f5eSAndroid Build Coastguard Worker ///
148*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVSLDUP instruction.
149*344a7f5eSAndroid Build Coastguard Worker ///
150*344a7f5eSAndroid Build Coastguard Worker /// \param __a
151*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [4 x float].
152*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [4 x float] containing the moved and duplicated
153*344a7f5eSAndroid Build Coastguard Worker /// values.
154*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_moveldup_ps(__m128 __a)155*344a7f5eSAndroid Build Coastguard Worker _mm_moveldup_ps(__m128 __a)
156*344a7f5eSAndroid Build Coastguard Worker {
157*344a7f5eSAndroid Build Coastguard Worker return __builtin_shufflevector((__v4sf)__a, (__v4sf)__a, 0, 0, 2, 2);
158*344a7f5eSAndroid Build Coastguard Worker }
159*344a7f5eSAndroid Build Coastguard Worker
160*344a7f5eSAndroid Build Coastguard Worker /// \brief Adds the even-indexed values and subtracts the odd-indexed values of
161*344a7f5eSAndroid Build Coastguard Worker /// two 128-bit vectors of [2 x double].
162*344a7f5eSAndroid Build Coastguard Worker ///
163*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
164*344a7f5eSAndroid Build Coastguard Worker ///
165*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VADDSUBPD instruction.
166*344a7f5eSAndroid Build Coastguard Worker ///
167*344a7f5eSAndroid Build Coastguard Worker /// \param __a
168*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [2 x double] containing the left source operand.
169*344a7f5eSAndroid Build Coastguard Worker /// \param __b
170*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [2 x double] containing the right source operand.
171*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [2 x double] containing the alternating sums
172*344a7f5eSAndroid Build Coastguard Worker /// and differences of both operands.
173*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128d __DEFAULT_FN_ATTRS
_mm_addsub_pd(__m128d __a,__m128d __b)174*344a7f5eSAndroid Build Coastguard Worker _mm_addsub_pd(__m128d __a, __m128d __b)
175*344a7f5eSAndroid Build Coastguard Worker {
176*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_addsubpd((__v2df)__a, (__v2df)__b);
177*344a7f5eSAndroid Build Coastguard Worker }
178*344a7f5eSAndroid Build Coastguard Worker
179*344a7f5eSAndroid Build Coastguard Worker /// \brief Horizontally adds the pairs of values contained in two 128-bit
180*344a7f5eSAndroid Build Coastguard Worker /// vectors of [2 x double].
181*344a7f5eSAndroid Build Coastguard Worker ///
182*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
183*344a7f5eSAndroid Build Coastguard Worker ///
184*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VHADDPD instruction.
185*344a7f5eSAndroid Build Coastguard Worker ///
186*344a7f5eSAndroid Build Coastguard Worker /// \param __a
187*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [2 x double] containing one of the source operands.
188*344a7f5eSAndroid Build Coastguard Worker /// The horizontal sum of the values is stored in the lower bits of the
189*344a7f5eSAndroid Build Coastguard Worker /// destination.
190*344a7f5eSAndroid Build Coastguard Worker /// \param __b
191*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [2 x double] containing one of the source operands.
192*344a7f5eSAndroid Build Coastguard Worker /// The horizontal sum of the values is stored in the upper bits of the
193*344a7f5eSAndroid Build Coastguard Worker /// destination.
194*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [2 x double] containing the horizontal sums of
195*344a7f5eSAndroid Build Coastguard Worker /// both operands.
196*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128d __DEFAULT_FN_ATTRS
_mm_hadd_pd(__m128d __a,__m128d __b)197*344a7f5eSAndroid Build Coastguard Worker _mm_hadd_pd(__m128d __a, __m128d __b)
198*344a7f5eSAndroid Build Coastguard Worker {
199*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_haddpd((__v2df)__a, (__v2df)__b);
200*344a7f5eSAndroid Build Coastguard Worker }
201*344a7f5eSAndroid Build Coastguard Worker
202*344a7f5eSAndroid Build Coastguard Worker /// \brief Horizontally subtracts the pairs of values contained in two 128-bit
203*344a7f5eSAndroid Build Coastguard Worker /// vectors of [2 x double].
204*344a7f5eSAndroid Build Coastguard Worker ///
205*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
206*344a7f5eSAndroid Build Coastguard Worker ///
207*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VHSUBPD instruction.
208*344a7f5eSAndroid Build Coastguard Worker ///
209*344a7f5eSAndroid Build Coastguard Worker /// \param __a
210*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [2 x double] containing one of the source operands.
211*344a7f5eSAndroid Build Coastguard Worker /// The horizontal difference of the values is stored in the lower bits of
212*344a7f5eSAndroid Build Coastguard Worker /// the destination.
213*344a7f5eSAndroid Build Coastguard Worker /// \param __b
214*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [2 x double] containing one of the source operands.
215*344a7f5eSAndroid Build Coastguard Worker /// The horizontal difference of the values is stored in the upper bits of
216*344a7f5eSAndroid Build Coastguard Worker /// the destination.
217*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [2 x double] containing the horizontal
218*344a7f5eSAndroid Build Coastguard Worker /// differences of both operands.
219*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128d __DEFAULT_FN_ATTRS
_mm_hsub_pd(__m128d __a,__m128d __b)220*344a7f5eSAndroid Build Coastguard Worker _mm_hsub_pd(__m128d __a, __m128d __b)
221*344a7f5eSAndroid Build Coastguard Worker {
222*344a7f5eSAndroid Build Coastguard Worker return __builtin_ia32_hsubpd((__v2df)__a, (__v2df)__b);
223*344a7f5eSAndroid Build Coastguard Worker }
224*344a7f5eSAndroid Build Coastguard Worker
225*344a7f5eSAndroid Build Coastguard Worker /// \brief Moves and duplicates one double-precision value to double-precision
226*344a7f5eSAndroid Build Coastguard Worker /// values stored in a 128-bit vector of [2 x double].
227*344a7f5eSAndroid Build Coastguard Worker ///
228*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
229*344a7f5eSAndroid Build Coastguard Worker ///
230*344a7f5eSAndroid Build Coastguard Worker /// \code
231*344a7f5eSAndroid Build Coastguard Worker /// __m128d _mm_loaddup_pd(double const * dp);
232*344a7f5eSAndroid Build Coastguard Worker /// \endcode
233*344a7f5eSAndroid Build Coastguard Worker ///
234*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVDDUP instruction.
235*344a7f5eSAndroid Build Coastguard Worker ///
236*344a7f5eSAndroid Build Coastguard Worker /// \param dp
237*344a7f5eSAndroid Build Coastguard Worker /// A pointer to a double-precision value to be moved and duplicated.
238*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [2 x double] containing the moved and
239*344a7f5eSAndroid Build Coastguard Worker /// duplicated values.
240*344a7f5eSAndroid Build Coastguard Worker #define _mm_loaddup_pd(dp) _mm_load1_pd(dp)
241*344a7f5eSAndroid Build Coastguard Worker
242*344a7f5eSAndroid Build Coastguard Worker /// \brief Moves and duplicates the double-precision value in the lower bits of
243*344a7f5eSAndroid Build Coastguard Worker /// a 128-bit vector of [2 x double] to double-precision values stored in a
244*344a7f5eSAndroid Build Coastguard Worker /// 128-bit vector of [2 x double].
245*344a7f5eSAndroid Build Coastguard Worker ///
246*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
247*344a7f5eSAndroid Build Coastguard Worker ///
248*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c VMOVDDUP instruction.
249*344a7f5eSAndroid Build Coastguard Worker ///
250*344a7f5eSAndroid Build Coastguard Worker /// \param __a
251*344a7f5eSAndroid Build Coastguard Worker /// A 128-bit vector of [2 x double]. Bits [63:0] are written to bits
252*344a7f5eSAndroid Build Coastguard Worker /// [127:64] and [63:0] of the destination.
253*344a7f5eSAndroid Build Coastguard Worker /// \returns A 128-bit vector of [2 x double] containing the moved and
254*344a7f5eSAndroid Build Coastguard Worker /// duplicated values.
255*344a7f5eSAndroid Build Coastguard Worker static __inline__ __m128d __DEFAULT_FN_ATTRS
_mm_movedup_pd(__m128d __a)256*344a7f5eSAndroid Build Coastguard Worker _mm_movedup_pd(__m128d __a)
257*344a7f5eSAndroid Build Coastguard Worker {
258*344a7f5eSAndroid Build Coastguard Worker return __builtin_shufflevector((__v2df)__a, (__v2df)__a, 0, 0);
259*344a7f5eSAndroid Build Coastguard Worker }
260*344a7f5eSAndroid Build Coastguard Worker
261*344a7f5eSAndroid Build Coastguard Worker #define _MM_DENORMALS_ZERO_ON (0x0040)
262*344a7f5eSAndroid Build Coastguard Worker #define _MM_DENORMALS_ZERO_OFF (0x0000)
263*344a7f5eSAndroid Build Coastguard Worker
264*344a7f5eSAndroid Build Coastguard Worker #define _MM_DENORMALS_ZERO_MASK (0x0040)
265*344a7f5eSAndroid Build Coastguard Worker
266*344a7f5eSAndroid Build Coastguard Worker #define _MM_GET_DENORMALS_ZERO_MODE() (_mm_getcsr() & _MM_DENORMALS_ZERO_MASK)
267*344a7f5eSAndroid Build Coastguard Worker #define _MM_SET_DENORMALS_ZERO_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_DENORMALS_ZERO_MASK) | (x)))
268*344a7f5eSAndroid Build Coastguard Worker
269*344a7f5eSAndroid Build Coastguard Worker /// \brief Establishes a linear address memory range to be monitored and puts
270*344a7f5eSAndroid Build Coastguard Worker /// the processor in the monitor event pending state. Data stored in the
271*344a7f5eSAndroid Build Coastguard Worker /// monitored address range causes the processor to exit the pending state.
272*344a7f5eSAndroid Build Coastguard Worker ///
273*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
274*344a7f5eSAndroid Build Coastguard Worker ///
275*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c MONITOR instruction.
276*344a7f5eSAndroid Build Coastguard Worker ///
277*344a7f5eSAndroid Build Coastguard Worker /// \param __p
278*344a7f5eSAndroid Build Coastguard Worker /// The memory range to be monitored. The size of the range is determined by
279*344a7f5eSAndroid Build Coastguard Worker /// CPUID function 0000_0005h.
280*344a7f5eSAndroid Build Coastguard Worker /// \param __extensions
281*344a7f5eSAndroid Build Coastguard Worker /// Optional extensions for the monitoring state.
282*344a7f5eSAndroid Build Coastguard Worker /// \param __hints
283*344a7f5eSAndroid Build Coastguard Worker /// Optional hints for the monitoring state.
284*344a7f5eSAndroid Build Coastguard Worker static __inline__ void __DEFAULT_FN_ATTRS
_mm_monitor(void const * __p,unsigned __extensions,unsigned __hints)285*344a7f5eSAndroid Build Coastguard Worker _mm_monitor(void const *__p, unsigned __extensions, unsigned __hints)
286*344a7f5eSAndroid Build Coastguard Worker {
287*344a7f5eSAndroid Build Coastguard Worker __builtin_ia32_monitor((void *)__p, __extensions, __hints);
288*344a7f5eSAndroid Build Coastguard Worker }
289*344a7f5eSAndroid Build Coastguard Worker
290*344a7f5eSAndroid Build Coastguard Worker /// \brief Used with the MONITOR instruction to wait while the processor is in
291*344a7f5eSAndroid Build Coastguard Worker /// the monitor event pending state. Data stored in the monitored address
292*344a7f5eSAndroid Build Coastguard Worker /// range causes the processor to exit the pending state.
293*344a7f5eSAndroid Build Coastguard Worker ///
294*344a7f5eSAndroid Build Coastguard Worker /// \headerfile <x86intrin.h>
295*344a7f5eSAndroid Build Coastguard Worker ///
296*344a7f5eSAndroid Build Coastguard Worker /// This intrinsic corresponds to the \c MWAIT instruction.
297*344a7f5eSAndroid Build Coastguard Worker ///
298*344a7f5eSAndroid Build Coastguard Worker /// \param __extensions
299*344a7f5eSAndroid Build Coastguard Worker /// Optional extensions for the monitoring state, which may vary by
300*344a7f5eSAndroid Build Coastguard Worker /// processor.
301*344a7f5eSAndroid Build Coastguard Worker /// \param __hints
302*344a7f5eSAndroid Build Coastguard Worker /// Optional hints for the monitoring state, which may vary by processor.
303*344a7f5eSAndroid Build Coastguard Worker static __inline__ void __DEFAULT_FN_ATTRS
_mm_mwait(unsigned __extensions,unsigned __hints)304*344a7f5eSAndroid Build Coastguard Worker _mm_mwait(unsigned __extensions, unsigned __hints)
305*344a7f5eSAndroid Build Coastguard Worker {
306*344a7f5eSAndroid Build Coastguard Worker __builtin_ia32_mwait(__extensions, __hints);
307*344a7f5eSAndroid Build Coastguard Worker }
308*344a7f5eSAndroid Build Coastguard Worker
309*344a7f5eSAndroid Build Coastguard Worker #undef __DEFAULT_FN_ATTRS
310*344a7f5eSAndroid Build Coastguard Worker
311*344a7f5eSAndroid Build Coastguard Worker #endif /* __PMMINTRIN_H */
312