| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-march=rv64gcv_zvfh -mabi=lp64 -O3" } */ |
| 3 |
|
| 4 |
#include "riscv_vector.h" |
| 5 |
|
| 6 |
typedef _Float16 float16_t; |
| 7 |
|
| 8 |
vfloat16mf4_t test_vfncvt_f_f_w_f16mf4(vfloat32mf2_t src, size_t vl) { |
| 9 |
return __riscv_vfncvt_f_f_w_f16mf4(src, vl); |
| 10 |
} |
| 11 |
|
| 12 |
vfloat16m4_t test_vfncvt_f_f_w_f16m4(vfloat32m8_t src, size_t vl) { |
| 13 |
return __riscv_vfncvt_f_f_w_f16m4(src, vl); |
| 14 |
} |
| 15 |
|
| 16 |
vfloat32mf2_t test_vfwcvt_f_f_v_f32mf2(vfloat16mf4_t src, size_t vl) { |
| 17 |
return __riscv_vfwcvt_f_f_v_f32mf2(src, vl); |
| 18 |
} |
| 19 |
|
| 20 |
vfloat32m8_t test_vfwcvt_f_f_v_f32m8(vfloat16m4_t src, size_t vl) { |
| 21 |
return __riscv_vfwcvt_f_f_v_f32m8(src, vl); |
| 22 |
} |
| 23 |
|
| 24 |
vfloat16mf4_t test_vle16_v_f16mf4(const float16_t *base, size_t vl) { |
| 25 |
return __riscv_vle16_v_f16mf4(base, vl); |
| 26 |
} |
| 27 |
|
| 28 |
vfloat16m8_t test_vle16_v_f16m8(const float16_t *base, size_t vl) { |
| 29 |
return __riscv_vle16_v_f16m8(base, vl); |
| 30 |
} |
| 31 |
|
| 32 |
vfloat16mf4_t test_vreinterpret_v_i16mf4_f16mf4(vint16mf4_t src) { |
| 33 |
return __riscv_vreinterpret_v_i16mf4_f16mf4(src); |
| 34 |
} |
| 35 |
|
| 36 |
vuint16m8_t test_vreinterpret_v_f16m8_u16m8(vfloat16m8_t src) { |
| 37 |
return __riscv_vreinterpret_v_f16m8_u16m8(src); |
| 38 |
} |
| 39 |
|
| 40 |
vfloat16mf2_t test_vlmul_ext_v_f16mf4_f16mf2(vfloat16mf4_t op1) { |
| 41 |
return __riscv_vlmul_ext_v_f16mf4_f16mf2(op1); |
| 42 |
} |
| 43 |
|
| 44 |
vfloat16m8_t test_vlmul_ext_v_f16mf4_f16m8(vfloat16mf4_t op1) { |
| 45 |
return __riscv_vlmul_ext_v_f16mf4_f16m8(op1); |
| 46 |
} |
| 47 |
|
| 48 |
vfloat16mf4_t test_vlmul_trunc_v_f16mf2_f16mf4(vfloat16mf2_t op1) { |
| 49 |
return __riscv_vlmul_trunc_v_f16mf2_f16mf4(op1); |
| 50 |
} |
| 51 |
|
| 52 |
vfloat16m4_t test_vlmul_trunc_v_f16m8_f16m4(vfloat16m8_t op1) { |
| 53 |
return __riscv_vlmul_trunc_v_f16m8_f16m4(op1); |
| 54 |
} |
| 55 |
|
| 56 |
vfloat16mf4_t test_vundefined_f16mf4() { |
| 57 |
return __riscv_vundefined_f16mf4(); |
| 58 |
} |
| 59 |
|
| 60 |
vfloat16m8_t test_vundefined_f16m8() { |
| 61 |
return __riscv_vundefined_f16m8(); |
| 62 |
} |
| 63 |
|
| 64 |
vfloat16m2_t test_vset_v_f16m1_f16m2(vfloat16m2_t dest, size_t index, vfloat16m1_t val) { |
| 65 |
return __riscv_vset_v_f16m1_f16m2(dest, 0, val); |
| 66 |
} |
| 67 |
|
| 68 |
vfloat16m4_t test_vget_v_f16m8_f16m4(vfloat16m8_t src, size_t index) { |
| 69 |
return __riscv_vget_v_f16m8_f16m4(src, 0); |
| 70 |
} |
| 71 |
|
| 72 |
/* { dg-final { scan-assembler-times {vsetvli\s+zero,\s*[a-x0-9]+,\s*e16,\s*mf4,\s*t[au],\s*m[au]} 3 } } */ |
| 73 |
/* { dg-final { scan-assembler-times {vsetvli\s+zero,\s*[a-x0-9]+,\s*e16,\s*m4,\s*t[au],\s*m[au]} 2 } } */ |
| 74 |
/* { dg-final { scan-assembler-times {vsetvli\s+zero,\s*[a-x0-9]+,\s*e16,\s*m8,\s*t[au],\s*m[au]} 1 } } */ |
| 75 |
/* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e16,\s*m8,\s*t[au],\s*m[au]} 1 } } */ |
| 76 |
/* { dg-final { scan-assembler-times {vfwcvt\.f\.f\.v\s+v[0-9]+,\s*v[0-9]+} 2 } } */ |
| 77 |
/* { dg-final { scan-assembler-times {vfncvt\.f\.f\.w\s+v[0-9]+,\s*v[0-9]+} 2 } } */ |
| 78 |
/* { dg-final { scan-assembler-times {vle16\.v\s+v[0-9]+,\s*0\([0-9ax]+\)} 2 } } */ |