185b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson/*===---- tmmintrin.h - SSSE3 intrinsics -----------------------------------===
285b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson *
385b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson * Permission is hereby granted, free of charge, to any person obtaining a copy
485b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson * of this software and associated documentation files (the "Software"), to deal
585b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson * in the Software without restriction, including without limitation the rights
685b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
785b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson * copies of the Software, and to permit persons to whom the Software is
885b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson * furnished to do so, subject to the following conditions:
985b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson *
1085b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson * The above copyright notice and this permission notice shall be included in
1185b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson * all copies or substantial portions of the Software.
1285b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson *
1385b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1485b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1585b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1685b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1785b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1885b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1985b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson * THE SOFTWARE.
2085b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson *
2185b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson *===-----------------------------------------------------------------------===
2285b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson */
2385b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
2485b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson#ifndef __TMMINTRIN_H
2585b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson#define __TMMINTRIN_H
2685b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
2785b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson#ifndef __SSSE3__
2885b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson#error "SSSE3 instruction set not enabled"
2985b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson#else
3085b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
3185b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson#include <pmmintrin.h>
3285b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
331bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
344f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_abs_pi8(__m64 __a)
3585b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
364f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m64)__builtin_ia32_pabsb((__v8qi)__a);
3785b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
3885b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
391bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
404f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_abs_epi8(__m128i __a)
4185b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
424f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m128i)__builtin_ia32_pabsb128((__v16qi)__a);
4385b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
4485b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
451bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
464f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_abs_pi16(__m64 __a)
4785b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
484f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m64)__builtin_ia32_pabsw((__v4hi)__a);
4985b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
5085b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
511bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
524f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_abs_epi16(__m128i __a)
5385b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
544f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m128i)__builtin_ia32_pabsw128((__v8hi)__a);
5585b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
5685b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
571bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
584f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_abs_pi32(__m64 __a)
5985b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
604f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m64)__builtin_ia32_pabsd((__v2si)__a);
6185b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
6285b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
631bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
644f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_abs_epi32(__m128i __a)
6585b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
664f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m128i)__builtin_ia32_pabsd128((__v4si)__a);
6785b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
6885b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
6932bae37b821e6ade738849ac14e3d3de06afb0beBob Wilson#define _mm_alignr_epi8(a, b, n) __extension__ ({ \
7032bae37b821e6ade738849ac14e3d3de06afb0beBob Wilson  __m128i __a = (a); \
7132bae37b821e6ade738849ac14e3d3de06afb0beBob Wilson  __m128i __b = (b); \
7232bae37b821e6ade738849ac14e3d3de06afb0beBob Wilson  (__m128i)__builtin_ia32_palignr128((__v16qi)__a, (__v16qi)__b, (n)); })
7332bae37b821e6ade738849ac14e3d3de06afb0beBob Wilson
7432bae37b821e6ade738849ac14e3d3de06afb0beBob Wilson#define _mm_alignr_pi8(a, b, n) __extension__ ({ \
7532bae37b821e6ade738849ac14e3d3de06afb0beBob Wilson  __m64 __a = (a); \
7632bae37b821e6ade738849ac14e3d3de06afb0beBob Wilson  __m64 __b = (b); \
7732bae37b821e6ade738849ac14e3d3de06afb0beBob Wilson  (__m64)__builtin_ia32_palignr((__v8qi)__a, (__v8qi)__b, (n)); })
7885b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
791bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
804f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_hadd_epi16(__m128i __a, __m128i __b)
8185b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
824f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m128i)__builtin_ia32_phaddw128((__v8hi)__a, (__v8hi)__b);
8385b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
8485b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
851bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
864f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_hadd_epi32(__m128i __a, __m128i __b)
8785b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
884f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m128i)__builtin_ia32_phaddd128((__v4si)__a, (__v4si)__b);
8985b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
9085b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
911bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
924f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_hadd_pi16(__m64 __a, __m64 __b)
9385b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
944f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m64)__builtin_ia32_phaddw((__v4hi)__a, (__v4hi)__b);
9585b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
9685b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
971bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
984f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_hadd_pi32(__m64 __a, __m64 __b)
9985b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1004f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m64)__builtin_ia32_phaddd((__v2si)__a, (__v2si)__b);
10185b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
10285b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1031bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
1044f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_hadds_epi16(__m128i __a, __m128i __b)
10585b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1064f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m128i)__builtin_ia32_phaddsw128((__v8hi)__a, (__v8hi)__b);
10785b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
10885b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1091bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
1104f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_hadds_pi16(__m64 __a, __m64 __b)
11185b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1124f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m64)__builtin_ia32_phaddsw((__v4hi)__a, (__v4hi)__b);
11385b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
11485b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1151bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
1164f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_hsub_epi16(__m128i __a, __m128i __b)
11785b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1184f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m128i)__builtin_ia32_phsubw128((__v8hi)__a, (__v8hi)__b);
11985b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
12085b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1211bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
1224f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_hsub_epi32(__m128i __a, __m128i __b)
12385b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1244f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m128i)__builtin_ia32_phsubd128((__v4si)__a, (__v4si)__b);
12585b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
12685b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1271bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
1284f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_hsub_pi16(__m64 __a, __m64 __b)
12985b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1304f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m64)__builtin_ia32_phsubw((__v4hi)__a, (__v4hi)__b);
13185b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
13285b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1331bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
1344f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_hsub_pi32(__m64 __a, __m64 __b)
13585b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1364f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m64)__builtin_ia32_phsubd((__v2si)__a, (__v2si)__b);
13785b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
13885b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1391bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
1404f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_hsubs_epi16(__m128i __a, __m128i __b)
14185b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1424f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m128i)__builtin_ia32_phsubsw128((__v8hi)__a, (__v8hi)__b);
14385b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
14485b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1451bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
1464f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_hsubs_pi16(__m64 __a, __m64 __b)
14785b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1484f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m64)__builtin_ia32_phsubsw((__v4hi)__a, (__v4hi)__b);
14985b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
15085b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1511bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
1524f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_maddubs_epi16(__m128i __a, __m128i __b)
15385b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1544f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m128i)__builtin_ia32_pmaddubsw128((__v16qi)__a, (__v16qi)__b);
15585b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
15685b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1571bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
1584f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_maddubs_pi16(__m64 __a, __m64 __b)
15985b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1604f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m64)__builtin_ia32_pmaddubsw((__v8qi)__a, (__v8qi)__b);
16185b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
16285b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1631bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
1644f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_mulhrs_epi16(__m128i __a, __m128i __b)
16585b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1664f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m128i)__builtin_ia32_pmulhrsw128((__v8hi)__a, (__v8hi)__b);
16785b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
16885b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1691bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
1704f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_mulhrs_pi16(__m64 __a, __m64 __b)
17185b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1724f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m64)__builtin_ia32_pmulhrsw((__v4hi)__a, (__v4hi)__b);
17385b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
17485b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1751bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
1764f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_shuffle_epi8(__m128i __a, __m128i __b)
17785b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1784f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m128i)__builtin_ia32_pshufb128((__v16qi)__a, (__v16qi)__b);
17985b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
18085b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1811bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
1824f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_shuffle_pi8(__m64 __a, __m64 __b)
18385b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1844f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m64)__builtin_ia32_pshufb((__v8qi)__a, (__v8qi)__b);
18585b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
18685b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1871bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
1884f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_sign_epi8(__m128i __a, __m128i __b)
18985b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1904f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m128i)__builtin_ia32_psignb128((__v16qi)__a, (__v16qi)__b);
19185b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
19285b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1931bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
1944f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_sign_epi16(__m128i __a, __m128i __b)
19585b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
1964f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m128i)__builtin_ia32_psignw128((__v8hi)__a, (__v8hi)__b);
19785b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
19885b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
1991bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m128i __attribute__((__always_inline__, __nodebug__))
2004f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_sign_epi32(__m128i __a, __m128i __b)
20185b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
2024f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m128i)__builtin_ia32_psignd128((__v4si)__a, (__v4si)__b);
20385b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
20485b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
2051bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
2064f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_sign_pi8(__m64 __a, __m64 __b)
20785b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
2084f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m64)__builtin_ia32_psignb((__v8qi)__a, (__v8qi)__b);
20985b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
21085b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
2111bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
2124f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_sign_pi16(__m64 __a, __m64 __b)
21385b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
2144f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m64)__builtin_ia32_psignw((__v4hi)__a, (__v4hi)__b);
21585b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
21685b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
2171bddbcbd11de09c7bcb48c3d661c447967db73a7Chris Lattnerstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
2184f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie_mm_sign_pi32(__m64 __a, __m64 __b)
21985b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson{
2204f918aed75d4927e88365541c7200f0b5fe5014bDavid Blaikie    return (__m64)__builtin_ia32_psignd((__v2si)__a, (__v2si)__b);
22185b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson}
22285b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
22385b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson#endif /* __SSSE3__ */
22485b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson
22585b2a47ec0450ee78b2c36ec482179cb4743bff7Anders Carlsson#endif /* __TMMINTRIN_H */
226