From: Luke Kenneth Casson Leighton Date: Thu, 18 Oct 2018 22:18:51 +0000 (+0100) Subject: c_lui X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b292fd7fd8c5ed8ecb7e6c681996a4206a158ad0;p=riscv-isa-sim.git c_lui --- diff --git a/riscv/insns/c_jr.h b/riscv/insns/c_jr.h index 9c4a8ea..1cb20d1 100644 --- a/riscv/insns/c_jr.h +++ b/riscv/insns/c_jr.h @@ -1,3 +1,3 @@ require_extension('C'); require(insn.rvc_rs1() != 0); -set_pc(RVC_RS1 & ~reg_t(1)); +set_pc(rv_and(RVC_RS1, sv_reg_t(~reg_t(1)))); diff --git a/riscv/insns/c_lui.h b/riscv/insns/c_lui.h index 85f29ab..9b53a44 100644 --- a/riscv/insns/c_lui.h +++ b/riscv/insns/c_lui.h @@ -1,8 +1,8 @@ require_extension('C'); if (insn.insn_t::rvc_rd() == 2) { // c.addi16sp require(insn.rvc_addi16sp_imm() != 0); - WRITE_REG(X_SP, sext_xlen(RVC_SP + insn.rvc_addi16sp_imm())); + WRITE_REG(X_SP, sext_xlen(rv_add(RVC_SP, insn.rvc_addi16sp_imm()))); } else { - require(insn.rvc_imm() != 0); - WRITE_RD(insn.rvc_imm() << 12); + require(rv_ne(insn.rvc_imm(), sv_reg_t(0L))); + WRITE_RD(rv_sl(insn.rvc_imm(), sv_reg_t(12UL))); }