1 /* { dg-do run } */
2 /* { dg-require-effective-target sse4 } */
3 /* { dg-options "-O2 -msse4.1" } */
4 /* { dg-skip-if "no M_PI" { vxworks_kernel } } */
5 
6 #ifndef CHECK_H
7 #define CHECK_H "sse4_1-check.h"
8 #endif
9 
10 #ifndef TEST
11 #define TEST sse4_1_test
12 #endif
13 
14 #include CHECK_H
15 
16 #include <smmintrin.h>
17 
18 #define iRoundMode 0x2
19 
20 static void
TEST(void)21 TEST (void)
22 {
23   union128d u, s;
24   double e[2] = {0.0};
25   int i;
26 
27   s.x = _mm_set_pd (1.1234, -2.3478);
28   u.x = _mm_round_pd (s.x, iRoundMode);
29 
30   for (i = 0; i < 2; i++)
31     {
32       __m128d tmp = _mm_load_sd (&s.a[i]);
33       tmp = _mm_round_sd (tmp, tmp, iRoundMode);
34       _mm_store_sd (&e[i], tmp);
35     }
36 
37   if (check_union128d (u, e))
38     abort ();
39 }
40