Revert "C.LWSP and C.LDSP with rd=0 are legal instructions"
authorAndrew Waterman <andrew@sifive.com>
Fri, 4 May 2018 19:05:33 +0000 (12:05 -0700)
committerAndrew Waterman <andrew@sifive.com>
Fri, 4 May 2018 19:05:33 +0000 (12:05 -0700)
See https://github.com/riscv/riscv-isa-manual/commit/01190b6ebeb29cfac6783a3e7ce30cd529bf6c59

riscv/insns/c_flwsp.h
riscv/insns/c_lwsp.h

index d1e14fe8631ae68f9f2d4abb87b65b221a8a32b8..79058c40a37d7b971640fc9877dc4be9ee91303b 100644 (file)
@@ -4,5 +4,6 @@ if (xlen == 32) {
   require_fp;
   WRITE_FRD(f32(MMU.load_uint32(RVC_SP + insn.rvc_lwsp_imm())));
 } else { // c.ldsp
+  require(insn.rvc_rd() != 0);
   WRITE_RD(MMU.load_int64(RVC_SP + insn.rvc_ldsp_imm()));
 }
index ed4dcf30887e4e299fd2cff5835a4faf521dc3e5..b3d74dbf087fb09553ca438bf4c44629ecfdc032 100644 (file)
@@ -1,2 +1,3 @@
 require_extension('C');
+require(insn.rvc_rd() != 0);
 WRITE_RD(MMU.load_int32(RVC_SP + insn.rvc_lwsp_imm()));