aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorUros Bizjak <uros@kss-loka.si>2005-10-25 15:01:12 +0200
committerUros Bizjak <uros@gcc.gnu.org>2005-10-25 15:01:12 +0200
commita22056479c1ec82073209cb070e310f3bddc7a59 (patch)
treece897d7c1e6a098b28782791fdeb1e49a2f3b12a /gcc
parente4b600fb239763b1da37a00cd42032415ff95c2a (diff)
downloadgcc-a22056479c1ec82073209cb070e310f3bddc7a59.zip
gcc-a22056479c1ec82073209cb070e310f3bddc7a59.tar.gz
gcc-a22056479c1ec82073209cb070e310f3bddc7a59.tar.bz2
i386-1.C: Include i386-cpuid.h.
* g++.dg/other/i386-1.C: Include i386-cpuid.h. Pass if CPU has no SSE support. From-SVN: r105885
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/other/i386-1.C12
2 files changed, 16 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e3adbc4..53cddc0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/g++.dg/other/i386-1.C b/gcc/testsuite/g++.dg/other/i386-1.C
index 4837197..c579cf2 100644
--- a/gcc/testsuite/g++.dg/other/i386-1.C
+++ b/gcc/testsuite/g++.dg/other/i386-1.C
@@ -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);