target: e2k: Add %pcsp_hi and %pcsp_lo registers.

This commit is contained in:
Denis Drakhnia 2020-11-14 14:23:58 +02:00 committed by Denis Drakhnia
parent 8a8985961e
commit 27d235d092
4 changed files with 29 additions and 5 deletions

View File

@ -97,7 +97,7 @@ void e2k_cpu_dump_state(CPUState *cs, FILE *f, int flags)
unsigned int i;
qemu_fprintf(f, "ip: " TARGET_FMT_lx "\n", env->ip);
qemu_fprintf(f, "pregs: %016lx\n", env->pregs);
qemu_fprintf(f, "pregs: %016lx\n", env->pf);
qemu_fprintf(f, "usd_hi: %016lx, usd_lo: %016lx\n",
env->usd_hi, env->usd_lo);
qemu_fprintf(f, "cr1_hi: %016lx, cr1_lo: %016lx\n",

View File

@ -28,6 +28,21 @@ void e2k_tcg_initialize(void);
#define CTPR_IPD_OFF 59
#define CTPR_IPD_END 60
#define PCSP_HI_IND_OFF 0 /* index for SPILL */
#define PCSP_HI_IND_END 31
#define PCSP_HI_IND_LEN (PCSP_HI_IND_END - PCSP_HI_IND_OFF + 1)
#define PCSP_HI_SIZE_OFF 32
#define PCSP_HI_SIZE_END 63 /* procedure stack chain size */
#define PCSP_HI_SIZE_LEN (PCSP_HI_SIZE_END - PCSP_HI_SIZE_OFF + 1)
#define PCSP_LO_BASE_OFF 0 /* procedure stack chain address */
#define PCSP_LO_BASE_END 47
#define PCSP_LO_BASE_LEN (PCSP_LO_BASE_END - PCSP_LO_BASE_OFF + 1)
#define PCSP_LO_READ_OFF 59
#define PCSP_LO_READ_BIT (1UL << PCSP_LO_READ_OFF)
#define PCSP_LO_WRITE_OFF 60
#define PCSP_LO_WRITE_BIT (1UL << PCSP_LO_WRITE_OFF)
#define CR1_HI_BR_OFF 0
#define CR1_HI_BR_END 27
#define CR1_HI_BR_LEN (CR1_HI_BR_END - CR1_HI_BR_OFF + 1)
@ -118,13 +133,18 @@ typedef struct CPUArchState {
target_ulong gregs[32]; // global regs
target_ulong wregs[WREGS_SIZE]; // window regs
target_ulong *win_ptr;
uint64_t pregs;
uint64_t pf; /* predicate file */
uint32_t wbs; // window regs offset
uint32_t wsz; // window regs size
uint32_t nfx; // TODO
uint32_t dbl; // TODO
uint64_t pcsp_hi;
uint64_t pcsp_lo;
/* cr0_hi == ip */
/* cr0_lo == pf */
uint64_t cr1_hi;
uint64_t cr1_lo;

View File

@ -429,11 +429,13 @@ void e2k_tcg_initialize(void) {
};
static const struct { TCGv_i64 *ptr; int off; const char *name; } r64[] = {
{ &e2k_cs.pregs, offsetof(CPUE2KState, pregs), "pregs" },
{ &e2k_cs.usd_hi, offsetof(CPUE2KState, usd_hi), "usd.hi" },
{ &e2k_cs.usd_lo, offsetof(CPUE2KState, usd_lo), "usd.lo" },
{ &e2k_cs.pregs, offsetof(CPUE2KState, pf), "pregs" },
{ &e2k_cs.pcsp_hi, offsetof(CPUE2KState, pcsp_hi), "pcsp_hi" },
{ &e2k_cs.pcsp_lo, offsetof(CPUE2KState, pcsp_lo), "pcsp_lo" },
{ &e2k_cs.cr1_hi, offsetof(CPUE2KState, cr1_hi), "cr1_hi" },
{ &e2k_cs.cr1_lo, offsetof(CPUE2KState, cr1_lo), "cr1_lo" },
{ &e2k_cs.usd_hi, offsetof(CPUE2KState, usd_hi), "usd.hi" },
{ &e2k_cs.usd_lo, offsetof(CPUE2KState, usd_lo), "usd.lo" },
{ &e2k_cs.lsr, offsetof(CPUE2KState, lsr), "lsr" },
};

View File

@ -50,6 +50,8 @@ typedef struct CPUE2KStateTCG {
TCGv_i32 wsz;
TCGv_i32 nfx;
TCGv_i32 dbl;
TCGv_i64 pcsp_hi;
TCGv_i64 pcsp_lo;
TCGv_i64 cr1_hi;
TCGv_i64 cr1_lo;
TCGv_i64 lsr;