diff mbox series

[v6,67/72] target/riscv: rvv-1.0: set mstatus.SD bit when writing vector CSRs

Message ID 20210112093950.17530-68-frank.chang@sifive.com (mailing list archive)
State New, archived
Headers show
Series support vector extension v1.0 | expand

Commit Message

Frank Chang Jan. 12, 2021, 9:39 a.m. UTC
From: Frank Chang <frank.chang@sifive.com>

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

Comments

Alistair Francis Jan. 28, 2021, 9:27 p.m. UTC | #1
On Tue, Jan 12, 2021 at 2:30 AM <frank.chang@sifive.com> wrote:
>
> From: Frank Chang <frank.chang@sifive.com>
>
> Signed-off-by: Frank Chang <frank.chang@sifive.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  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 28c1ce7928a..176010674e8 100644
> --- a/target/riscv/csr.c
> +++ b/target/riscv/csr.c
> @@ -301,7 +301,7 @@ static int write_vxrm(CPURISCVState *env, int csrno, target_ulong val)
>      if (!env->debugger && !riscv_cpu_vector_enabled(env)) {
>          return -1;
>      }
> -    env->mstatus |= MSTATUS_VS;
> +    env->mstatus |= MSTATUS_VS | MSTATUS_SD;
>  #endif
>
>      env->vxrm = val;
> @@ -320,7 +320,7 @@ static int write_vxsat(CPURISCVState *env, int csrno, target_ulong val)
>      if (!env->debugger && !riscv_cpu_vector_enabled(env)) {
>          return -1;
>      }
> -    env->mstatus |= MSTATUS_VS;
> +    env->mstatus |= MSTATUS_VS | MSTATUS_SD;
>  #endif
>
>      env->vxsat = val;
> @@ -339,7 +339,7 @@ static int write_vstart(CPURISCVState *env, int csrno, target_ulong val)
>      if (!env->debugger && !riscv_cpu_vector_enabled(env)) {
>          return -1;
>      }
> -    env->mstatus |= MSTATUS_VS;
> +    env->mstatus |= MSTATUS_VS | MSTATUS_SD;
>  #endif
>
>      /*
> @@ -362,7 +362,7 @@ static int write_vcsr(CPURISCVState *env, int csrno, target_ulong val)
>      if (!env->debugger && !riscv_cpu_vector_enabled(env)) {
>          return -1;
>      }
> -    env->mstatus |= MSTATUS_VS;
> +    env->mstatus |= MSTATUS_VS | MSTATUS_SD;
>  #endif
>
>      env->vxrm = (val & VCSR_VXRM) >> VCSR_VXRM_SHIFT;
> --
> 2.17.1
>
>
diff mbox series

Patch

diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index 28c1ce7928a..176010674e8 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -301,7 +301,7 @@  static int write_vxrm(CPURISCVState *env, int csrno, target_ulong val)
     if (!env->debugger && !riscv_cpu_vector_enabled(env)) {
         return -1;
     }
-    env->mstatus |= MSTATUS_VS;
+    env->mstatus |= MSTATUS_VS | MSTATUS_SD;
 #endif
 
     env->vxrm = val;
@@ -320,7 +320,7 @@  static int write_vxsat(CPURISCVState *env, int csrno, target_ulong val)
     if (!env->debugger && !riscv_cpu_vector_enabled(env)) {
         return -1;
     }
-    env->mstatus |= MSTATUS_VS;
+    env->mstatus |= MSTATUS_VS | MSTATUS_SD;
 #endif
 
     env->vxsat = val;
@@ -339,7 +339,7 @@  static int write_vstart(CPURISCVState *env, int csrno, target_ulong val)
     if (!env->debugger && !riscv_cpu_vector_enabled(env)) {
         return -1;
     }
-    env->mstatus |= MSTATUS_VS;
+    env->mstatus |= MSTATUS_VS | MSTATUS_SD;
 #endif
 
     /*
@@ -362,7 +362,7 @@  static int write_vcsr(CPURISCVState *env, int csrno, target_ulong val)
     if (!env->debugger && !riscv_cpu_vector_enabled(env)) {
         return -1;
     }
-    env->mstatus |= MSTATUS_VS;
+    env->mstatus |= MSTATUS_VS | MSTATUS_SD;
 #endif
 
     env->vxrm = (val & VCSR_VXRM) >> VCSR_VXRM_SHIFT;