| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-mavx512fp16 -O2" } */ |
| 3 |
|
| 4 |
/* { dg-final { scan-assembler-times "vpbroadcastw" 1 { target { ! ia32 } } } } */ |
| 5 |
/* { dg-final { scan-assembler-times "vpblendw" 1 { target { ! ia32 } } } } */ |
| 6 |
/* { dg-final { scan-assembler-times "vmovsh" 1 { target { ! ia32 } } } } */ |
| 7 |
|
| 8 |
/* { dg-final { scan-assembler-times "vpinsrw" 2 { target ia32 } } } */ |
| 9 |
#include <immintrin.h> |
| 10 |
|
| 11 |
typedef __bf16 __v8bf __attribute__ ((__vector_size__ (16))); |
| 12 |
typedef __bf16 __m128bf16 __attribute__ ((__vector_size__ (16), __may_alias__)); |
| 13 |
|
| 14 |
__m128bf16 |
| 15 |
__attribute__ ((noinline, noclone)) |
| 16 |
foo1 (__m128bf16 a, __bf16 f) |
| 17 |
{ |
| 18 |
__v8bf x = (__v8bf) a; |
| 19 |
x[2] = f; |
| 20 |
return (__m128bf16) x; |
| 21 |
} |
| 22 |
|
| 23 |
__m128bf16 |
| 24 |
__attribute__ ((noinline, noclone)) |
| 25 |
foo2 (__m128bf16 a, __bf16 f) |
| 26 |
{ |
| 27 |
__v8bf x = (__v8bf) a; |
| 28 |
x[0] = f; |
| 29 |
return (__m128bf16) x; |
| 30 |
} |