This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

SSE fix 9 - MMX _m64 type


Hi,
this makes __mm64 type vector that is required to get argument passing
convention right for both i386 and x86-64.
We've discussed the change earlier, so hope it is safe even when bit
intrusive.

Honza

Fri Oct 18 01:58:36 CEST 2002  Jan Hubicka  <jh@suse.cz>
	* 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.
	
*** /p1/dfa/egcs/gcc/config/i386/mmintrin.h	Fri Feb 15 21:33:04 2002
--- mmintrin.h	Fri Oct 18 01:54:59 2002
***************
*** 31,37 ****
  #define _MMINTRIN_H_INCLUDED
  
  /* The data type intended for user use.  */
! typedef unsigned long long __m64;
  
  /* Internal data types for implementing the intrinsics.  */
  typedef int __v2si __attribute__ ((__mode__ (__V2SI__)));
--- 31,37 ----
  #define _MMINTRIN_H_INCLUDED
  
  /* The data type intended for user use.  */
! typedef int __m64 __attribute__ ((__mode__ (__V2SI__)));
  
  /* Internal data types for implementing the intrinsics.  */
  typedef int __v2si __attribute__ ((__mode__ (__V2SI__)));
*************** _mm_empty (void)
*** 49,62 ****
  static __inline __m64 
  _mm_cvtsi32_si64 (int __i)
  {
!   return (unsigned int) __i;
  }
  
  /* Convert the lower 32 bits of the __m64 object into an integer.  */
  static __inline int
  _mm_cvtsi64_si32 (__m64 __i)
  {
!   return __i;
  }
  
  /* Pack the four 16-bit values from M1 into the lower four 8-bit values of
--- 49,64 ----
  static __inline __m64 
  _mm_cvtsi32_si64 (int __i)
  {
!   long long __tmp = (unsigned int)__i;
!   return (__m64) __tmp;
  }
  
  /* Convert the lower 32 bits of the __m64 object into an integer.  */
  static __inline int
  _mm_cvtsi64_si32 (__m64 __i)
  {
!   long long __tmp = (long long)__i;
!   return __tmp;
  }
  
  /* Pack the four 16-bit values from M1 into the lower four 8-bit values of
*************** _mm_mullo_pi16 (__m64 __m1, __m64 __m2)
*** 269,275 ****
  static __inline __m64
  _mm_sll_pi16 (__m64 __m, __m64 __count)
  {
!   return (__m64) __builtin_ia32_psllw ((__v4hi)__m, __count);
  }
  
  static __inline __m64
--- 271,277 ----
  static __inline __m64
  _mm_sll_pi16 (__m64 __m, __m64 __count)
  {
!   return (__m64) __builtin_ia32_psllw ((__v4hi)__m, (long long)__count);
  }
  
  static __inline __m64
*************** _mm_slli_pi16 (__m64 __m, int __count)
*** 282,288 ****
  static __inline __m64
  _mm_sll_pi32 (__m64 __m, __m64 __count)
  {
!   return (__m64) __builtin_ia32_pslld ((__v2si)__m, __count);
  }
  
  static __inline __m64
--- 284,290 ----
  static __inline __m64
  _mm_sll_pi32 (__m64 __m, __m64 __count)
  {
!   return (__m64) __builtin_ia32_pslld ((__v2si)__m, (long long)__count);
  }
  
  static __inline __m64
*************** _mm_slli_pi32 (__m64 __m, int __count)
*** 295,314 ****
  static __inline __m64
  _mm_sll_pi64 (__m64 __m, __m64 __count)
  {
!   return (__m64) __builtin_ia32_psllq (__m, __count);
  }
  
  static __inline __m64
  _mm_slli_pi64 (__m64 __m, int __count)
  {
!   return (__m64) __builtin_ia32_psllq (__m, __count);
  }
  
  /* 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)
  {
!   return (__m64) __builtin_ia32_psraw ((__v4hi)__m, __count);
  }
  
  static __inline __m64
--- 297,316 ----
  static __inline __m64
  _mm_sll_pi64 (__m64 __m, __m64 __count)
  {
!   return (__m64) __builtin_ia32_psllq ((long long)__m, (long long)__count);
  }
  
  static __inline __m64
  _mm_slli_pi64 (__m64 __m, int __count)
  {
!   return (__m64) __builtin_ia32_psllq ((long long)__m, (long long)__count);
  }
  
  /* 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)
  {
!   return (__m64) __builtin_ia32_psraw ((__v4hi)__m, (long long)__count);
  }
  
  static __inline __m64
*************** _mm_srai_pi16 (__m64 __m, int __count)
*** 321,327 ****
  static __inline __m64
  _mm_sra_pi32 (__m64 __m, __m64 __count)
  {
!   return (__m64) __builtin_ia32_psrad ((__v2si)__m, __count);
  }
  
  static __inline __m64
--- 323,329 ----
  static __inline __m64
  _mm_sra_pi32 (__m64 __m, __m64 __count)
  {
!   return (__m64) __builtin_ia32_psrad ((__v2si)__m, (long long)__count);
  }
  
  static __inline __m64
*************** _mm_srai_pi32 (__m64 __m, int __count)
*** 334,340 ****
  static __inline __m64
  _mm_srl_pi16 (__m64 __m, __m64 __count)
  {
!   return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, __count);
  }
  
  static __inline __m64
--- 336,342 ----
  static __inline __m64
  _mm_srl_pi16 (__m64 __m, __m64 __count)
  {
!   return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, (long long)__count);
  }
  
  static __inline __m64
*************** _mm_srli_pi16 (__m64 __m, int __count)
*** 347,353 ****
  static __inline __m64
  _mm_srl_pi32 (__m64 __m, __m64 __count)
  {
!   return (__m64) __builtin_ia32_psrld ((__v2si)__m, __count);
  }
  
  static __inline __m64
--- 349,355 ----
  static __inline __m64
  _mm_srl_pi32 (__m64 __m, __m64 __count)
  {
!   return (__m64) __builtin_ia32_psrld ((__v2si)__m, (long long)__count);
  }
  
  static __inline __m64
*************** _mm_srli_pi32 (__m64 __m, int __count)
*** 360,379 ****
  static __inline __m64
  _mm_srl_pi64 (__m64 __m, __m64 __count)
  {
!   return (__m64) __builtin_ia32_psrlq (__m, __count);
  }
  
  static __inline __m64
  _mm_srli_pi64 (__m64 __m, int __count)
  {
!   return (__m64) __builtin_ia32_psrlq (__m, __count);
  }
  
  /* Bit-wise AND the 64-bit values in M1 and M2.  */
  static __inline __m64
  _mm_and_si64 (__m64 __m1, __m64 __m2)
  {
!   return __builtin_ia32_pand (__m1, __m2);
  }
  
  /* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the
--- 362,381 ----
  static __inline __m64
  _mm_srl_pi64 (__m64 __m, __m64 __count)
  {
!   return (__m64) __builtin_ia32_psrlq ((long long)__m, (long long)__count);
  }
  
  static __inline __m64
  _mm_srli_pi64 (__m64 __m, int __count)
  {
!   return (__m64) __builtin_ia32_psrlq ((long long)__m, (long long)__count);
  }
  
  /* Bit-wise AND the 64-bit values in M1 and M2.  */
  static __inline __m64
  _mm_and_si64 (__m64 __m1, __m64 __m2)
  {
!   return (__m64) __builtin_ia32_pand ((long long)__m1, (long long)__m2);
  }
  
  /* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the
*************** _mm_and_si64 (__m64 __m1, __m64 __m2)
*** 381,401 ****
  static __inline __m64
  _mm_andnot_si64 (__m64 __m1, __m64 __m2)
  {
!   return __builtin_ia32_pandn (__m1, __m2);
  }
  
  /* Bit-wise inclusive OR the 64-bit values in M1 and M2.  */
  static __inline __m64
  _mm_or_si64 (__m64 __m1, __m64 __m2)
  {
!   return __builtin_ia32_por (__m1, __m2);
  }
  
  /* Bit-wise exclusive OR the 64-bit values in M1 and M2.  */
  static __inline __m64
  _mm_xor_si64 (__m64 __m1, __m64 __m2)
  {
!   return __builtin_ia32_pxor (__m1, __m2);
  }
  
  /* Compare eight 8-bit values.  The result of the comparison is 0xFF if the
--- 383,403 ----
  static __inline __m64
  _mm_andnot_si64 (__m64 __m1, __m64 __m2)
  {
!   return (__m64) __builtin_ia32_pandn ((long long)__m1, (long long)__m2);
  }
  
  /* Bit-wise inclusive OR the 64-bit values in M1 and M2.  */
  static __inline __m64
  _mm_or_si64 (__m64 __m1, __m64 __m2)
  {
!   return (__m64)__builtin_ia32_por ((long long)__m1, (long long)__m2);
  }
  
  /* Bit-wise exclusive OR the 64-bit values in M1 and M2.  */
  static __inline __m64
  _mm_xor_si64 (__m64 __m1, __m64 __m2)
  {
!   return (__m64)__builtin_ia32_pxor ((long long)__m1, (long long)__m2);
  }
  
  /* Compare eight 8-bit values.  The result of the comparison is 0xFF if the
*************** _mm_cmpgt_pi32 (__m64 __m1, __m64 __m2)
*** 444,450 ****
  static __inline __m64
  _mm_setzero_si64 (void)
  {
!   return __builtin_ia32_mmx_zero ();
  }
  
  /* Creates a vector of two 32-bit values; I0 is least significant.  */
--- 446,452 ----
  static __inline __m64
  _mm_setzero_si64 (void)
  {
!   return (__m64)__builtin_ia32_mmx_zero ();
  }
  
  /* Creates a vector of two 32-bit values; I0 is least significant.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]