Fix for issue #183: No illegal instruction exception for c.sxxi instructions encoded...
authorShubhodeep Roy Choudhury <deepsrc@gmail.com>
Fri, 16 Mar 2018 08:16:20 +0000 (13:46 +0530)
committerAndrew Waterman <andrew@sifive.com>
Fri, 16 Mar 2018 17:08:39 +0000 (10:08 -0700)
riscv/insns/c_slli.h
riscv/insns/c_srai.h
riscv/insns/c_srli.h

index 24fbb1335be3060dd7b9b1d2c2dd96a1585608ba..19d7908dc5b5f8659a44353d41ec88edeb714a45 100644 (file)
@@ -1,3 +1,3 @@
 require_extension('C');
-require(insn.rvc_zimm() < xlen);
+require(insn.rvc_zimm() < xlen && insn.rvc_zimm() > 0);
 WRITE_RD(sext_xlen(RVC_RS1 << insn.rvc_zimm()));
index f6638b1e2747c7bc2ec8bb268230658ff4f77052..7b594e9ef1f48cccc2262aa4e28e9d0f8aed8b57 100644 (file)
@@ -1,3 +1,3 @@
 require_extension('C');
-require(insn.rvc_zimm() < xlen);
+require(insn.rvc_zimm() < xlen && insn.rvc_zimm() > 0);
 WRITE_RVC_RS1S(sext_xlen(sext_xlen(RVC_RS1S) >> insn.rvc_zimm()));
index f410fefda56322c0aa7d4d39caa2d5af3c75fbee..008ae6221e89985b2f3a0aef5c74e698137a9114 100644 (file)
@@ -1,3 +1,3 @@
 require_extension('C');
-require(insn.rvc_zimm() < xlen);
+require(insn.rvc_zimm() < xlen && insn.rvc_zimm() > 0);
 WRITE_RVC_RS1S(sext_xlen(zext_xlen(RVC_RS1S) >> insn.rvc_zimm()));