Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/sse2-cvtsd2si-1.c

raw
1 /* { dg-do run } */
2 /* { dg-options "-O3 -mvsx -Wno-psabi" } */
3 /* { dg-additional-options "-mdejagnu-cpu=power8" { target { ! has_arch_pwr8 } } } */
4 /* { dg-require-effective-target p8vector_hw } */
5
6 #ifndef CHECK_H
7 #define CHECK_H "sse2-check.h"
8 #endif
9
10 #include CHECK_H
11
12 #ifndef TEST
13 #define TEST sse2_test_cvtsd2si_1
14 #endif
15
16 #include <emmintrin.h>
17
18
19 static int
20 __attribute__((noinline, unused))
21 test (__m128d p)
22 {
23 return _mm_cvtsd_si32 (p);
24 }
25
26 static void
27 TEST (void)
28 {
29 union128d s;
30 int e;
31 int d;
32
33 s.x = _mm_set_pd (123.321, 456.987);
34
35 d = test (s.x);
36
37 e = (int)(s.a[0] + 0.5);
38
39 if (d != e)
40 {
41 #if DEBUG
42 printf ("sse2_test_cvtsd2si_1; failed\n");
43 printf ("\t [%f,%f] -> [%d]\n", s.a[0], s.a[1], d);
44 printf ("\t expect [%d]\n", e);
45 #endif
46 abort ();
47 }
48 }