From a992b3de2f1484f039ae91c79384c5d807a0d798 Mon Sep 17 00:00:00 2001 From: Jim Date: Mon, 3 Sep 2007 00:00:00 -0400 Subject: [PATCH] set crs[PBH] with 1 32-bit store instead of 2 16-bit stores in main loop + changed order of 3 lines in iget16 to improve performance --- em.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/em.c b/em.c index aef6899..67a3fb2 100644 --- a/em.c +++ b/em.c @@ -1028,11 +1028,11 @@ unsigned short iget16(ea_t ea) { static ea_t prevvpn = 0xFFFFFC00; /* virtual page address */ if (*(int *)&ea >= 0) { - thisvpn = ea & 0x8FFFFC00; /* no match if ea faulted */ + thisvpn = ea & 0x0FFFFC00; /* segment and page number */ if ((thisvpn != prevvpn) || (((ea & 0x0FFF0000) >= 0x800) && (crsl[OWNER32] != prevowner))) { - prevppa = mapva(ea, RP, RACC, &access) & 0xFFFFFC00; - prevowner = crsl[OWNER32]; prevvpn = thisvpn; + prevowner = crsl[OWNER32]; + prevppa = mapva(ea, RP, RACC, &access) & 0xFFFFFC00; } return mem[prevppa + (ea & 0x3FF)]; } @@ -4244,8 +4244,12 @@ fetch: process stops running, RP is copied to PB. When a process starts running again, PB is copied to RP. */ +#ifdef FAST + *(int *)(crs+PBH) = RP & 0xFFFF0000; +#else crs[PBH] = RPH; crs[PBL] = 0; +#endif earp = RP; if (crs[MODALS] & 010) { /* px enabled, bump 1ms process timer */