]> gcc.gnu.org Git - gcc.git/commitdiff
i386-1.C: Include i386-cpuid.h.
authorUros Bizjak <uros@kss-loka.si>
Tue, 25 Oct 2005 13:01:12 +0000 (15:01 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Tue, 25 Oct 2005 13:01:12 +0000 (15:01 +0200)
* g++.dg/other/i386-1.C: Include i386-cpuid.h.  Pass if
CPU has no SSE support.

From-SVN: r105885

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/i386-1.C

index e3adbc4b3853a936af8dcf4dd2ad505c1cdee2bf..53cddc0bbc2516aab8054e38bc0f1b3212dbdc59 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-25  Uros Bizjak  <uros@kss-loka.si>
+
+       * g++.dg/other/i386-1.C: Include i386-cpuid.h.  Pass if
+       CPU has no SSE support.
+
 2005-10-24  Jerry DeLisle  <jvdelisle@verizon.net>
 
         PR libgfortran/24224
index 48371978a9884376398c400a2b56d6718847c699..c579cf2f8c6efaa744e78ed51214386573d516ed 100644 (file)
@@ -3,13 +3,23 @@
 
 #include <xmmintrin.h>
 #include <stdio.h>
+#include "../../gcc.dg/i386-cpuid.h"
 
 int main(int argc, char** argv) {
   float a = 1.0f;
   float b = 2.0f;
   float c = 3.0f;
   float r;
-  
+
+  unsigned long cpu_facilities;
+
+  cpu_facilities = i386_cpuid ();
+
+  if ((cpu_facilities & (bit_MMX | bit_SSE | bit_CMOV))
+      != (bit_MMX | bit_SSE | bit_CMOV))
+    /* If host has no vector support, pass.  */
+    return 0;
+
   __m128 v = _mm_set_ps(a, b, c, 0);
   
   v = (__m128)_mm_srli_si128((__m128i)v, 4);
This page took 0.093134 seconds and 5 git commands to generate.