From e465de145c69c28230b5c73cc58f96fd9bd04419 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Sat, 13 May 2017 22:37:22 -0700 Subject: [PATCH] Make C.LI/C.LUI trapping behavior match spec --- riscv/insns/c_li.h | 1 - riscv/insns/c_lui.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) 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); } -- 2.30.2