1 /* APPLE LOCAL file mainline 2005-06-30 Radar 4131077 */ 2 /* Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 3 4 This file is part of GCC. 5 6 GCC is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 GCC is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with GCC; see the file COPYING. If not, write to 18 the Free Software Foundation, 51 Franklin Street, Fifth Floor, 19 Boston, MA 02110-1301, USA. */ 20 21 /* As a special exception, if you include this header file into source 22 files compiled by GCC, this header file does not by itself cause 23 the resulting executable to be covered by the GNU General Public 24 License. This exception does not however invalidate any other 25 reasons why the executable file might be covered by the GNU General 26 Public License. */ 27 28 /* Implemented from the specification included in the Intel C++ Compiler 29 User Guide and Reference, version 9.0. */ 30 31 #ifndef _PMMINTRIN_H_INCLUDED 32 #define _PMMINTRIN_H_INCLUDED 33 34 #ifdef __SSE3__ 35 #include <xmmintrin.h> 36 #include <emmintrin.h> 37 38 /* Additional bits in the MXCSR. */ 39 #define _MM_DENORMALS_ZERO_MASK 0x0040 40 #define _MM_DENORMALS_ZERO_ON 0x0040 41 #define _MM_DENORMALS_ZERO_OFF 0x0000 42 43 #define _MM_SET_DENORMALS_ZERO_MODE(mode) \ 44 _mm_setcsr ((_mm_getcsr () & ~_MM_DENORMALS_ZERO_MASK) | (mode)) 45 #define _MM_GET_DENORMALS_ZERO_MODE() \ 46 (_mm_getcsr() & _MM_DENORMALS_ZERO_MASK) 47 48 /* APPLE LOCAL begin nodebug inline 4152603 */ 49 #define __always_inline__ __always_inline__, __nodebug__ 50 /* APPLE LOCAL end nodebug inline 4152603 */ 51 52 /* APPLE LOCAL begin radar 5618945 */ 53 #undef __STATIC_INLINE 54 #ifdef __GNUC_STDC_INLINE__ 55 #define __STATIC_INLINE __inline 56 #else 57 #define __STATIC_INLINE static __inline 58 #endif 59 /* APPLE LOCAL end radar 5618945 */ 60 61 /* APPLE LOCAL begin radar 4152603 */ 62 /* APPLE LOCAL begin radar 5618945 */ 63 __STATIC_INLINE __m128 __attribute__((__always_inline__)) 64 /* APPLE LOCAL end radar 5618945 */ 65 _mm_addsub_ps (__m128 __X, __m128 __Y) 66 { 67 return (__m128) __builtin_ia32_addsubps ((__v4sf)__X, (__v4sf)__Y); 68 } 69 70 /* APPLE LOCAL begin radar 5618945 */ 71 __STATIC_INLINE __m128 __attribute__((__always_inline__)) 72 /* APPLE LOCAL end radar 5618945 */ 73 _mm_hadd_ps (__m128 __X, __m128 __Y) 74 { 75 return (__m128) __builtin_ia32_haddps ((__v4sf)__X, (__v4sf)__Y); 76 } 77 78 /* APPLE LOCAL begin radar 5618945 */ 79 __STATIC_INLINE __m128 __attribute__((__always_inline__)) 80 /* APPLE LOCAL end radar 5618945 */ 81 _mm_hsub_ps (__m128 __X, __m128 __Y) 82 { 83 return (__m128) __builtin_ia32_hsubps ((__v4sf)__X, (__v4sf)__Y); 84 } 85 86 /* APPLE LOCAL begin radar 5618945 */ 87 __STATIC_INLINE __m128 __attribute__((__always_inline__)) 88 /* APPLE LOCAL end radar 5618945 */ 89 _mm_movehdup_ps (__m128 __X) 90 { 91 return (__m128) __builtin_ia32_movshdup ((__v4sf)__X); 92 } 93 94 /* APPLE LOCAL begin radar 5618945 */ 95 __STATIC_INLINE __m128 __attribute__((__always_inline__)) 96 /* APPLE LOCAL end radar 5618945 */ 97 _mm_moveldup_ps (__m128 __X) 98 { 99 return (__m128) __builtin_ia32_movsldup ((__v4sf)__X); 100 } 101 102 /* APPLE LOCAL begin radar 5618945 */ 103 __STATIC_INLINE __m128d __attribute__((__always_inline__)) 104 /* APPLE LOCAL end radar 5618945 */ 105 _mm_addsub_pd (__m128d __X, __m128d __Y) 106 { 107 return (__m128d) __builtin_ia32_addsubpd ((__v2df)__X, (__v2df)__Y); 108 } 109 110 /* APPLE LOCAL begin radar 5618945 */ 111 __STATIC_INLINE __m128d __attribute__((__always_inline__)) 112 /* APPLE LOCAL end radar 5618945 */ 113 _mm_hadd_pd (__m128d __X, __m128d __Y) 114 { 115 return (__m128d) __builtin_ia32_haddpd ((__v2df)__X, (__v2df)__Y); 116 } 117 118 /* APPLE LOCAL begin radar 5618945 */ 119 __STATIC_INLINE __m128d __attribute__((__always_inline__)) 120 /* APPLE LOCAL end radar 5618945 */ 121 _mm_hsub_pd (__m128d __X, __m128d __Y) 122 { 123 return (__m128d) __builtin_ia32_hsubpd ((__v2df)__X, (__v2df)__Y); 124 } 125 126 /* APPLE LOCAL begin radar 5618945 */ 127 __STATIC_INLINE __m128d __attribute__((__always_inline__)) 128 /* APPLE LOCAL end radar 5618945 */ 129 _mm_loaddup_pd (double const *__P) 130 { 131 return _mm_load1_pd (__P); 132 } 133 134 /* APPLE LOCAL begin radar 5618945 */ 135 __STATIC_INLINE __m128d __attribute__((__always_inline__)) 136 /* APPLE LOCAL end radar 5618945 */ 137 _mm_movedup_pd (__m128d __X) 138 { 139 return _mm_shuffle_pd (__X, __X, _MM_SHUFFLE2 (0,0)); 140 } 141 142 /* APPLE LOCAL begin radar 5618945 */ 143 __STATIC_INLINE __m128i __attribute__((__always_inline__)) 144 /* APPLE LOCAL end radar 5618945 */ 145 _mm_lddqu_si128 (__m128i const *__P) 146 { 147 return (__m128i) __builtin_ia32_lddqu ((char const *)__P); 148 } 149 150 /* APPLE LOCAL begin radar 5618945 */ 151 __STATIC_INLINE void __attribute__((__always_inline__)) 152 /* APPLE LOCAL end radar 5618945 */ 153 _mm_monitor (void const * __P, unsigned int __E, unsigned int __H) 154 { 155 __builtin_ia32_monitor (__P, __E, __H); 156 } 157 158 /* APPLE LOCAL begin radar 5618945 */ 159 __STATIC_INLINE void __attribute__((__always_inline__)) 160 /* APPLE LOCAL end radar 5618945 */ 161 _mm_mwait (unsigned int __E, unsigned int __H) 162 { 163 __builtin_ia32_mwait (__E, __H); 164 } 165 /* APPLE LOCAL end radar 4152603 */ 166 /* APPLE LOCAL begin nodebug inline 4152603 */ 167 #undef __always_inline__ 168 /* APPLE LOCAL end nodebug inline 4152603 */ 169 170 #endif /* __SSE3__ */ 171 172 #endif /* _PMMINTRIN_H_INCLUDED */ 173