vxcptsave->vxcptevac,vxcptrestore->vxcpthold
authorYunsup Lee <yunsup@cs.berkeley.edu>
Mon, 16 Mar 2015 08:59:55 +0000 (01:59 -0700)
committerYunsup Lee <yunsup@cs.berkeley.edu>
Mon, 16 Mar 2015 08:59:55 +0000 (01:59 -0700)
this change was necessary since the impl csr is gone.

hwacha/decode_hwacha.h
hwacha/encodings_hwacha.h
hwacha/hwacha_disasm.cc
hwacha/insns/vxcptevac.h [new file with mode: 0644]
hwacha/insns/vxcpthold.h [new file with mode: 0644]
hwacha/insns/vxcptrestore.h [deleted file]
hwacha/insns/vxcptsave.h [deleted file]
hwacha/opcodes_hwacha.h

index b00c6af94e27952fa8be49bf4cc54dff930044ae..1541758bd116cf8f554c8ead09dce3d209a45e74 100644 (file)
@@ -14,6 +14,7 @@
 #define MAXVL (h->get_ct_state()->maxvl)
 #define VL (h->get_ct_state()->vl)
 #define UTIDX (h->get_ct_state()->count)
+#define PREC (h->get_ct_state()->prec)
 #define VF_PC (h->get_ct_state()->vf_pc)
 #define WRITE_NXPR(nxprnext) (h->get_ct_state()->nxpr = (nxprnext))
 #define WRITE_NFPR(nfprnext) (h->get_ct_state()->nfpr = (nfprnext))
index 11fa889a5edf870a65ac3c221e090e277cd28f95..433748f081d17d602acded69db1f95554c5b6eb3 100644 (file)
 #define MASK_VXCPTAUX  0xfffff07f
 #define MASK_VXCPTCAUSE  0xfffff07f
 #define MASK_VXCPTEVAC  0xfff07fff
-#define MASK_VXCPTHOLD  0xffffffff
+#define MASK_VXCPTHOLD  0xfff07fff
 #define MASK_VXCPTKILL  0xffffffff
 #define MASK_VXCPTRESTORE  0xfff07fff
 #define MASK_VXCPTSAVE  0xfff07fff
index 02e3d5711e01d4df1b650e44bc0452aa5f569a42..a950cd516167e828980fdc354030f0b5624b7f43 100644 (file)
@@ -139,8 +139,8 @@ std::vector<disasm_insn_t*> hwacha_t::get_disasms()
 
   DISASM_INSN("vxcptcause", vxcptcause, 0, {&xrd});
   DISASM_INSN("vxcptaux", vxcptaux, 0, {&xrd});
-  DISASM_INSN("vxcptsave", vxcptsave, 0, {&xrs1});
-  DISASM_INSN("vxcptrestore", vxcptrestore, 0, {&xrs1});
+  DISASM_INSN("vxcptevac", vxcptevac, 0, {&xrs1});
+  DISASM_INSN("vxcpthold", vxcpthold, 0, {&xrs1});
   DISASM_INSN("vxcptkill", vxcptkill, 0, {});
 
   const uint32_t mask_vseglen = 0x7UL << 29;
diff --git a/hwacha/insns/vxcptevac.h b/hwacha/insns/vxcptevac.h
new file mode 100644 (file)
index 0000000..607e352
--- /dev/null
@@ -0,0 +1,48 @@
+require_supervisor_hwacha;
+reg_t addr = XS1;
+
+#define STORE_B(addr, value) \
+  p->get_mmu()->store_uint8(addr, value); \
+  addr += 1; \
+
+#define STORE_W(addr, value) \
+  p->get_mmu()->store_uint32(addr, value); \
+  addr += 4; \
+
+#define STORE_D(addr, value) \
+  p->get_mmu()->store_uint64(addr, value); \
+  addr += 8; \
+
+// to be compliant with the evac structure
+STORE_D(addr, (uint64_t)-1);
+
+STORE_W(addr, NXPR);
+STORE_W(addr, NFPR);
+STORE_W(addr, MAXVL);
+STORE_W(addr, VL);
+STORE_W(addr, UTIDX);
+STORE_W(addr, PREC);
+
+STORE_D(addr, VF_PC);
+
+for (uint32_t x=1; x<NXPR; x++) {
+  for (uint32_t i=0; i<VL; i++) {
+    STORE_D(addr, UT_READ_XPR(i, x));
+  }
+}
+
+for (uint32_t f=0; f<NFPR; f++) {
+  for (uint32_t i=0; i<VL; i++) {
+    STORE_D(addr, UT_READ_FPR(i, f));
+  }
+}
+
+for (uint32_t i=0; i<VL; i++) {
+  STORE_B(addr, h->get_ut_state(i)->run);
+}
+
+#undef STORE_B
+#undef STORE_W
+#undef STORE_D
+
+#include "insns/vxcptkill.h"
diff --git a/hwacha/insns/vxcpthold.h b/hwacha/insns/vxcpthold.h
new file mode 100644 (file)
index 0000000..adefd75
--- /dev/null
@@ -0,0 +1,42 @@
+require_supervisor_hwacha;
+reg_t addr = XS1;
+
+#define LOAD_B(addr) \
+  (addr += 1, p->get_mmu()->load_uint8(addr-1))
+
+#define LOAD_W(addr) \
+  (addr += 4, p->get_mmu()->load_uint32(addr-4))
+
+#define LOAD_D(addr) \
+  (addr += 8, p->get_mmu()->load_uint64(addr-8))
+
+// to be compliant with the evac structure
+addr += 8;
+
+WRITE_NXPR(LOAD_W(addr));
+WRITE_NFPR(LOAD_W(addr));
+WRITE_MAXVL(LOAD_W(addr));
+WRITE_VL(LOAD_W(addr));
+WRITE_UTIDX(LOAD_W(addr));
+WRITE_PREC(LOAD_W(addr));
+WRITE_VF_PC(LOAD_D(addr));
+
+for (uint32_t x=1; x<NXPR; x++) {
+  for (uint32_t i=0; i<VL; i++) {
+    UT_WRITE_XPR(i, x, LOAD_D(addr));
+  }
+}
+
+for (uint32_t f=0; f<NFPR; f++) {
+  for (uint32_t i=0; i<VL; i++) {
+    UT_WRITE_FPR(i, f, LOAD_D(addr));
+  }
+}
+
+for (uint32_t i=0; i<VL; i++) {
+  h->get_ut_state(i)->run = LOAD_B(addr);
+}
+
+#undef LOAD_B
+#undef LOAD_W
+#undef LOAD_D
diff --git a/hwacha/insns/vxcptrestore.h b/hwacha/insns/vxcptrestore.h
deleted file mode 100644 (file)
index db7a62e..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-require_supervisor_hwacha;
-reg_t addr = XS1;
-
-#define LOAD_B(addr) \
-  (addr += 1, p->get_mmu()->load_uint8(addr-1))
-
-#define LOAD_W(addr) \
-  (addr += 4, p->get_mmu()->load_uint32(addr-4))
-
-#define LOAD_D(addr) \
-  (addr += 8, p->get_mmu()->load_uint64(addr-8))
-
-
-WRITE_NXPR(LOAD_W(addr));
-WRITE_NFPR(LOAD_W(addr));
-WRITE_MAXVL(LOAD_W(addr));
-WRITE_VL(LOAD_W(addr));
-WRITE_UTIDX(LOAD_W(addr));
-addr += 4;
-WRITE_VF_PC(LOAD_D(addr));
-
-for (uint32_t x=1; x<NXPR; x++) {
-  for (uint32_t i=0; i<VL; i++) {
-    UT_WRITE_XPR(i, x, LOAD_D(addr));
-  }
-}
-
-for (uint32_t f=0; f<NFPR; f++) {
-  for (uint32_t i=0; i<VL; i++) {
-    UT_WRITE_FPR(i, f, LOAD_D(addr));
-  }
-}
-
-for (uint32_t i=0; i<VL; i++) {
-  h->get_ut_state(i)->run = LOAD_B(addr);
-}
-
-#undef LOAD_B
-#undef LOAD_W
-#undef LOAD_D
diff --git a/hwacha/insns/vxcptsave.h b/hwacha/insns/vxcptsave.h
deleted file mode 100644 (file)
index cc663ed..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-require_supervisor_hwacha;
-reg_t addr = XS1;
-
-#define STORE_B(addr, value) \
-  p->get_mmu()->store_uint8(addr, value); \
-  addr += 1; \
-
-#define STORE_W(addr, value) \
-  p->get_mmu()->store_uint32(addr, value); \
-  addr += 4; \
-
-#define STORE_D(addr, value) \
-  p->get_mmu()->store_uint64(addr, value); \
-  addr += 8; \
-
-STORE_W(addr, NXPR);
-STORE_W(addr, NFPR);
-STORE_W(addr, MAXVL);
-STORE_W(addr, VL);
-STORE_W(addr, UTIDX);
-addr += 4;
-STORE_D(addr, VF_PC);
-
-for (uint32_t x=1; x<NXPR; x++) {
-  for (uint32_t i=0; i<VL; i++) {
-    STORE_D(addr, UT_READ_XPR(i, x));
-  }
-}
-
-for (uint32_t f=0; f<NFPR; f++) {
-  for (uint32_t i=0; i<VL; i++) {
-    STORE_D(addr, UT_READ_FPR(i, f));
-  }
-}
-
-for (uint32_t i=0; i<VL; i++) {
-  STORE_B(addr, h->get_ut_state(i)->run);
-}
-
-#undef STORE_B
-#undef STORE_W
-#undef STORE_D
-
-#include "insns/vxcptkill.h"
index b6dbe8b6529aa6ffb4629b82ae43a017b8e864d2..d0eb1eea2450c70f13cdf229ea018bcc7fc325fb 100644 (file)
@@ -42,6 +42,6 @@ DECLARE_INSN(vssegstw, MATCH_VSSEGSTW, MASK_VSSEGSTW)
 DECLARE_INSN(vssegw, MATCH_VSSEGW, MASK_VSSEGW)
 DECLARE_INSN(vxcptaux, MATCH_VXCPTAUX, MASK_VXCPTAUX)
 DECLARE_INSN(vxcptcause, MATCH_VXCPTCAUSE, MASK_VXCPTCAUSE)
+DECLARE_INSN(vxcptevac, MATCH_VXCPTEVAC, MASK_VXCPTEVAC)
+DECLARE_INSN(vxcpthold, MATCH_VXCPTHOLD, MASK_VXCPTHOLD)
 DECLARE_INSN(vxcptkill, MATCH_VXCPTKILL, MASK_VXCPTKILL)
-DECLARE_INSN(vxcptrestore, MATCH_VXCPTRESTORE, MASK_VXCPTRESTORE)
-DECLARE_INSN(vxcptsave, MATCH_VXCPTSAVE, MASK_VXCPTSAVE)