c_lui
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 18 Oct 2018 22:18:51 +0000 (23:18 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 18 Oct 2018 22:18:51 +0000 (23:18 +0100)
riscv/insns/c_jr.h
riscv/insns/c_lui.h

index 9c4a8ea9a79d00feeb641230b4c679301ba83022..1cb20d1e28f1796478971c5def0f78bf9acdcc72 100644 (file)
@@ -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))));
index 85f29ab216b1f84317e4748d60106a7ac0ee96b2..9b53a44042565eaa37ebd3600a57d9e921c7aa68 100644 (file)
@@ -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)));
 }