cpu_rvv.c 300 B

12345678910111213
  1. #ifndef __riscv_vector
  2. #error RVV not supported
  3. #endif
  4. #include <riscv_vector.h>
  5. int main(void)
  6. {
  7. size_t vlmax = __riscv_vsetvlmax_e32m1();
  8. vuint32m1_t a = __riscv_vmv_v_x_u32m1(0, vlmax);
  9. vuint32m1_t b = __riscv_vadd_vv_u32m1(a, a, vlmax);
  10. return __riscv_vmv_x_s_u32m1_u32(b);
  11. }