qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v7 67/75] target/riscv: rvv-1.0: set mstatus.SD bit when writing


From: frank . chang
Subject: [PATCH v7 67/75] target/riscv: rvv-1.0: set mstatus.SD bit when writing vector CSRs
Date: Fri, 26 Feb 2021 11:18:51 +0800

From: Frank Chang <frank.chang@sifive.com>

Signed-off-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
---
 target/riscv/csr.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index aa76da9e185..e0f1106d909 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -293,7 +293,7 @@ static int write_vxrm(CPURISCVState *env, int csrno, 
target_ulong val)
     if (!env->debugger && !riscv_cpu_vector_enabled(env)) {
         return -RISCV_EXCP_ILLEGAL_INST;
     }
-    env->mstatus |= MSTATUS_VS;
+    env->mstatus |= MSTATUS_VS | MSTATUS_SD;
 #endif
 
     env->vxrm = val;
@@ -312,7 +312,7 @@ static int write_vxsat(CPURISCVState *env, int csrno, 
target_ulong val)
     if (!env->debugger && !riscv_cpu_vector_enabled(env)) {
         return -RISCV_EXCP_ILLEGAL_INST;
     }
-    env->mstatus |= MSTATUS_VS;
+    env->mstatus |= MSTATUS_VS | MSTATUS_SD;
 #endif
 
     env->vxsat = val;
@@ -331,7 +331,7 @@ static int write_vstart(CPURISCVState *env, int csrno, 
target_ulong val)
     if (!env->debugger && !riscv_cpu_vector_enabled(env)) {
         return -RISCV_EXCP_ILLEGAL_INST;
     }
-    env->mstatus |= MSTATUS_VS;
+    env->mstatus |= MSTATUS_VS | MSTATUS_SD;
 #endif
 
     /*
@@ -354,7 +354,7 @@ static int write_vcsr(CPURISCVState *env, int csrno, 
target_ulong val)
     if (!env->debugger && !riscv_cpu_vector_enabled(env)) {
         return -RISCV_EXCP_ILLEGAL_INST;
     }
-    env->mstatus |= MSTATUS_VS;
+    env->mstatus |= MSTATUS_VS | MSTATUS_SD;
 #endif
 
     env->vxrm = (val & VCSR_VXRM) >> VCSR_VXRM_SHIFT;
-- 
2.17.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]