static int ahcnt, ahcnt2;
static int noaccesshistory = 0;
-#define MAX_ACCESSHIST 32
+#define MAX_ACCESSHIST 48
static struct accesshistory ahist[MAX_ACCESSHIST];
static struct accesshistory ahist2[MAX_ACCESSHIST];
return 0;
}
+static int handle_specials_pack(uae_u16 opcode, uaecptr pc, struct instr *dp, int *isconstant)
+{
+ // PACK and UNPK has third parameter
+ if (dp->mnemo == i_PACK || dp->mnemo == i_UNPK) {
+ uae_u16 v = rand16();
+ put_word_test(pc, v);
+ *isconstant = 16;
+ return 2;
+ }
+ return 0;
+}
+
+
static int handle_specials_stack(uae_u16 opcode, uaecptr pc, struct instr *dp, int *isconstant)
{
int offset = 0;
v = imm_special >> 2;
uae_u16 sr = v & 31;
sr |= (v >> 5) << 12;
- put_word_test(addr, sr);
- addr += 2;
- offset += 2;
+ put_word_test(addr + 4, sr);
*isconstant = imm_special >= (1 << (4 + 5)) * 4 ? 0 : -1;
} else if (opcode == 0x4e73) {
// RTE
{
uae_u16 opw1 = (opcode_memory[2] << 8) | (opcode_memory[3] << 0);
uae_u16 opw2 = (opcode_memory[4] << 8) | (opcode_memory[5] << 0);
- if (opc == 0x6100
- && opw1 == 0x001e
-// && opw2 == 0x2770
+ if (opc == 0x61ff
+ && opw1 == 0x0000
+ && opw2 == 0x9908
)
printf("");
static uae_u8 *save_exception(uae_u8 *p)
{
uae_u8 *op = p;
- int framelen;
p++;
uae_u8 *sf = test_memory + test_memory_size + EXTRA_RESERVED_SPACE - exception_stack_frame_size;
// parse exception and store fields that are unique
*p++ = sf[7];
switch (frame >> 12)
{
+ case 0:
+ break;
case 2:
// instruction address
p = store_rel(p, 0, opcode_memory_start, gl(sf + 8), 1);
opcodecnt++;
if (isunsupported(dp))
return;
+ if ((opcode & 0xf000) == 0xf000 && !currprefs.fpu_model)
+ return;
fpumode = currprefs.fpu_model && (opcode & 0xf000) == 0xf000;
}
// bcc.x
pc += handle_specials_branch(opc, pc, dp, &isconstant_src);
+ // pack
+ pc += handle_specials_pack(opc, pc, dp, &isconstant_src);
put_word_test(opcode_memory_start, opc);
continue;
}
+ if (!currprefs.fpu_model && (opcode & 0xf000) == 0xf000) {
+ continue;
+ }
+
if (table->handler != -1) {
int idx = table->handler;
f = cpufunctbl[idx];
x_cp_put_word = put_word_test;
x_cp_put_byte = put_byte_test;
- if (currprefs.fpu_model) {
- fpu_reset();
- }
+ fpu_reset();
starttime = time(0);
verbose = 0;
for (int j = 1; lookuptab[j].name; j++) {
- for (int i = 0; i < 8; i++) {
- test_mnemo(path, lookuptab[j].name, i, fpuopcode);
- }
+ test_mnemo(path, lookuptab[j].name, 0, -1);
+ test_mnemo(path, lookuptab[j].name, 4, -1);
+ test_mnemo(path, lookuptab[j].name, 6, -1);
+ test_mnemo(path, lookuptab[j].name, -1, -1);
}
// illg last. All currently selected CPU model's unsupported opcodes
// (illegal instruction, a-line and f-line)
- for (int i = 0; i < 8; i++) {
- test_mnemo(path, lookuptab[0].name, i, fpuopcode);
- }
+ test_mnemo(path, lookuptab[0].name, 0, -1);
+ test_mnemo(path, lookuptab[0].name, 4, -1);
+ test_mnemo(path, lookuptab[0].name, 6, -1);
+ test_mnemo(path, lookuptab[0].name, -1, -1);
break;
}
};
static int ahcnt;
-#define MAX_ACCESSHIST 8
+#define MAX_ACCESSHIST 48
static struct accesshistory ahist[MAX_ACCESSHIST];
static void endinfo(void)
outbp += strlen(outbp);
}
+struct srbit
+{
+ char *name;
+ int bit;
+};
+static struct srbit srbits[] = {
+ { "T1", 15 },
+ { "T0", 14 },
+ { "M", 13 },
+ { "S", 12 },
+ { "X", 4 },
+ { "N", 3 },
+ { "Z", 2 },
+ { "V", 1 },
+ { "C", 0 },
+ { NULL, 0 }
+};
+
static void out_regs(struct registers *r, int before)
{
for (int i = 0; i < 16; i++) {
uae_u16 s = before ? test_sr : r->sr;
uae_u16 s1 = test_regs.sr;
uae_u16 s2 = test_sr;
- sprintf(outbp, "T%c%d S%c%d X%c%d N%c%d Z%c%d V%c%d C%c%d",
- (s1 & 0x8000) != (s2 & 0x8000) ? '*' : '=', (s & 0x8000) != 0,
- (s1 & 0x2000) != (s2 & 0x2000) ? '*' : '=', (s & 0x2000) != 0,
- (s1 & 0x10) != (s2 & 0x10) ? '*' : '=', (s & 0x10) != 0,
- (s1 & 0x08) != (s2 & 0x08) ? '*' : '=', (s & 0x08) != 0,
- (s1 & 0x04) != (s2 & 0x04) ? '*' : '=', (s & 0x04) != 0,
- (s1 & 0x02) != (s2 & 0x02) ? '*' : '=', (s & 0x02) != 0,
- (s1 & 0x01) != (s2 & 0x01) ? '*' : '=', (s & 0x01) != 0);
- outbp += strlen(outbp);
+ uae_u16 s3 = before ? s1 : last_registers.sr;
+ for (int i = 0; srbits[i].name; i++) {
+ if (i > 0)
+ *outbp++ = ' ';
+ uae_u16 mask = 1 << srbits[i].bit;
+ sprintf(outbp, "%s%c%d", srbits[i].name, (s3 & mask) != (s1 & mask) ? '!' : ((s1 & mask) != (s2 & mask) ? '*' : '='), (s & mask) != 0);
+ outbp += strlen(outbp);
+ }
if (!fpu_model) {
strcat(outbp, "\n");
if (memcmp(exc, sp, exclen)) {
strcpy(outbp, "Exception stack frame mismatch:\n");
outbp += strlen(outbp);
- hexdump(sp, exclen);
+ strcpy(outbp, "Expected: ");
+ outbp += strlen(outbp);
hexdump(exc, exclen);
+ strcpy(outbp, "Got : ");
+ outbp += strlen(outbp);
+ hexdump(sp, exclen);
errors = 1;
}
return p;