OLD | NEW |
1 /*===---- xmmintrin.h - SSE intrinsics -------------------------------------=== | 1 /*===---- xmmintrin.h - SSE intrinsics -------------------------------------=== |
2 * | 2 * |
3 * Permission is hereby granted, free of charge, to any person obtaining a copy | 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 | 4 * of this software and associated documentation files (the "Software"), to deal |
5 * in the Software without restriction, including without limitation the rights | 5 * in the Software without restriction, including without limitation the rights |
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | 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 | 7 * copies of the Software, and to permit persons to whom the Software is |
8 * furnished to do so, subject to the following conditions: | 8 * furnished to do so, subject to the following conditions: |
9 * | 9 * |
10 * The above copyright notice and this permission notice shall be included in | 10 * The above copyright notice and this permission notice shall be included in |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 { | 728 { |
729 return __builtin_ia32_pmovmskb((__v8qi)a); | 729 return __builtin_ia32_pmovmskb((__v8qi)a); |
730 } | 730 } |
731 | 731 |
732 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) | 732 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
733 _mm_mulhi_pu16(__m64 a, __m64 b) | 733 _mm_mulhi_pu16(__m64 a, __m64 b) |
734 { | 734 { |
735 return (__m64)__builtin_ia32_pmulhuw((__v4hi)a, (__v4hi)b); | 735 return (__m64)__builtin_ia32_pmulhuw((__v4hi)a, (__v4hi)b); |
736 } | 736 } |
737 | 737 |
738 #define _mm_shuffle_pi16(a, n) \ | 738 #define _mm_shuffle_pi16(a, n) __extension__ ({ \ |
739 ((__m64)__builtin_ia32_pshufw(a, n)) | 739 __m64 __a = (a); \ |
| 740 (__m64)__builtin_ia32_pshufw((__v4hi)__a, (n)); }) |
740 | 741 |
741 static __inline__ void __attribute__((__always_inline__, __nodebug__)) | 742 static __inline__ void __attribute__((__always_inline__, __nodebug__)) |
742 _mm_maskmove_si64(__m64 d, __m64 n, char *p) | 743 _mm_maskmove_si64(__m64 d, __m64 n, char *p) |
743 { | 744 { |
744 __builtin_ia32_maskmovq((__v8qi)d, (__v8qi)n, p); | 745 __builtin_ia32_maskmovq((__v8qi)d, (__v8qi)n, p); |
745 } | 746 } |
746 | 747 |
747 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) | 748 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) |
748 _mm_avg_pu8(__m64 a, __m64 b) | 749 _mm_avg_pu8(__m64 a, __m64 b) |
749 { | 750 { |
(...skipping 17 matching lines...) Expand all Loading... |
767 { | 768 { |
768 return __builtin_ia32_stmxcsr(); | 769 return __builtin_ia32_stmxcsr(); |
769 } | 770 } |
770 | 771 |
771 static __inline__ void __attribute__((__always_inline__, __nodebug__)) | 772 static __inline__ void __attribute__((__always_inline__, __nodebug__)) |
772 _mm_setcsr(unsigned int i) | 773 _mm_setcsr(unsigned int i) |
773 { | 774 { |
774 __builtin_ia32_ldmxcsr(i); | 775 __builtin_ia32_ldmxcsr(i); |
775 } | 776 } |
776 | 777 |
777 #define _mm_shuffle_ps(a, b, mask) \ | 778 #define _mm_shuffle_ps(a, b, mask) __extension__ ({ \ |
778 (__builtin_shufflevector((__v4sf)(a), (__v4sf)(b), \ | 779 __m128 __a = (a); \ |
779 (mask) & 0x3, ((mask) & 0xc) >> 2, \ | 780 __m128 __b = (b); \ |
780 (((mask) & 0x30) >> 4) + 4, \ | 781 (__m128)__builtin_shufflevector((__v4sf)__a, (__v4sf)__b, \ |
781 (((mask) & 0xc0) >> 6) + 4)) | 782 (mask) & 0x3, ((mask) & 0xc) >> 2, \ |
| 783 (((mask) & 0x30) >> 4) + 4, \ |
| 784 (((mask) & 0xc0) >> 6) + 4); }) |
782 | 785 |
783 static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) | 786 static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
784 _mm_unpackhi_ps(__m128 a, __m128 b) | 787 _mm_unpackhi_ps(__m128 a, __m128 b) |
785 { | 788 { |
786 return __builtin_shufflevector(a, b, 2, 6, 3, 7); | 789 return __builtin_shufflevector(a, b, 2, 6, 3, 7); |
787 } | 790 } |
788 | 791 |
789 static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) | 792 static __inline__ __m128 __attribute__((__always_inline__, __nodebug__)) |
790 _mm_unpacklo_ps(__m128 a, __m128 b) | 793 _mm_unpacklo_ps(__m128 a, __m128 b) |
791 { | 794 { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 #define _m_ _mm_ | 981 #define _m_ _mm_ |
979 | 982 |
980 /* Ugly hack for backwards-compatibility (compatible with gcc) */ | 983 /* Ugly hack for backwards-compatibility (compatible with gcc) */ |
981 #ifdef __SSE2__ | 984 #ifdef __SSE2__ |
982 #include <emmintrin.h> | 985 #include <emmintrin.h> |
983 #endif | 986 #endif |
984 | 987 |
985 #endif /* __SSE__ */ | 988 #endif /* __SSE__ */ |
986 | 989 |
987 #endif /* __XMMINTRIN_H */ | 990 #endif /* __XMMINTRIN_H */ |
OLD | NEW |