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]

fix some x86 sse/mmx tests


This is fallout from Jan Beulich's 2005-12-06 patch.  Disabling
the inlines when the insn isn't available prevents the tests 
from testing the insns.


r~


        * config/i386/mmintrin.h (_mm_add_si64): Only define for SSE2.
        (_mm_sub_si64): Likewise.
        * config/i386/xmmintrin.h (_mm_shuffle_pi16, _m_pshufw): Likewise.

        * gcc.target/i386/sse-7.c: Use -msse2.

Index: gcc/config/i386/mmintrin.h
===================================================================
--- gcc/config/i386/mmintrin.h	(revision 108963)
+++ gcc/config/i386/mmintrin.h	(working copy)
@@ -274,11 +274,13 @@ _m_paddd (__m64 __m1, __m64 __m2)
 }
 
 /* Add the 64-bit values in M1 to the 64-bit values in M2.  */
+#ifdef __SSE2__
 static __inline __m64 __attribute__((__always_inline__))
 _mm_add_si64 (__m64 __m1, __m64 __m2)
 {
   return (__m64) __builtin_ia32_paddq ((long long)__m1, (long long)__m2);
 }
+#endif
 
 /* Add the 8-bit values in M1 to the 8-bit values in M2 using signed
    saturated arithmetic.  */
@@ -376,11 +378,13 @@ _m_psubd (__m64 __m1, __m64 __m2)
 }
 
 /* Add the 64-bit values in M1 to the 64-bit values in M2.  */
+#ifdef __SSE2__
 static __inline __m64 __attribute__((__always_inline__))
 _mm_sub_si64 (__m64 __m1, __m64 __m2)
 {
   return (__m64) __builtin_ia32_psubq ((long long)__m1, (long long)__m2);
 }
+#endif
 
 /* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed
    saturating arithmetic.  */
Index: gcc/config/i386/xmmintrin.h
===================================================================
--- gcc/config/i386/xmmintrin.h	(revision 108963)
+++ gcc/config/i386/xmmintrin.h	(working copy)
@@ -1075,6 +1075,7 @@ _m_pmulhuw (__m64 __A, __m64 __B)
 
 /* Return a combination of the four 16-bit values in A.  The selector
    must be an immediate.  */
+#ifdef __SSE2__
 #if 0
 static __inline __m64 __attribute__((__always_inline__))
 _mm_shuffle_pi16 (__m64 __A, int __N)
@@ -1092,6 +1093,7 @@ _m_pshufw (__m64 __A, int __N)
   ((__m64) __builtin_ia32_pshufw ((__v4hi)(A), (N)))
 #define _m_pshufw(A, N)		_mm_shuffle_pi16 ((A), (N))
 #endif
+#endif
 
 /* Conditionally store byte elements of A into P.  The high bit of each
    byte in the selector N determines whether the corresponding byte from
Index: gcc/testsuite/gcc.target/i386/sse-7.c
===================================================================
--- gcc/testsuite/gcc.target/i386/sse-7.c	(revision 108963)
+++ gcc/testsuite/gcc.target/i386/sse-7.c	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O2 -msse" } */
+/* { dg-options "-O2 -msse2" } */
 #include <xmmintrin.h>
 #include <stdio.h>
 #include <stdlib.h>


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