1
0
mirror of https://github.com/simh/simh.git synced 2026-04-29 05:05:14 +00:00

VAX: Add octaword result information to instruction history

Also reworked drom result bitfield macros to use standard shift and masks
This commit is contained in:
Mark Pizzolato
2016-05-28 06:03:21 -07:00
parent 4e7fada26c
commit a71a7c6882
4 changed files with 129 additions and 99 deletions

View File

@@ -230,19 +230,6 @@
rh = arh
#define HIST_MIN 64
#define HIST_MAX 250000
typedef struct {
double time;
int32 iPC;
int32 PSL;
int32 opc;
uint8 inst[INST_SIZE];
uint32 opnd[OPND_SIZE];
uint32 res[6];
} InstHistory;
uint32 *M = NULL; /* memory */
int32 R[16]; /* registers */
int32 STK[5]; /* stack pointers */
@@ -603,32 +590,35 @@ for ( ;; ) {
if (hst_lnt) {
InstHistory *hlast = &hst[hst_p ? hst_p-1 : hst_lnt -1];
int res = (drom[hlast->opc][0] & DR_M_RESMASK) >> DR_V_RESMASK;
switch ((drom[hlast->opc][0] & DR_M_RESMASK) >> DR_V_RESMASK) {
case RB_O>>DR_V_RESMASK:
switch (DR_GETRES(drom[hlast->opc][0]) << DR_V_RESMASK) {
case RB_O:
case RB_OB:
case RB_OW:
case RB_OL:
case RB_OQ:
break;
case RB_Q>>DR_V_RESMASK:
case RB_Q:
hlast->res[1] = rh;
hlast->res[0] = r;
break;
case RB_B>>DR_V_RESMASK:
case RB_W>>DR_V_RESMASK:
case RB_L>>DR_V_RESMASK:
case RB_B:
case RB_W:
case RB_L:
hlast->res[0] = r;
break;
case RB_R5>>DR_V_RESMASK:
case RB_R5:
hlast->res[5] = R[5];
hlast->res[4] = R[4];
case RB_R3>>DR_V_RESMASK:
case RB_R3:
hlast->res[3] = R[3];
hlast->res[2] = R[2];
case RB_R1>>DR_V_RESMASK:
case RB_R1:
hlast->res[1] = R[1];
case RB_R0>>DR_V_RESMASK:
case RB_R0:
hlast->res[0] = R[0];
break;
case RB_SP>>DR_V_RESMASK:
case RB_SP:
hlast->res[0] = Read (SP, L_LONG, RA);
break;
default:
@@ -3104,7 +3094,8 @@ for ( ;; ) {
case ADDH2: case ADDH3: case SUBH2: case SUBH3:
case MULH2: case MULH3: case DIVH2: case DIVH3:
case ACBH: case POLYH: case EMODH:
cc = op_octa (opnd, cc, opc, acc, spec, va);
cc = op_octa (opnd, cc, opc, acc, spec, va,
(hst_lnt ? &hst[hst_p ? hst_p-1 : hst_lnt -1] : NULL) );
if (cc & LSIGN) { /* ACBH branch? */
BRANCHW (brdisp);
cc = cc & CC_MASK; /* mask off flag */
@@ -3569,33 +3560,33 @@ for (i = 1, j = 0, more = FALSE; i <= numspec; i++) { /* loop thru specs */
break;
} /* end case */
} /* end for */
if ((line == 0) && ((drom[h->opc][0] & DR_M_RESMASK) >> DR_V_RESMASK)) {
if ((line == 0) && (DR_GETRES(drom[h->opc][0]))) {
fprintf (st, " ->");
switch ((drom[h->opc][0] & DR_M_RESMASK) >> DR_V_RESMASK) {
case RB_O>>DR_V_RESMASK:
switch (DR_GETRES(drom[h->opc][0]) << DR_V_RESMASK) {
case RB_O:
fprintf (st, " %08X %08X %08X %08X", h->res[0], h->res[1], h->res[2], h->res[3]);
break;
case RB_Q>>DR_V_RESMASK:
case RB_Q:
fprintf (st, " %08X %08X", h->res[0], h->res[1]);
break;
case RB_B>>DR_V_RESMASK:
case RB_W>>DR_V_RESMASK:
case RB_L>>DR_V_RESMASK:
case RB_B:
case RB_W:
case RB_L:
fprintf (st, " %08X", h->res[0]);
break;
case RB_R5>>DR_V_RESMASK:
case RB_R3>>DR_V_RESMASK:
case RB_R1>>DR_V_RESMASK:
case RB_R0>>DR_V_RESMASK:
case RB_R5:
case RB_R3:
case RB_R1:
case RB_R0:
if (1) {
static const int rcnts[] = {1, 2, 4, 6};
int i;
for (i = 0; i < rcnts[((drom[h->opc][0] & DR_M_RESMASK) - RB_R0) >> DR_V_RESMASK]; i++)
for (i = 0; i < rcnts[DR_GETRES(drom[h->opc][0]) - DR_GETRES(RB_R0)]; i++)
fprintf (st, " R%d:%08X", i, h->res[i]);
}
break;
case RB_SP>>DR_V_RESMASK:
case RB_SP:
fprintf (st, " SP: %08X", h->res[0]);
break;
default: