Debian Codegraph @

gcc/testsuite/gcc.target/i386/avx10_2-vcvttsd2usis-2.c

raw
1 /* { dg-do run } */
2 /* { dg-options "-O2 -march=x86-64-v3 -mavx10.2" } */
3 /* { dg-require-effective-target avx10_2 } */
4
5 #define AVX10_2
6 #define AVX10_SCALAR
7 #include "avx10-helper.h"
8 #include <limits.h>
9
10 void
11 TEST (void)
12 {
13 UNION_TYPE (128, d) s;
14 unsigned int res1;
15 unsigned long long res2;
16 unsigned int res1_ref = 0;
17 unsigned long long res2_ref = 0;
18 int i, sign = 1;
19
20 s.a[0] = 2.46;
21
22 res1 = _mm_cvtts_roundsd_epu32 (s.x, 8);
23
24 if (s.a[0] > UINT_MAX)
25 res1_ref = UINT_MAX;
26 else if (s.a[0] < 0)
27 res1_ref = 0;
28 else
29 res1_ref = s.a[0];
30
31 if (res1 != res1_ref)
32 abort();
33
34 res1 = _mm_cvtts_sd_epu32 (s.x);
35
36 if (s.a[0] > UINT_MAX)
37 res1_ref = UINT_MAX;
38 else if (s.a[0] < 0)
39 res1_ref = 0;
40 else
41 res1_ref = s.a[0];
42
43 if (res1 != res1_ref)
44 abort();
45
46 #ifdef __x86_64__
47 res2 = _mm_cvtts_roundsd_epu64 (s.x, 8);
48
49 if (s.a[0] > ULONG_MAX)
50 res2_ref = ULONG_MAX;
51 else if (s.a[0] < 0)
52 res2_ref = 0;
53 else
54 res2_ref = s.a[0];
55
56 if (res2 != res2_ref)
57 abort();
58
59 res2 = _mm_cvtts_sd_epu64 (s.x);
60
61 if (s.a[0] > ULONG_MAX)
62 res2_ref = ULONG_MAX;
63 else if (s.a[0] < 0)
64 res2_ref = 0;
65 else
66 res2_ref = s.a[0];
67
68 if (res2 != res2_ref)
69 abort();
70 #endif
71 }