Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add macro for vector test to not switch to U-mode after initialization #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions p/riscv_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
RVTEST_VECTOR_ENABLE; \
.endm

#define RVTEST_RV64MV \
.macro init; \
RVTEST_MVECTOR_ENABLE; \
.endm

#define RVTEST_RV32U \
.macro init; \
.endm
Expand All @@ -37,6 +42,11 @@
RVTEST_VECTOR_ENABLE; \
.endm

#define RVTEST_RV32MV \
.macro init; \
RVTEST_MVECTOR_ENABLE; \
.endm

#define RVTEST_RV64M \
.macro init; \
RVTEST_ENABLE_MACHINE; \
Expand Down Expand Up @@ -145,6 +155,14 @@
csrwi fcsr, 0; \
csrwi vcsr, 0;

#define RVTEST_MVECTOR_ENABLE \
li a0, (MSTATUS_VS & (MSTATUS_VS >> 1)) | \
(MSTATUS_FS & (MSTATUS_FS >> 1)) | \
(MSTATUS_MPP); \
csrs mstatus, a0; \
csrwi fcsr, 0; \
csrwi vcsr, 0;

#define RISCV_MULTICORE_DISABLE \
csrr a0, mhartid; \
1: bnez a0, 1b
Expand Down