Debian Codegraph @

gcc/testsuite/gcc.target/i386/avx10_2-512-vfpclassbf16-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 #ifndef AVX10_2
6 #define AVX10_2
7 #define AVX10_2_512
8 #define AVX10_512BIT
9 #endif
10 #include "avx10-helper.h"
11 #define SIZE (AVX512F_LEN / 16)
12 #include "avx512f-mask-type.h"
13
14 void
15 TEST (void)
16 {
17 int i;
18 MASK_TYPE res1 = 0, res2 = 0;
19 __mmask16 exp = 0;
20 UNION_TYPE (AVX512F_LEN, bf16_uw) src1;
21 UNION_TYPE (AVX512F_LEN, ) src2;
22 MASK_TYPE mask = MASK_VALUE;
23
24 for (i = 0; i < SIZE / 2; i++)
25 {
26 src1.a[i] = 0;
27 src2.a[i] = (uint32_t) (src1.a[i]) << 16;
28 }
29
30 for (i = SIZE / 2; i < SIZE; i++)
31 src1.a[i] = 0;
32
33 src1.a[0] = 0x7FC0;
34 src2.a[0] = convert_bf16_to_fp32 (src1.a[0]);
35
36 _mm_setcsr (0x9FC0);
37 exp = INTRINSIC (_fpclass_ps_mask) (src2.x, 0x01);
38
39 _mm_setcsr (0x1f80);
40 res1 = INTRINSIC (_fpclass_pbh_mask) (src1.x, 0x01);
41 res2 = INTRINSIC (_mask_fpclass_pbh_mask) (mask, src1.x, 1);
42
43 if (exp != res1 || (mask & exp) != res2)
44 abort ();
45 }