Debian Codegraph @

gcc/testsuite/gcc.target/i386/avx512fp16-vcomish-1c.c

raw
1 /* { dg-do run { target avx512fp16 } } */
2 /* { dg-options "-O2 -mavx512fp16 -mavx512dq" } */
3
4
5 #define AVX512FP16
6 #include "avx512fp16-helper.h"
7
8
9 #define CMP(imm, rel) \
10 dst_ref = 0; \
11 dst_ref = ((int) rel) | dst_ref; \
12 dst = _mm_comi_round_sh(src1.xmmh[0], src2.xmmh[0], imm, \
13 _MM_FROUND_NO_EXC); \
14 if (dst_ref != dst) abort(); \
15
16 void
17 test_512 (void)
18 {
19 V512 v1,v2,v3,v4;
20 float s1,s2;
21 int res,exp,dst;
22 __mmask8 dst_ref;
23
24 init_src_nanf();
25 unpack_ph_2twops(src1, &v1, &v2);
26 unpack_ph_2twops(src2, &v3, &v4);
27 s1 = v1.f32[0];
28 s2 = v3.f32[0];
29
30 CMP(_CMP_EQ_OQ, !isunordered(s1, s2) && s1 == s2);
31 CMP(_CMP_LT_OS, !isunordered(s1, s2) && s1 < s2);
32 CMP(_CMP_LE_OS, !isunordered(s1, s2) && s1 <= s2);
33 CMP(_CMP_UNORD_Q, isunordered(s1, s2));
34 CMP(_CMP_NEQ_UQ, isunordered(s1, s2) || s1 != s2);
35 CMP(_CMP_NLT_US, isunordered(s1, s2) || s1 >= s2);
36 CMP(_CMP_NLE_US, isunordered(s1, s2) || s1 > s2);
37 CMP(_CMP_ORD_Q, !isunordered(s1, s2));
38
39 CMP(_CMP_EQ_UQ, isunordered(s1, s2) || s1 == s2);
40 CMP(_CMP_NGE_US, isunordered(s1, s2) || s1 < s2);
41 CMP(_CMP_NGT_US, isunordered(s1, s2) || s1 <= s2);
42
43 CMP(_CMP_FALSE_OQ, 0);
44 CMP(_CMP_NEQ_OQ, !isunordered(s1, s2) && s1 != s2);
45 CMP(_CMP_GE_OS, !isunordered(s1, s2) && s1 >= s2);
46 CMP(_CMP_GT_OS, !isunordered(s1, s2) && s1 > s2);
47 CMP(_CMP_TRUE_UQ, 1);
48
49 CMP(_CMP_EQ_OS, !isunordered(s1, s2) && s1 == s2);
50 CMP(_CMP_LT_OQ, !isunordered(s1, s2) && s1 < s2);
51 CMP(_CMP_LE_OQ, !isunordered(s1, s2) && s1 <= s2);
52 CMP(_CMP_UNORD_S, isunordered(s1, s2));
53 CMP(_CMP_NEQ_US, isunordered(s1, s2) || s1 != s2);
54 CMP(_CMP_NLT_UQ, isunordered(s1, s2) || s1 >= s2);
55 CMP(_CMP_NLE_UQ, isunordered(s1, s2) || s1 > s2);
56 CMP(_CMP_ORD_S, !isunordered(s1, s2));
57 CMP(_CMP_EQ_US, isunordered(s1, s2) || s1 == s2);
58 CMP(_CMP_NGE_UQ, isunordered(s1, s2) || s1 < s2);
59 CMP(_CMP_NGT_UQ, isunordered(s1, s2) || s1 <= s2);
60 CMP(_CMP_FALSE_OS, 0);
61 CMP(_CMP_NEQ_OS, !isunordered(s1, s2) && s1 != s2);
62 CMP(_CMP_GE_OQ, !isunordered(s1, s2) && s1 >= s2);
63 CMP(_CMP_GT_OQ, !isunordered(s1, s2) && s1 > s2);
64 CMP(_CMP_TRUE_US, 1);
65 }
66