Use new NaN discipline
[riscv-isa-sim.git] / hwacha / insns / vxcptevac.h
1 require_supervisor_hwacha;
2 reg_t addr = XS1;
3
4 #define STORE_B(addr, value) \
5 p->get_mmu()->store_uint8(addr, value); \
6 addr += 1; \
7
8 #define STORE_W(addr, value) \
9 p->get_mmu()->store_uint32(addr, value); \
10 addr += 4; \
11
12 #define STORE_D(addr, value) \
13 p->get_mmu()->store_uint64(addr, value); \
14 addr += 8; \
15
16 // to be compliant with the evac structure
17 STORE_D(addr, (uint64_t)-1);
18
19 STORE_W(addr, NXPR);
20 STORE_W(addr, NFPR);
21 STORE_W(addr, MAXVL);
22 STORE_W(addr, VL);
23 STORE_W(addr, UTIDX);
24 STORE_W(addr, PREC);
25
26 STORE_D(addr, VF_PC);
27
28 for (uint32_t x=1; x<NXPR; x++) {
29 for (uint32_t i=0; i<VL; i++) {
30 STORE_D(addr, UT_READ_XPR(i, x));
31 }
32 }
33
34 for (uint32_t f=0; f<NFPR; f++) {
35 for (uint32_t i=0; i<VL; i++) {
36 STORE_D(addr, UT_READ_FPR(i, f));
37 }
38 }
39
40 for (uint32_t i=0; i<VL; i++) {
41 STORE_B(addr, h->get_ut_state(i)->run);
42 }
43
44 #undef STORE_B
45 #undef STORE_W
46 #undef STORE_D
47
48 #include "insns/vxcptkill.h"