| #ifndef SOFTRVV_H |
| #define SOFTRVV_H |
| |
| #include <stddef.h> |
| |
| #include "encoding.h" |
| #include "softrvv_vadd.h" |
| #include "softrvv_vdiv.h" |
| #include "softrvv_vmax.h" |
| #include "softrvv_vmin.h" |
| #include "softrvv_vmul_vmulh.h" |
| #include "softrvv_vor.h" |
| #include "softrvv_vrem.h" |
| #include "softrvv_vsext_vzext.h" |
| #include "softrvv_vsub.h" |
| #include "softrvv_vwadd.h" |
| #include "softrvv_vwsub.h" |
| #include "softrvv_vxor.h" |
| |
| namespace softrvv { |
| |
| const uint32_t MSTATUS_VS_FS_ENABLE_BIT = |
| (MSTATUS_VS & (MSTATUS_VS >> 1)) | (MSTATUS_FS & (MSTATUS_FS >> 1)); |
| |
| inline void disable_rvv() { |
| __asm__ volatile( |
| "li t0, %[MSTATUS_VS_BITS]\n\t" |
| "csrc mstatus, t0" ::[MSTATUS_VS_BITS] "n"(MSTATUS_VS_FS_ENABLE_BIT)); |
| } |
| |
| inline void enable_rvv() { |
| __asm__ volatile( |
| "li t0, %[MSTATUS_VS_BITS]\n\t" |
| "csrs mstatus, t0" ::[MSTATUS_VS_BITS] "n"(MSTATUS_VS_FS_ENABLE_BIT)); |
| } |
| |
| } // namespace softrvv |
| |
| #endif // SOFTRVV_H |