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