2004-03-25 00:45:50 +01:00
|
|
|
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
2002-01-12 08:38:50 +01:00
|
|
|
|
i386-aout.h, [...]: GNU CC -> GCC.
* config/i386/i386-aout.h, config/i386/i386-coff.h,
config/i386/i386-interix.h, config/i386/i386-interix3.h,
config/i386/i386-modes.def, config/i386/i386-protos.h,
config/i386/i386.c, config/i386/i386.h, config/i386/i386.md,
config/i386/i386elf.h, config/i386/k6.md, config/i386/kaos-i386.h,
config/i386/linux-aout.h, config/i386/linux.h, config/i386/linux64.h,
config/i386/lynx-ng.h, config/i386/lynx.h, config/i386/mingw32.h,
config/i386/mmintrin.h, config/i386/moss.h: GNU CC -> GCC.
"GNU compiler" -> GCC.
From-SVN: r71811
2003-09-26 05:46:06 +02:00
|
|
|
This file is part of GCC.
|
2002-01-12 08:38:50 +01:00
|
|
|
|
i386-aout.h, [...]: GNU CC -> GCC.
* config/i386/i386-aout.h, config/i386/i386-coff.h,
config/i386/i386-interix.h, config/i386/i386-interix3.h,
config/i386/i386-modes.def, config/i386/i386-protos.h,
config/i386/i386.c, config/i386/i386.h, config/i386/i386.md,
config/i386/i386elf.h, config/i386/k6.md, config/i386/kaos-i386.h,
config/i386/linux-aout.h, config/i386/linux.h, config/i386/linux64.h,
config/i386/lynx-ng.h, config/i386/lynx.h, config/i386/mingw32.h,
config/i386/mmintrin.h, config/i386/moss.h: GNU CC -> GCC.
"GNU compiler" -> GCC.
From-SVN: r71811
2003-09-26 05:46:06 +02:00
|
|
|
GCC is free software; you can redistribute it and/or modify
|
2002-01-12 08:38:50 +01:00
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
i386-aout.h, [...]: GNU CC -> GCC.
* config/i386/i386-aout.h, config/i386/i386-coff.h,
config/i386/i386-interix.h, config/i386/i386-interix3.h,
config/i386/i386-modes.def, config/i386/i386-protos.h,
config/i386/i386.c, config/i386/i386.h, config/i386/i386.md,
config/i386/i386elf.h, config/i386/k6.md, config/i386/kaos-i386.h,
config/i386/linux-aout.h, config/i386/linux.h, config/i386/linux64.h,
config/i386/lynx-ng.h, config/i386/lynx.h, config/i386/mingw32.h,
config/i386/mmintrin.h, config/i386/moss.h: GNU CC -> GCC.
"GNU compiler" -> GCC.
From-SVN: r71811
2003-09-26 05:46:06 +02:00
|
|
|
GCC is distributed in the hope that it will be useful,
|
2002-01-12 08:38:50 +01:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
i386-aout.h, [...]: GNU CC -> GCC.
* config/i386/i386-aout.h, config/i386/i386-coff.h,
config/i386/i386-interix.h, config/i386/i386-interix3.h,
config/i386/i386-modes.def, config/i386/i386-protos.h,
config/i386/i386.c, config/i386/i386.h, config/i386/i386.md,
config/i386/i386elf.h, config/i386/k6.md, config/i386/kaos-i386.h,
config/i386/linux-aout.h, config/i386/linux.h, config/i386/linux64.h,
config/i386/lynx-ng.h, config/i386/lynx.h, config/i386/mingw32.h,
config/i386/mmintrin.h, config/i386/moss.h: GNU CC -> GCC.
"GNU compiler" -> GCC.
From-SVN: r71811
2003-09-26 05:46:06 +02:00
|
|
|
along with GCC; see the file COPYING. If not, write to
|
2002-01-12 08:38:50 +01:00
|
|
|
the Free Software Foundation, 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
|
|
|
|
/* As a special exception, if you include this header file into source
|
|
|
|
files compiled by GCC, this header file does not by itself cause
|
|
|
|
the resulting executable to be covered by the GNU General Public
|
|
|
|
License. This exception does not however invalidate any other
|
|
|
|
reasons why the executable file might be covered by the GNU General
|
|
|
|
Public License. */
|
|
|
|
|
|
|
|
/* Implemented from the specification included in the Intel C++ Compiler
|
2003-06-06 15:52:17 +02:00
|
|
|
User Guide and Reference, version 8.0. */
|
2002-01-12 08:38:50 +01:00
|
|
|
|
|
|
|
#ifndef _MMINTRIN_H_INCLUDED
|
|
|
|
#define _MMINTRIN_H_INCLUDED
|
|
|
|
|
2002-10-17 19:09:17 +02:00
|
|
|
#ifndef __MMX__
|
|
|
|
# error "MMX instruction set not enabled"
|
|
|
|
#else
|
2002-01-12 08:38:50 +01:00
|
|
|
/* The data type intended for user use. */
|
2004-12-20 11:55:11 +01:00
|
|
|
typedef int __m64 __attribute__ ((__vector_size__ (8)));
|
2002-01-12 08:38:50 +01:00
|
|
|
|
|
|
|
/* Internal data types for implementing the intrinsics. */
|
2004-12-20 11:55:11 +01:00
|
|
|
typedef int __v2si __attribute__ ((__vector_size__ (8)));
|
|
|
|
typedef short __v4hi __attribute__ ((__vector_size__ (8)));
|
|
|
|
typedef char __v8qi __attribute__ ((__vector_size__ (8)));
|
2002-01-12 08:38:50 +01:00
|
|
|
|
|
|
|
/* Empty the multimedia state. */
|
|
|
|
static __inline void
|
|
|
|
_mm_empty (void)
|
|
|
|
{
|
|
|
|
__builtin_ia32_emms ();
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline void
|
|
|
|
_m_empty (void)
|
|
|
|
{
|
|
|
|
_mm_empty ();
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_cvtsi32_si64 (int __i)
|
|
|
|
{
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
long long __tmp = (unsigned int)__i;
|
|
|
|
return (__m64) __tmp;
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_from_int (int __i)
|
|
|
|
{
|
|
|
|
return _mm_cvtsi32_si64 (__i);
|
|
|
|
}
|
|
|
|
|
i386.c (def_builtin): Special case 64bit builtins.
* i386.c (def_builtin): Special case 64bit builtins.
(MASK_SSE164, MASK_SSE264): New constants.
(builtin_description): Add 64bit builtins.
(ix86_init_mmx_sse_builtins): Likewise.
* i386.h (enum ix86_builtins): Likewise.
* i386.md (cvtss2siq, cvttss2siq, cvtsd2siq, cvttsd2siq, cvtsi2sdq,
sse2_movq2dq_rex64, sse2_movsq2q_rex64): New.
(sse2_movq2dq, sse2_movsq2q): Disable for 64bit.
* mmintrin.h (_mm_cvtsi64x_si64, _mm_set_pi64x, _mm_cvtsi64_si64x): New.
* xmmintrin.h (_mm_cvtss_si64x, _mm_cvttss_si64x, _mm_cvtsi64x_ss,
_mm_set_epi64x, _mm_set1_epi64x, _mm_cvtsd_si64x, _mm_cvttsd_si64x,
_mm_cvtsi64x_sd, _mm_cvtsi64x_si128, _mm_cvtsi128_si64x): New.
From-SVN: r63267
2003-02-22 03:09:06 +01:00
|
|
|
#ifdef __x86_64__
|
|
|
|
/* Convert I to a __m64 object. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_cvtsi64x_si64 (long long __i)
|
|
|
|
{
|
|
|
|
return (__m64) __i;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Convert I to a __m64 object. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_set_pi64x (long long __i)
|
|
|
|
{
|
|
|
|
return (__m64) __i;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Convert the lower 32 bits of the __m64 object into an integer. */
|
|
|
|
static __inline int
|
|
|
|
_mm_cvtsi64_si32 (__m64 __i)
|
|
|
|
{
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
long long __tmp = (long long)__i;
|
|
|
|
return __tmp;
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline int
|
|
|
|
_m_to_int (__m64 __i)
|
|
|
|
{
|
|
|
|
return _mm_cvtsi64_si32 (__i);
|
|
|
|
}
|
|
|
|
|
i386.c (def_builtin): Special case 64bit builtins.
* i386.c (def_builtin): Special case 64bit builtins.
(MASK_SSE164, MASK_SSE264): New constants.
(builtin_description): Add 64bit builtins.
(ix86_init_mmx_sse_builtins): Likewise.
* i386.h (enum ix86_builtins): Likewise.
* i386.md (cvtss2siq, cvttss2siq, cvtsd2siq, cvttsd2siq, cvtsi2sdq,
sse2_movq2dq_rex64, sse2_movsq2q_rex64): New.
(sse2_movq2dq, sse2_movsq2q): Disable for 64bit.
* mmintrin.h (_mm_cvtsi64x_si64, _mm_set_pi64x, _mm_cvtsi64_si64x): New.
* xmmintrin.h (_mm_cvtss_si64x, _mm_cvttss_si64x, _mm_cvtsi64x_ss,
_mm_set_epi64x, _mm_set1_epi64x, _mm_cvtsd_si64x, _mm_cvttsd_si64x,
_mm_cvtsi64x_sd, _mm_cvtsi64x_si128, _mm_cvtsi128_si64x): New.
From-SVN: r63267
2003-02-22 03:09:06 +01:00
|
|
|
#ifdef __x86_64__
|
|
|
|
/* Convert the lower 32 bits of the __m64 object into an integer. */
|
|
|
|
static __inline long long
|
|
|
|
_mm_cvtsi64_si64x (__m64 __i)
|
|
|
|
{
|
|
|
|
return (long long)__i;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Pack the four 16-bit values from M1 into the lower four 8-bit values of
|
|
|
|
the result, and the four 16-bit values from M2 into the upper four 8-bit
|
|
|
|
values of the result, all with signed saturation. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_packs_pi16 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_packsswb ((__v4hi)__m1, (__v4hi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_packsswb (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_packs_pi16 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Pack the two 32-bit values from M1 in to the lower two 16-bit values of
|
|
|
|
the result, and the two 32-bit values from M2 into the upper two 16-bit
|
|
|
|
values of the result, all with signed saturation. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_packs_pi32 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_packssdw ((__v2si)__m1, (__v2si)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_packssdw (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_packs_pi32 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Pack the four 16-bit values from M1 into the lower four 8-bit values of
|
|
|
|
the result, and the four 16-bit values from M2 into the upper four 8-bit
|
|
|
|
values of the result, all with unsigned saturation. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_packs_pu16 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_packuswb ((__v4hi)__m1, (__v4hi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_packuswb (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_packs_pu16 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Interleave the four 8-bit values from the high half of M1 with the four
|
|
|
|
8-bit values from the high half of M2. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_unpackhi_pi8 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_punpckhbw ((__v8qi)__m1, (__v8qi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_punpckhbw (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_unpackhi_pi8 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Interleave the two 16-bit values from the high half of M1 with the two
|
|
|
|
16-bit values from the high half of M2. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_unpackhi_pi16 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_punpckhwd ((__v4hi)__m1, (__v4hi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_punpckhwd (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_unpackhi_pi16 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Interleave the 32-bit value from the high half of M1 with the 32-bit
|
|
|
|
value from the high half of M2. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_unpackhi_pi32 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_punpckhdq ((__v2si)__m1, (__v2si)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_punpckhdq (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_unpackhi_pi32 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Interleave the four 8-bit values from the low half of M1 with the four
|
|
|
|
8-bit values from the low half of M2. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_unpacklo_pi8 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_punpcklbw ((__v8qi)__m1, (__v8qi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_punpcklbw (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_unpacklo_pi8 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Interleave the two 16-bit values from the low half of M1 with the two
|
|
|
|
16-bit values from the low half of M2. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_unpacklo_pi16 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_punpcklwd ((__v4hi)__m1, (__v4hi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_punpcklwd (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_unpacklo_pi16 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Interleave the 32-bit value from the low half of M1 with the 32-bit
|
|
|
|
value from the low half of M2. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_unpacklo_pi32 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_punpckldq ((__v2si)__m1, (__v2si)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_punpckldq (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_unpacklo_pi32 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Add the 8-bit values in M1 to the 8-bit values in M2. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_add_pi8 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_paddb ((__v8qi)__m1, (__v8qi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_paddb (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_add_pi8 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Add the 16-bit values in M1 to the 16-bit values in M2. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_add_pi16 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_paddw ((__v4hi)__m1, (__v4hi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_paddw (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_add_pi16 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Add the 32-bit values in M1 to the 32-bit values in M2. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_add_pi32 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_paddd ((__v2si)__m1, (__v2si)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_paddd (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_add_pi32 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2003-02-22 01:32:09 +01:00
|
|
|
/* Add the 64-bit values in M1 to the 64-bit values in M2. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_add_si64 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_paddq ((long long)__m1, (long long)__m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Add the 8-bit values in M1 to the 8-bit values in M2 using signed
|
|
|
|
saturated arithmetic. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_adds_pi8 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_paddsb ((__v8qi)__m1, (__v8qi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_paddsb (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_adds_pi8 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Add the 16-bit values in M1 to the 16-bit values in M2 using signed
|
|
|
|
saturated arithmetic. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_adds_pi16 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_paddsw ((__v4hi)__m1, (__v4hi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_paddsw (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_adds_pi16 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned
|
|
|
|
saturated arithmetic. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_adds_pu8 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_paddusb ((__v8qi)__m1, (__v8qi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_paddusb (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_adds_pu8 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned
|
|
|
|
saturated arithmetic. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_adds_pu16 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_paddusw ((__v4hi)__m1, (__v4hi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_paddusw (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_adds_pu16 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Subtract the 8-bit values in M2 from the 8-bit values in M1. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_sub_pi8 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_psubb ((__v8qi)__m1, (__v8qi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psubb (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_sub_pi8 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Subtract the 16-bit values in M2 from the 16-bit values in M1. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_sub_pi16 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_psubw ((__v4hi)__m1, (__v4hi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psubw (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_sub_pi16 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Subtract the 32-bit values in M2 from the 32-bit values in M1. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_sub_pi32 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_psubd ((__v2si)__m1, (__v2si)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psubd (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_sub_pi32 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2003-02-22 01:32:09 +01:00
|
|
|
/* Add the 64-bit values in M1 to the 64-bit values in M2. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_sub_si64 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_psubq ((long long)__m1, (long long)__m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed
|
|
|
|
saturating arithmetic. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_subs_pi8 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_psubsb ((__v8qi)__m1, (__v8qi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psubsb (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_subs_pi8 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using
|
|
|
|
signed saturating arithmetic. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_subs_pi16 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_psubsw ((__v4hi)__m1, (__v4hi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psubsw (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_subs_pi16 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using
|
|
|
|
unsigned saturating arithmetic. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_subs_pu8 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_psubusb ((__v8qi)__m1, (__v8qi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psubusb (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_subs_pu8 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using
|
|
|
|
unsigned saturating arithmetic. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_subs_pu16 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_psubusw ((__v4hi)__m1, (__v4hi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psubusw (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_subs_pu16 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing
|
|
|
|
four 32-bit intermediate results, which are then summed by pairs to
|
|
|
|
produce two 32-bit results. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_madd_pi16 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_pmaddwd ((__v4hi)__m1, (__v4hi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_pmaddwd (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_madd_pi16 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Multiply four signed 16-bit values in M1 by four signed 16-bit values in
|
|
|
|
M2 and produce the high 16 bits of the 32-bit results. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_mulhi_pi16 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_pmulhw ((__v4hi)__m1, (__v4hi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_pmulhw (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_mulhi_pi16 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce
|
|
|
|
the low 16 bits of the results. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_mullo_pi16 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_pmullw ((__v4hi)__m1, (__v4hi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_pmullw (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_mullo_pi16 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Shift four 16-bit values in M left by COUNT. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_sll_pi16 (__m64 __m, __m64 __count)
|
|
|
|
{
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
return (__m64) __builtin_ia32_psllw ((__v4hi)__m, (long long)__count);
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psllw (__m64 __m, __m64 __count)
|
|
|
|
{
|
|
|
|
return _mm_sll_pi16 (__m, __count);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
static __inline __m64
|
|
|
|
_mm_slli_pi16 (__m64 __m, int __count)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_psllw ((__v4hi)__m, __count);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psllwi (__m64 __m, int __count)
|
|
|
|
{
|
|
|
|
return _mm_slli_pi16 (__m, __count);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Shift two 32-bit values in M left by COUNT. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_sll_pi32 (__m64 __m, __m64 __count)
|
|
|
|
{
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
return (__m64) __builtin_ia32_pslld ((__v2si)__m, (long long)__count);
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_pslld (__m64 __m, __m64 __count)
|
|
|
|
{
|
|
|
|
return _mm_sll_pi32 (__m, __count);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
static __inline __m64
|
|
|
|
_mm_slli_pi32 (__m64 __m, int __count)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_pslld ((__v2si)__m, __count);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_pslldi (__m64 __m, int __count)
|
|
|
|
{
|
|
|
|
return _mm_slli_pi32 (__m, __count);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Shift the 64-bit value in M left by COUNT. */
|
|
|
|
static __inline __m64
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
_mm_sll_si64 (__m64 __m, __m64 __count)
|
2002-01-12 08:38:50 +01:00
|
|
|
{
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
return (__m64) __builtin_ia32_psllq ((long long)__m, (long long)__count);
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psllq (__m64 __m, __m64 __count)
|
|
|
|
{
|
|
|
|
return _mm_sll_si64 (__m, __count);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
static __inline __m64
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
_mm_slli_si64 (__m64 __m, int __count)
|
2002-01-12 08:38:50 +01:00
|
|
|
{
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
return (__m64) __builtin_ia32_psllq ((long long)__m, (long long)__count);
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psllqi (__m64 __m, int __count)
|
|
|
|
{
|
|
|
|
return _mm_slli_si64 (__m, __count);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_sra_pi16 (__m64 __m, __m64 __count)
|
|
|
|
{
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
return (__m64) __builtin_ia32_psraw ((__v4hi)__m, (long long)__count);
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psraw (__m64 __m, __m64 __count)
|
|
|
|
{
|
|
|
|
return _mm_sra_pi16 (__m, __count);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
static __inline __m64
|
|
|
|
_mm_srai_pi16 (__m64 __m, int __count)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_psraw ((__v4hi)__m, __count);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psrawi (__m64 __m, int __count)
|
|
|
|
{
|
|
|
|
return _mm_srai_pi16 (__m, __count);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_sra_pi32 (__m64 __m, __m64 __count)
|
|
|
|
{
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
return (__m64) __builtin_ia32_psrad ((__v2si)__m, (long long)__count);
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psrad (__m64 __m, __m64 __count)
|
|
|
|
{
|
|
|
|
return _mm_sra_pi32 (__m, __count);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
static __inline __m64
|
|
|
|
_mm_srai_pi32 (__m64 __m, int __count)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_psrad ((__v2si)__m, __count);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psradi (__m64 __m, int __count)
|
|
|
|
{
|
|
|
|
return _mm_srai_pi32 (__m, __count);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Shift four 16-bit values in M right by COUNT; shift in zeros. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_srl_pi16 (__m64 __m, __m64 __count)
|
|
|
|
{
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, (long long)__count);
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psrlw (__m64 __m, __m64 __count)
|
|
|
|
{
|
|
|
|
return _mm_srl_pi16 (__m, __count);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
static __inline __m64
|
|
|
|
_mm_srli_pi16 (__m64 __m, int __count)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, __count);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psrlwi (__m64 __m, int __count)
|
|
|
|
{
|
|
|
|
return _mm_srli_pi16 (__m, __count);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Shift two 32-bit values in M right by COUNT; shift in zeros. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_srl_pi32 (__m64 __m, __m64 __count)
|
|
|
|
{
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
return (__m64) __builtin_ia32_psrld ((__v2si)__m, (long long)__count);
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psrld (__m64 __m, __m64 __count)
|
|
|
|
{
|
|
|
|
return _mm_srl_pi32 (__m, __count);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
static __inline __m64
|
|
|
|
_mm_srli_pi32 (__m64 __m, int __count)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_psrld ((__v2si)__m, __count);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psrldi (__m64 __m, int __count)
|
|
|
|
{
|
|
|
|
return _mm_srli_pi32 (__m, __count);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Shift the 64-bit value in M left by COUNT; shift in zeros. */
|
|
|
|
static __inline __m64
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
_mm_srl_si64 (__m64 __m, __m64 __count)
|
2002-01-12 08:38:50 +01:00
|
|
|
{
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
return (__m64) __builtin_ia32_psrlq ((long long)__m, (long long)__count);
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psrlq (__m64 __m, __m64 __count)
|
|
|
|
{
|
|
|
|
return _mm_srl_si64 (__m, __count);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
static __inline __m64
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
_mm_srli_si64 (__m64 __m, int __count)
|
2002-01-12 08:38:50 +01:00
|
|
|
{
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
return (__m64) __builtin_ia32_psrlq ((long long)__m, (long long)__count);
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_psrlqi (__m64 __m, int __count)
|
|
|
|
{
|
|
|
|
return _mm_srli_si64 (__m, __count);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Bit-wise AND the 64-bit values in M1 and M2. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_and_si64 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
i386.c (bdesc_2arg): Update names for mmx_ prefixes.
* config/i386/i386.c (bdesc_2arg): Update names for mmx_ prefixes.
(ix86_expand_builtin): Likewise. Frob MASKMOVQ wrt the input mem
just like MASKMOVDQU. Return plain zero for MMX_ZERO.
* config/i386/i386.md (MMXMODEI, mov<MMXMODEI>,
mov<MMXMODEI>_internal_rex64, mov<MMXMODEI>_internal, movv2sf,
movv2sf_internal_rex64, movv2sf_internal, MMXMODE,
movmisalign<MMXMODE>, mmx_pmovmskb, mmx_maskmovq, mmx_maskmovq_rex,
sse_movntdi, addv8qi3, addv4hi3, addv2si3, mmx_adddi3, ssaddv8qi3,
ssaddv4hi3, usaddv8qi3, usaddv4hi3, subv8qi3, subv4hi3, subv2si3,
mmx_subdi3, sssubv8qi3, sssubv4hi3, ussubv8qi3, ussubv4hi3,
mulv4hi3, smulv4hi3_highpart, umulv4hi3_highpart, mmx_pmaddwd,
sse2_umulsidi3, mmx_iordi3, mmx_xordi3, mmx_anddi3, mmx_nanddi3,
mmx_uavgv8qi3, mmx_uavgv4hi3, mmx_psadbw, mmx_pinsrw, mmx_pinsrw,
mmx_pextrw, mmx_pshufw, eqv8qi3, eqv4hi3, eqv2si3, gtv8qi3, gtv4hi3,
gtv2si3, umaxv8qi3, smaxv4hi3, uminv8qi3, sminv4hi3, ashrv4hi3,
ashrv2si3, lshrv4hi3, lshrv2si3, mmx_lshrdi3, ashlv4hi3, ashlv2si3,
mmx_ashldi3, mmx_packsswb, mmx_packssdw, mmx_packuswb, mmx_punpckhbw,
mmx_punpckhwd, mmx_punpckhdq, mmx_punpcklbw, mmx_punpcklwd,
mmx_punpckldq, emms, addv2sf3, subv2sf3, subrv2sf3, gtv2sf3, gev2sf3,
eqv2sf3, pfmaxv2sf3, pfminv2sf3, mulv2sf3, femms, pf2id, pf2iw,
pfacc, pfnacc, pfpnacc, pi2fw, floatv2si2, pfrcpv2sf2, pfrcpit1v2sf3,
pfrcpit2v2sf3, pfrsqrtv2sf2, pfrsqit1v2sf3, pmulhrwv4hi3, pswapdv2si2,
pswapdv2sf2): Move to mmx.md; rename as necessary with leading
mmx_ prefix.
(mmx_clrdi, pavgusb): Remove.
(ldmxcsr, stmxcsr, sfence, sfence_insn): Move to sse.md; rename
with leading sse_ prefix.
* config/i386/sse.md: Receive them.
* config/i386/mmx.md: New file.
(MMXMODE12, MMXMODE24, mmxvecsize): New.
(subrv2sf3): Turn into expander for normal subtraction.
(mmx_addv2sf3, mmx_mulv2sf3, mmx_smaxv2sf3, mmx_sminv2sf3,
mmx_eqv2sf3, mmx_mulv4hi3, mmx_smulv4hi3_highpart,
mmx_umulv4hi3_highpart, mmx_pmaddwd, mmx_pmulhrwv4hi3, sse2_umulsidi3,
mmx_umaxv8qi3, mmx_smaxv4hi3, mmx_uminv8qi3, mmx_sminv4hi3): Mark
commutative; use ix86_binary_operator_ok.
(mmx_add<MMXMODEI>3, mmx_ssadd<MMXMODE12>3, mmx_usadd<MMXMODE12>3,
mmx_sub<MMXMODEI>3, mmx_sssub<MMXMODE12>3, mmx_ussub<MMXMODE12>3
mmx_ashr<MMXMODE24>3, mmx_lshr<MMXMODE23>3, mmx_ashl<MMXMODE24>3
mmx_eq<MMXMODEI>3, mmx_gt<MMXMODEI>3, mmx_and<MMXMODEI>3,
mmx_nand<MMXMODEI>3, mmx_ior<MMXMODEI>3, mmx_xor<MMXMODEI>3):
Macroize from existing patterns; use ix86_binary_operator_ok.
(mmx_packsswb, mmx_packssdw, mmx_packuswb): Add memory alternative.
(mmx_punpckhbw, mmx_punpcklbw, mmx_punpckhwd, mmx_punpcklwd,
mmx_punpckhdq, mmx_punpckhdq, mmx_punpckldq): Likewise. Model
with vec_select+vec_concat.
(mmx_pshufw, mmx_pshufw_1): Likewise.
(mmx_uavgv8qi3): Merge pavgusb. Model correcty.
(mmx_uavgv4hi3): Model correctly.
* config/i386/mmintrin.h (_mm_and_si64, _mm_andnot_si64, _mm_or_si64,
_mm_xor_si64): Remove casts.
From-SVN: r93107
2005-01-09 12:23:25 +01:00
|
|
|
return __builtin_ia32_pand (__m1, __m2);
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_pand (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_and_si64 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the
|
|
|
|
64-bit value in M2. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_andnot_si64 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
i386.c (bdesc_2arg): Update names for mmx_ prefixes.
* config/i386/i386.c (bdesc_2arg): Update names for mmx_ prefixes.
(ix86_expand_builtin): Likewise. Frob MASKMOVQ wrt the input mem
just like MASKMOVDQU. Return plain zero for MMX_ZERO.
* config/i386/i386.md (MMXMODEI, mov<MMXMODEI>,
mov<MMXMODEI>_internal_rex64, mov<MMXMODEI>_internal, movv2sf,
movv2sf_internal_rex64, movv2sf_internal, MMXMODE,
movmisalign<MMXMODE>, mmx_pmovmskb, mmx_maskmovq, mmx_maskmovq_rex,
sse_movntdi, addv8qi3, addv4hi3, addv2si3, mmx_adddi3, ssaddv8qi3,
ssaddv4hi3, usaddv8qi3, usaddv4hi3, subv8qi3, subv4hi3, subv2si3,
mmx_subdi3, sssubv8qi3, sssubv4hi3, ussubv8qi3, ussubv4hi3,
mulv4hi3, smulv4hi3_highpart, umulv4hi3_highpart, mmx_pmaddwd,
sse2_umulsidi3, mmx_iordi3, mmx_xordi3, mmx_anddi3, mmx_nanddi3,
mmx_uavgv8qi3, mmx_uavgv4hi3, mmx_psadbw, mmx_pinsrw, mmx_pinsrw,
mmx_pextrw, mmx_pshufw, eqv8qi3, eqv4hi3, eqv2si3, gtv8qi3, gtv4hi3,
gtv2si3, umaxv8qi3, smaxv4hi3, uminv8qi3, sminv4hi3, ashrv4hi3,
ashrv2si3, lshrv4hi3, lshrv2si3, mmx_lshrdi3, ashlv4hi3, ashlv2si3,
mmx_ashldi3, mmx_packsswb, mmx_packssdw, mmx_packuswb, mmx_punpckhbw,
mmx_punpckhwd, mmx_punpckhdq, mmx_punpcklbw, mmx_punpcklwd,
mmx_punpckldq, emms, addv2sf3, subv2sf3, subrv2sf3, gtv2sf3, gev2sf3,
eqv2sf3, pfmaxv2sf3, pfminv2sf3, mulv2sf3, femms, pf2id, pf2iw,
pfacc, pfnacc, pfpnacc, pi2fw, floatv2si2, pfrcpv2sf2, pfrcpit1v2sf3,
pfrcpit2v2sf3, pfrsqrtv2sf2, pfrsqit1v2sf3, pmulhrwv4hi3, pswapdv2si2,
pswapdv2sf2): Move to mmx.md; rename as necessary with leading
mmx_ prefix.
(mmx_clrdi, pavgusb): Remove.
(ldmxcsr, stmxcsr, sfence, sfence_insn): Move to sse.md; rename
with leading sse_ prefix.
* config/i386/sse.md: Receive them.
* config/i386/mmx.md: New file.
(MMXMODE12, MMXMODE24, mmxvecsize): New.
(subrv2sf3): Turn into expander for normal subtraction.
(mmx_addv2sf3, mmx_mulv2sf3, mmx_smaxv2sf3, mmx_sminv2sf3,
mmx_eqv2sf3, mmx_mulv4hi3, mmx_smulv4hi3_highpart,
mmx_umulv4hi3_highpart, mmx_pmaddwd, mmx_pmulhrwv4hi3, sse2_umulsidi3,
mmx_umaxv8qi3, mmx_smaxv4hi3, mmx_uminv8qi3, mmx_sminv4hi3): Mark
commutative; use ix86_binary_operator_ok.
(mmx_add<MMXMODEI>3, mmx_ssadd<MMXMODE12>3, mmx_usadd<MMXMODE12>3,
mmx_sub<MMXMODEI>3, mmx_sssub<MMXMODE12>3, mmx_ussub<MMXMODE12>3
mmx_ashr<MMXMODE24>3, mmx_lshr<MMXMODE23>3, mmx_ashl<MMXMODE24>3
mmx_eq<MMXMODEI>3, mmx_gt<MMXMODEI>3, mmx_and<MMXMODEI>3,
mmx_nand<MMXMODEI>3, mmx_ior<MMXMODEI>3, mmx_xor<MMXMODEI>3):
Macroize from existing patterns; use ix86_binary_operator_ok.
(mmx_packsswb, mmx_packssdw, mmx_packuswb): Add memory alternative.
(mmx_punpckhbw, mmx_punpcklbw, mmx_punpckhwd, mmx_punpcklwd,
mmx_punpckhdq, mmx_punpckhdq, mmx_punpckldq): Likewise. Model
with vec_select+vec_concat.
(mmx_pshufw, mmx_pshufw_1): Likewise.
(mmx_uavgv8qi3): Merge pavgusb. Model correcty.
(mmx_uavgv4hi3): Model correctly.
* config/i386/mmintrin.h (_mm_and_si64, _mm_andnot_si64, _mm_or_si64,
_mm_xor_si64): Remove casts.
From-SVN: r93107
2005-01-09 12:23:25 +01:00
|
|
|
return __builtin_ia32_pandn (__m1, __m2);
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_pandn (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_andnot_si64 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_or_si64 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
i386.c (bdesc_2arg): Update names for mmx_ prefixes.
* config/i386/i386.c (bdesc_2arg): Update names for mmx_ prefixes.
(ix86_expand_builtin): Likewise. Frob MASKMOVQ wrt the input mem
just like MASKMOVDQU. Return plain zero for MMX_ZERO.
* config/i386/i386.md (MMXMODEI, mov<MMXMODEI>,
mov<MMXMODEI>_internal_rex64, mov<MMXMODEI>_internal, movv2sf,
movv2sf_internal_rex64, movv2sf_internal, MMXMODE,
movmisalign<MMXMODE>, mmx_pmovmskb, mmx_maskmovq, mmx_maskmovq_rex,
sse_movntdi, addv8qi3, addv4hi3, addv2si3, mmx_adddi3, ssaddv8qi3,
ssaddv4hi3, usaddv8qi3, usaddv4hi3, subv8qi3, subv4hi3, subv2si3,
mmx_subdi3, sssubv8qi3, sssubv4hi3, ussubv8qi3, ussubv4hi3,
mulv4hi3, smulv4hi3_highpart, umulv4hi3_highpart, mmx_pmaddwd,
sse2_umulsidi3, mmx_iordi3, mmx_xordi3, mmx_anddi3, mmx_nanddi3,
mmx_uavgv8qi3, mmx_uavgv4hi3, mmx_psadbw, mmx_pinsrw, mmx_pinsrw,
mmx_pextrw, mmx_pshufw, eqv8qi3, eqv4hi3, eqv2si3, gtv8qi3, gtv4hi3,
gtv2si3, umaxv8qi3, smaxv4hi3, uminv8qi3, sminv4hi3, ashrv4hi3,
ashrv2si3, lshrv4hi3, lshrv2si3, mmx_lshrdi3, ashlv4hi3, ashlv2si3,
mmx_ashldi3, mmx_packsswb, mmx_packssdw, mmx_packuswb, mmx_punpckhbw,
mmx_punpckhwd, mmx_punpckhdq, mmx_punpcklbw, mmx_punpcklwd,
mmx_punpckldq, emms, addv2sf3, subv2sf3, subrv2sf3, gtv2sf3, gev2sf3,
eqv2sf3, pfmaxv2sf3, pfminv2sf3, mulv2sf3, femms, pf2id, pf2iw,
pfacc, pfnacc, pfpnacc, pi2fw, floatv2si2, pfrcpv2sf2, pfrcpit1v2sf3,
pfrcpit2v2sf3, pfrsqrtv2sf2, pfrsqit1v2sf3, pmulhrwv4hi3, pswapdv2si2,
pswapdv2sf2): Move to mmx.md; rename as necessary with leading
mmx_ prefix.
(mmx_clrdi, pavgusb): Remove.
(ldmxcsr, stmxcsr, sfence, sfence_insn): Move to sse.md; rename
with leading sse_ prefix.
* config/i386/sse.md: Receive them.
* config/i386/mmx.md: New file.
(MMXMODE12, MMXMODE24, mmxvecsize): New.
(subrv2sf3): Turn into expander for normal subtraction.
(mmx_addv2sf3, mmx_mulv2sf3, mmx_smaxv2sf3, mmx_sminv2sf3,
mmx_eqv2sf3, mmx_mulv4hi3, mmx_smulv4hi3_highpart,
mmx_umulv4hi3_highpart, mmx_pmaddwd, mmx_pmulhrwv4hi3, sse2_umulsidi3,
mmx_umaxv8qi3, mmx_smaxv4hi3, mmx_uminv8qi3, mmx_sminv4hi3): Mark
commutative; use ix86_binary_operator_ok.
(mmx_add<MMXMODEI>3, mmx_ssadd<MMXMODE12>3, mmx_usadd<MMXMODE12>3,
mmx_sub<MMXMODEI>3, mmx_sssub<MMXMODE12>3, mmx_ussub<MMXMODE12>3
mmx_ashr<MMXMODE24>3, mmx_lshr<MMXMODE23>3, mmx_ashl<MMXMODE24>3
mmx_eq<MMXMODEI>3, mmx_gt<MMXMODEI>3, mmx_and<MMXMODEI>3,
mmx_nand<MMXMODEI>3, mmx_ior<MMXMODEI>3, mmx_xor<MMXMODEI>3):
Macroize from existing patterns; use ix86_binary_operator_ok.
(mmx_packsswb, mmx_packssdw, mmx_packuswb): Add memory alternative.
(mmx_punpckhbw, mmx_punpcklbw, mmx_punpckhwd, mmx_punpcklwd,
mmx_punpckhdq, mmx_punpckhdq, mmx_punpckldq): Likewise. Model
with vec_select+vec_concat.
(mmx_pshufw, mmx_pshufw_1): Likewise.
(mmx_uavgv8qi3): Merge pavgusb. Model correcty.
(mmx_uavgv4hi3): Model correctly.
* config/i386/mmintrin.h (_mm_and_si64, _mm_andnot_si64, _mm_or_si64,
_mm_xor_si64): Remove casts.
From-SVN: r93107
2005-01-09 12:23:25 +01:00
|
|
|
return __builtin_ia32_por (__m1, __m2);
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_por (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_or_si64 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_xor_si64 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
i386.c (bdesc_2arg): Update names for mmx_ prefixes.
* config/i386/i386.c (bdesc_2arg): Update names for mmx_ prefixes.
(ix86_expand_builtin): Likewise. Frob MASKMOVQ wrt the input mem
just like MASKMOVDQU. Return plain zero for MMX_ZERO.
* config/i386/i386.md (MMXMODEI, mov<MMXMODEI>,
mov<MMXMODEI>_internal_rex64, mov<MMXMODEI>_internal, movv2sf,
movv2sf_internal_rex64, movv2sf_internal, MMXMODE,
movmisalign<MMXMODE>, mmx_pmovmskb, mmx_maskmovq, mmx_maskmovq_rex,
sse_movntdi, addv8qi3, addv4hi3, addv2si3, mmx_adddi3, ssaddv8qi3,
ssaddv4hi3, usaddv8qi3, usaddv4hi3, subv8qi3, subv4hi3, subv2si3,
mmx_subdi3, sssubv8qi3, sssubv4hi3, ussubv8qi3, ussubv4hi3,
mulv4hi3, smulv4hi3_highpart, umulv4hi3_highpart, mmx_pmaddwd,
sse2_umulsidi3, mmx_iordi3, mmx_xordi3, mmx_anddi3, mmx_nanddi3,
mmx_uavgv8qi3, mmx_uavgv4hi3, mmx_psadbw, mmx_pinsrw, mmx_pinsrw,
mmx_pextrw, mmx_pshufw, eqv8qi3, eqv4hi3, eqv2si3, gtv8qi3, gtv4hi3,
gtv2si3, umaxv8qi3, smaxv4hi3, uminv8qi3, sminv4hi3, ashrv4hi3,
ashrv2si3, lshrv4hi3, lshrv2si3, mmx_lshrdi3, ashlv4hi3, ashlv2si3,
mmx_ashldi3, mmx_packsswb, mmx_packssdw, mmx_packuswb, mmx_punpckhbw,
mmx_punpckhwd, mmx_punpckhdq, mmx_punpcklbw, mmx_punpcklwd,
mmx_punpckldq, emms, addv2sf3, subv2sf3, subrv2sf3, gtv2sf3, gev2sf3,
eqv2sf3, pfmaxv2sf3, pfminv2sf3, mulv2sf3, femms, pf2id, pf2iw,
pfacc, pfnacc, pfpnacc, pi2fw, floatv2si2, pfrcpv2sf2, pfrcpit1v2sf3,
pfrcpit2v2sf3, pfrsqrtv2sf2, pfrsqit1v2sf3, pmulhrwv4hi3, pswapdv2si2,
pswapdv2sf2): Move to mmx.md; rename as necessary with leading
mmx_ prefix.
(mmx_clrdi, pavgusb): Remove.
(ldmxcsr, stmxcsr, sfence, sfence_insn): Move to sse.md; rename
with leading sse_ prefix.
* config/i386/sse.md: Receive them.
* config/i386/mmx.md: New file.
(MMXMODE12, MMXMODE24, mmxvecsize): New.
(subrv2sf3): Turn into expander for normal subtraction.
(mmx_addv2sf3, mmx_mulv2sf3, mmx_smaxv2sf3, mmx_sminv2sf3,
mmx_eqv2sf3, mmx_mulv4hi3, mmx_smulv4hi3_highpart,
mmx_umulv4hi3_highpart, mmx_pmaddwd, mmx_pmulhrwv4hi3, sse2_umulsidi3,
mmx_umaxv8qi3, mmx_smaxv4hi3, mmx_uminv8qi3, mmx_sminv4hi3): Mark
commutative; use ix86_binary_operator_ok.
(mmx_add<MMXMODEI>3, mmx_ssadd<MMXMODE12>3, mmx_usadd<MMXMODE12>3,
mmx_sub<MMXMODEI>3, mmx_sssub<MMXMODE12>3, mmx_ussub<MMXMODE12>3
mmx_ashr<MMXMODE24>3, mmx_lshr<MMXMODE23>3, mmx_ashl<MMXMODE24>3
mmx_eq<MMXMODEI>3, mmx_gt<MMXMODEI>3, mmx_and<MMXMODEI>3,
mmx_nand<MMXMODEI>3, mmx_ior<MMXMODEI>3, mmx_xor<MMXMODEI>3):
Macroize from existing patterns; use ix86_binary_operator_ok.
(mmx_packsswb, mmx_packssdw, mmx_packuswb): Add memory alternative.
(mmx_punpckhbw, mmx_punpcklbw, mmx_punpckhwd, mmx_punpcklwd,
mmx_punpckhdq, mmx_punpckhdq, mmx_punpckldq): Likewise. Model
with vec_select+vec_concat.
(mmx_pshufw, mmx_pshufw_1): Likewise.
(mmx_uavgv8qi3): Merge pavgusb. Model correcty.
(mmx_uavgv4hi3): Model correctly.
* config/i386/mmintrin.h (_mm_and_si64, _mm_andnot_si64, _mm_or_si64,
_mm_xor_si64): Remove casts.
From-SVN: r93107
2005-01-09 12:23:25 +01:00
|
|
|
return __builtin_ia32_pxor (__m1, __m2);
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_pxor (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_xor_si64 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Compare eight 8-bit values. The result of the comparison is 0xFF if the
|
|
|
|
test is true and zero if false. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_pcmpeqb ((__v8qi)__m1, (__v8qi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_pcmpeqb (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_cmpeq_pi8 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
static __inline __m64
|
|
|
|
_mm_cmpgt_pi8 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_pcmpgtb ((__v8qi)__m1, (__v8qi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_pcmpgtb (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_cmpgt_pi8 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Compare four 16-bit values. The result of the comparison is 0xFFFF if
|
|
|
|
the test is true and zero if false. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_cmpeq_pi16 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_pcmpeqw ((__v4hi)__m1, (__v4hi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_pcmpeqw (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_cmpeq_pi16 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
static __inline __m64
|
|
|
|
_mm_cmpgt_pi16 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_pcmpgtw ((__v4hi)__m1, (__v4hi)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_pcmpgtw (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_cmpgt_pi16 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if
|
|
|
|
the test is true and zero if false. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_pcmpeqd ((__v2si)__m1, (__v2si)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_pcmpeqd (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_cmpeq_pi32 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
static __inline __m64
|
|
|
|
_mm_cmpgt_pi32 (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return (__m64) __builtin_ia32_pcmpgtd ((__v2si)__m1, (__v2si)__m2);
|
|
|
|
}
|
|
|
|
|
2003-06-06 16:06:41 +02:00
|
|
|
static __inline __m64
|
|
|
|
_m_pcmpgtd (__m64 __m1, __m64 __m2)
|
|
|
|
{
|
|
|
|
return _mm_cmpgt_pi32 (__m1, __m2);
|
|
|
|
}
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
/* Creates a 64-bit zero. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_setzero_si64 (void)
|
|
|
|
{
|
re PR target/7693 (Typo in i386 mmintrin.h header)
* mmintrin.h (__m64): typedef it to v2si.
(_mm_cvtsi32_si64, _mm_cvtsi32_si64_mm_sll_pi16,
_mm_sll_pi32, _mm_sll_pi64, _mm_slli_pi64, _mm_sra_pi16,
_mm_sra_pi32, _mm_srl_pi16, _mm_srl_pi32, _mm_srl_pi64,
_mm_srli_pi64, _mm_and_si64, _mm_andnot_si64,
_mm_or_si64, _mm_xor_si64): Add neccesary casts.
* xmmintrin.h (_mm_setzero_si64): Likewise.
* i386.h (ALIGN_MODE_128): Update comment; add missing modes
(SSE_REG_MODE_P, MMX_REG_MODE_P): New macros.
PR target/7693
Patch by Shawn Wagner
* mmintrin.h: Replace pi64 by si64.
From-SVN: r58306
2002-10-19 10:48:37 +02:00
|
|
|
return (__m64)__builtin_ia32_mmx_zero ();
|
2002-01-12 08:38:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Creates a vector of two 32-bit values; I0 is least significant. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_set_pi32 (int __i1, int __i0)
|
|
|
|
{
|
|
|
|
union {
|
|
|
|
__m64 __q;
|
|
|
|
struct {
|
|
|
|
unsigned int __i0;
|
|
|
|
unsigned int __i1;
|
|
|
|
} __s;
|
|
|
|
} __u;
|
|
|
|
|
|
|
|
__u.__s.__i0 = __i0;
|
|
|
|
__u.__s.__i1 = __i1;
|
|
|
|
|
|
|
|
return __u.__q;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Creates a vector of four 16-bit values; W0 is least significant. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0)
|
|
|
|
{
|
|
|
|
unsigned int __i1 = (unsigned short)__w3 << 16 | (unsigned short)__w2;
|
|
|
|
unsigned int __i0 = (unsigned short)__w1 << 16 | (unsigned short)__w0;
|
|
|
|
return _mm_set_pi32 (__i1, __i0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Creates a vector of eight 8-bit values; B0 is least significant. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_set_pi8 (char __b7, char __b6, char __b5, char __b4,
|
|
|
|
char __b3, char __b2, char __b1, char __b0)
|
|
|
|
{
|
|
|
|
unsigned int __i1, __i0;
|
|
|
|
|
|
|
|
__i1 = (unsigned char)__b7;
|
|
|
|
__i1 = __i1 << 8 | (unsigned char)__b6;
|
|
|
|
__i1 = __i1 << 8 | (unsigned char)__b5;
|
|
|
|
__i1 = __i1 << 8 | (unsigned char)__b4;
|
|
|
|
|
|
|
|
__i0 = (unsigned char)__b3;
|
|
|
|
__i0 = __i0 << 8 | (unsigned char)__b2;
|
|
|
|
__i0 = __i0 << 8 | (unsigned char)__b1;
|
|
|
|
__i0 = __i0 << 8 | (unsigned char)__b0;
|
|
|
|
|
|
|
|
return _mm_set_pi32 (__i1, __i0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Similar, but with the arguments in reverse order. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_setr_pi32 (int __i0, int __i1)
|
|
|
|
{
|
|
|
|
return _mm_set_pi32 (__i1, __i0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static __inline __m64
|
|
|
|
_mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3)
|
|
|
|
{
|
|
|
|
return _mm_set_pi16 (__w3, __w2, __w1, __w0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static __inline __m64
|
|
|
|
_mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3,
|
|
|
|
char __b4, char __b5, char __b6, char __b7)
|
|
|
|
{
|
|
|
|
return _mm_set_pi8 (__b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Creates a vector of two 32-bit values, both elements containing I. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_set1_pi32 (int __i)
|
|
|
|
{
|
|
|
|
return _mm_set_pi32 (__i, __i);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Creates a vector of four 16-bit values, all elements containing W. */
|
|
|
|
static __inline __m64
|
|
|
|
_mm_set1_pi16 (short __w)
|
|
|
|
{
|
|
|
|
unsigned int __i = (unsigned short)__w << 16 | (unsigned short)__w;
|
|
|
|
return _mm_set1_pi32 (__i);
|
|
|
|
}
|
|
|
|
|
2003-10-26 17:18:31 +01:00
|
|
|
/* Creates a vector of eight 8-bit values, all elements containing B. */
|
2002-01-12 08:38:50 +01:00
|
|
|
static __inline __m64
|
|
|
|
_mm_set1_pi8 (char __b)
|
|
|
|
{
|
|
|
|
unsigned int __w = (unsigned char)__b << 8 | (unsigned char)__b;
|
|
|
|
unsigned int __i = __w << 16 | __w;
|
|
|
|
return _mm_set1_pi32 (__i);
|
|
|
|
}
|
|
|
|
|
2002-10-17 19:09:17 +02:00
|
|
|
#endif /* __MMX__ */
|
2002-01-12 08:38:50 +01:00
|
|
|
#endif /* _MMINTRIN_H_INCLUDED */
|