Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.dg / other / i386-1.C
blob8f03a33f2087141e82e8e40af93f6115fc446f05
1 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
2 /* { dg-options "-march=pentium4" } */
3 /* { dg-require-effective-target ilp32 } */
5 #include <xmmintrin.h>
6 #include <stdio.h>
7 #include "../../gcc.dg/i386-cpuid.h"
9 int main(int argc, char** argv) {
10   float a = 1.0f;
11   float b = 2.0f;
12   float c = 3.0f;
13   float r;
15   unsigned long cpu_facilities;
17   cpu_facilities = i386_cpuid ();
19   if ((cpu_facilities & (bit_MMX | bit_SSE | bit_SSE2 | bit_CMOV))
20       != (bit_MMX | bit_SSE | bit_SSE2 | bit_CMOV))
21     /* If host has no vector support, pass.  */
22     return 0;
24   __m128 v = _mm_set_ps(a, b, c, 0);
25   
26   v = (__m128)_mm_srli_si128((__m128i)v, 4);
27   _mm_store_ss(&r, v);
28   if (r != 3.0f)
29     abort ();
30   exit (0);