From: Andrew Waterman Date: Sun, 14 May 2017 05:37:22 +0000 (-0700) Subject: Make C.LI/C.LUI trapping behavior match spec X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e465de145c69c28230b5c73cc58f96fd9bd04419;p=riscv-isa-sim.git Make C.LI/C.LUI trapping behavior match spec --- diff --git a/riscv/insns/c_li.h b/riscv/insns/c_li.h index 844686d..f9fd66b 100644 --- a/riscv/insns/c_li.h +++ b/riscv/insns/c_li.h @@ -1,3 +1,2 @@ require_extension('C'); -require(insn.rvc_rd() != 0); WRITE_RD(insn.rvc_imm()); diff --git a/riscv/insns/c_lui.h b/riscv/insns/c_lui.h index 130aaed..75d8eb8 100644 --- a/riscv/insns/c_lui.h +++ b/riscv/insns/c_lui.h @@ -3,6 +3,6 @@ if (insn.rvc_rd() == 2) { // c.addi16sp require(insn.rvc_addi16sp_imm() != 0); WRITE_REG(X_SP, sext_xlen(RVC_SP + insn.rvc_addi16sp_imm())); } else { - require(insn.rvc_rd() != 0); + require(insn.rvc_imm() != 0); WRITE_RD(insn.rvc_imm() << 12); }