Debian Codegraph @

gcc/testsuite/gcc.target/i386/avx10_2-vcvttss2usis-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, ) s;
14 unsigned int res1;
15 unsigned long long res2;
16 unsigned int res1_ref = 0;
17 unsigned long long res2_ref = 0;
18
19 s.a[0] = 2.46;
20
21 res1 = _mm_cvtts_roundss_epu32 (s.x, 8);
22
23 if (s.a[0] > UINT_MAX)
24 res1_ref = UINT_MAX;
25 else if (s.a[0] < 0)
26 res1_ref = 0;
27 else
28 res1_ref = s.a[0];
29
30 if (res1 != res1_ref)
31 abort();
32
33 res1 = _mm_cvtts_ss_epu32 (s.x);
34
35 if (s.a[0] > UINT_MAX)
36 res1_ref = UINT_MAX;
37 else if (s.a[0] < 0)
38 res1_ref = 0;
39 else
40 res1_ref = s.a[0];
41
42 if (res1 != res1_ref)
43 abort();
44
45 #ifdef __x86_64__
46 res2 = _mm_cvtts_roundss_epu64 (s.x, 8);
47
48 if (s.a[0] > ULONG_MAX)
49 res2_ref = ULONG_MAX;
50 else if (s.a[0] < 0)
51 res2_ref = 0;
52 else
53 res2_ref = s.a[0];
54
55 if (res2 != res2_ref)
56 abort();
57
58 res2 = _mm_cvtts_ss_epu64 (s.x);
59
60 if (s.a[0] > ULONG_MAX)
61 res2_ref = ULONG_MAX;
62 else if (s.a[0] < 0)
63 res2_ref = 0;
64 else
65 res2_ref = s.a[0];
66
67 if (res2 != res2_ref)
68 abort();
69 #endif
70 }