From 68d1d85208680ca335141916df0c54a4f03aace5 Mon Sep 17 00:00:00 2001 From: Yunsup Lee Date: Mon, 16 Mar 2015 01:59:55 -0700 Subject: [PATCH] vxcptsave->vxcptevac,vxcptrestore->vxcpthold this change was necessary since the impl csr is gone. --- hwacha/decode_hwacha.h | 1 + hwacha/encodings_hwacha.h | 2 +- hwacha/hwacha_disasm.cc | 4 ++-- hwacha/insns/{vxcptsave.h => vxcptevac.h} | 6 +++++- hwacha/insns/{vxcptrestore.h => vxcpthold.h} | 4 +++- hwacha/opcodes_hwacha.h | 4 ++-- 6 files changed, 14 insertions(+), 7 deletions(-) rename hwacha/insns/{vxcptsave.h => vxcptevac.h} (89%) rename hwacha/insns/{vxcptrestore.h => vxcpthold.h} (90%) diff --git a/hwacha/decode_hwacha.h b/hwacha/decode_hwacha.h index b00c6af..1541758 100644 --- a/hwacha/decode_hwacha.h +++ b/hwacha/decode_hwacha.h @@ -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)) diff --git a/hwacha/encodings_hwacha.h b/hwacha/encodings_hwacha.h index 11fa889..433748f 100644 --- a/hwacha/encodings_hwacha.h +++ b/hwacha/encodings_hwacha.h @@ -111,7 +111,7 @@ #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 diff --git a/hwacha/hwacha_disasm.cc b/hwacha/hwacha_disasm.cc index 02e3d57..a950cd5 100644 --- a/hwacha/hwacha_disasm.cc +++ b/hwacha/hwacha_disasm.cc @@ -139,8 +139,8 @@ std::vector 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/vxcptsave.h b/hwacha/insns/vxcptevac.h similarity index 89% rename from hwacha/insns/vxcptsave.h rename to hwacha/insns/vxcptevac.h index cc663ed..607e352 100644 --- a/hwacha/insns/vxcptsave.h +++ b/hwacha/insns/vxcptevac.h @@ -13,12 +13,16 @@ reg_t addr = XS1; 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); -addr += 4; +STORE_W(addr, PREC); + STORE_D(addr, VF_PC); for (uint32_t x=1; xget_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)); -addr += 4; +WRITE_PREC(LOAD_W(addr)); WRITE_VF_PC(LOAD_D(addr)); for (uint32_t x=1; x