Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.target / i386 / sse4a-montsd.c
blob1cc067db62fcdaa2ee7d4654298e6b798169da1e
1 /* { dg-do run } */
2 /* { dg-require-effective-target sse4a } */
3 /* { dg-options "-O2 -msse4a" } */
5 #include "sse4a-check.h"
7 #include <ammintrin.h>
9 static void
10 sse4a_test_movntsd (double *out, double *in)
12 __m128d in_v2df = _mm_load_sd (in);
13 _mm_stream_sd (out, in_v2df);
16 static int
17 chk_sd (double *v1, double *v2)
19 int n_fails = 0;
20 if (v1[0] != v2[0])
21 n_fails += 1;
22 return n_fails;
25 double vals[10] =
27 100.0, 200.0, 300.0, 400.0, 5.0,
28 -1.0, .345, -21.5, 9.32, 8.41
31 static void
32 sse4a_test (void)
34 int i;
35 int fail = 0;
36 double *out;
38 out = (double *) malloc (sizeof (double));
39 for (i = 0; i < 10; i += 1)
41 sse4a_test_movntsd (out, &vals[i]);
43 fail += chk_sd (out, &vals[i]);
46 if (fail != 0)
47 abort ();