| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -march=rv64gcxtheadvector -mabi=lp64d -mtune=rocket" } */ |
| 3 |
|
| 4 |
/* In order to trigger the issue strided broadcast must be enabled |
| 5 |
and we must broadcast integer memory operands via strided load. |
| 6 |
This is disabled and there is currently no param to change it |
| 7 |
so the test will pass either way. */ |
| 8 |
|
| 9 |
#include <riscv_vector.h> |
| 10 |
|
| 11 |
void test(int16_t *dst, long vl) { |
| 12 |
vuint16m1_t v6 = __riscv_vmv_v_x_u16m1(*dst, vl); |
| 13 |
vfloat32m2_t s0 = __riscv_vfmv_v_f_f32m2(0, vl); |
| 14 |
__riscv_vse16_v_u16m1(dst, v6, vl); |
| 15 |
__riscv_vse32_v_f32m2((float*)dst, s0, vl); |
| 16 |
} |
| 17 |
|
| 18 |
/* { dg-final { scan-assembler-times "th.vsetvli\tzero,a1,e16,m1" 2 } } */ |
| 19 |
/* { dg-final { scan-assembler-times "th.vsetvli\tzero,a1,e32,m2" 2 } } */ |