Debian Codegraph @

gcc/testsuite/gcc.target/i386/bf16_short_warn.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -msse2" } */
3
4 #include<immintrin.h>
5 typedef struct {
6 short payload;
7 } BFloat16;
8
9 __attribute__((target("avx512vl,avx512bf16")))
10 BFloat16 tobf16_avx512(float f)
11 {
12 BFloat16 r;
13 __m128bh m = _mm_cvtneps_pbh(_mm_set_ss(f));
14 r.payload = m[0]; /* { dg-warning " be careful of implicit conversion between '__bf16' and 'short'" } */
15 return r;
16 }
17