1 /* APPLE LOCAL file ssse3 4424835 */ 2 /* Copyright (C) 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, 59 Temple Place - Suite 330, 19 Boston, MA 02111-1307, 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.1. */ 30 31 #ifndef _TMMINTRIN_H_INCLUDED 32 #define _TMMINTRIN_H_INCLUDED 33 34 #ifdef __SSSE3__ 35 #include <pmmintrin.h> 36 37 /* APPLE LOCAL begin nodebug inline */ 38 #define __always_inline__ __always_inline__, __nodebug__ 39 /* APPLE LOCAL end nodebug inline */ 40 41 /* APPLE LOCAL begin radar 5618945 */ 42 #undef __STATIC_INLINE 43 #ifdef __GNUC_STDC_INLINE__ 44 #define __STATIC_INLINE __inline 45 #else 46 #define __STATIC_INLINE static __inline 47 #endif 48 /* APPLE LOCAL end radar 5618945 */ 49 50 /* APPLE LOCAL begin radar 5618945 */ 51 __STATIC_INLINE __m128i __attribute__((__always_inline__)) 52 /* APPLE LOCAL end radar 5618945 */ 53 _mm_hadd_epi16 (__m128i __X, __m128i __Y) 54 { 55 return (__m128i) __builtin_ia32_phaddw128 ((__v8hi)__X, (__v8hi)__Y); 56 } 57 58 /* APPLE LOCAL begin radar 5618945 */ 59 __STATIC_INLINE __m128i __attribute__((__always_inline__)) 60 /* APPLE LOCAL end radar 5618945 */ 61 _mm_hadd_epi32 (__m128i __X, __m128i __Y) 62 { 63 return (__m128i) __builtin_ia32_phaddd128 ((__v4si)__X, (__v4si)__Y); 64 } 65 66 /* APPLE LOCAL begin radar 5618945 */ 67 __STATIC_INLINE __m128i __attribute__((__always_inline__)) 68 /* APPLE LOCAL end radar 5618945 */ 69 _mm_hadds_epi16 (__m128i __X, __m128i __Y) 70 { 71 return (__m128i) __builtin_ia32_phaddsw128 ((__v8hi)__X, (__v8hi)__Y); 72 } 73 74 /* APPLE LOCAL begin radar 5618945 */ 75 __STATIC_INLINE __m64 __attribute__((__always_inline__)) 76 /* APPLE LOCAL end radar 5618945 */ 77 _mm_hadd_pi16 (__m64 __X, __m64 __Y) 78 { 79 return (__m64) __builtin_ia32_phaddw ((__v4hi)__X, (__v4hi)__Y); 80 } 81 82 /* APPLE LOCAL begin radar 5618945 */ 83 __STATIC_INLINE __m64 __attribute__((__always_inline__)) 84 /* APPLE LOCAL end radar 5618945 */ 85 _mm_hadd_pi32 (__m64 __X, __m64 __Y) 86 { 87 return (__m64) __builtin_ia32_phaddd ((__v2si)__X, (__v2si)__Y); 88 } 89 90 /* APPLE LOCAL begin radar 5618945 */ 91 __STATIC_INLINE __m64 __attribute__((__always_inline__)) 92 /* APPLE LOCAL end radar 5618945 */ 93 _mm_hadds_pi16 (__m64 __X, __m64 __Y) 94 { 95 return (__m64) __builtin_ia32_phaddsw ((__v4hi)__X, (__v4hi)__Y); 96 } 97 98 /* APPLE LOCAL begin radar 5618945 */ 99 __STATIC_INLINE __m128i __attribute__((__always_inline__)) 100 /* APPLE LOCAL end radar 5618945 */ 101 _mm_hsub_epi16 (__m128i __X, __m128i __Y) 102 { 103 return (__m128i) __builtin_ia32_phsubw128 ((__v8hi)__X, (__v8hi)__Y); 104 } 105 106 /* APPLE LOCAL begin radar 5618945 */ 107 __STATIC_INLINE __m128i __attribute__((__always_inline__)) 108 /* APPLE LOCAL end radar 5618945 */ 109 _mm_hsub_epi32 (__m128i __X, __m128i __Y) 110 { 111 return (__m128i) __builtin_ia32_phsubd128 ((__v4si)__X, (__v4si)__Y); 112 } 113 114 /* APPLE LOCAL begin radar 5618945 */ 115 __STATIC_INLINE __m128i __attribute__((__always_inline__)) 116 /* APPLE LOCAL end radar 5618945 */ 117 _mm_hsubs_epi16 (__m128i __X, __m128i __Y) 118 { 119 return (__m128i) __builtin_ia32_phsubsw128 ((__v8hi)__X, (__v8hi)__Y); 120 } 121 122 /* APPLE LOCAL begin radar 5618945 */ 123 __STATIC_INLINE __m64 __attribute__((__always_inline__)) 124 /* APPLE LOCAL end radar 5618945 */ 125 _mm_hsub_pi16 (__m64 __X, __m64 __Y) 126 { 127 return (__m64) __builtin_ia32_phsubw ((__v4hi)__X, (__v4hi)__Y); 128 } 129 130 /* APPLE LOCAL begin radar 5618945 */ 131 __STATIC_INLINE __m64 __attribute__((__always_inline__)) 132 /* APPLE LOCAL end radar 5618945 */ 133 _mm_hsub_pi32 (__m64 __X, __m64 __Y) 134 { 135 return (__m64) __builtin_ia32_phsubd ((__v2si)__X, (__v2si)__Y); 136 } 137 138 /* APPLE LOCAL begin radar 5618945 */ 139 __STATIC_INLINE __m64 __attribute__((__always_inline__)) 140 /* APPLE LOCAL end radar 5618945 */ 141 _mm_hsubs_pi16 (__m64 __X, __m64 __Y) 142 { 143 return (__m64) __builtin_ia32_phsubsw ((__v4hi)__X, (__v4hi)__Y); 144 } 145 146 /* APPLE LOCAL begin radar 5618945 */ 147 __STATIC_INLINE __m128i __attribute__((__always_inline__)) 148 /* APPLE LOCAL end radar 5618945 */ 149 _mm_maddubs_epi16 (__m128i __X, __m128i __Y) 150 { 151 return (__m128i) __builtin_ia32_pmaddubsw128 ((__v16qi)__X, (__v16qi)__Y); 152 } 153 154 /* APPLE LOCAL begin radar 5618945 */ 155 __STATIC_INLINE __m64 __attribute__((__always_inline__)) 156 /* APPLE LOCAL end radar 5618945 */ 157 _mm_maddubs_pi16 (__m64 __X, __m64 __Y) 158 { 159 return (__m64) __builtin_ia32_pmaddubsw ((__v8qi)__X, (__v8qi)__Y); 160 } 161 162 /* APPLE LOCAL begin radar 5618945 */ 163 __STATIC_INLINE __m128i __attribute__((__always_inline__)) 164 /* APPLE LOCAL end radar 5618945 */ 165 _mm_mulhrs_epi16 (__m128i __X, __m128i __Y) 166 { 167 return (__m128i) __builtin_ia32_pmulhrsw128 ((__v8hi)__X, (__v8hi)__Y); 168 } 169 170 /* APPLE LOCAL begin radar 5618945 */ 171 __STATIC_INLINE __m64 __attribute__((__always_inline__)) 172 /* APPLE LOCAL end radar 5618945 */ 173 _mm_mulhrs_pi16 (__m64 __X, __m64 __Y) 174 { 175 return (__m64) __builtin_ia32_pmulhrsw ((__v4hi)__X, (__v4hi)__Y); 176 } 177 178 /* APPLE LOCAL begin radar 5618945 */ 179 __STATIC_INLINE __m128i __attribute__((__always_inline__)) 180 /* APPLE LOCAL end radar 5618945 */ 181 _mm_shuffle_epi8 (__m128i __X, __m128i __Y) 182 { 183 return (__m128i) __builtin_ia32_pshufb128 ((__v16qi)__X, (__v16qi)__Y); 184 } 185 186 /* APPLE LOCAL begin radar 5618945 */ 187 __STATIC_INLINE __m64 __attribute__((__always_inline__)) 188 /* APPLE LOCAL end radar 5618945 */ 189 _mm_shuffle_pi8 (__m64 __X, __m64 __Y) 190 { 191 return (__m64) __builtin_ia32_pshufb ((__v8qi)__X, (__v8qi)__Y); 192 } 193 194 /* APPLE LOCAL begin radar 5618945 */ 195 __STATIC_INLINE __m128i __attribute__((__always_inline__)) 196 /* APPLE LOCAL end radar 5618945 */ 197 _mm_sign_epi8 (__m128i __X, __m128i __Y) 198 { 199 return (__m128i) __builtin_ia32_psignb128 ((__v16qi)__X, (__v16qi)__Y); 200 } 201 202 /* APPLE LOCAL begin radar 5618945 */ 203 __STATIC_INLINE __m128i __attribute__((__always_inline__)) 204 /* APPLE LOCAL end radar 5618945 */ 205 _mm_sign_epi16 (__m128i __X, __m128i __Y) 206 { 207 return (__m128i) __builtin_ia32_psignw128 ((__v8hi)__X, (__v8hi)__Y); 208 } 209 210 /* APPLE LOCAL begin radar 5618945 */ 211 __STATIC_INLINE __m128i __attribute__((__always_inline__)) 212 /* APPLE LOCAL end radar 5618945 */ 213 _mm_sign_epi32 (__m128i __X, __m128i __Y) 214 { 215 return (__m128i) __builtin_ia32_psignd128 ((__v4si)__X, (__v4si)__Y); 216 } 217 218 /* APPLE LOCAL begin radar 5618945 */ 219 __STATIC_INLINE __m64 __attribute__((__always_inline__)) 220 /* APPLE LOCAL end radar 5618945 */ 221 _mm_sign_pi8 (__m64 __X, __m64 __Y) 222 { 223 return (__m64) __builtin_ia32_psignb ((__v8qi)__X, (__v8qi)__Y); 224 } 225 226 /* APPLE LOCAL begin radar 5618945 */ 227 __STATIC_INLINE __m64 __attribute__((__always_inline__)) 228 /* APPLE LOCAL end radar 5618945 */ 229 _mm_sign_pi16 (__m64 __X, __m64 __Y) 230 { 231 return (__m64) __builtin_ia32_psignw ((__v4hi)__X, (__v4hi)__Y); 232 } 233 234 /* APPLE LOCAL begin radar 5618945 */ 235 __STATIC_INLINE __m64 __attribute__((__always_inline__)) 236 /* APPLE LOCAL end radar 5618945 */ 237 _mm_sign_pi32 (__m64 __X, __m64 __Y) 238 { 239 return (__m64) __builtin_ia32_psignd ((__v2si)__X, (__v2si)__Y); 240 } 241 242 /* APPLE LOCAL begin 5814283 */ 243 #define _mm_alignr_epi8(__X, __Y, __N) \ 244 ((__m128i)__builtin_ia32_palignr128 ((__v2di)(__X), (__v2di)(__Y), (__N) * 8)) 245 /* APPLE LOCAL end 5814283 */ 246 247 #define _mm_alignr_pi8(__X, __Y, __N) \ 248 ((__m64)__builtin_ia32_palignr ((long long) (__X), (long long) (__Y), (__N) * 8)) 249 250 /* APPLE LOCAL begin radar 5618945 */ 251 __STATIC_INLINE __m128i __attribute__((__always_inline__)) 252 /* APPLE LOCAL end radar 5618945 */ 253 _mm_abs_epi8 (__m128i __X) 254 { 255 return (__m128i) __builtin_ia32_pabsb128 ((__v16qi)__X); 256 } 257 258 /* APPLE LOCAL begin radar 5618945 */ 259 __STATIC_INLINE __m128i __attribute__((__always_inline__)) 260 /* APPLE LOCAL end radar 5618945 */ 261 _mm_abs_epi16 (__m128i __X) 262 { 263 return (__m128i) __builtin_ia32_pabsw128 ((__v8hi)__X); 264 } 265 266 /* APPLE LOCAL begin radar 5618945 */ 267 __STATIC_INLINE __m128i __attribute__((__always_inline__)) 268 /* APPLE LOCAL end radar 5618945 */ 269 _mm_abs_epi32 (__m128i __X) 270 { 271 return (__m128i) __builtin_ia32_pabsd128 ((__v4si)__X); 272 } 273 274 /* APPLE LOCAL begin radar 5618945 */ 275 __STATIC_INLINE __m64 __attribute__((__always_inline__)) 276 /* APPLE LOCAL end radar 5618945 */ 277 _mm_abs_pi8 (__m64 __X) 278 { 279 return (__m64) __builtin_ia32_pabsb ((__v8qi)__X); 280 } 281 282 /* APPLE LOCAL begin radar 5618945 */ 283 __STATIC_INLINE __m64 __attribute__((__always_inline__)) 284 /* APPLE LOCAL end radar 5618945 */ 285 _mm_abs_pi16 (__m64 __X) 286 { 287 return (__m64) __builtin_ia32_pabsw ((__v4hi)__X); 288 } 289 290 /* APPLE LOCAL begin radar 5618945 */ 291 __STATIC_INLINE __m64 __attribute__((__always_inline__)) 292 /* APPLE LOCAL end radar 5618945 */ 293 _mm_abs_pi32 (__m64 __X) 294 { 295 return (__m64) __builtin_ia32_pabsd ((__v2si)__X); 296 } 297 298 /* APPLE LOCAL begin nodebug inline */ 299 #undef __always_inline__ 300 /* APPLE LOCAL end nodebug inline */ 301 302 #endif /* __SSSE3__ */ 303 304 #endif /* _TMMINTRIN_H_INCLUDED */ 305