sketchbook
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ammintrin.h
Go to the documentation of this file.
1 /*===---- ammintrin.h - SSE4a intrinsics -----------------------------------===
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to deal
5  * in the Software without restriction, including without limitation the rights
6  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7  * copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19  * THE SOFTWARE.
20  *
21  *===-----------------------------------------------------------------------===
22  */
23 
24 #ifndef __AMMINTRIN_H
25 #define __AMMINTRIN_H
26 
27 #include <pmmintrin.h>
28 
29 /* Define the default attributes for the functions in this file. */
30 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sse4a")))
31 
58 #define _mm_extracti_si64(x, len, idx) \
59  ((__m128i)__builtin_ia32_extrqi((__v2di)(__m128i)(x), \
60  (char)(len), (char)(idx)))
61 
83 static __inline__ __m128i __DEFAULT_FN_ATTRS
84 _mm_extract_si64(__m128i __x, __m128i __y)
85 {
86  return (__m128i)__builtin_ia32_extrq((__v2di)__x, (__v16qi)__y);
87 }
88 
124 
125 #define _mm_inserti_si64(x, y, len, idx) \
126  ((__m128i)__builtin_ia32_insertqi((__v2di)(__m128i)(x), \
127  (__v2di)(__m128i)(y), \
128  (char)(len), (char)(idx)))
129 
158 
159 static __inline__ __m128i __DEFAULT_FN_ATTRS
160 _mm_insert_si64(__m128i __x, __m128i __y)
161 {
162  return (__m128i)__builtin_ia32_insertq((__v2di)__x, (__v2di)__y);
163 }
164 
180 static __inline__ void __DEFAULT_FN_ATTRS
181 _mm_stream_sd(double *__p, __m128d __a)
182 {
183  __builtin_ia32_movntsd(__p, (__v2df)__a);
184 }
185 
201 static __inline__ void __DEFAULT_FN_ATTRS
202 _mm_stream_ss(float *__p, __m128 __a)
203 {
204  __builtin_ia32_movntss(__p, (__v4sf)__a);
205 }
206 
207 #undef __DEFAULT_FN_ATTRS
208 
209 #endif /* __AMMINTRIN_H */
static __inline unsigned char unsigned int unsigned int unsigned int * __p
Definition: adxintrin.h:38
static __inline unsigned char unsigned int unsigned int __y
Definition: adxintrin.h:36
static __inline unsigned char unsigned int __x
Definition: adxintrin.h:36
#define __DEFAULT_FN_ATTRS
Definition: ammintrin.h:30