Make C.LI/C.LUI trapping behavior match spec
authorAndrew Waterman <andrew@sifive.com>
Sun, 14 May 2017 05:37:22 +0000 (22:37 -0700)
committerAndrew Waterman <andrew@sifive.com>
Sun, 14 May 2017 05:37:48 +0000 (22:37 -0700)
riscv/insns/c_li.h
riscv/insns/c_lui.h

index 844686dd21d9a595a8c095463eb98fdc6b778a53..f9fd66b2f32ee651f97a76c89ba68da0bce1cc56 100644 (file)
@@ -1,3 +1,2 @@
 require_extension('C');
-require(insn.rvc_rd() != 0);
 WRITE_RD(insn.rvc_imm());
index 130aaed8f4c93bc9cc23b12909bb1a7db5e31d60..75d8eb892fa966dccc966690f3640e124d68ceda 100644 (file)
@@ -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);
 }