aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/c_sub.h
diff options
context:
space:
mode:
Diffstat (limited to 'riscv/insns/c_sub.h')
-rw-r--r--riscv/insns/c_sub.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/riscv/insns/c_sub.h b/riscv/insns/c_sub.h
new file mode 100644
index 0000000..993fdd3
--- /dev/null
+++ b/riscv/insns/c_sub.h
@@ -0,0 +1,3 @@
+require_extension('C');
+require(insn.rvc_rd() != 0 && insn.rvc_rs2() != 0);
+WRITE_RD(sext_xlen(RVC_RS1 - RVC_RS2));