| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-march=x86-64-v3 -mavx10.2 -O2" } */ |
| 3 |
/* { dg-final { scan-assembler-times "vcvt2ps2phx\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 4 |
/* { dg-final { scan-assembler-times "vcvt2ps2phx\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 5 |
/* { dg-final { scan-assembler-times "vcvt2ps2phx\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ |
| 6 |
/* { dg-final { scan-assembler-times "vcvt2ps2phx\[ \\t\]+\{rn-sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 7 |
/* { dg-final { scan-assembler-times "vcvt2ps2phx\[ \\t\]+\{rn-sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 8 |
/* { dg-final { scan-assembler-times "vcvt2ps2phx\[ \\t\]+\{rn-sae\}\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\{%k\[0-9\]\}\{z\}\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */ |
| 9 |
/* { dg-final { scan-assembler-times "vcvtbiasph2bf8\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 10 |
/* { dg-final { scan-assembler-times "vcvtbiasph2bf8\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 11 |
/* { dg-final { scan-assembler-times "vcvtbiasph2bf8\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 12 |
/* { dg-final { scan-assembler-times "vcvtbiasph2bf8s\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 13 |
/* { dg-final { scan-assembler-times "vcvtbiasph2bf8s\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 14 |
/* { dg-final { scan-assembler-times "vcvtbiasph2bf8s\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 15 |
/* { dg-final { scan-assembler-times "vcvtbiasph2hf8\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 16 |
/* { dg-final { scan-assembler-times "vcvtbiasph2hf8\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 17 |
/* { dg-final { scan-assembler-times "vcvtbiasph2hf8\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 18 |
/* { dg-final { scan-assembler-times "vcvtbiasph2hf8s\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 19 |
/* { dg-final { scan-assembler-times "vcvtbiasph2hf8s\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 20 |
/* { dg-final { scan-assembler-times "vcvtbiasph2hf8s\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 21 |
/* { dg-final { scan-assembler-times "vcvt2ph2bf8\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 22 |
/* { dg-final { scan-assembler-times "vcvt2ph2bf8\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 23 |
/* { dg-final { scan-assembler-times "vcvt2ph2bf8\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 24 |
/* { dg-final { scan-assembler-times "vcvt2ph2bf8s\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 25 |
/* { dg-final { scan-assembler-times "vcvt2ph2bf8s\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 26 |
/* { dg-final { scan-assembler-times "vcvt2ph2bf8s\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 27 |
/* { dg-final { scan-assembler-times "vcvt2ph2hf8\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 28 |
/* { dg-final { scan-assembler-times "vcvt2ph2hf8\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 29 |
/* { dg-final { scan-assembler-times "vcvt2ph2hf8\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 30 |
/* { dg-final { scan-assembler-times "vcvt2ph2hf8s\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 31 |
/* { dg-final { scan-assembler-times "vcvt2ph2hf8s\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 32 |
/* { dg-final { scan-assembler-times "vcvt2ph2hf8s\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 33 |
/* { dg-final { scan-assembler-times "vcvthf82ph\[ \\t\]*%ymm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 34 |
/* { dg-final { scan-assembler-times "vcvthf82ph\[ \\t\]*%ymm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 35 |
/* { dg-final { scan-assembler-times "vcvthf82ph\[ \\t\]*%ymm\[0-9\]+,\[^\{\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 36 |
/* { dg-final { scan-assembler-times "vcvtph2bf8\[ \\t\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 37 |
/* { dg-final { scan-assembler-times "vcvtph2bf8\[ \\t\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 38 |
/* { dg-final { scan-assembler-times "vcvtph2bf8\[ \\t\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 39 |
/* { dg-final { scan-assembler-times "vcvtph2bf8s\[ \\t\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 40 |
/* { dg-final { scan-assembler-times "vcvtph2bf8s\[ \\t\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 41 |
/* { dg-final { scan-assembler-times "vcvtph2bf8s\[ \\t\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 42 |
/* { dg-final { scan-assembler-times "vcvtph2hf8\[ \\t\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 43 |
/* { dg-final { scan-assembler-times "vcvtph2hf8\[ \\t\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 44 |
/* { dg-final { scan-assembler-times "vcvtph2hf8\[ \\t\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 45 |
/* { dg-final { scan-assembler-times "vcvtph2hf8s\[ \\t\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 46 |
/* { dg-final { scan-assembler-times "vcvtph2hf8s\[ \\t\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 47 |
/* { dg-final { scan-assembler-times "vcvtph2hf8s\[ \\t\]*%zmm\[0-9\]+,\[^\{\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 48 |
/* { dg-final { scan-assembler-times "vpsllw\[ \t]\+\\\$8, %zmm\[0-9]\+, %zmm\[0-9]\+(?:\n|\[ \\t\]+#)" 2 } } */ |
| 49 |
/* { dg-final { scan-assembler-times "vpsllw\[ \t]\+\\\$8, %zmm\[0-9]\+, %zmm\[0-9]\+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 50 |
/* { dg-final { scan-assembler-times "vpmovsxbw\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%zmm\[0-9\](?:\n|\[ \\t\]+#)" 2 } } */ |
| 51 |
/* { dg-final { scan-assembler-times "vpmovsxbw\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ |
| 52 |
|
| 53 |
#include <immintrin.h> |
| 54 |
|
| 55 |
volatile __m256i x256i, z1; |
| 56 |
volatile __m512i x512i; |
| 57 |
volatile __m512 x, a1, b1; |
| 58 |
volatile __m512h y, x512h, z; |
| 59 |
volatile __mmask16 m16; |
| 60 |
volatile __mmask32 m32; |
| 61 |
volatile __mmask64 m64; |
| 62 |
const void *a; |
| 63 |
__m512bh *c; |
| 64 |
__m512h *d; |
| 65 |
|
| 66 |
void extern |
| 67 |
avx10_2_test (void) |
| 68 |
{ |
| 69 |
y = _mm512_cvtx2ps_ph (a1, b1); |
| 70 |
y = _mm512_mask_cvtx2ps_ph (y, m32, a1, b1); |
| 71 |
y = _mm512_maskz_cvtx2ps_ph (m32, a1, b1); |
| 72 |
|
| 73 |
y = _mm512_cvtx_round2ps_ph (a1, b1, 8); |
| 74 |
y = _mm512_mask_cvtx_round2ps_ph (y, m32, a1, b1, 8); |
| 75 |
y = _mm512_maskz_cvtx_round2ps_ph (m32, a1, b1, 8); |
| 76 |
} |
| 77 |
|
| 78 |
void extern |
| 79 |
avx10_2_vcvtbiasph2bf8_test (void) |
| 80 |
{ |
| 81 |
x256i = _mm512_cvtbiasph_bf8 (x512i, x512h); |
| 82 |
x256i = _mm512_mask_cvtbiasph_bf8 (x256i, m32, x512i, x512h); |
| 83 |
x256i = _mm512_maskz_cvtbiasph_bf8 (m32, x512i, x512h); |
| 84 |
} |
| 85 |
|
| 86 |
void extern |
| 87 |
avx10_2_vcvtbiasph2bf8s_test (void) |
| 88 |
{ |
| 89 |
x256i = _mm512_cvts_biasph_bf8 (x512i, x512h); |
| 90 |
x256i = _mm512_mask_cvts_biasph_bf8 (x256i, m32, x512i, x512h); |
| 91 |
x256i = _mm512_maskz_cvts_biasph_bf8 (m32, x512i, x512h); |
| 92 |
} |
| 93 |
|
| 94 |
void extern |
| 95 |
avx10_2_vcvtbiasph2hf8_test (void) |
| 96 |
{ |
| 97 |
x256i = _mm512_cvtbiasph_hf8 (x512i, x512h); |
| 98 |
x256i = _mm512_mask_cvtbiasph_hf8 (x256i, m32, x512i, x512h); |
| 99 |
x256i = _mm512_maskz_cvtbiasph_hf8 (m32, x512i, x512h); |
| 100 |
} |
| 101 |
|
| 102 |
void extern |
| 103 |
avx10_2_vcvtbiasph2hf8s_test (void) |
| 104 |
{ |
| 105 |
x256i = _mm512_cvts_biasph_hf8 (x512i, x512h); |
| 106 |
x256i = _mm512_mask_cvts_biasph_hf8 (x256i, m32, x512i, x512h); |
| 107 |
x256i = _mm512_maskz_cvts_biasph_hf8 (m32, x512i, x512h); |
| 108 |
} |
| 109 |
|
| 110 |
void extern |
| 111 |
avx10_2_vcvt2ph2bf8_test (void) |
| 112 |
{ |
| 113 |
x512i = _mm512_cvt2ph_bf8 (x512h, x512h); |
| 114 |
x512i = _mm512_mask_cvt2ph_bf8 (x512i, m64, x512h, x512h); |
| 115 |
x512i = _mm512_maskz_cvt2ph_bf8 (m64, x512h, x512h); |
| 116 |
} |
| 117 |
|
| 118 |
void extern |
| 119 |
avx10_2_vcvt2ph2bf8s_test (void) |
| 120 |
{ |
| 121 |
x512i = _mm512_cvts_2ph_bf8 (x512h, x512h); |
| 122 |
x512i = _mm512_mask_cvts_2ph_bf8 (x512i, m64, x512h, x512h); |
| 123 |
x512i = _mm512_maskz_cvts_2ph_bf8 (m64, x512h, x512h); |
| 124 |
} |
| 125 |
|
| 126 |
void extern |
| 127 |
avx10_2_vcvt2ph2hf8_test (void) |
| 128 |
{ |
| 129 |
x512i = _mm512_cvt2ph_hf8 (x512h, x512h); |
| 130 |
x512i = _mm512_mask_cvt2ph_hf8 (x512i, m64, x512h, x512h); |
| 131 |
x512i = _mm512_maskz_cvt2ph_hf8 (m64, x512h, x512h); |
| 132 |
} |
| 133 |
|
| 134 |
void extern |
| 135 |
avx10_2_vcvt2ph2hf8s_test (void) |
| 136 |
{ |
| 137 |
x512i = _mm512_cvts_2ph_hf8 (x512h, x512h); |
| 138 |
x512i = _mm512_mask_cvts_2ph_hf8 (x512i, m64, x512h, x512h); |
| 139 |
x512i = _mm512_maskz_cvts_2ph_hf8 (m64, x512h, x512h); |
| 140 |
} |
| 141 |
|
| 142 |
void extern |
| 143 |
avx10_2_vcvthf82ph_test (void) |
| 144 |
{ |
| 145 |
x512h = _mm512_cvthf8_ph (x256i); |
| 146 |
x512h = _mm512_mask_cvthf8_ph (x512h, m32, x256i); |
| 147 |
x512h = _mm512_maskz_cvthf8_ph (m32, x256i); |
| 148 |
} |
| 149 |
|
| 150 |
void extern |
| 151 |
avx10_2_vcvtph2bf8_test (void) |
| 152 |
{ |
| 153 |
x256i = _mm512_cvtph_bf8 (x512h); |
| 154 |
x256i = _mm512_mask_cvtph_bf8 (x256i, m32, x512h); |
| 155 |
x256i = _mm512_maskz_cvtph_bf8 (m32, x512h); |
| 156 |
} |
| 157 |
|
| 158 |
void extern |
| 159 |
avx10_2_vcvtph2bf8s_test (void) |
| 160 |
{ |
| 161 |
x256i = _mm512_cvts_ph_bf8 (x512h); |
| 162 |
x256i = _mm512_mask_cvts_ph_bf8 (x256i, m32, x512h); |
| 163 |
x256i = _mm512_maskz_cvts_ph_bf8 (m32, x512h); |
| 164 |
} |
| 165 |
|
| 166 |
void extern |
| 167 |
avx10_2_vcvtph2hf8_test (void) |
| 168 |
{ |
| 169 |
x256i = _mm512_cvtph_hf8 (x512h); |
| 170 |
x256i = _mm512_mask_cvtph_hf8 (x256i, m32, x512h); |
| 171 |
x256i = _mm512_maskz_cvtph_hf8 (m32, x512h); |
| 172 |
} |
| 173 |
|
| 174 |
void extern |
| 175 |
avx10_2_vcvtph2hf8s_test (void) |
| 176 |
{ |
| 177 |
x256i = _mm512_cvts_ph_hf8 (x512h); |
| 178 |
x256i = _mm512_mask_cvts_ph_hf8 (x256i, m32, x512h); |
| 179 |
x256i = _mm512_maskz_cvts_ph_hf8 (m32, x512h); |
| 180 |
} |
| 181 |
|
| 182 |
void extern |
| 183 |
avx10_2_cvtbf8_fp16_test (void) |
| 184 |
{ |
| 185 |
y = _mm512_cvtbf8_ph (z1); |
| 186 |
y = _mm512_mask_cvtbf8_ph (z, m32, z1); |
| 187 |
y = _mm512_maskz_cvtbf8_ph (m32, z1); |
| 188 |
} |