summaryrefslogtreecommitdiff
path: root/p
diff options
context:
space:
mode:
authorChih-Min Chao <chihmin.chao@sifive.com>2019-11-27 23:44:26 -0800
committerChih-Min Chao <chihmin.chao@sifive.com>2019-11-28 00:01:42 -0800
commit3efbb03df8b7490cf3975b59e8f67966cac43168 (patch)
tree31063f2e63e195f253a4fefe40a9e6ae3ab26f7f /p
parentee995655e60f5ca4bc4b3d62fec7a82c066cf811 (diff)
downloadenv-3efbb03df8b7490cf3975b59e8f67966cac43168.zip
env-3efbb03df8b7490cf3975b59e8f67966cac43168.tar.gz
env-3efbb03df8b7490cf3975b59e8f67966cac43168.tar.bz2
rvv: add mstatus.vs definition and initial mcaro
1. mstatus.vs is similar to mstatus.fs but desiged for vector extension. 2. add mstatus.vs initialization macro. The macro also enables floating unit. Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Diffstat (limited to 'p')
-rw-r--r--p/riscv_test.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/p/riscv_test.h b/p/riscv_test.h
index edeb34f..bb7ced6 100644
--- a/p/riscv_test.h
+++ b/p/riscv_test.h
@@ -18,6 +18,11 @@
RVTEST_FP_ENABLE; \
.endm
+#define RVTEST_RV64UV \
+ .macro init; \
+ RVTEST_VECTOR_ENABLE; \
+ .endm
+
#define RVTEST_RV32U \
.macro init; \
.endm
@@ -27,6 +32,11 @@
RVTEST_FP_ENABLE; \
.endm
+#define RVTEST_RV32UV \
+ .macro init; \
+ RVTEST_VECTOR_ENABLE; \
+ .endm
+
#define RVTEST_RV64M \
.macro init; \
RVTEST_ENABLE_MACHINE; \
@@ -95,6 +105,12 @@
csrs mstatus, a0; \
csrwi fcsr, 0
+#define RVTEST_VECTOR_ENABLE \
+ li a0, (MSTATUS_VS & (MSTATUS_VS >> 1)) | \
+ (MSTATUS_FS & (MSTATUS_FS >> 1)); \
+ csrs mstatus, a0; \
+ csrwi fcsr, 0
+
#define RISCV_MULTICORE_DISABLE \
csrr a0, mhartid; \
1: bnez a0, 1b