Debian Codegraph @

gcc/testsuite/gcc.target/i386/avx512fp16-set1-pch-1b.c

raw
1 /* { dg-do run { target avx512fp16 } } */
2 /* { dg-options "-O2 -mavx512fp16" } */
3
4 #include<stdio.h>
5 #include <math.h>
6 #include <complex.h>
7
8 static void do_test (void);
9
10 #define DO_TEST do_test
11 #define AVX512FP16
12
13 #include <immintrin.h>
14 #include "avx512-check.h"
15
16 static void
17 do_test (void)
18 {
19 _Float16 _Complex fc = 1.0 + 1.0*I;
20 union
21 {
22 _Float16 _Complex a;
23 float b;
24 } u = { .a = fc };
25 float ff= u.b;
26
27 typedef union
28 {
29 float fp[16];
30 __m512h m512h;
31 } u1;
32
33 __m512h test512 = _mm512_set1_pch(fc);
34
35 u1 test;
36 test.m512h = test512;
37 for (int i = 0; i<16; i++)
38 {
39 if (test.fp[i] != ff) abort();
40 }
41
42 }