add AUIPC insn; remove RDNPC insn
authorAndrew Waterman <waterman@cs.berkeley.edu>
Wed, 17 Apr 2013 11:38:17 +0000 (04:38 -0700)
committerAndrew Waterman <waterman@cs.berkeley.edu>
Wed, 17 Apr 2013 11:38:17 +0000 (04:38 -0700)
riscv/disasm.cc
riscv/insns/auipc.h [new file with mode: 0644]
riscv/insns/rdnpc.h [deleted file]
riscv/opcodes.h
riscv/riscv.mk.in

index d8c4ab0b79afc721fc8c4d426b49c8a34cb8a1f2..8bab238c061aab15bde59b4fcbdd0b675e49f445 100644 (file)
@@ -502,11 +502,11 @@ disassembler::disassembler()
   DEFINE_BTYPE(bgeu)
 
   DEFINE_LTYPE(lui);
+  DEFINE_LTYPE(auipc);
 
   DEFINE_I2TYPE("jr", jalr_j);
   add_insn(new disasm_insn_t("jalr", match_jalr_c | match_rd_ra, mask_jalr_c | mask_rd | mask_imm, xrs1_reg));
   add_insn(new disasm_insn_t("ret", match_jalr_r | match_rs1_ra, mask_jalr_r | mask_rd | mask_rs1 | mask_imm));
-  DEFINE_DTYPE(rdnpc);
   DEFINE_ITYPE(jalr_c);
   DEFINE_ITYPE(jalr_r);
   DEFINE_ITYPE(jalr_j);
diff --git a/riscv/insns/auipc.h b/riscv/insns/auipc.h
new file mode 100644 (file)
index 0000000..48480cd
--- /dev/null
@@ -0,0 +1 @@
+RD = sext_xprlen(sext32(BIGIMM << IMM_BITS) + pc);
diff --git a/riscv/insns/rdnpc.h b/riscv/insns/rdnpc.h
deleted file mode 100644 (file)
index 5525421..0000000
+++ /dev/null
@@ -1 +0,0 @@
-RD = npc;
index 8ac1ab262e6cd16fd5d4183d67041f7bb79f2316..ab33192b48a39f9791145196ce8df3fe496a05d6 100644 (file)
@@ -9,7 +9,6 @@ DECLARE_INSN(bltu, 0x363, 0x3ff)
 DECLARE_INSN(vlsegstwu, 0xb0b, 0xfff)
 DECLARE_INSN(vvcfg, 0x473, 0xf801ffff)
 DECLARE_INSN(movz, 0x2f7, 0x1ffff)
-DECLARE_INSN(fcvt_lu_s, 0x9053, 0x3ff1ff)
 DECLARE_INSN(c_ld, 0x9, 0x1f)
 DECLARE_INSN(c_srli32, 0xc19, 0x1c1f)
 DECLARE_INSN(fmin_s, 0x18053, 0x1ffff)
@@ -234,10 +233,11 @@ DECLARE_INSN(fence_v_g, 0x2af, 0x3ff)
 DECLARE_INSN(vmsv, 0x873, 0x3fffff)
 DECLARE_INSN(vmst, 0x1073, 0x1ffff)
 DECLARE_INSN(setpcr, 0xfb, 0x3ff)
-DECLARE_INSN(rdnpc, 0x26b, 0x7ffffff)
+DECLARE_INSN(fcvt_lu_s, 0x9053, 0x3ff1ff)
 DECLARE_INSN(vxcpthold, 0x277b, 0xffffffff)
 DECLARE_INSN(fcvt_s_l, 0xc053, 0x3ff1ff)
 DECLARE_INSN(vflsegstd, 0xd8b, 0xfff)
+DECLARE_INSN(auipc, 0x17, 0x7f)
 DECLARE_INSN(c_add, 0x1a, 0x801f)
 DECLARE_INSN(fcvt_lu_d, 0x90d3, 0x3ff1ff)
 DECLARE_INSN(vfld, 0x58b, 0x3fffff)
index bf6e07ab6f637ba067a5e7bc84dfc690b222577c..b3f8598ddb12ca75745444baef6e1b9da295f55d 100644 (file)
@@ -33,7 +33,7 @@ DISPATCH_SRCS := \
 $(DISPATCH_SRCS): %.cc: dispatch $(wildcard insns/*.h) $(riscv_hdrs)
        $< $(subst dispatch,,$(subst .cc,,$@)) $(NDISPATCH) 1024 < $(src_dir)/riscv/opcodes.h > $@
 
-$(src_dir)/riscv/dispatch.h: %.h: dispatch
+dispatch.h: %.h: dispatch $(riscv_hdrs)
        $< $(NDISPATCH) 1024 < $(src_dir)/riscv/opcodes.h > $@
 
 riscv_srcs = \