qemu-riscv
[Top][All Lists]
Advanced

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

Re: [PATCH v1 2/5] target/riscv: Use the RiscVException enum for CSR pre


From: Richard Henderson
Subject: Re: [PATCH v1 2/5] target/riscv: Use the RiscVException enum for CSR predicates
Date: Wed, 17 Mar 2021 13:44:03 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 3/17/21 11:39 AM, Alistair Francis wrote:
@@ -1312,8 +1320,8 @@ int riscv_csrrw(CPURISCVState *env, int csrno, 
target_ulong *ret_value,
          return -RISCV_EXCP_ILLEGAL_INST;
      }
      ret = csr_ops[csrno].predicate(env, csrno);
-    if (ret < 0) {
-        return ret;
+    if (ret > 0) {
+        return -ret;
      }

I think you want

  if (ret != RISCV_EXCP_NONE) {
     return -ret;
  }

here. But of course this outer interface is still confused until patches 4+5. So perhaps it doesn't matter.


r~



reply via email to

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