More unique names

This commit is contained in:
Jasmine Iwanek
2024-08-12 20:01:54 -04:00
parent f38b6c00c6
commit ad3eaf17a9
7 changed files with 354 additions and 354 deletions

View File

@@ -18,7 +18,7 @@
#define CYCLES(c) (int *) c #define CYCLES(c) (int *) c
#define CYCLES2(c16, c32) (int *) ((-1 & ~0xffff) | c16 | (c32 << 8)) #define CYCLES2(c16, c32) (int *) ((-1 & ~0xffff) | c16 | (c32 << 8))
static int *opcode_timings[256] = { static int *opcode_timings_486[256] = {
// clang-format off // clang-format off
/*00*/ &timing_mr, &timing_mr, &timing_rm, &timing_rm, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), &timing_mr, &timing_mr, &timing_rm, &timing_rm, &timing_rr, &timing_rr, CYCLES(2), NULL, /*00*/ &timing_mr, &timing_mr, &timing_rm, &timing_rm, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), &timing_mr, &timing_mr, &timing_rm, &timing_rm, &timing_rr, &timing_rr, CYCLES(2), NULL,
/*10*/ &timing_mr, &timing_mr, &timing_rm, &timing_rm, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), &timing_mr, &timing_mr, &timing_rm, &timing_rm, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), /*10*/ &timing_mr, &timing_mr, &timing_rm, &timing_rm, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), &timing_mr, &timing_mr, &timing_rm, &timing_rm, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3),
@@ -42,7 +42,7 @@ static int *opcode_timings[256] = {
// clang-format on // clang-format on
}; };
static int *opcode_timings_mod3[256] = { static int *opcode_timings_486_mod3[256] = {
// clang-format off // clang-format off
/*00*/ &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, CYCLES(2), NULL, /*00*/ &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, CYCLES(2), NULL,
/*10*/ &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), /*10*/ &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3),
@@ -66,7 +66,7 @@ static int *opcode_timings_mod3[256] = {
// clang-format on // clang-format on
}; };
static int *opcode_timings_0f[256] = { static int *opcode_timings_486_0f[256] = {
// clang-format off // clang-format off
/*00*/ CYCLES(20), CYCLES(11), CYCLES(11), CYCLES(10), NULL, CYCLES(195), CYCLES(7), NULL, CYCLES(1000), CYCLES(10000), NULL, NULL, NULL, NULL, NULL, NULL, /*00*/ CYCLES(20), CYCLES(11), CYCLES(11), CYCLES(10), NULL, CYCLES(195), CYCLES(7), NULL, CYCLES(1000), CYCLES(10000), NULL, NULL, NULL, NULL, NULL, NULL,
/*10*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /*10*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -89,7 +89,7 @@ static int *opcode_timings_0f[256] = {
/*f0*/ NULL, &timing_rm, &timing_rm, &timing_rm, NULL, &timing_rm, NULL, NULL, &timing_rm, &timing_rm, &timing_rm, NULL, &timing_rm, &timing_rm, &timing_rm, NULL, /*f0*/ NULL, &timing_rm, &timing_rm, &timing_rm, NULL, &timing_rm, NULL, NULL, &timing_rm, &timing_rm, &timing_rm, NULL, &timing_rm, &timing_rm, &timing_rm, NULL,
// clang-format on // clang-format on
}; };
static int *opcode_timings_0f_mod3[256] = { static int *opcode_timings_486_0f_mod3[256] = {
// clang-format off // clang-format off
/*00*/ CYCLES(20), CYCLES(11), CYCLES(11), CYCLES(10), NULL, CYCLES(195), CYCLES(7), NULL, CYCLES(1000), CYCLES(10000), NULL, NULL, NULL, NULL, NULL, NULL, /*00*/ CYCLES(20), CYCLES(11), CYCLES(11), CYCLES(10), NULL, CYCLES(195), CYCLES(7), NULL, CYCLES(1000), CYCLES(10000), NULL, NULL, NULL, NULL, NULL, NULL,
/*10*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /*10*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -113,65 +113,65 @@ static int *opcode_timings_0f_mod3[256] = {
// clang-format on // clang-format on
}; };
static int *opcode_timings_shift[8] = { static int *opcode_timings_486_shift[8] = {
// clang-format off // clang-format off
CYCLES(7), CYCLES(7), CYCLES(10), CYCLES(10), CYCLES(7), CYCLES(7), CYCLES(7), CYCLES(7) CYCLES(7), CYCLES(7), CYCLES(10), CYCLES(10), CYCLES(7), CYCLES(7), CYCLES(7), CYCLES(7)
}; };
static int *opcode_timings_shift_mod3[8] = { static int *opcode_timings_486_shift_mod3[8] = {
// clang-format off // clang-format off
CYCLES(3), CYCLES(3), CYCLES(9), CYCLES(9), CYCLES(3), CYCLES(3), CYCLES(3), CYCLES(3) CYCLES(3), CYCLES(3), CYCLES(9), CYCLES(9), CYCLES(3), CYCLES(3), CYCLES(3), CYCLES(3)
// clang-format on // clang-format on
}; };
static int *opcode_timings_f6[8] = { static int *opcode_timings_486_f6[8] = {
// clang-format off // clang-format off
&timing_rm, NULL, &timing_mm, &timing_mm, CYCLES(13), CYCLES(14), CYCLES(16), CYCLES(19) &timing_rm, NULL, &timing_mm, &timing_mm, CYCLES(13), CYCLES(14), CYCLES(16), CYCLES(19)
// clang-format on // clang-format on
}; };
static int *opcode_timings_f6_mod3[8] = { static int *opcode_timings_486_f6_mod3[8] = {
// clang-format off // clang-format off
&timing_rr, NULL, &timing_rr, &timing_rr, CYCLES(13), CYCLES(14), CYCLES(16), CYCLES(19) &timing_rr, NULL, &timing_rr, &timing_rr, CYCLES(13), CYCLES(14), CYCLES(16), CYCLES(19)
// clang-format on // clang-format on
}; };
static int *opcode_timings_f7[8] = { static int *opcode_timings_486_f7[8] = {
// clang-format off // clang-format off
&timing_rm, NULL, &timing_mm, &timing_mm, CYCLES(21), CYCLES2(22,38), CYCLES2(24,40), CYCLES2(27,43) &timing_rm, NULL, &timing_mm, &timing_mm, CYCLES(21), CYCLES2(22,38), CYCLES2(24,40), CYCLES2(27,43)
// clang-format on // clang-format on
}; };
static int *opcode_timings_f7_mod3[8] = { static int *opcode_timings_486_f7_mod3[8] = {
// clang-format off // clang-format off
&timing_rr, NULL, &timing_rr, &timing_rr, CYCLES(21), CYCLES2(22,38), CYCLES2(24,40), CYCLES2(27,43) &timing_rr, NULL, &timing_rr, &timing_rr, CYCLES(21), CYCLES2(22,38), CYCLES2(24,40), CYCLES2(27,43)
}; };
static int *opcode_timings_ff[8] = { static int *opcode_timings_486_ff[8] = {
// clang-format off // clang-format off
&timing_mm, &timing_mm, CYCLES(5), CYCLES(0), CYCLES(5), CYCLES(0), CYCLES(5), NULL &timing_mm, &timing_mm, CYCLES(5), CYCLES(0), CYCLES(5), CYCLES(0), CYCLES(5), NULL
}; };
static int *opcode_timings_ff_mod3[8] = { static int *opcode_timings_486_ff_mod3[8] = {
// clang-format off // clang-format off
&timing_rr, &timing_rr, CYCLES(5), CYCLES(0), CYCLES(5), CYCLES(0), CYCLES(5), NULL &timing_rr, &timing_rr, CYCLES(5), CYCLES(0), CYCLES(5), CYCLES(0), CYCLES(5), NULL
// clang-format on // clang-format on
}; };
static int *opcode_timings_d8[8] = { static int *opcode_timings_486_d8[8] = {
// clang-format off // clang-format off
/* FADDil FMULil FCOMil FCOMPil FSUBil FSUBRil FDIVil FDIVRil*/ /* FADDil FMULil FCOMil FCOMPil FSUBil FSUBRil FDIVil FDIVRil*/
CYCLES(8), CYCLES(11), CYCLES(4), CYCLES(4), CYCLES(8), CYCLES(8), CYCLES(73), CYCLES(73) CYCLES(8), CYCLES(11), CYCLES(4), CYCLES(4), CYCLES(8), CYCLES(8), CYCLES(73), CYCLES(73)
// clang-format on // clang-format on
}; };
static int *opcode_timings_d8_mod3[8] = { static int *opcode_timings_486_d8_mod3[8] = {
// clang-format off // clang-format off
/* FADD FMUL FCOM FCOMP FSUB FSUBR FDIV FDIVR*/ /* FADD FMUL FCOM FCOMP FSUB FSUBR FDIV FDIVR*/
CYCLES(8), CYCLES(16), CYCLES(4), CYCLES(4), CYCLES(8), CYCLES(8), CYCLES(73), CYCLES(73) CYCLES(8), CYCLES(16), CYCLES(4), CYCLES(4), CYCLES(8), CYCLES(8), CYCLES(73), CYCLES(73)
// clang-format on // clang-format on
}; };
static int *opcode_timings_d9[8] = { static int *opcode_timings_486_d9[8] = {
// clang-format off // clang-format off
/* FLDs FSTs FSTPs FLDENV FLDCW FSTENV FSTCW*/ /* FLDs FSTs FSTPs FLDENV FLDCW FSTENV FSTCW*/
CYCLES(3), NULL, CYCLES(7), CYCLES(7), CYCLES(34), CYCLES(4), CYCLES(67), CYCLES(3) CYCLES(3), NULL, CYCLES(7), CYCLES(7), CYCLES(34), CYCLES(4), CYCLES(67), CYCLES(3)
// clang-format on // clang-format on
}; };
static int *opcode_timings_d9_mod3[64] = { static int *opcode_timings_486_d9_mod3[64] = {
// clang-format off // clang-format off
/*FLD*/ /*FLD*/
CYCLES(4), CYCLES(4), CYCLES(4), CYCLES(4), CYCLES(4), CYCLES(4), CYCLES(4), CYCLES(4), CYCLES(4), CYCLES(4), CYCLES(4), CYCLES(4), CYCLES(4), CYCLES(4), CYCLES(4), CYCLES(4),
@@ -192,25 +192,25 @@ static int *opcode_timings_d9_mod3[64] = {
// clang-format on // clang-format on
}; };
static int *opcode_timings_da[8] = { static int *opcode_timings_486_da[8] = {
// clang-format off // clang-format off
/* FADDil FMULil FCOMil FCOMPil FSUBil FSUBRil FDIVil FDIVRil*/ /* FADDil FMULil FCOMil FCOMPil FSUBil FSUBRil FDIVil FDIVRil*/
CYCLES(8), CYCLES(11), CYCLES(4), CYCLES(4), CYCLES(8), CYCLES(8), CYCLES(73), CYCLES(73) CYCLES(8), CYCLES(11), CYCLES(4), CYCLES(4), CYCLES(8), CYCLES(8), CYCLES(73), CYCLES(73)
// clang-format on // clang-format on
}; };
static int *opcode_timings_da_mod3[8] = { static int *opcode_timings_486_da_mod3[8] = {
// clang-format off // clang-format off
NULL, NULL, NULL, NULL, NULL, CYCLES(5), NULL, NULL NULL, NULL, NULL, NULL, NULL, CYCLES(5), NULL, NULL
// clang-format on // clang-format on
}; };
static int *opcode_timings_db[8] = { static int *opcode_timings_486_db[8] = {
// clang-format off // clang-format off
/* FLDil FSTil FSTPil FLDe FSTPe*/ /* FLDil FSTil FSTPil FLDe FSTPe*/
CYCLES(9), NULL, CYCLES(28), CYCLES(28), NULL, CYCLES(5), NULL, CYCLES(6) CYCLES(9), NULL, CYCLES(28), CYCLES(28), NULL, CYCLES(5), NULL, CYCLES(6)
// clang-format on // clang-format on
}; };
static int *opcode_timings_db_mod3[64] = { static int *opcode_timings_486_db_mod3[64] = {
// clang-format off // clang-format off
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -224,74 +224,74 @@ static int *opcode_timings_db_mod3[64] = {
// clang-format on // clang-format on
}; };
static int *opcode_timings_dc[8] = { static int *opcode_timings_486_dc[8] = {
// clang-format off // clang-format off
/* opFADDd_a16 opFMULd_a16 opFCOMd_a16 opFCOMPd_a16 opFSUBd_a16 opFSUBRd_a16 opFDIVd_a16 opFDIVRd_a16*/ /* opFADDd_a16 opFMULd_a16 opFCOMd_a16 opFCOMPd_a16 opFSUBd_a16 opFSUBRd_a16 opFDIVd_a16 opFDIVRd_a16*/
CYCLES(8), CYCLES(11), CYCLES(4), CYCLES(4), CYCLES(8), CYCLES(8), CYCLES(73), CYCLES(73) CYCLES(8), CYCLES(11), CYCLES(4), CYCLES(4), CYCLES(8), CYCLES(8), CYCLES(73), CYCLES(73)
// clang-format on // clang-format on
}; };
static int *opcode_timings_dc_mod3[8] = { static int *opcode_timings_486_dc_mod3[8] = {
// clang-format off // clang-format off
/* opFADDr opFMULr opFSUBRr opFSUBr opFDIVRr opFDIVr*/ /* opFADDr opFMULr opFSUBRr opFSUBr opFDIVRr opFDIVr*/
CYCLES(8), CYCLES(16), NULL, NULL, CYCLES(8), CYCLES(8), CYCLES(73), CYCLES(73) CYCLES(8), CYCLES(16), NULL, NULL, CYCLES(8), CYCLES(8), CYCLES(73), CYCLES(73)
// clang-format on // clang-format on
}; };
static int *opcode_timings_dd[8] = { static int *opcode_timings_486_dd[8] = {
// clang-format off // clang-format off
/* FLDd FSTd FSTPd FRSTOR FSAVE FSTSW*/ /* FLDd FSTd FSTPd FRSTOR FSAVE FSTSW*/
CYCLES(3), NULL, CYCLES(8), CYCLES(8), CYCLES(131), NULL, CYCLES(154), CYCLES(3) CYCLES(3), NULL, CYCLES(8), CYCLES(8), CYCLES(131), NULL, CYCLES(154), CYCLES(3)
// clang-format on // clang-format on
}; };
static int *opcode_timings_dd_mod3[8] = { static int *opcode_timings_486_dd_mod3[8] = {
// clang-format off // clang-format off
/* FFFREE FST FSTP FUCOM FUCOMP*/ /* FFFREE FST FSTP FUCOM FUCOMP*/
CYCLES(3), NULL, CYCLES(3), CYCLES(3), CYCLES(4), CYCLES(4), NULL, NULL CYCLES(3), NULL, CYCLES(3), CYCLES(3), CYCLES(4), CYCLES(4), NULL, NULL
// clang-format on // clang-format on
}; };
static int *opcode_timings_de[8] = { static int *opcode_timings_486_de[8] = {
// clang-format off // clang-format off
/* FADDiw FMULiw FCOMiw FCOMPiw FSUBil FSUBRil FDIVil FDIVRil*/ /* FADDiw FMULiw FCOMiw FCOMPiw FSUBil FSUBRil FDIVil FDIVRil*/
CYCLES(8), CYCLES(11), CYCLES(4), CYCLES(4), CYCLES(8), CYCLES(8), CYCLES(73), CYCLES(73) CYCLES(8), CYCLES(11), CYCLES(4), CYCLES(4), CYCLES(8), CYCLES(8), CYCLES(73), CYCLES(73)
// clang-format on // clang-format on
}; };
static int *opcode_timings_de_mod3[8] = { static int *opcode_timings_486_de_mod3[8] = {
// clang-format off // clang-format off
/* FADD FMUL FCOMPP FSUB FSUBR FDIV FDIVR*/ /* FADD FMUL FCOMPP FSUB FSUBR FDIV FDIVR*/
CYCLES(8), CYCLES(16), NULL, CYCLES(5), CYCLES(8), CYCLES(8), CYCLES(73), CYCLES(73) CYCLES(8), CYCLES(16), NULL, CYCLES(5), CYCLES(8), CYCLES(8), CYCLES(73), CYCLES(73)
// clang-format on // clang-format on
}; };
static int *opcode_timings_df[8] = { static int *opcode_timings_486_df[8] = {
// clang-format off // clang-format off
/* FILDiw FISTiw FISTPiw FILDiq FBSTP FISTPiq*/ /* FILDiw FISTiw FISTPiw FILDiq FBSTP FISTPiq*/
CYCLES(13), NULL, CYCLES(29), CYCLES(29), NULL, CYCLES(10), CYCLES(172), CYCLES(28) CYCLES(13), NULL, CYCLES(29), CYCLES(29), NULL, CYCLES(10), CYCLES(172), CYCLES(28)
// clang-format on // clang-format on
}; };
static int *opcode_timings_df_mod3[8] = { static int *opcode_timings_486_df_mod3[8] = {
// clang-format off // clang-format off
/* FFREE FST FSTP FUCOM FUCOMP*/ /* FFREE FST FSTP FUCOM FUCOMP*/
CYCLES(3), NULL, CYCLES(3), CYCLES(3), CYCLES(4), CYCLES(4), NULL, NULL CYCLES(3), NULL, CYCLES(3), CYCLES(3), CYCLES(4), CYCLES(4), NULL, NULL
// clang-format on // clang-format on
}; };
static int *opcode_timings_8x[8] = { static int *opcode_timings_486_8x[8] = {
// clang-format off // clang-format off
&timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_rm &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_rm
// clang-format on // clang-format on
}; };
static int *opcode_timings_8x_mod3[8] = { static int *opcode_timings_486_8x_mod3[8] = {
// clang-format off // clang-format off
&timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_rm &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_rm
// clang-format on // clang-format on
}; };
static int *opcode_timings_81[8] = { static int *opcode_timings_486_81[8] = {
// clang-format off // clang-format off
&timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_rm &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_rm
// clang-format on // clang-format on
}; };
static int *opcode_timings_81_mod3[8] = { static int *opcode_timings_486_81_mod3[8] = {
// clang-format off // clang-format off
&timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_rm &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_rm
// clang-format on // clang-format on
@@ -330,7 +330,7 @@ codegen_timing_486_start(void)
void void
codegen_timing_486_prefix(uint8_t prefix, uint32_t fetchdat) codegen_timing_486_prefix(uint8_t prefix, uint32_t fetchdat)
{ {
timing_count += COUNT(opcode_timings[prefix], 0); timing_count += COUNT(opcode_timings_486[prefix], 0);
last_prefix = prefix; last_prefix = prefix;
} }
@@ -344,47 +344,47 @@ codegen_timing_486_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNUSED(u
switch (last_prefix) { switch (last_prefix) {
case 0x0f: case 0x0f:
timings = mod3 ? opcode_timings_0f_mod3 : opcode_timings_0f; timings = mod3 ? opcode_timings_486_0f_mod3 : opcode_timings_486_0f;
deps = mod3 ? opcode_deps_0f_mod3 : opcode_deps_0f; deps = mod3 ? opcode_deps_0f_mod3 : opcode_deps_0f;
break; break;
case 0xd8: case 0xd8:
timings = mod3 ? opcode_timings_d8_mod3 : opcode_timings_d8; timings = mod3 ? opcode_timings_486_d8_mod3 : opcode_timings_486_d8;
deps = mod3 ? opcode_deps_d8_mod3 : opcode_deps_d8; deps = mod3 ? opcode_deps_d8_mod3 : opcode_deps_d8;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xd9: case 0xd9:
timings = mod3 ? opcode_timings_d9_mod3 : opcode_timings_d9; timings = mod3 ? opcode_timings_486_d9_mod3 : opcode_timings_486_d9;
deps = mod3 ? opcode_deps_d9_mod3 : opcode_deps_d9; deps = mod3 ? opcode_deps_d9_mod3 : opcode_deps_d9;
opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7; opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7;
break; break;
case 0xda: case 0xda:
timings = mod3 ? opcode_timings_da_mod3 : opcode_timings_da; timings = mod3 ? opcode_timings_486_da_mod3 : opcode_timings_486_da;
deps = mod3 ? opcode_deps_da_mod3 : opcode_deps_da; deps = mod3 ? opcode_deps_da_mod3 : opcode_deps_da;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdb: case 0xdb:
timings = mod3 ? opcode_timings_db_mod3 : opcode_timings_db; timings = mod3 ? opcode_timings_486_db_mod3 : opcode_timings_486_db;
deps = mod3 ? opcode_deps_db_mod3 : opcode_deps_db; deps = mod3 ? opcode_deps_db_mod3 : opcode_deps_db;
opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7; opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7;
break; break;
case 0xdc: case 0xdc:
timings = mod3 ? opcode_timings_dc_mod3 : opcode_timings_dc; timings = mod3 ? opcode_timings_486_dc_mod3 : opcode_timings_486_dc;
deps = mod3 ? opcode_deps_dc_mod3 : opcode_deps_dc; deps = mod3 ? opcode_deps_dc_mod3 : opcode_deps_dc;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdd: case 0xdd:
timings = mod3 ? opcode_timings_dd_mod3 : opcode_timings_dd; timings = mod3 ? opcode_timings_486_dd_mod3 : opcode_timings_486_dd;
deps = mod3 ? opcode_deps_dd_mod3 : opcode_deps_dd; deps = mod3 ? opcode_deps_dd_mod3 : opcode_deps_dd;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xde: case 0xde:
timings = mod3 ? opcode_timings_de_mod3 : opcode_timings_de; timings = mod3 ? opcode_timings_486_de_mod3 : opcode_timings_486_de;
deps = mod3 ? opcode_deps_de_mod3 : opcode_deps_de; deps = mod3 ? opcode_deps_de_mod3 : opcode_deps_de;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdf: case 0xdf:
timings = mod3 ? opcode_timings_df_mod3 : opcode_timings_df; timings = mod3 ? opcode_timings_486_df_mod3 : opcode_timings_486_df;
deps = mod3 ? opcode_deps_df_mod3 : opcode_deps_df; deps = mod3 ? opcode_deps_df_mod3 : opcode_deps_df;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
@@ -394,12 +394,12 @@ codegen_timing_486_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNUSED(u
case 0x80: case 0x80:
case 0x82: case 0x82:
case 0x83: case 0x83:
timings = mod3 ? opcode_timings_8x_mod3 : opcode_timings_8x; timings = mod3 ? opcode_timings_486_8x_mod3 : opcode_timings_486_8x;
deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x; deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0x81: case 0x81:
timings = mod3 ? opcode_timings_81_mod3 : opcode_timings_81; timings = mod3 ? opcode_timings_486_81_mod3 : opcode_timings_486_81;
deps = mod3 ? opcode_deps_81_mod3 : opcode_deps_81; deps = mod3 ? opcode_deps_81_mod3 : opcode_deps_81;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
@@ -410,29 +410,29 @@ codegen_timing_486_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNUSED(u
case 0xd1: case 0xd1:
case 0xd2: case 0xd2:
case 0xd3: case 0xd3:
timings = mod3 ? opcode_timings_shift_mod3 : opcode_timings_shift; timings = mod3 ? opcode_timings_486_shift_mod3 : opcode_timings_486_shift;
deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift; deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xf6: case 0xf6:
timings = mod3 ? opcode_timings_f6_mod3 : opcode_timings_f6; timings = mod3 ? opcode_timings_486_f6_mod3 : opcode_timings_486_f6;
deps = mod3 ? opcode_deps_f6_mod3 : opcode_deps_f6; deps = mod3 ? opcode_deps_f6_mod3 : opcode_deps_f6;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xf7: case 0xf7:
timings = mod3 ? opcode_timings_f7_mod3 : opcode_timings_f7; timings = mod3 ? opcode_timings_486_f7_mod3 : opcode_timings_486_f7;
deps = mod3 ? opcode_deps_f7_mod3 : opcode_deps_f7; deps = mod3 ? opcode_deps_f7_mod3 : opcode_deps_f7;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xff: case 0xff:
timings = mod3 ? opcode_timings_ff_mod3 : opcode_timings_ff; timings = mod3 ? opcode_timings_486_ff_mod3 : opcode_timings_486_ff;
deps = mod3 ? opcode_deps_ff_mod3 : opcode_deps_ff; deps = mod3 ? opcode_deps_ff_mod3 : opcode_deps_ff;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
default: default:
timings = mod3 ? opcode_timings_mod3 : opcode_timings; timings = mod3 ? opcode_timings_486_mod3 : opcode_timings_486;
deps = mod3 ? opcode_deps_mod3 : opcode_deps; deps = mod3 ? opcode_deps_mod3 : opcode_deps;
break; break;
} }

View File

@@ -65,7 +65,7 @@ static uint32_t prev_fetchdat;
static uint32_t last_regmask_modified; static uint32_t last_regmask_modified;
static uint32_t regmask_modified; static uint32_t regmask_modified;
static uint32_t opcode_timings[256] = { static uint32_t opcode_timings_686[256] = {
// clang-format off // clang-format off
/* ADD ADD ADD ADD*/ /* ADD ADD ADD ADD*/
/*00*/ PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RM, PAIR_XY | CYCLES_RM, /*00*/ PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RM, PAIR_XY | CYCLES_RM,
@@ -202,7 +202,7 @@ static uint32_t opcode_timings[256] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_mod3[256] = { static uint32_t opcode_timings_686_mod3[256] = {
// clang-format off // clang-format off
/* ADD ADD ADD ADD*/ /* ADD ADD ADD ADD*/
/*00*/ PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, /*00*/ PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG,
@@ -340,7 +340,7 @@ static uint32_t opcode_timings_mod3[256] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_0f[256] = { static uint32_t opcode_timings_686_0f[256] = {
// clang-format off // clang-format off
/*00*/ PAIR_NP | CYCLES(20), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(10), /*00*/ PAIR_NP | CYCLES(20), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(10),
INVALID, PAIR_NP | CYCLES(195), PAIR_NP | CYCLES(7), INVALID, INVALID, PAIR_NP | CYCLES(195), PAIR_NP | CYCLES(7), INVALID,
@@ -423,7 +423,7 @@ static uint32_t opcode_timings_0f[256] = {
PAIR_X | CYCLES_RM, PAIR_X | CYCLES_RM, PAIR_X | CYCLES_RM, INVALID, PAIR_X | CYCLES_RM, PAIR_X | CYCLES_RM, PAIR_X | CYCLES_RM, INVALID,
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_0f_mod3[256] = { static uint32_t opcode_timings_686_0f_mod3[256] = {
// clang-format off // clang-format off
/*00*/ PAIR_NP | CYCLES(20), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(10), /*00*/ PAIR_NP | CYCLES(20), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(10),
INVALID, PAIR_NP | CYCLES(195), PAIR_NP | CYCLES(7), INVALID, INVALID, PAIR_NP | CYCLES(195), PAIR_NP | CYCLES(7), INVALID,
@@ -506,44 +506,44 @@ static uint32_t opcode_timings_0f_mod3[256] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_shift[8] = { static uint32_t opcode_timings_686_shift[8] = {
// clang-format off // clang-format off
PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES(3), PAIR_XY | CYCLES(4), PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES(3), PAIR_XY | CYCLES(4),
PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW,
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_shift_mod3[8] = { static uint32_t opcode_timings_686_shift_mod3[8] = {
// clang-format off // clang-format off
PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES(3), PAIR_XY | CYCLES(4), PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES(3), PAIR_XY | CYCLES(4),
PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG,
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_shift_imm[8] = { static uint32_t opcode_timings_686_shift_imm[8] = {
// clang-format off // clang-format off
PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES(8), PAIR_XY | CYCLES(9), PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES(8), PAIR_XY | CYCLES(9),
PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW,
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_shift_imm_mod3[8] = { static uint32_t opcode_timings_686_shift_imm_mod3[8] = {
// clang-format off // clang-format off
PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES(3), PAIR_XY | CYCLES(4), PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES(3), PAIR_XY | CYCLES(4),
PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG,
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_shift_cl[8] = { static uint32_t opcode_timings_686_shift_cl[8] = {
// clang-format off // clang-format off
PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(8), PAIR_XY | CYCLES(9), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(8), PAIR_XY | CYCLES(9),
PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2),
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_shift_cl_mod3[8] = { static uint32_t opcode_timings_686_shift_cl_mod3[8] = {
// clang-format off // clang-format off
PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(8), PAIR_XY | CYCLES(9), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(8), PAIR_XY | CYCLES(9),
PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2), PAIR_XY | CYCLES(2),
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_f6[8] = { static uint32_t opcode_timings_686_f6[8] = {
// clang-format off // clang-format off
/* TST NOT NEG*/ /* TST NOT NEG*/
PAIR_XY | CYCLES_RM, INVALID, PAIR_XY | CYCLES(1), PAIR_XY | CYCLES(1), PAIR_XY | CYCLES_RM, INVALID, PAIR_XY | CYCLES(1), PAIR_XY | CYCLES(1),
@@ -551,7 +551,7 @@ static uint32_t opcode_timings_f6[8] = {
PAIR_NP | CYCLES(4), PAIR_NP | CYCLES(4), PAIR_NP | CYCLES(18), PAIR_NP | CYCLES(18) PAIR_NP | CYCLES(4), PAIR_NP | CYCLES(4), PAIR_NP | CYCLES(18), PAIR_NP | CYCLES(18)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_f6_mod3[8] = { static uint32_t opcode_timings_686_f6_mod3[8] = {
// clang-format off // clang-format off
/* TST NOT NEG*/ /* TST NOT NEG*/
PAIR_XY | CYCLES_REG, INVALID, PAIR_XY | CYCLES(1), PAIR_XY | CYCLES(1), PAIR_XY | CYCLES_REG, INVALID, PAIR_XY | CYCLES(1), PAIR_XY | CYCLES(1),
@@ -559,7 +559,7 @@ static uint32_t opcode_timings_f6_mod3[8] = {
PAIR_NP | CYCLES(4), PAIR_NP | CYCLES(4), PAIR_NP | CYCLES(18), PAIR_NP | CYCLES(18) PAIR_NP | CYCLES(4), PAIR_NP | CYCLES(4), PAIR_NP | CYCLES(18), PAIR_NP | CYCLES(18)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_f7[8] = { static uint32_t opcode_timings_686_f7[8] = {
// clang-format off // clang-format off
/* TST NOT NEG*/ /* TST NOT NEG*/
PAIR_XY | CYCLES_REG, INVALID, PAIR_XY | CYCLES(1), PAIR_XY | CYCLES(1), PAIR_XY | CYCLES_REG, INVALID, PAIR_XY | CYCLES(1), PAIR_XY | CYCLES(1),
@@ -567,7 +567,7 @@ static uint32_t opcode_timings_f7[8] = {
PAIR_NP | CYCLES_MULTI(4,10), PAIR_NP | CYCLES_MULTI(4,10), PAIR_NP | CYCLES_MULTI(19,27), PAIR_NP | CYCLES_MULTI(22,30) PAIR_NP | CYCLES_MULTI(4,10), PAIR_NP | CYCLES_MULTI(4,10), PAIR_NP | CYCLES_MULTI(19,27), PAIR_NP | CYCLES_MULTI(22,30)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_f7_mod3[8] = { static uint32_t opcode_timings_686_f7_mod3[8] = {
// clang-format off // clang-format off
/* TST NOT NEG*/ /* TST NOT NEG*/
PAIR_XY | CYCLES_REG, INVALID, PAIR_XY | CYCLES(1), PAIR_XY | CYCLES(1), PAIR_XY | CYCLES_REG, INVALID, PAIR_XY | CYCLES(1), PAIR_XY | CYCLES(1),
@@ -575,7 +575,7 @@ static uint32_t opcode_timings_f7_mod3[8] = {
PAIR_NP | CYCLES_MULTI(4,10), PAIR_NP | CYCLES_MULTI(4,10), PAIR_NP | CYCLES_MULTI(19,27), PAIR_NP | CYCLES_MULTI(22,30) PAIR_NP | CYCLES_MULTI(4,10), PAIR_NP | CYCLES_MULTI(4,10), PAIR_NP | CYCLES_MULTI(19,27), PAIR_NP | CYCLES_MULTI(22,30)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_ff[8] = { static uint32_t opcode_timings_686_ff[8] = {
// clang-format off // clang-format off
/* INC DEC CALL CALL far*/ /* INC DEC CALL CALL far*/
PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_X_BRANCH | CYCLES(3), PAIR_NP | CYCLES(5), PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_X_BRANCH | CYCLES(3), PAIR_NP | CYCLES(5),
@@ -583,7 +583,7 @@ static uint32_t opcode_timings_ff[8] = {
PAIR_X_BRANCH | CYCLES(3), PAIR_NP | CYCLES(5), PAIR_XY | CYCLES(1), INVALID PAIR_X_BRANCH | CYCLES(3), PAIR_NP | CYCLES(5), PAIR_XY | CYCLES(1), INVALID
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_ff_mod3[8] = { static uint32_t opcode_timings_686_ff_mod3[8] = {
// clang-format off // clang-format off
/* INC DEC CALL CALL far*/ /* INC DEC CALL CALL far*/
PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_X_BRANCH | CYCLES(1), PAIR_XY | CYCLES(5), PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_X_BRANCH | CYCLES(1), PAIR_XY | CYCLES(5),
@@ -592,7 +592,7 @@ static uint32_t opcode_timings_ff_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_d8[8] = { static uint32_t opcode_timings_686_d8[8] = {
// clang-format off // clang-format off
/* FADDs FMULs FCOMs FCOMPs*/ /* FADDs FMULs FCOMs FCOMPs*/
PAIR_X | CYCLES(7), PAIR_X | CYCLES(6), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(7), PAIR_X | CYCLES(6), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4),
@@ -600,7 +600,7 @@ static uint32_t opcode_timings_d8[8] = {
PAIR_X | CYCLES(7), PAIR_X | CYCLES(7), PAIR_X | CYCLES(34), PAIR_X | CYCLES(34) PAIR_X | CYCLES(7), PAIR_X | CYCLES(7), PAIR_X | CYCLES(34), PAIR_X | CYCLES(34)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_d8_mod3[8] = { static uint32_t opcode_timings_686_d8_mod3[8] = {
// clang-format off // clang-format off
/* FADD FMUL FCOM FCOMP*/ /* FADD FMUL FCOM FCOMP*/
PAIR_X | CYCLES(7), PAIR_X | CYCLES(6), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(7), PAIR_X | CYCLES(6), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4),
@@ -609,7 +609,7 @@ static uint32_t opcode_timings_d8_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_d9[8] = { static uint32_t opcode_timings_686_d9[8] = {
// clang-format off // clang-format off
/* FLDs FSTs FSTPs*/ /* FLDs FSTs FSTPs*/
PAIR_X | CYCLES(2), INVALID, PAIR_X | CYCLES(2), PAIR_X | CYCLES(2), PAIR_X | CYCLES(2), INVALID, PAIR_X | CYCLES(2), PAIR_X | CYCLES(2),
@@ -617,7 +617,7 @@ static uint32_t opcode_timings_d9[8] = {
PAIR_X | CYCLES(30), PAIR_X | CYCLES(4), PAIR_X | CYCLES(24), PAIR_X | CYCLES(5) PAIR_X | CYCLES(30), PAIR_X | CYCLES(4), PAIR_X | CYCLES(24), PAIR_X | CYCLES(5)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_d9_mod3[64] = { static uint32_t opcode_timings_686_d9_mod3[64] = {
// clang-format off // clang-format off
/*FLD*/ /*FLD*/
PAIR_X | CYCLES(2), PAIR_X | CYCLES(2), PAIR_X | CYCLES(2), PAIR_X | CYCLES(2), PAIR_X | CYCLES(2), PAIR_X | CYCLES(2), PAIR_X | CYCLES(2), PAIR_X | CYCLES(2),
@@ -650,7 +650,7 @@ static uint32_t opcode_timings_d9_mod3[64] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_da[8] = { static uint32_t opcode_timings_686_da[8] = {
// clang-format off // clang-format off
/* FIADDl FIMULl FICOMl FICOMPl*/ /* FIADDl FIMULl FICOMl FICOMPl*/
PAIR_X | CYCLES(12), PAIR_X | CYCLES(11), PAIR_X | CYCLES(10), PAIR_X | CYCLES(10), PAIR_X | CYCLES(12), PAIR_X | CYCLES(11), PAIR_X | CYCLES(10), PAIR_X | CYCLES(10),
@@ -658,14 +658,14 @@ static uint32_t opcode_timings_da[8] = {
PAIR_X | CYCLES(29), PAIR_X | CYCLES(27), PAIR_X | CYCLES(38), PAIR_X | CYCLES(48) PAIR_X | CYCLES(29), PAIR_X | CYCLES(27), PAIR_X | CYCLES(38), PAIR_X | CYCLES(48)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_da_mod3[8] = { static uint32_t opcode_timings_686_da_mod3[8] = {
// clang-format off // clang-format off
PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4),
INVALID, PAIR_X | CYCLES(5), INVALID, INVALID INVALID, PAIR_X | CYCLES(5), INVALID, INVALID
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_db[8] = { static uint32_t opcode_timings_686_db[8] = {
// clang-format off // clang-format off
/* FLDil FSTil FSTPil*/ /* FLDil FSTil FSTPil*/
PAIR_X | CYCLES(2), INVALID, PAIR_X | CYCLES(2), PAIR_X | CYCLES(2), PAIR_X | CYCLES(2), INVALID, PAIR_X | CYCLES(2), PAIR_X | CYCLES(2),
@@ -673,7 +673,7 @@ static uint32_t opcode_timings_db[8] = {
INVALID, PAIR_X | CYCLES(2), INVALID, PAIR_X | CYCLES(2) INVALID, PAIR_X | CYCLES(2), INVALID, PAIR_X | CYCLES(2)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_db_mod3[64] = { static uint32_t opcode_timings_686_db_mod3[64] = {
// clang-format off // clang-format off
PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4),
PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4), PAIR_X | CYCLES(4),
@@ -703,7 +703,7 @@ static uint32_t opcode_timings_db_mod3[64] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_dc[8] = { static uint32_t opcode_timings_686_dc[8] = {
// clang-format off // clang-format off
/* FADDd FMULd FCOMd FCOMPd*/ /* FADDd FMULd FCOMd FCOMPd*/
PAIR_X | CYCLES(7), PAIR_X | CYCLES(7), PAIR_X | CYCLES(7), PAIR_X | CYCLES(7), PAIR_X | CYCLES(7), PAIR_X | CYCLES(7), PAIR_X | CYCLES(7), PAIR_X | CYCLES(7),
@@ -711,7 +711,7 @@ static uint32_t opcode_timings_dc[8] = {
PAIR_X | CYCLES(7), PAIR_X | CYCLES(7), PAIR_X | CYCLES(34), PAIR_X | CYCLES(34) PAIR_X | CYCLES(7), PAIR_X | CYCLES(7), PAIR_X | CYCLES(34), PAIR_X | CYCLES(34)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_dc_mod3[8] = { static uint32_t opcode_timings_686_dc_mod3[8] = {
// clang-format off // clang-format off
/* opFADDr opFMULr*/ /* opFADDr opFMULr*/
PAIR_X | CYCLES(7), PAIR_X | CYCLES(7), INVALID, INVALID, PAIR_X | CYCLES(7), PAIR_X | CYCLES(7), INVALID, INVALID,
@@ -720,7 +720,7 @@ static uint32_t opcode_timings_dc_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_dd[8] = { static uint32_t opcode_timings_686_dd[8] = {
// clang-format off // clang-format off
/* FLDd FSTd FSTPd*/ /* FLDd FSTd FSTPd*/
PAIR_X | CYCLES(2), INVALID, PAIR_X | CYCLES(2), PAIR_X | CYCLES(2), PAIR_X | CYCLES(2), INVALID, PAIR_X | CYCLES(2), PAIR_X | CYCLES(2),
@@ -728,7 +728,7 @@ static uint32_t opcode_timings_dd[8] = {
PAIR_X | CYCLES(72), INVALID, PAIR_X | CYCLES(67), PAIR_X | CYCLES(2) PAIR_X | CYCLES(72), INVALID, PAIR_X | CYCLES(67), PAIR_X | CYCLES(2)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_dd_mod3[8] = { static uint32_t opcode_timings_686_dd_mod3[8] = {
// clang-format off // clang-format off
/* FFFREE FST FSTP*/ /* FFFREE FST FSTP*/
PAIR_X | CYCLES(3), INVALID, PAIR_X | CYCLES(2), PAIR_X | CYCLES(2), PAIR_X | CYCLES(3), INVALID, PAIR_X | CYCLES(2), PAIR_X | CYCLES(2),
@@ -737,14 +737,14 @@ static uint32_t opcode_timings_dd_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_de[8] = { static uint32_t opcode_timings_686_de[8] = {
// clang-format off // clang-format off
/* FIADDw FIMULw FICOMw FICOMPw*/ /* FIADDw FIMULw FICOMw FICOMPw*/
PAIR_X | CYCLES(12), PAIR_X | CYCLES(11), PAIR_X | CYCLES(10), PAIR_X | CYCLES(10), PAIR_X | CYCLES(12), PAIR_X | CYCLES(11), PAIR_X | CYCLES(10), PAIR_X | CYCLES(10),
/* FISUBw FISUBRw FIDIVw FIDIVRw*/ /* FISUBw FISUBRw FIDIVw FIDIVRw*/
PAIR_X | CYCLES(27), PAIR_X | CYCLES(27), PAIR_X | CYCLES(38), PAIR_X | CYCLES(38) PAIR_X | CYCLES(27), PAIR_X | CYCLES(27), PAIR_X | CYCLES(38), PAIR_X | CYCLES(38)
}; };
static uint32_t opcode_timings_de_mod3[8] = { static uint32_t opcode_timings_686_de_mod3[8] = {
// clang-format off // clang-format off
/* FADD FMUL FCOMPP*/ /* FADD FMUL FCOMPP*/
PAIR_X | CYCLES(7), PAIR_X | CYCLES(7), INVALID, PAIR_X | CYCLES(7), PAIR_X | CYCLES(7), PAIR_X | CYCLES(7), INVALID, PAIR_X | CYCLES(7),
@@ -753,7 +753,7 @@ static uint32_t opcode_timings_de_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_df[8] = { static uint32_t opcode_timings_686_df[8] = {
// clang-format off // clang-format off
/* FILDiw FISTiw FISTPiw*/ /* FILDiw FISTiw FISTPiw*/
PAIR_X | CYCLES(8), INVALID, PAIR_X | CYCLES(10), PAIR_X | CYCLES(13), PAIR_X | CYCLES(8), INVALID, PAIR_X | CYCLES(10), PAIR_X | CYCLES(13),
@@ -761,7 +761,7 @@ static uint32_t opcode_timings_df[8] = {
INVALID, PAIR_X | CYCLES(8), PAIR_X | CYCLES(63), PAIR_X | CYCLES(13) INVALID, PAIR_X | CYCLES(8), PAIR_X | CYCLES(63), PAIR_X | CYCLES(13)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_df_mod3[8] = { static uint32_t opcode_timings_686_df_mod3[8] = {
// clang-format off // clang-format off
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
/* FSTSW AX*/ /* FSTSW AX*/
@@ -769,25 +769,25 @@ static uint32_t opcode_timings_df_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_8x[8] = { static uint32_t opcode_timings_686_8x[8] = {
// clang-format off // clang-format off
PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW,
PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RM PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RM
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_8x_mod3[8] = { static uint32_t opcode_timings_686_8x_mod3[8] = {
// clang-format off // clang-format off
PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG,
PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_81[8] = { static uint32_t opcode_timings_686_81[8] = {
// clang-format off // clang-format off
PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW,
PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RM PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RMW, PAIR_XY | CYCLES_RM
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_81_mod3[8] = { static uint32_t opcode_timings_686_81_mod3[8] = {
// clang-format off // clang-format off
PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG,
PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG, PAIR_XY | CYCLES_REG
@@ -874,47 +874,47 @@ codegen_timing_686_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNUSED(u
switch (last_prefix) { switch (last_prefix) {
case 0x0f: case 0x0f:
timings = mod3 ? opcode_timings_0f_mod3 : opcode_timings_0f; timings = mod3 ? opcode_timings_686_0f_mod3 : opcode_timings_686_0f;
deps = mod3 ? opcode_deps_0f_mod3 : opcode_deps_0f; deps = mod3 ? opcode_deps_0f_mod3 : opcode_deps_0f;
break; break;
case 0xd8: case 0xd8:
timings = mod3 ? opcode_timings_d8_mod3 : opcode_timings_d8; timings = mod3 ? opcode_timings_686_d8_mod3 : opcode_timings_686_d8;
deps = mod3 ? opcode_deps_d8_mod3 : opcode_deps_d8; deps = mod3 ? opcode_deps_d8_mod3 : opcode_deps_d8;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xd9: case 0xd9:
timings = mod3 ? opcode_timings_d9_mod3 : opcode_timings_d9; timings = mod3 ? opcode_timings_686_d9_mod3 : opcode_timings_686_d9;
deps = mod3 ? opcode_deps_d9_mod3 : opcode_deps_d9; deps = mod3 ? opcode_deps_d9_mod3 : opcode_deps_d9;
opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7; opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7;
break; break;
case 0xda: case 0xda:
timings = mod3 ? opcode_timings_da_mod3 : opcode_timings_da; timings = mod3 ? opcode_timings_686_da_mod3 : opcode_timings_686_da;
deps = mod3 ? opcode_deps_da_mod3 : opcode_deps_da; deps = mod3 ? opcode_deps_da_mod3 : opcode_deps_da;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdb: case 0xdb:
timings = mod3 ? opcode_timings_db_mod3 : opcode_timings_db; timings = mod3 ? opcode_timings_686_db_mod3 : opcode_timings_686_db;
deps = mod3 ? opcode_deps_db_mod3 : opcode_deps_db; deps = mod3 ? opcode_deps_db_mod3 : opcode_deps_db;
opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7; opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7;
break; break;
case 0xdc: case 0xdc:
timings = mod3 ? opcode_timings_dc_mod3 : opcode_timings_dc; timings = mod3 ? opcode_timings_686_dc_mod3 : opcode_timings_686_dc;
deps = mod3 ? opcode_deps_dc_mod3 : opcode_deps_dc; deps = mod3 ? opcode_deps_dc_mod3 : opcode_deps_dc;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdd: case 0xdd:
timings = mod3 ? opcode_timings_dd_mod3 : opcode_timings_dd; timings = mod3 ? opcode_timings_686_dd_mod3 : opcode_timings_686_dd;
deps = mod3 ? opcode_deps_dd_mod3 : opcode_deps_dd; deps = mod3 ? opcode_deps_dd_mod3 : opcode_deps_dd;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xde: case 0xde:
timings = mod3 ? opcode_timings_de_mod3 : opcode_timings_de; timings = mod3 ? opcode_timings_686_de_mod3 : opcode_timings_686_de;
deps = mod3 ? opcode_deps_de_mod3 : opcode_deps_de; deps = mod3 ? opcode_deps_de_mod3 : opcode_deps_de;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdf: case 0xdf:
timings = mod3 ? opcode_timings_df_mod3 : opcode_timings_df; timings = mod3 ? opcode_timings_686_df_mod3 : opcode_timings_686_df;
deps = mod3 ? opcode_deps_df_mod3 : opcode_deps_df; deps = mod3 ? opcode_deps_df_mod3 : opcode_deps_df;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
@@ -924,55 +924,55 @@ codegen_timing_686_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNUSED(u
case 0x80: case 0x80:
case 0x82: case 0x82:
case 0x83: case 0x83:
timings = mod3 ? opcode_timings_8x_mod3 : opcode_timings_8x; timings = mod3 ? opcode_timings_686_8x_mod3 : opcode_timings_686_8x;
deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x; deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0x81: case 0x81:
timings = mod3 ? opcode_timings_81_mod3 : opcode_timings_81; timings = mod3 ? opcode_timings_686_81_mod3 : opcode_timings_686_81;
deps = mod3 ? opcode_deps_81_mod3 : opcode_deps_81; deps = mod3 ? opcode_deps_81_mod3 : opcode_deps_81;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xc0: case 0xc0:
case 0xc1: case 0xc1:
timings = mod3 ? opcode_timings_shift_imm_mod3 : opcode_timings_shift_imm; timings = mod3 ? opcode_timings_686_shift_imm_mod3 : opcode_timings_686_shift_imm;
deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift; deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xd0: case 0xd0:
case 0xd1: case 0xd1:
timings = mod3 ? opcode_timings_shift_mod3 : opcode_timings_shift; timings = mod3 ? opcode_timings_686_shift_mod3 : opcode_timings_686_shift;
deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift; deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xd2: case 0xd2:
case 0xd3: case 0xd3:
timings = mod3 ? opcode_timings_shift_cl_mod3 : opcode_timings_shift_cl; timings = mod3 ? opcode_timings_686_shift_cl_mod3 : opcode_timings_686_shift_cl;
deps = mod3 ? opcode_deps_shift_cl_mod3 : opcode_deps_shift_cl; deps = mod3 ? opcode_deps_shift_cl_mod3 : opcode_deps_shift_cl;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xf6: case 0xf6:
timings = mod3 ? opcode_timings_f6_mod3 : opcode_timings_f6; timings = mod3 ? opcode_timings_686_f6_mod3 : opcode_timings_686_f6;
deps = mod3 ? opcode_deps_f6_mod3 : opcode_deps_f6; deps = mod3 ? opcode_deps_f6_mod3 : opcode_deps_f6;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xf7: case 0xf7:
timings = mod3 ? opcode_timings_f7_mod3 : opcode_timings_f7; timings = mod3 ? opcode_timings_686_f7_mod3 : opcode_timings_686_f7;
deps = mod3 ? opcode_deps_f7_mod3 : opcode_deps_f7; deps = mod3 ? opcode_deps_f7_mod3 : opcode_deps_f7;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xff: case 0xff:
timings = mod3 ? opcode_timings_ff_mod3 : opcode_timings_ff; timings = mod3 ? opcode_timings_686_ff_mod3 : opcode_timings_686_ff;
deps = mod3 ? opcode_deps_ff_mod3 : opcode_deps_ff; deps = mod3 ? opcode_deps_ff_mod3 : opcode_deps_ff;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
default: default:
timings = mod3 ? opcode_timings_mod3 : opcode_timings; timings = mod3 ? opcode_timings_686_mod3 : opcode_timings_686;
deps = mod3 ? opcode_deps_mod3 : opcode_deps; deps = mod3 ? opcode_deps_mod3 : opcode_deps;
break; break;
} }

View File

@@ -759,7 +759,7 @@ static const risc86_instruction_t vector_wbinvd_op = {
#define INVALID NULL #define INVALID NULL
static const risc86_instruction_t *opcode_timings[256] = { static const risc86_instruction_t *opcode_timings_k6[256] = {
// clang-format off // clang-format off
/* ADD ADD ADD ADD*/ /* ADD ADD ADD ADD*/
/*00*/ &alux_store_op, &alu_store_op, &load_alux_op, &load_alu_op, /*00*/ &alux_store_op, &alu_store_op, &load_alux_op, &load_alu_op,
@@ -896,7 +896,7 @@ static const risc86_instruction_t *opcode_timings[256] = {
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_mod3[256] = { static const risc86_instruction_t *opcode_timings_k6_mod3[256] = {
// clang-format off // clang-format off
/* ADD ADD ADD ADD*/ /* ADD ADD ADD ADD*/
/*00*/ &alux_op, &alu_op, &alux_op, &alu_op, /*00*/ &alux_op, &alu_op, &alux_op, &alu_op,
@@ -1033,7 +1033,7 @@ static const risc86_instruction_t *opcode_timings_mod3[256] = {
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_0f[256] = { static const risc86_instruction_t *opcode_timings_k6_0f[256] = {
// clang-format off // clang-format off
/*00*/ &vector_alu6_op, &vector_alu6_op, &vector_alu6_op, &vector_alu6_op, /*00*/ &vector_alu6_op, &vector_alu6_op, &vector_alu6_op, &vector_alu6_op,
INVALID, &vector_alu6_op, &vector_alu6_op, INVALID, INVALID, &vector_alu6_op, &vector_alu6_op, INVALID,
@@ -1116,7 +1116,7 @@ static const risc86_instruction_t *opcode_timings_0f[256] = {
&load_mmx_op, &load_mmx_op, &load_mmx_op, INVALID, &load_mmx_op, &load_mmx_op, &load_mmx_op, INVALID,
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_0f_mod3[256] = { static const risc86_instruction_t *opcode_timings_k6_0f_mod3[256] = {
// clang-format off // clang-format off
/*00*/ &vector_alu6_op, &vector_alu6_op, &vector_alu6_op, &vector_alu6_op, /*00*/ &vector_alu6_op, &vector_alu6_op, &vector_alu6_op, &vector_alu6_op,
INVALID, &vector_alu6_op, &vector_alu6_op, INVALID, INVALID, &vector_alu6_op, &vector_alu6_op, INVALID,
@@ -1200,7 +1200,7 @@ static const risc86_instruction_t *opcode_timings_0f_mod3[256] = {
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_0f0f[256] = { static const risc86_instruction_t *opcode_timings_k6_0f0f[256] = {
// clang-format off // clang-format off
/*00*/ INVALID, INVALID, INVALID, INVALID, /*00*/ INVALID, INVALID, INVALID, INVALID,
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
@@ -1283,7 +1283,7 @@ static const risc86_instruction_t *opcode_timings_0f0f[256] = {
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_0f0f_mod3[256] = { static const risc86_instruction_t *opcode_timings_k6_0f0f_mod3[256] = {
// clang-format off // clang-format off
/*00*/ INVALID, INVALID, INVALID, INVALID, /*00*/ INVALID, INVALID, INVALID, INVALID,
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
@@ -1367,57 +1367,57 @@ static const risc86_instruction_t *opcode_timings_0f0f_mod3[256] = {
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_shift[8] = { static const risc86_instruction_t *opcode_timings_k6_shift[8] = {
// clang-format off // clang-format off
&vector_alu_store_op, &vector_alu_store_op, &vector_alu_store_op, &vector_alu_store_op, &vector_alu_store_op, &vector_alu_store_op, &vector_alu_store_op, &vector_alu_store_op,
&vector_alu_store_op, &vector_alu_store_op, &vector_alu_store_op, &vector_alu_store_op &vector_alu_store_op, &vector_alu_store_op, &vector_alu_store_op, &vector_alu_store_op
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_shift_b[8] = { static const risc86_instruction_t *opcode_timings_k6_shift_b[8] = {
// clang-format off // clang-format off
&vector_alux_store_op, &vector_alux_store_op, &vector_alux_store_op, &vector_alux_store_op, &vector_alux_store_op, &vector_alux_store_op, &vector_alux_store_op, &vector_alux_store_op,
&vector_alux_store_op, &vector_alux_store_op, &vector_alux_store_op, &vector_alux_store_op &vector_alux_store_op, &vector_alux_store_op, &vector_alux_store_op, &vector_alux_store_op
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_shift_mod3[8] = { static const risc86_instruction_t *opcode_timings_k6_shift_mod3[8] = {
// clang-format off // clang-format off
&vector_alu1_op, &vector_alu1_op, &vector_alu1_op, &vector_alu1_op, &vector_alu1_op, &vector_alu1_op, &vector_alu1_op, &vector_alu1_op,
&alu_op, &alu_op, &alu_op, &alu_op &alu_op, &alu_op, &alu_op, &alu_op
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_shift_b_mod3[8] = { static const risc86_instruction_t *opcode_timings_k6_shift_b_mod3[8] = {
// clang-format off // clang-format off
&vector_alux1_op, &vector_alux1_op, &vector_alux1_op, &vector_alux1_op, &vector_alux1_op, &vector_alux1_op, &vector_alux1_op, &vector_alux1_op,
&alux_op, &alux_op, &alux_op, &alux_op &alux_op, &alux_op, &alux_op, &alux_op
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_80[8] = { static const risc86_instruction_t *opcode_timings_k6_80[8] = {
// clang-format off // clang-format off
&alux_store_op, &alux_store_op, &vector_alux_store_op, &vector_alux_store_op, &alux_store_op, &alux_store_op, &vector_alux_store_op, &vector_alux_store_op,
&alux_store_op, &alux_store_op, &alux_store_op, &alux_store_op, &alux_store_op, &alux_store_op, &alux_store_op, &alux_store_op,
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_80_mod3[8] = { static const risc86_instruction_t *opcode_timings_k6_80_mod3[8] = {
// clang-format off // clang-format off
&alux_op, &alux_op, &alux_store_op, &alux_store_op, &alux_op, &alux_op, &alux_store_op, &alux_store_op,
&alux_op, &alux_op, &alux_op, &alux_op, &alux_op, &alux_op, &alux_op, &alux_op,
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_8x[8] = { static const risc86_instruction_t *opcode_timings_k6_8x[8] = {
// clang-format off // clang-format off
&alu_store_op, &alu_store_op, &vector_alu_store_op, &vector_alu_store_op, &alu_store_op, &alu_store_op, &vector_alu_store_op, &vector_alu_store_op,
&alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op,
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_8x_mod3[8] = { static const risc86_instruction_t *opcode_timings_k6_8x_mod3[8] = {
// clang-format off // clang-format off
&alu_op, &alu_op, &alu_store_op, &alu_store_op, &alu_op, &alu_op, &alu_store_op, &alu_store_op,
&alu_op, &alu_op, &alu_op, &alu_op, &alu_op, &alu_op, &alu_op, &alu_op,
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_f6[8] = { static const risc86_instruction_t *opcode_timings_k6_f6[8] = {
// clang-format off // clang-format off
/* TST NOT NEG*/ /* TST NOT NEG*/
&test_mem_imm_b_op, INVALID, &vector_alux_store_op, &vector_alux_store_op, &test_mem_imm_b_op, INVALID, &vector_alux_store_op, &vector_alux_store_op,
@@ -1425,7 +1425,7 @@ static const risc86_instruction_t *opcode_timings_f6[8] = {
&vector_mul_mem_op, &vector_mul_mem_op, &vector_div16_mem_op, &vector_div16_mem_op, &vector_mul_mem_op, &vector_mul_mem_op, &vector_div16_mem_op, &vector_div16_mem_op,
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_f6_mod3[8] = { static const risc86_instruction_t *opcode_timings_k6_f6_mod3[8] = {
// clang-format off // clang-format off
/* TST NOT NEG*/ /* TST NOT NEG*/
&test_reg_b_op, INVALID, &alux_op, &alux_op, &test_reg_b_op, INVALID, &alux_op, &alux_op,
@@ -1433,7 +1433,7 @@ static const risc86_instruction_t *opcode_timings_f6_mod3[8] = {
&vector_mul_op, &vector_mul_op, &vector_div16_op, &vector_div16_op, &vector_mul_op, &vector_mul_op, &vector_div16_op, &vector_div16_op,
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_f7[8] = { static const risc86_instruction_t *opcode_timings_k6_f7[8] = {
// clang-format off // clang-format off
/* TST NOT NEG*/ /* TST NOT NEG*/
&test_mem_imm_op, INVALID, &vector_alu_store_op, &vector_alu_store_op, &test_mem_imm_op, INVALID, &vector_alu_store_op, &vector_alu_store_op,
@@ -1441,7 +1441,7 @@ static const risc86_instruction_t *opcode_timings_f7[8] = {
&vector_mul64_mem_op, &vector_mul64_mem_op, &vector_div32_mem_op, &vector_div32_mem_op, &vector_mul64_mem_op, &vector_mul64_mem_op, &vector_div32_mem_op, &vector_div32_mem_op,
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_f7_mod3[8] = { static const risc86_instruction_t *opcode_timings_k6_f7_mod3[8] = {
// clang-format off // clang-format off
/* TST NOT NEG*/ /* TST NOT NEG*/
&test_reg_op, INVALID, &alu_op, &alu_op, &test_reg_op, INVALID, &alu_op, &alu_op,
@@ -1449,7 +1449,7 @@ static const risc86_instruction_t *opcode_timings_f7_mod3[8] = {
&vector_mul64_op, &vector_mul64_op, &vector_div32_op, &vector_div32_op, &vector_mul64_op, &vector_mul64_op, &vector_div32_op, &vector_div32_op,
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_ff[8] = { static const risc86_instruction_t *opcode_timings_k6_ff[8] = {
// clang-format off // clang-format off
/* INC DEC CALL CALL far*/ /* INC DEC CALL CALL far*/
&alu_store_op, &alu_store_op, &store_op, &vector_call_far_op, &alu_store_op, &alu_store_op, &store_op, &vector_call_far_op,
@@ -1457,7 +1457,7 @@ static const risc86_instruction_t *opcode_timings_ff[8] = {
&branch_op, &vector_jmp_far_op, &push_mem_op, INVALID &branch_op, &vector_jmp_far_op, &push_mem_op, INVALID
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_ff_mod3[8] = { static const risc86_instruction_t *opcode_timings_k6_ff_mod3[8] = {
// clang-format off // clang-format off
/* INC DEC CALL CALL far*/ /* INC DEC CALL CALL far*/
&vector_alu1_op, &vector_alu1_op, &store_op, &vector_call_far_op, &vector_alu1_op, &vector_alu1_op, &store_op, &vector_call_far_op,
@@ -1466,7 +1466,7 @@ static const risc86_instruction_t *opcode_timings_ff_mod3[8] = {
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_d8[8] = { static const risc86_instruction_t *opcode_timings_k6_d8[8] = {
// clang-format off // clang-format off
/* FADDs FMULs FCOMs FCOMPs*/ /* FADDs FMULs FCOMs FCOMPs*/
&load_float_op, &load_float_op, &load_float_op, &load_float_op, &load_float_op, &load_float_op, &load_float_op, &load_float_op,
@@ -1474,7 +1474,7 @@ static const risc86_instruction_t *opcode_timings_d8[8] = {
&load_float_op, &load_float_op, &fdiv_mem_op, &fdiv_mem_op, &load_float_op, &load_float_op, &fdiv_mem_op, &fdiv_mem_op,
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_d8_mod3[8] = { static const risc86_instruction_t *opcode_timings_k6_d8_mod3[8] = {
// clang-format off // clang-format off
/* FADD FMUL FCOM FCOMP*/ /* FADD FMUL FCOM FCOMP*/
&float_op, &float_op, &float_op, &float_op, &float_op, &float_op, &float_op, &float_op,
@@ -1483,7 +1483,7 @@ static const risc86_instruction_t *opcode_timings_d8_mod3[8] = {
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_d9[8] = { static const risc86_instruction_t *opcode_timings_k6_d9[8] = {
// clang-format off // clang-format off
/* FLDs FSTs FSTPs*/ /* FLDs FSTs FSTPs*/
&load_float_op, INVALID, &fstore_op, &fstore_op, &load_float_op, INVALID, &fstore_op, &fstore_op,
@@ -1491,7 +1491,7 @@ static const risc86_instruction_t *opcode_timings_d9[8] = {
&vector_float_l_op, &vector_fldcw_op, &vector_float_l_op, &vector_float_op &vector_float_l_op, &vector_fldcw_op, &vector_float_l_op, &vector_float_op
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_d9_mod3[64] = { static const risc86_instruction_t *opcode_timings_k6_d9_mod3[64] = {
// clang-format off // clang-format off
/*FLD*/ /*FLD*/
&float_op, &float_op, &float_op, &float_op, &float_op, &float_op, &float_op, &float_op,
@@ -1524,7 +1524,7 @@ static const risc86_instruction_t *opcode_timings_d9_mod3[64] = {
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_da[8] = { static const risc86_instruction_t *opcode_timings_k6_da[8] = {
// clang-format off // clang-format off
/* FIADDl FIMULl FICOMl FICOMPl*/ /* FIADDl FIMULl FICOMl FICOMPl*/
&load_float_op, &load_float_op, &load_float_op, &load_float_op, &load_float_op, &load_float_op, &load_float_op, &load_float_op,
@@ -1532,7 +1532,7 @@ static const risc86_instruction_t *opcode_timings_da[8] = {
&load_float_op, &load_float_op, &fdiv_mem_op, &fdiv_mem_op, &load_float_op, &load_float_op, &fdiv_mem_op, &fdiv_mem_op,
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_da_mod3[8] = { static const risc86_instruction_t *opcode_timings_k6_da_mod3[8] = {
// clang-format off // clang-format off
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
/* FCOMPP*/ /* FCOMPP*/
@@ -1540,7 +1540,7 @@ static const risc86_instruction_t *opcode_timings_da_mod3[8] = {
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_db[8] = { static const risc86_instruction_t *opcode_timings_k6_db[8] = {
// clang-format off // clang-format off
/* FLDil FSTil FSTPil*/ /* FLDil FSTil FSTPil*/
&load_float_op, INVALID, &fstore_op, &fstore_op, &load_float_op, INVALID, &fstore_op, &fstore_op,
@@ -1548,7 +1548,7 @@ static const risc86_instruction_t *opcode_timings_db[8] = {
INVALID, &vector_flde_op, INVALID, &vector_fste_op INVALID, &vector_flde_op, INVALID, &vector_fste_op
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_db_mod3[64] = { static const risc86_instruction_t *opcode_timings_k6_db_mod3[64] = {
// clang-format off // clang-format off
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
@@ -1578,7 +1578,7 @@ static const risc86_instruction_t *opcode_timings_db_mod3[64] = {
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_dc[8] = { static const risc86_instruction_t *opcode_timings_k6_dc[8] = {
// clang-format off // clang-format off
/* FADDd FMULd FCOMd FCOMPd*/ /* FADDd FMULd FCOMd FCOMPd*/
&load_float_op, &load_float_op, &load_float_op, &load_float_op, &load_float_op, &load_float_op, &load_float_op, &load_float_op,
@@ -1586,7 +1586,7 @@ static const risc86_instruction_t *opcode_timings_dc[8] = {
&load_float_op, &load_float_op, &fdiv_mem_op, &fdiv_mem_op, &load_float_op, &load_float_op, &fdiv_mem_op, &fdiv_mem_op,
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_dc_mod3[8] = { static const risc86_instruction_t *opcode_timings_k6_dc_mod3[8] = {
// clang-format off // clang-format off
/* opFADDr opFMULr*/ /* opFADDr opFMULr*/
&float_op, &float_op, INVALID, INVALID, &float_op, &float_op, INVALID, INVALID,
@@ -1595,7 +1595,7 @@ static const risc86_instruction_t *opcode_timings_dc_mod3[8] = {
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_dd[8] = { static const risc86_instruction_t *opcode_timings_k6_dd[8] = {
// clang-format off // clang-format off
/* FLDd FSTd FSTPd*/ /* FLDd FSTd FSTPd*/
&load_float_op, INVALID, &fstore_op, &fstore_op, &load_float_op, INVALID, &fstore_op, &fstore_op,
@@ -1603,7 +1603,7 @@ static const risc86_instruction_t *opcode_timings_dd[8] = {
&vector_float_l_op, INVALID, &vector_float_l_op, &vector_float_l_op &vector_float_l_op, INVALID, &vector_float_l_op, &vector_float_l_op
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_dd_mod3[8] = { static const risc86_instruction_t *opcode_timings_k6_dd_mod3[8] = {
// clang-format off // clang-format off
/* FFFREE FST FSTP*/ /* FFFREE FST FSTP*/
&float_op, INVALID, &float_op, &float_op, &float_op, INVALID, &float_op, &float_op,
@@ -1612,7 +1612,7 @@ static const risc86_instruction_t *opcode_timings_dd_mod3[8] = {
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_de[8] = { static const risc86_instruction_t *opcode_timings_k6_de[8] = {
// clang-format off // clang-format off
/* FIADDw FIMULw FICOMw FICOMPw*/ /* FIADDw FIMULw FICOMw FICOMPw*/
&load_float_op, &load_float_op, &load_float_op, &load_float_op, &load_float_op, &load_float_op, &load_float_op, &load_float_op,
@@ -1620,7 +1620,7 @@ static const risc86_instruction_t *opcode_timings_de[8] = {
&load_float_op, &load_float_op, &fdiv_mem_op, &fdiv_mem_op, &load_float_op, &load_float_op, &fdiv_mem_op, &fdiv_mem_op,
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_de_mod3[8] = { static const risc86_instruction_t *opcode_timings_k6_de_mod3[8] = {
// clang-format off // clang-format off
/* FADDP FMULP FCOMPP*/ /* FADDP FMULP FCOMPP*/
&float_op, &float_op, INVALID, &float_op, &float_op, &float_op, INVALID, &float_op,
@@ -1629,7 +1629,7 @@ static const risc86_instruction_t *opcode_timings_de_mod3[8] = {
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_df[8] = { static const risc86_instruction_t *opcode_timings_k6_df[8] = {
// clang-format off // clang-format off
/* FILDiw FISTiw FISTPiw*/ /* FILDiw FISTiw FISTPiw*/
&load_float_op, INVALID, &fstore_op, &fstore_op, &load_float_op, INVALID, &fstore_op, &fstore_op,
@@ -1637,7 +1637,7 @@ static const risc86_instruction_t *opcode_timings_df[8] = {
INVALID, &load_float_op, &vector_float_l_op, &fstore_op, INVALID, &load_float_op, &vector_float_l_op, &fstore_op,
// clang-format on // clang-format on
}; };
static const risc86_instruction_t *opcode_timings_df_mod3[8] = { static const risc86_instruction_t *opcode_timings_k6_df_mod3[8] = {
// clang-format off // clang-format off
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
/* FSTSW AX*/ /* FSTSW AX*/
@@ -2094,51 +2094,51 @@ codegen_timing_k6_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, uint32_t
opcode = fastreadb(cs + opcode_pc); opcode = fastreadb(cs + opcode_pc);
ins_table = mod3 ? opcode_timings_0f0f_mod3 : opcode_timings_0f0f; ins_table = mod3 ? opcode_timings_k6_0f0f_mod3 : opcode_timings_k6_0f0f;
deps = mod3 ? opcode_deps_0f0f_mod3 : opcode_deps_0f0f; deps = mod3 ? opcode_deps_0f0f_mod3 : opcode_deps_0f0f;
} else { } else {
ins_table = mod3 ? opcode_timings_0f_mod3 : opcode_timings_0f; ins_table = mod3 ? opcode_timings_k6_0f_mod3 : opcode_timings_k6_0f;
deps = mod3 ? opcode_deps_0f_mod3 : opcode_deps_0f; deps = mod3 ? opcode_deps_0f_mod3 : opcode_deps_0f;
} }
break; break;
case 0xd8: case 0xd8:
ins_table = mod3 ? opcode_timings_d8_mod3 : opcode_timings_d8; ins_table = mod3 ? opcode_timings_k6_d8_mod3 : opcode_timings_k6_d8;
deps = mod3 ? opcode_deps_d8_mod3 : opcode_deps_d8; deps = mod3 ? opcode_deps_d8_mod3 : opcode_deps_d8;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xd9: case 0xd9:
ins_table = mod3 ? opcode_timings_d9_mod3 : opcode_timings_d9; ins_table = mod3 ? opcode_timings_k6_d9_mod3 : opcode_timings_k6_d9;
deps = mod3 ? opcode_deps_d9_mod3 : opcode_deps_d9; deps = mod3 ? opcode_deps_d9_mod3 : opcode_deps_d9;
opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7; opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7;
break; break;
case 0xda: case 0xda:
ins_table = mod3 ? opcode_timings_da_mod3 : opcode_timings_da; ins_table = mod3 ? opcode_timings_k6_da_mod3 : opcode_timings_k6_da;
deps = mod3 ? opcode_deps_da_mod3 : opcode_deps_da; deps = mod3 ? opcode_deps_da_mod3 : opcode_deps_da;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdb: case 0xdb:
ins_table = mod3 ? opcode_timings_db_mod3 : opcode_timings_db; ins_table = mod3 ? opcode_timings_k6_db_mod3 : opcode_timings_k6_db;
deps = mod3 ? opcode_deps_db_mod3 : opcode_deps_db; deps = mod3 ? opcode_deps_db_mod3 : opcode_deps_db;
opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7; opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7;
break; break;
case 0xdc: case 0xdc:
ins_table = mod3 ? opcode_timings_dc_mod3 : opcode_timings_dc; ins_table = mod3 ? opcode_timings_k6_dc_mod3 : opcode_timings_k6_dc;
deps = mod3 ? opcode_deps_dc_mod3 : opcode_deps_dc; deps = mod3 ? opcode_deps_dc_mod3 : opcode_deps_dc;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdd: case 0xdd:
ins_table = mod3 ? opcode_timings_dd_mod3 : opcode_timings_dd; ins_table = mod3 ? opcode_timings_k6_dd_mod3 : opcode_timings_k6_dd;
deps = mod3 ? opcode_deps_dd_mod3 : opcode_deps_dd; deps = mod3 ? opcode_deps_dd_mod3 : opcode_deps_dd;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xde: case 0xde:
ins_table = mod3 ? opcode_timings_de_mod3 : opcode_timings_de; ins_table = mod3 ? opcode_timings_k6_de_mod3 : opcode_timings_k6_de;
deps = mod3 ? opcode_deps_de_mod3 : opcode_deps_de; deps = mod3 ? opcode_deps_de_mod3 : opcode_deps_de;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdf: case 0xdf:
ins_table = mod3 ? opcode_timings_df_mod3 : opcode_timings_df; ins_table = mod3 ? opcode_timings_k6_df_mod3 : opcode_timings_k6_df;
deps = mod3 ? opcode_deps_df_mod3 : opcode_deps_df; deps = mod3 ? opcode_deps_df_mod3 : opcode_deps_df;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
@@ -2147,13 +2147,13 @@ codegen_timing_k6_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, uint32_t
switch (opcode) { switch (opcode) {
case 0x80: case 0x80:
case 0x82: case 0x82:
ins_table = mod3 ? opcode_timings_80_mod3 : opcode_timings_80; ins_table = mod3 ? opcode_timings_k6_80_mod3 : opcode_timings_k6_80;
deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x; deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0x81: case 0x81:
case 0x83: case 0x83:
ins_table = mod3 ? opcode_timings_8x_mod3 : opcode_timings_8x; ins_table = mod3 ? opcode_timings_k6_8x_mod3 : opcode_timings_k6_8x;
deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x; deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
@@ -2161,7 +2161,7 @@ codegen_timing_k6_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, uint32_t
case 0xc0: case 0xc0:
case 0xd0: case 0xd0:
case 0xd2: case 0xd2:
ins_table = mod3 ? opcode_timings_shift_b_mod3 : opcode_timings_shift_b; ins_table = mod3 ? opcode_timings_k6_shift_b_mod3 : opcode_timings_k6_shift_b;
deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift; deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
@@ -2169,29 +2169,29 @@ codegen_timing_k6_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, uint32_t
case 0xc1: case 0xc1:
case 0xd1: case 0xd1:
case 0xd3: case 0xd3:
ins_table = mod3 ? opcode_timings_shift_mod3 : opcode_timings_shift; ins_table = mod3 ? opcode_timings_k6_shift_mod3 : opcode_timings_k6_shift;
deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift; deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xf6: case 0xf6:
ins_table = mod3 ? opcode_timings_f6_mod3 : opcode_timings_f6; ins_table = mod3 ? opcode_timings_k6_f6_mod3 : opcode_timings_k6_f6;
deps = mod3 ? opcode_deps_f6_mod3 : opcode_deps_f6; deps = mod3 ? opcode_deps_f6_mod3 : opcode_deps_f6;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xf7: case 0xf7:
ins_table = mod3 ? opcode_timings_f7_mod3 : opcode_timings_f7; ins_table = mod3 ? opcode_timings_k6_f7_mod3 : opcode_timings_k6_f7;
deps = mod3 ? opcode_deps_f7_mod3 : opcode_deps_f7; deps = mod3 ? opcode_deps_f7_mod3 : opcode_deps_f7;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xff: case 0xff:
ins_table = mod3 ? opcode_timings_ff_mod3 : opcode_timings_ff; ins_table = mod3 ? opcode_timings_k6_ff_mod3 : opcode_timings_k6_ff;
deps = mod3 ? opcode_deps_ff_mod3 : opcode_deps_ff; deps = mod3 ? opcode_deps_ff_mod3 : opcode_deps_ff;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
default: default:
ins_table = mod3 ? opcode_timings_mod3 : opcode_timings; ins_table = mod3 ? opcode_timings_k6_mod3 : opcode_timings_k6;
deps = mod3 ? opcode_deps_mod3 : opcode_deps; deps = mod3 ? opcode_deps_mod3 : opcode_deps;
break; break;
} }

View File

@@ -787,7 +787,7 @@ static const macro_op_t wbinvd_op = {
}; };
#define INVALID NULL #define INVALID NULL
static const macro_op_t *opcode_timings[256] = { static const macro_op_t *opcode_timings_p6[256] = {
// clang-format off // clang-format off
/* ADD ADD ADD ADD*/ /* ADD ADD ADD ADD*/
/*00*/ &alup0_store_op, &alu_store_op, &load_alup0_op, &load_alu_op, /*00*/ &alup0_store_op, &alu_store_op, &load_alup0_op, &load_alu_op,
@@ -924,7 +924,7 @@ static const macro_op_t *opcode_timings[256] = {
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_mod3[256] = { static const macro_op_t *opcode_timings_p6_mod3[256] = {
// clang-format off // clang-format off
/* ADD ADD ADD ADD*/ /* ADD ADD ADD ADD*/
/*00*/ &alup0_op, &alu_op, &alup0_op, &alu_op, /*00*/ &alup0_op, &alu_op, &alup0_op, &alu_op,
@@ -1062,7 +1062,7 @@ static const macro_op_t *opcode_timings_mod3[256] = {
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_0f[256] = { static const macro_op_t *opcode_timings_p6_0f[256] = {
// clang-format off // clang-format off
/*00*/ &alu6_op, &alu6_op, &alu6_op, &alu6_op, /*00*/ &alu6_op, &alu6_op, &alu6_op, &alu6_op,
INVALID, &alu6_op, &alu6_op, INVALID, INVALID, &alu6_op, &alu6_op, INVALID,
@@ -1145,7 +1145,7 @@ static const macro_op_t *opcode_timings_0f[256] = {
&load_mmx_op, &load_mmx_op, &load_mmx_op, INVALID, &load_mmx_op, &load_mmx_op, &load_mmx_op, INVALID,
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_0f_mod3[256] = { static const macro_op_t *opcode_timings_p6_0f_mod3[256] = {
// clang-format off // clang-format off
/*00*/ &alu6_op, &alu6_op, &alu6_op, &alu6_op, /*00*/ &alu6_op, &alu6_op, &alu6_op, &alu6_op,
INVALID, &alu6_op, &alu6_op, INVALID, INVALID, &alu6_op, &alu6_op, INVALID,
@@ -1228,58 +1228,58 @@ static const macro_op_t *opcode_timings_0f_mod3[256] = {
&mmx_op, &mmx_op, &mmx_op, INVALID, &mmx_op, &mmx_op, &mmx_op, INVALID,
}; };
static const macro_op_t *opcode_timings_shift[8] = static const macro_op_t *opcode_timings_p6_shift[8] =
{ {
// clang-format off // clang-format off
&alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op,
&alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_shift_b[8] = { static const macro_op_t *opcode_timings_p6_shift_b[8] = {
// clang-format off // clang-format off
&alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op,
&alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op &alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_shift_mod3[8] = { static const macro_op_t *opcode_timings_p6_shift_mod3[8] = {
// clang-format off // clang-format off
&complex_alu1_op, &complex_alu1_op, &complex_alu1_op, &complex_alu1_op, &complex_alu1_op, &complex_alu1_op, &complex_alu1_op, &complex_alu1_op,
&alu_op, &alu_op, &alu_op, &alu_op &alu_op, &alu_op, &alu_op, &alu_op
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_shift_b_mod3[8] = { static const macro_op_t *opcode_timings_p6_shift_b_mod3[8] = {
// clang-format off // clang-format off
&complex_alup0_1_op, &complex_alup0_1_op, &complex_alup0_1_op, &complex_alup0_1_op, &complex_alup0_1_op, &complex_alup0_1_op, &complex_alup0_1_op, &complex_alup0_1_op,
&alup0_op, &alup0_op, &alup0_op, &alup0_op &alup0_op, &alup0_op, &alup0_op, &alup0_op
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_80[8] = { static const macro_op_t *opcode_timings_p6_80[8] = {
// clang-format off // clang-format off
&alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op,
&alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op, &alup0_store_op,
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_80_mod3[8] = { static const macro_op_t *opcode_timings_p6_80_mod3[8] = {
// clang-format off // clang-format off
&alup0_op, &alup0_op, &alup0_store_op, &alup0_store_op, &alup0_op, &alup0_op, &alup0_store_op, &alup0_store_op,
&alup0_op, &alup0_op, &alup0_op, &alup0_op, &alup0_op, &alup0_op, &alup0_op, &alup0_op,
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_8x[8] = { static const macro_op_t *opcode_timings_p6_8x[8] = {
// clang-format off // clang-format off
&alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op,
&alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op, &alu_store_op,
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_8x_mod3[8] = { static const macro_op_t *opcode_timings_p6_8x_mod3[8] = {
// clang-format off // clang-format off
&alu_op, &alu_op, &alu_store_op, &alu_store_op, &alu_op, &alu_op, &alu_store_op, &alu_store_op,
&alu_op, &alu_op, &alu_op, &alu_op, &alu_op, &alu_op, &alu_op, &alu_op,
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_f6[8] = { static const macro_op_t *opcode_timings_p6_f6[8] = {
// clang-format off // clang-format off
/* TST NOT NEG*/ /* TST NOT NEG*/
&test_mem_imm_b_op, INVALID, &alup0_store_op, &alup0_store_op, &test_mem_imm_b_op, INVALID, &alup0_store_op, &alup0_store_op,
@@ -1287,7 +1287,7 @@ static const macro_op_t *opcode_timings_f6[8] = {
&mul_mem_op, &mul_mem_op, &div16_mem_op, &div16_mem_op, &mul_mem_op, &mul_mem_op, &div16_mem_op, &div16_mem_op,
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_f6_mod3[8] = { static const macro_op_t *opcode_timings_p6_f6_mod3[8] = {
// clang-format off // clang-format off
/* TST NOT NEG*/ /* TST NOT NEG*/
&test_reg_b_op, INVALID, &alup0_op, &alup0_op, &test_reg_b_op, INVALID, &alup0_op, &alup0_op,
@@ -1295,7 +1295,7 @@ static const macro_op_t *opcode_timings_f6_mod3[8] = {
&mul_op, &mul_op, &div16_op, &div16_op, &mul_op, &mul_op, &div16_op, &div16_op,
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_f7[8] = { static const macro_op_t *opcode_timings_p6_f7[8] = {
// clang-format off // clang-format off
/* TST NOT NEG*/ /* TST NOT NEG*/
&test_mem_imm_op, INVALID, &alu_store_op, &alu_store_op, &test_mem_imm_op, INVALID, &alu_store_op, &alu_store_op,
@@ -1303,7 +1303,7 @@ static const macro_op_t *opcode_timings_f7[8] = {
&mul64_mem_op, &mul64_mem_op, &div32_mem_op, &div32_mem_op, &mul64_mem_op, &mul64_mem_op, &div32_mem_op, &div32_mem_op,
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_f7_mod3[8] = { static const macro_op_t *opcode_timings_p6_f7_mod3[8] = {
// clang-format off // clang-format off
/* TST NOT NEG*/ /* TST NOT NEG*/
&test_reg_op, INVALID, &alu_op, &alu_op, &test_reg_op, INVALID, &alu_op, &alu_op,
@@ -1311,7 +1311,7 @@ static const macro_op_t *opcode_timings_f7_mod3[8] = {
&mul64_op, &mul64_op, &div32_op, &div32_op, &mul64_op, &mul64_op, &div32_op, &div32_op,
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_ff[8] = { static const macro_op_t *opcode_timings_p6_ff[8] = {
// clang-format off // clang-format off
/* INC DEC CALL CALL far*/ /* INC DEC CALL CALL far*/
&alu_store_op, &alu_store_op, &store_op, &call_far_op, &alu_store_op, &alu_store_op, &store_op, &call_far_op,
@@ -1319,7 +1319,7 @@ static const macro_op_t *opcode_timings_ff[8] = {
&branch_op, &jmp_far_op, &push_mem_op, INVALID &branch_op, &jmp_far_op, &push_mem_op, INVALID
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_ff_mod3[8] = { static const macro_op_t *opcode_timings_p6_ff_mod3[8] = {
// clang-format off // clang-format off
/* INC DEC CALL CALL far*/ /* INC DEC CALL CALL far*/
&complex_alu1_op, &complex_alu1_op, &store_op, &call_far_op, &complex_alu1_op, &complex_alu1_op, &store_op, &call_far_op,
@@ -1328,7 +1328,7 @@ static const macro_op_t *opcode_timings_ff_mod3[8] = {
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_d8[8] = { static const macro_op_t *opcode_timings_p6_d8[8] = {
// clang-format off // clang-format off
/* FADDs FMULs FCOMs FCOMPs*/ /* FADDs FMULs FCOMs FCOMPs*/
&load_fadd_op, &load_fmul_op, &load_float_op, &load_float_op, &load_fadd_op, &load_fmul_op, &load_float_op, &load_float_op,
@@ -1336,7 +1336,7 @@ static const macro_op_t *opcode_timings_d8[8] = {
&load_float_op, &load_float_op, &fdiv_mem_op, &fdiv_mem_op, &load_float_op, &load_float_op, &fdiv_mem_op, &fdiv_mem_op,
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_d8_mod3[8] = { static const macro_op_t *opcode_timings_p6_d8_mod3[8] = {
// clang-format off // clang-format off
/* FADD FMUL FCOM FCOMP*/ /* FADD FMUL FCOM FCOMP*/
&fadd_op, &fmul_op, &float_op, &float_op, &fadd_op, &fmul_op, &float_op, &float_op,
@@ -1345,7 +1345,7 @@ static const macro_op_t *opcode_timings_d8_mod3[8] = {
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_d9[8] = { static const macro_op_t *opcode_timings_p6_d9[8] = {
// clang-format off // clang-format off
/* FLDs FSTs FSTPs*/ /* FLDs FSTs FSTPs*/
&load_float_op, INVALID, &fstore_op, &fstore_op, &load_float_op, INVALID, &fstore_op, &fstore_op,
@@ -1353,7 +1353,7 @@ static const macro_op_t *opcode_timings_d9[8] = {
&complex_float_l_op, &fldcw_op, &complex_float_l_op, &complex_float_op &complex_float_l_op, &fldcw_op, &complex_float_l_op, &complex_float_op
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_d9_mod3[64] = { static const macro_op_t *opcode_timings_p6_d9_mod3[64] = {
// clang-format off // clang-format off
/*FLD*/ /*FLD*/
&float_op, &float_op, &float_op, &float_op, &float_op, &float_op, &float_op, &float_op,
@@ -1386,7 +1386,7 @@ static const macro_op_t *opcode_timings_d9_mod3[64] = {
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_da[8] = { static const macro_op_t *opcode_timings_p6_da[8] = {
// clang-format off // clang-format off
/* FIADDl FIMULl FICOMl FICOMPl*/ /* FIADDl FIMULl FICOMl FICOMPl*/
&load_fadd_op, &load_fmul_op, &load_float_op, &load_float_op, &load_fadd_op, &load_fmul_op, &load_float_op, &load_float_op,
@@ -1394,7 +1394,7 @@ static const macro_op_t *opcode_timings_da[8] = {
&load_float_op, &load_float_op, &fdiv_mem_op, &fdiv_mem_op, &load_float_op, &load_float_op, &fdiv_mem_op, &fdiv_mem_op,
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_da_mod3[8] = { static const macro_op_t *opcode_timings_p6_da_mod3[8] = {
// clang-format off // clang-format off
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
/* FCOMPP*/ /* FCOMPP*/
@@ -1402,7 +1402,7 @@ static const macro_op_t *opcode_timings_da_mod3[8] = {
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_db[8] = { static const macro_op_t *opcode_timings_p6_db[8] = {
// clang-format off // clang-format off
/* FLDil FSTil FSTPil*/ /* FLDil FSTil FSTPil*/
&load_float_op, INVALID, &fstore_op, &fstore_op, &load_float_op, INVALID, &fstore_op, &fstore_op,
@@ -1410,7 +1410,7 @@ static const macro_op_t *opcode_timings_db[8] = {
INVALID, &flde_op, INVALID, &fste_op INVALID, &flde_op, INVALID, &fste_op
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_db_mod3[64] = { static const macro_op_t *opcode_timings_p6_db_mod3[64] = {
// clang-format off // clang-format off
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
@@ -1440,7 +1440,7 @@ static const macro_op_t *opcode_timings_db_mod3[64] = {
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_dc[8] = { static const macro_op_t *opcode_timings_p6_dc[8] = {
// clang-format off // clang-format off
/* FADDd FMULd FCOMd FCOMPd*/ /* FADDd FMULd FCOMd FCOMPd*/
&load_fadd_op, &load_fmul_op, &load_float_op, &load_float_op, &load_fadd_op, &load_fmul_op, &load_float_op, &load_float_op,
@@ -1448,7 +1448,7 @@ static const macro_op_t *opcode_timings_dc[8] = {
&load_float_op, &load_float_op, &fdiv_mem_op, &fdiv_mem_op, &load_float_op, &load_float_op, &fdiv_mem_op, &fdiv_mem_op,
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_dc_mod3[8] = { static const macro_op_t *opcode_timings_p6_dc_mod3[8] = {
// clang-format off // clang-format off
/* opFADDr opFMULr*/ /* opFADDr opFMULr*/
&fadd_op, &fmul_op, INVALID, INVALID, &fadd_op, &fmul_op, INVALID, INVALID,
@@ -1457,7 +1457,7 @@ static const macro_op_t *opcode_timings_dc_mod3[8] = {
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_dd[8] = { static const macro_op_t *opcode_timings_p6_dd[8] = {
// clang-format off // clang-format off
/* FLDd FSTd FSTPd*/ /* FLDd FSTd FSTPd*/
&load_float_op, INVALID, &fstore_op, &fstore_op, &load_float_op, INVALID, &fstore_op, &fstore_op,
@@ -1465,7 +1465,7 @@ static const macro_op_t *opcode_timings_dd[8] = {
&complex_float_l_op, INVALID, &complex_float_l_op, &complex_float_l_op &complex_float_l_op, INVALID, &complex_float_l_op, &complex_float_l_op
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_dd_mod3[8] = { static const macro_op_t *opcode_timings_p6_dd_mod3[8] = {
// clang-format off // clang-format off
/* FFFREE FST FSTP*/ /* FFFREE FST FSTP*/
&float_op, INVALID, &float_op, &float_op, &float_op, INVALID, &float_op, &float_op,
@@ -1474,7 +1474,7 @@ static const macro_op_t *opcode_timings_dd_mod3[8] = {
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_de[8] = { static const macro_op_t *opcode_timings_p6_de[8] = {
// clang-format off // clang-format off
/* FIADDw FIMULw FICOMw FICOMPw*/ /* FIADDw FIMULw FICOMw FICOMPw*/
&load_fiadd_op, &load_fiadd_op, &load_fiadd_op, &load_fiadd_op, &load_fiadd_op, &load_fiadd_op, &load_fiadd_op, &load_fiadd_op,
@@ -1482,7 +1482,7 @@ static const macro_op_t *opcode_timings_de[8] = {
&load_fiadd_op, &load_fiadd_op, &load_fiadd_op, &load_fiadd_op, &load_fiadd_op, &load_fiadd_op, &load_fiadd_op, &load_fiadd_op,
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_de_mod3[8] = { static const macro_op_t *opcode_timings_p6_de_mod3[8] = {
// clang-format off // clang-format off
/* FADDP FMULP FCOMPP*/ /* FADDP FMULP FCOMPP*/
&fadd_op, &fmul_op, INVALID, &float_op, &fadd_op, &fmul_op, INVALID, &float_op,
@@ -1491,7 +1491,7 @@ static const macro_op_t *opcode_timings_de_mod3[8] = {
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_df[8] = { static const macro_op_t *opcode_timings_p6_df[8] = {
// clang-format off // clang-format off
/* FILDiw FISTiw FISTPiw*/ /* FILDiw FISTiw FISTPiw*/
&load_float_op, INVALID, &fstore_op, &fstore_op, &load_float_op, INVALID, &fstore_op, &fstore_op,
@@ -1499,7 +1499,7 @@ static const macro_op_t *opcode_timings_df[8] = {
INVALID, &load_float_op, &complex_float_l_op, &fstore_op, INVALID, &load_float_op, &complex_float_l_op, &fstore_op,
// clang-format on // clang-format on
}; };
static const macro_op_t *opcode_timings_df_mod3[8] = { static const macro_op_t *opcode_timings_p6_df_mod3[8] = {
// clang-format off // clang-format off
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
/* FSTSW AX*/ /* FSTSW AX*/
@@ -1865,47 +1865,47 @@ codegen_timing_p6_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNUSED(ui
switch (last_prefix) { switch (last_prefix) {
case 0x0f: case 0x0f:
ins_table = mod3 ? opcode_timings_0f_mod3 : opcode_timings_0f; ins_table = mod3 ? opcode_timings_p6_0f_mod3 : opcode_timings_p6_0f;
deps = mod3 ? opcode_deps_0f_mod3 : opcode_deps_0f; deps = mod3 ? opcode_deps_0f_mod3 : opcode_deps_0f;
break; break;
case 0xd8: case 0xd8:
ins_table = mod3 ? opcode_timings_d8_mod3 : opcode_timings_d8; ins_table = mod3 ? opcode_timings_p6_d8_mod3 : opcode_timings_p6_d8;
deps = mod3 ? opcode_deps_d8_mod3 : opcode_deps_d8; deps = mod3 ? opcode_deps_d8_mod3 : opcode_deps_d8;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xd9: case 0xd9:
ins_table = mod3 ? opcode_timings_d9_mod3 : opcode_timings_d9; ins_table = mod3 ? opcode_timings_p6_d9_mod3 : opcode_timings_p6_d9;
deps = mod3 ? opcode_deps_d9_mod3 : opcode_deps_d9; deps = mod3 ? opcode_deps_d9_mod3 : opcode_deps_d9;
opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7; opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7;
break; break;
case 0xda: case 0xda:
ins_table = mod3 ? opcode_timings_da_mod3 : opcode_timings_da; ins_table = mod3 ? opcode_timings_p6_da_mod3 : opcode_timings_p6_da;
deps = mod3 ? opcode_deps_da_mod3 : opcode_deps_da; deps = mod3 ? opcode_deps_da_mod3 : opcode_deps_da;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdb: case 0xdb:
ins_table = mod3 ? opcode_timings_db_mod3 : opcode_timings_db; ins_table = mod3 ? opcode_timings_p6_db_mod3 : opcode_timings_p6_db;
deps = mod3 ? opcode_deps_db_mod3 : opcode_deps_db; deps = mod3 ? opcode_deps_db_mod3 : opcode_deps_db;
opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7; opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7;
break; break;
case 0xdc: case 0xdc:
ins_table = mod3 ? opcode_timings_dc_mod3 : opcode_timings_dc; ins_table = mod3 ? opcode_timings_p6_dc_mod3 : opcode_timings_p6_dc;
deps = mod3 ? opcode_deps_dc_mod3 : opcode_deps_dc; deps = mod3 ? opcode_deps_dc_mod3 : opcode_deps_dc;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdd: case 0xdd:
ins_table = mod3 ? opcode_timings_dd_mod3 : opcode_timings_dd; ins_table = mod3 ? opcode_timings_p6_dd_mod3 : opcode_timings_p6_dd;
deps = mod3 ? opcode_deps_dd_mod3 : opcode_deps_dd; deps = mod3 ? opcode_deps_dd_mod3 : opcode_deps_dd;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xde: case 0xde:
ins_table = mod3 ? opcode_timings_de_mod3 : opcode_timings_de; ins_table = mod3 ? opcode_timings_p6_de_mod3 : opcode_timings_p6_de;
deps = mod3 ? opcode_deps_de_mod3 : opcode_deps_de; deps = mod3 ? opcode_deps_de_mod3 : opcode_deps_de;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdf: case 0xdf:
ins_table = mod3 ? opcode_timings_df_mod3 : opcode_timings_df; ins_table = mod3 ? opcode_timings_p6_df_mod3 : opcode_timings_p6_df;
deps = mod3 ? opcode_deps_df_mod3 : opcode_deps_df; deps = mod3 ? opcode_deps_df_mod3 : opcode_deps_df;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
@@ -1914,13 +1914,13 @@ codegen_timing_p6_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNUSED(ui
switch (opcode) { switch (opcode) {
case 0x80: case 0x80:
case 0x82: case 0x82:
ins_table = mod3 ? opcode_timings_80_mod3 : opcode_timings_80; ins_table = mod3 ? opcode_timings_p6_80_mod3 : opcode_timings_p6_80;
deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x; deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0x81: case 0x81:
case 0x83: case 0x83:
ins_table = mod3 ? opcode_timings_8x_mod3 : opcode_timings_8x; ins_table = mod3 ? opcode_timings_p6_8x_mod3 : opcode_timings_p6_8x;
deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x; deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
@@ -1928,7 +1928,7 @@ codegen_timing_p6_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNUSED(ui
case 0xc0: case 0xc0:
case 0xd0: case 0xd0:
case 0xd2: case 0xd2:
ins_table = mod3 ? opcode_timings_shift_b_mod3 : opcode_timings_shift_b; ins_table = mod3 ? opcode_timings_p6_shift_b_mod3 : opcode_timings_p6_shift_b;
deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift; deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
@@ -1936,29 +1936,29 @@ codegen_timing_p6_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNUSED(ui
case 0xc1: case 0xc1:
case 0xd1: case 0xd1:
case 0xd3: case 0xd3:
ins_table = mod3 ? opcode_timings_shift_mod3 : opcode_timings_shift; ins_table = mod3 ? opcode_timings_p6_shift_mod3 : opcode_timings_p6_shift;
deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift; deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xf6: case 0xf6:
ins_table = mod3 ? opcode_timings_f6_mod3 : opcode_timings_f6; ins_table = mod3 ? opcode_timings_p6_f6_mod3 : opcode_timings_p6_f6;
deps = mod3 ? opcode_deps_f6_mod3 : opcode_deps_f6; deps = mod3 ? opcode_deps_f6_mod3 : opcode_deps_f6;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xf7: case 0xf7:
ins_table = mod3 ? opcode_timings_f7_mod3 : opcode_timings_f7; ins_table = mod3 ? opcode_timings_p6_f7_mod3 : opcode_timings_p6_f7;
deps = mod3 ? opcode_deps_f7_mod3 : opcode_deps_f7; deps = mod3 ? opcode_deps_f7_mod3 : opcode_deps_f7;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xff: case 0xff:
ins_table = mod3 ? opcode_timings_ff_mod3 : opcode_timings_ff; ins_table = mod3 ? opcode_timings_p6_ff_mod3 : opcode_timings_p6_ff;
deps = mod3 ? opcode_deps_ff_mod3 : opcode_deps_ff; deps = mod3 ? opcode_deps_ff_mod3 : opcode_deps_ff;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
default: default:
ins_table = mod3 ? opcode_timings_mod3 : opcode_timings; ins_table = mod3 ? opcode_timings_p6_mod3 : opcode_timings_p6;
deps = mod3 ? opcode_deps_mod3 : opcode_deps; deps = mod3 ? opcode_deps_mod3 : opcode_deps;
break; break;
} }

View File

@@ -110,7 +110,7 @@ static uint32_t addr_regmask;
static int fpu_latency; static int fpu_latency;
static int fpu_st_latency[8]; static int fpu_st_latency[8];
static uint64_t opcode_timings[256] = { static uint64_t opcode_timings_p6[256] = {
// clang-format off // clang-format off
/* ADD ADD ADD ADD*/ /* ADD ADD ADD ADD*/
/*00*/ PAIR_UV | CYCLES_RMW, PAIR_UV | CYCLES_RMW, PAIR_UV | CYCLES_RM, PAIR_UV | CYCLES_RM, /*00*/ PAIR_UV | CYCLES_RMW, PAIR_UV | CYCLES_RMW, PAIR_UV | CYCLES_RM, PAIR_UV | CYCLES_RM,
@@ -247,7 +247,7 @@ static uint64_t opcode_timings[256] = {
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_mod3[256] = { static uint64_t opcode_timings_p6_mod3[256] = {
// clang-format off // clang-format off
/* ADD ADD ADD ADD*/ /* ADD ADD ADD ADD*/
/*00*/ PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, /*00*/ PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG,
@@ -385,7 +385,7 @@ static uint64_t opcode_timings_mod3[256] = {
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_0f[256] = { static uint64_t opcode_timings_p6_0f[256] = {
// clang-format off // clang-format off
/*00*/ PAIR_NP | CYCLES(20), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(10), /*00*/ PAIR_NP | CYCLES(20), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(10),
INVALID, PAIR_NP | CYCLES(195), PAIR_NP | CYCLES(7), INVALID, INVALID, PAIR_NP | CYCLES(195), PAIR_NP | CYCLES(7), INVALID,
@@ -468,7 +468,7 @@ static uint64_t opcode_timings_0f[256] = {
PAIR_U | CYCLES_RM, PAIR_U | CYCLES_RM, PAIR_U | CYCLES_RM, INVALID, PAIR_U | CYCLES_RM, PAIR_U | CYCLES_RM, PAIR_U | CYCLES_RM, INVALID,
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_0f_mod3[256] = { static uint64_t opcode_timings_p6_0f_mod3[256] = {
// clang-format off // clang-format off
/*00*/ PAIR_NP | CYCLES(20), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(10), /*00*/ PAIR_NP | CYCLES(20), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(10),
INVALID, PAIR_NP | CYCLES(195), PAIR_NP | CYCLES(7), INVALID, INVALID, PAIR_NP | CYCLES(195), PAIR_NP | CYCLES(7), INVALID,
@@ -552,20 +552,20 @@ static uint64_t opcode_timings_0f_mod3[256] = {
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_shift[8] = { static uint64_t opcode_timings_p6_shift[8] = {
// clang-format off // clang-format off
PAIR_U | CYCLES_RMW, PAIR_U | CYCLES_RMW, PAIR_U | CYCLES_RMW, PAIR_U | CYCLES_RMW, PAIR_U | CYCLES_RMW, PAIR_U | CYCLES_RMW, PAIR_U | CYCLES_RMW, PAIR_U | CYCLES_RMW,
PAIR_U | CYCLES_RMW, PAIR_U | CYCLES_RMW, PAIR_U | CYCLES_RMW, PAIR_U | CYCLES_RMW, PAIR_U | CYCLES_RMW, PAIR_U | CYCLES_RMW, PAIR_U | CYCLES_RMW, PAIR_U | CYCLES_RMW,
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_shift_mod3[8] = { static uint64_t opcode_timings_p6_shift_mod3[8] = {
// clang-format off // clang-format off
PAIR_U | CYCLES_REG, PAIR_U | CYCLES_REG, PAIR_U | CYCLES_REG, PAIR_U | CYCLES_REG, PAIR_U | CYCLES_REG, PAIR_U | CYCLES_REG, PAIR_U | CYCLES_REG, PAIR_U | CYCLES_REG,
PAIR_U | CYCLES_REG, PAIR_U | CYCLES_REG, PAIR_U | CYCLES_REG, PAIR_U | CYCLES_REG, PAIR_U | CYCLES_REG, PAIR_U | CYCLES_REG, PAIR_U | CYCLES_REG, PAIR_U | CYCLES_REG,
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_f6[8] = { static uint64_t opcode_timings_p6_f6[8] = {
// clang-format off // clang-format off
/* TST NOT NEG*/ /* TST NOT NEG*/
PAIR_UV | CYCLES_RM, INVALID, PAIR_NP | CYCLES(3), PAIR_NP | CYCLES(3), PAIR_UV | CYCLES_RM, INVALID, PAIR_NP | CYCLES(3), PAIR_NP | CYCLES(3),
@@ -573,7 +573,7 @@ static uint64_t opcode_timings_f6[8] = {
PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(17), PAIR_NP | CYCLES(22) PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(17), PAIR_NP | CYCLES(22)
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_f6_mod3[8] = { static uint64_t opcode_timings_p6_f6_mod3[8] = {
// clang-format off // clang-format off
/* TST NOT NEG*/ /* TST NOT NEG*/
PAIR_UV | CYCLES_REG, INVALID, PAIR_NP | CYCLES(3), PAIR_NP | CYCLES(3), PAIR_UV | CYCLES_REG, INVALID, PAIR_NP | CYCLES(3), PAIR_NP | CYCLES(3),
@@ -581,7 +581,7 @@ static uint64_t opcode_timings_f6_mod3[8] = {
PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(17), PAIR_NP | CYCLES(22) PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(11), PAIR_NP | CYCLES(17), PAIR_NP | CYCLES(22)
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_f7[8] = { static uint64_t opcode_timings_p6_f7[8] = {
// clang-format off // clang-format off
/* TST NOT NEG*/ /* TST NOT NEG*/
PAIR_UV | CYCLES_RM, INVALID, PAIR_NP | CYCLES(3), PAIR_NP | CYCLES(3), PAIR_UV | CYCLES_RM, INVALID, PAIR_NP | CYCLES(3), PAIR_NP | CYCLES(3),
@@ -589,7 +589,7 @@ static uint64_t opcode_timings_f7[8] = {
PAIR_NP | CYCLES_MULTI(11,10), PAIR_NP | CYCLES_MULTI(11,10), PAIR_NP | CYCLES_MULTI(25,41), PAIR_NP | CYCLES_MULTI(30,46) PAIR_NP | CYCLES_MULTI(11,10), PAIR_NP | CYCLES_MULTI(11,10), PAIR_NP | CYCLES_MULTI(25,41), PAIR_NP | CYCLES_MULTI(30,46)
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_f7_mod3[8] = { static uint64_t opcode_timings_p6_f7_mod3[8] = {
// clang-format off // clang-format off
/* TST NOT NEG*/ /* TST NOT NEG*/
PAIR_UV | CYCLES_REG, INVALID, PAIR_NP | CYCLES(3), PAIR_NP | CYCLES(3), PAIR_UV | CYCLES_REG, INVALID, PAIR_NP | CYCLES(3), PAIR_NP | CYCLES(3),
@@ -597,7 +597,7 @@ static uint64_t opcode_timings_f7_mod3[8] = {
PAIR_NP | CYCLES_MULTI(11,10), PAIR_NP | CYCLES_MULTI(11,10), PAIR_NP | CYCLES_MULTI(25,41), PAIR_NP | CYCLES_MULTI(30,46) PAIR_NP | CYCLES_MULTI(11,10), PAIR_NP | CYCLES_MULTI(11,10), PAIR_NP | CYCLES_MULTI(25,41), PAIR_NP | CYCLES_MULTI(30,46)
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_ff[8] = { static uint64_t opcode_timings_p6_ff[8] = {
// clang-format off // clang-format off
/* INC DEC CALL CALL far*/ /* INC DEC CALL CALL far*/
PAIR_UV | CYCLES_RMW, PAIR_UV | CYCLES_RMW, PAIR_NP | CYCLES(4), PAIR_NP | CYCLES(0), PAIR_UV | CYCLES_RMW, PAIR_UV | CYCLES_RMW, PAIR_NP | CYCLES(4), PAIR_NP | CYCLES(0),
@@ -605,7 +605,7 @@ static uint64_t opcode_timings_ff[8] = {
PAIR_NP | CYCLES(2), PAIR_NP | CYCLES(0), PAIR_NP | CYCLES(2), INVALID PAIR_NP | CYCLES(2), PAIR_NP | CYCLES(0), PAIR_NP | CYCLES(2), INVALID
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_ff_mod3[8] = { static uint64_t opcode_timings_p6_ff_mod3[8] = {
// clang-format off // clang-format off
/* INC DEC CALL CALL far*/ /* INC DEC CALL CALL far*/
PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_NP | CYCLES(4), PAIR_NP | CYCLES(0), PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_NP | CYCLES(4), PAIR_NP | CYCLES(0),
@@ -614,7 +614,7 @@ static uint64_t opcode_timings_ff_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_d8[8] = { static uint64_t opcode_timings_p6_d8[8] = {
// clang-format off // clang-format off
/* FADDs FMULs FCOMs FCOMPs*/ /* FADDs FMULs FCOMs FCOMPs*/
PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(1,0,0),
@@ -622,7 +622,7 @@ static uint64_t opcode_timings_d8[8] = {
PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(39,38,2), PAIR_FX | FPU_CYCLES(39,38,2) PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(39,38,2), PAIR_FX | FPU_CYCLES(39,38,2)
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_d8_mod3[8] = { static uint64_t opcode_timings_p6_d8_mod3[8] = {
// clang-format off // clang-format off
/* FADD FMUL FCOM FCOMP*/ /* FADD FMUL FCOM FCOMP*/
PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(1,0,0),
@@ -631,7 +631,7 @@ static uint64_t opcode_timings_d8_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_d9[8] = { static uint64_t opcode_timings_p6_d9[8] = {
// clang-format off // clang-format off
/* FLDs FSTs FSTPs*/ /* FLDs FSTs FSTPs*/
PAIR_FX | FPU_CYCLES(1,0,0), INVALID, PAIR_NP | FPU_CYCLES(2,0,0), PAIR_NP | FPU_CYCLES(2,0,0), PAIR_FX | FPU_CYCLES(1,0,0), INVALID, PAIR_NP | FPU_CYCLES(2,0,0), PAIR_NP | FPU_CYCLES(2,0,0),
@@ -639,7 +639,7 @@ static uint64_t opcode_timings_d9[8] = {
PAIR_NP | FPU_CYCLES(32,0,0), PAIR_NP | FPU_CYCLES(8,0,0), PAIR_NP | FPU_CYCLES(48,0,0), PAIR_NP | FPU_CYCLES(2,0,0) PAIR_NP | FPU_CYCLES(32,0,0), PAIR_NP | FPU_CYCLES(8,0,0), PAIR_NP | FPU_CYCLES(48,0,0), PAIR_NP | FPU_CYCLES(2,0,0)
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_d9_mod3[64] = { static uint64_t opcode_timings_p6_d9_mod3[64] = {
// clang-format off // clang-format off
/*FLD*/ /*FLD*/
PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(1,0,0),
@@ -672,7 +672,7 @@ static uint64_t opcode_timings_d9_mod3[64] = {
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_da[8] = { static uint64_t opcode_timings_p6_da[8] = {
// clang-format off // clang-format off
/* FIADDl FIMULl FICOMl FICOMPl*/ /* FIADDl FIMULl FICOMl FICOMPl*/
PAIR_NP | FPU_CYCLES(6,2,2), PAIR_NP | FPU_CYCLES(6,2,2), PAIR_NP | FPU_CYCLES(4,0,0), PAIR_NP | FPU_CYCLES(4,0,0), PAIR_NP | FPU_CYCLES(6,2,2), PAIR_NP | FPU_CYCLES(6,2,2), PAIR_NP | FPU_CYCLES(4,0,0), PAIR_NP | FPU_CYCLES(4,0,0),
@@ -680,7 +680,7 @@ static uint64_t opcode_timings_da[8] = {
PAIR_NP | FPU_CYCLES(6,2,2), PAIR_NP | FPU_CYCLES(6,2,2), PAIR_NP | FPU_CYCLES(42,38,2), PAIR_NP | FPU_CYCLES(42,38,2) PAIR_NP | FPU_CYCLES(6,2,2), PAIR_NP | FPU_CYCLES(6,2,2), PAIR_NP | FPU_CYCLES(42,38,2), PAIR_NP | FPU_CYCLES(42,38,2)
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_da_mod3[8] = { static uint64_t opcode_timings_p6_da_mod3[8] = {
// clang-format off // clang-format off
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
/* FCOMPP*/ /* FCOMPP*/
@@ -688,7 +688,7 @@ static uint64_t opcode_timings_da_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_db[8] = { static uint64_t opcode_timings_p6_db[8] = {
// clang-format off // clang-format off
/* FLDil FSTil FSTPil*/ /* FLDil FSTil FSTPil*/
PAIR_NP | FPU_CYCLES(3,2,2), INVALID, PAIR_NP | FPU_CYCLES(6,0,0), PAIR_NP | FPU_CYCLES(6,0,0), PAIR_NP | FPU_CYCLES(3,2,2), INVALID, PAIR_NP | FPU_CYCLES(6,0,0), PAIR_NP | FPU_CYCLES(6,0,0),
@@ -696,7 +696,7 @@ static uint64_t opcode_timings_db[8] = {
INVALID, PAIR_NP | FPU_CYCLES(3,0,0), INVALID, PAIR_NP | FPU_CYCLES(3,0,0) INVALID, PAIR_NP | FPU_CYCLES(3,0,0), INVALID, PAIR_NP | FPU_CYCLES(3,0,0)
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_db_mod3[64] = { static uint64_t opcode_timings_p6_db_mod3[64] = {
// clang-format off // clang-format off
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
@@ -726,7 +726,7 @@ static uint64_t opcode_timings_db_mod3[64] = {
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_dc[8] = { static uint64_t opcode_timings_p6_dc[8] = {
// clang-format off // clang-format off
/* FADDd FMULd FCOMd FCOMPd*/ /* FADDd FMULd FCOMd FCOMPd*/
PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(1,0,0),
@@ -734,7 +734,7 @@ static uint64_t opcode_timings_dc[8] = {
PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(39,38,2), PAIR_FX | FPU_CYCLES(39,38,2) PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(39,38,2), PAIR_FX | FPU_CYCLES(39,38,2)
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_dc_mod3[8] = { static uint64_t opcode_timings_p6_dc_mod3[8] = {
// clang-format off // clang-format off
/* opFADDr opFMULr*/ /* opFADDr opFMULr*/
PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(3,2,2), INVALID, INVALID, PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(3,2,2), INVALID, INVALID,
@@ -743,7 +743,7 @@ static uint64_t opcode_timings_dc_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_dd[8] = { static uint64_t opcode_timings_p6_dd[8] = {
// clang-format off // clang-format off
/* FLDd FSTd FSTPd*/ /* FLDd FSTd FSTPd*/
PAIR_FX | FPU_CYCLES(1,0,0), INVALID, PAIR_NP | FPU_CYCLES(2,0,0), PAIR_NP | FPU_CYCLES(2,0,0), PAIR_FX | FPU_CYCLES(1,0,0), INVALID, PAIR_NP | FPU_CYCLES(2,0,0), PAIR_NP | FPU_CYCLES(2,0,0),
@@ -751,7 +751,7 @@ static uint64_t opcode_timings_dd[8] = {
PAIR_NP | FPU_CYCLES(70,0,0), INVALID, PAIR_NP | FPU_CYCLES(127,0,0), PAIR_NP | FPU_CYCLES(6,0,0) PAIR_NP | FPU_CYCLES(70,0,0), INVALID, PAIR_NP | FPU_CYCLES(127,0,0), PAIR_NP | FPU_CYCLES(6,0,0)
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_dd_mod3[8] = { static uint64_t opcode_timings_p6_dd_mod3[8] = {
// clang-format off // clang-format off
/* FFFREE FST FSTP*/ /* FFFREE FST FSTP*/
PAIR_NP | FPU_CYCLES(2,0,0), INVALID, PAIR_NP | FPU_CYCLES(1,0,0), PAIR_NP | FPU_CYCLES(1,0,0), PAIR_NP | FPU_CYCLES(2,0,0), INVALID, PAIR_NP | FPU_CYCLES(1,0,0), PAIR_NP | FPU_CYCLES(1,0,0),
@@ -760,7 +760,7 @@ static uint64_t opcode_timings_dd_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_de[8] = { static uint64_t opcode_timings_p6_de[8] = {
// clang-format off // clang-format off
/* FIADDw FIMULw FICOMw FICOMPw*/ /* FIADDw FIMULw FICOMw FICOMPw*/
PAIR_NP | FPU_CYCLES(6,2,2), PAIR_NP | FPU_CYCLES(6,2,2), PAIR_NP | FPU_CYCLES(4,0,0), PAIR_NP | FPU_CYCLES(4,0,0), PAIR_NP | FPU_CYCLES(6,2,2), PAIR_NP | FPU_CYCLES(6,2,2), PAIR_NP | FPU_CYCLES(4,0,0), PAIR_NP | FPU_CYCLES(4,0,0),
@@ -768,7 +768,7 @@ static uint64_t opcode_timings_de[8] = {
PAIR_NP | FPU_CYCLES(6,2,2), PAIR_NP | FPU_CYCLES(6,2,2), PAIR_NP | FPU_CYCLES(42,38,2), PAIR_NP | FPU_CYCLES(42,38,2) PAIR_NP | FPU_CYCLES(6,2,2), PAIR_NP | FPU_CYCLES(6,2,2), PAIR_NP | FPU_CYCLES(42,38,2), PAIR_NP | FPU_CYCLES(42,38,2)
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_de_mod3[8] = { static uint64_t opcode_timings_p6_de_mod3[8] = {
// clang-format off // clang-format off
/* FADDP FMULP FCOMPP*/ /* FADDP FMULP FCOMPP*/
PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(3,2,2), INVALID, PAIR_FX | FPU_CYCLES(1,0,0), PAIR_FX | FPU_CYCLES(3,2,2), PAIR_FX | FPU_CYCLES(3,2,2), INVALID, PAIR_FX | FPU_CYCLES(1,0,0),
@@ -777,7 +777,7 @@ static uint64_t opcode_timings_de_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_df[8] = { static uint64_t opcode_timings_p6_df[8] = {
// clang-format off // clang-format off
/* FILDiw FISTiw FISTPiw*/ /* FILDiw FISTiw FISTPiw*/
PAIR_NP | FPU_CYCLES(3,2,2), INVALID, PAIR_NP | FPU_CYCLES(6,0,0), PAIR_NP | FPU_CYCLES(6,0,0), PAIR_NP | FPU_CYCLES(3,2,2), INVALID, PAIR_NP | FPU_CYCLES(6,0,0), PAIR_NP | FPU_CYCLES(6,0,0),
@@ -785,7 +785,7 @@ static uint64_t opcode_timings_df[8] = {
INVALID, PAIR_NP | FPU_CYCLES(3,2,2), PAIR_NP | FPU_CYCLES(148,0,0), PAIR_NP | FPU_CYCLES(6,0,0) INVALID, PAIR_NP | FPU_CYCLES(3,2,2), PAIR_NP | FPU_CYCLES(148,0,0), PAIR_NP | FPU_CYCLES(6,0,0)
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_df_mod3[8] = { static uint64_t opcode_timings_p6_df_mod3[8] = {
// clang-format off // clang-format off
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
/* FSTSW AX*/ /* FSTSW AX*/
@@ -793,25 +793,25 @@ static uint64_t opcode_timings_df_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_81[8] = { static uint64_t opcode_timings_p6_81[8] = {
// clang-format off // clang-format off
PAIR_UV | CYCLES_RMW | CYCLES_IMM1632, PAIR_UV | CYCLES_RMW | CYCLES_IMM1632, PAIR_UV | CYCLES_RMW | CYCLES_IMM1632, PAIR_UV | CYCLES_RMW | CYCLES_IMM1632, PAIR_UV | CYCLES_RMW | CYCLES_IMM1632, PAIR_UV | CYCLES_RMW | CYCLES_IMM1632, PAIR_UV | CYCLES_RMW | CYCLES_IMM1632, PAIR_UV | CYCLES_RMW | CYCLES_IMM1632,
PAIR_UV | CYCLES_RMW | CYCLES_IMM1632, PAIR_UV | CYCLES_RMW | CYCLES_IMM1632, PAIR_UV | CYCLES_RMW | CYCLES_IMM1632, PAIR_UV | CYCLES_RM | CYCLES_IMM1632 PAIR_UV | CYCLES_RMW | CYCLES_IMM1632, PAIR_UV | CYCLES_RMW | CYCLES_IMM1632, PAIR_UV | CYCLES_RMW | CYCLES_IMM1632, PAIR_UV | CYCLES_RM | CYCLES_IMM1632
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_81_mod3[8] = { static uint64_t opcode_timings_p6_81_mod3[8] = {
// clang-format off // clang-format off
PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG,
PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_8x[8] = { static uint64_t opcode_timings_p6_8x[8] = {
// clang-format off // clang-format off
PAIR_UV | CYCLES_RMW | CYCLES_IMM8, PAIR_UV | CYCLES_RMW | CYCLES_IMM8, PAIR_UV | CYCLES_RMW | CYCLES_IMM8, PAIR_UV | CYCLES_RMW | CYCLES_IMM8, PAIR_UV | CYCLES_RMW | CYCLES_IMM8, PAIR_UV | CYCLES_RMW | CYCLES_IMM8, PAIR_UV | CYCLES_RMW | CYCLES_IMM8, PAIR_UV | CYCLES_RMW | CYCLES_IMM8,
PAIR_UV | CYCLES_RMW | CYCLES_IMM8, PAIR_UV | CYCLES_RMW | CYCLES_IMM8, PAIR_UV | CYCLES_RMW | CYCLES_IMM8, PAIR_UV | CYCLES_RM | CYCLES_IMM8 PAIR_UV | CYCLES_RMW | CYCLES_IMM8, PAIR_UV | CYCLES_RMW | CYCLES_IMM8, PAIR_UV | CYCLES_RMW | CYCLES_IMM8, PAIR_UV | CYCLES_RM | CYCLES_IMM8
// clang-format on // clang-format on
}; };
static uint64_t opcode_timings_8x_mod3[8] = { static uint64_t opcode_timings_p6_8x_mod3[8] = {
// clang-format off // clang-format off
PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG,
PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG, PAIR_UV | CYCLES_REG
@@ -1097,47 +1097,47 @@ codegen_timing_pentium_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNUS
switch (last_prefix) { switch (last_prefix) {
case 0x0f: case 0x0f:
timings = mod3 ? opcode_timings_0f_mod3 : opcode_timings_0f; timings = mod3 ? opcode_timings_p6_0f_mod3 : opcode_timings_p6_0f;
deps = mod3 ? opcode_deps_0f_mod3 : opcode_deps_0f; deps = mod3 ? opcode_deps_0f_mod3 : opcode_deps_0f;
break; break;
case 0xd8: case 0xd8:
timings = mod3 ? opcode_timings_d8_mod3 : opcode_timings_d8; timings = mod3 ? opcode_timings_p6_d8_mod3 : opcode_timings_p6_d8;
deps = mod3 ? opcode_deps_d8_mod3 : opcode_deps_d8; deps = mod3 ? opcode_deps_d8_mod3 : opcode_deps_d8;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xd9: case 0xd9:
timings = mod3 ? opcode_timings_d9_mod3 : opcode_timings_d9; timings = mod3 ? opcode_timings_p6_d9_mod3 : opcode_timings_p6_d9;
deps = mod3 ? opcode_deps_d9_mod3 : opcode_deps_d9; deps = mod3 ? opcode_deps_d9_mod3 : opcode_deps_d9;
opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7; opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7;
break; break;
case 0xda: case 0xda:
timings = mod3 ? opcode_timings_da_mod3 : opcode_timings_da; timings = mod3 ? opcode_timings_p6_da_mod3 : opcode_timings_p6_da;
deps = mod3 ? opcode_deps_da_mod3 : opcode_deps_da; deps = mod3 ? opcode_deps_da_mod3 : opcode_deps_da;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdb: case 0xdb:
timings = mod3 ? opcode_timings_db_mod3 : opcode_timings_db; timings = mod3 ? opcode_timings_p6_db_mod3 : opcode_timings_p6_db;
deps = mod3 ? opcode_deps_db_mod3 : opcode_deps_db; deps = mod3 ? opcode_deps_db_mod3 : opcode_deps_db;
opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7; opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7;
break; break;
case 0xdc: case 0xdc:
timings = mod3 ? opcode_timings_dc_mod3 : opcode_timings_dc; timings = mod3 ? opcode_timings_p6_dc_mod3 : opcode_timings_p6_dc;
deps = mod3 ? opcode_deps_dc_mod3 : opcode_deps_dc; deps = mod3 ? opcode_deps_dc_mod3 : opcode_deps_dc;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdd: case 0xdd:
timings = mod3 ? opcode_timings_dd_mod3 : opcode_timings_dd; timings = mod3 ? opcode_timings_p6_dd_mod3 : opcode_timings_p6_dd;
deps = mod3 ? opcode_deps_dd_mod3 : opcode_deps_dd; deps = mod3 ? opcode_deps_dd_mod3 : opcode_deps_dd;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xde: case 0xde:
timings = mod3 ? opcode_timings_de_mod3 : opcode_timings_de; timings = mod3 ? opcode_timings_p6_de_mod3 : opcode_timings_p6_de;
deps = mod3 ? opcode_deps_de_mod3 : opcode_deps_de; deps = mod3 ? opcode_deps_de_mod3 : opcode_deps_de;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdf: case 0xdf:
timings = mod3 ? opcode_timings_df_mod3 : opcode_timings_df; timings = mod3 ? opcode_timings_p6_df_mod3 : opcode_timings_p6_df;
deps = mod3 ? opcode_deps_df_mod3 : opcode_deps_df; deps = mod3 ? opcode_deps_df_mod3 : opcode_deps_df;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
@@ -1147,12 +1147,12 @@ codegen_timing_pentium_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNUS
case 0x80: case 0x80:
case 0x82: case 0x82:
case 0x83: case 0x83:
timings = mod3 ? opcode_timings_8x_mod3 : opcode_timings_8x; timings = mod3 ? opcode_timings_p6_8x_mod3 : opcode_timings_p6_8x;
deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x; deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0x81: case 0x81:
timings = mod3 ? opcode_timings_81_mod3 : opcode_timings_81; timings = mod3 ? opcode_timings_p6_81_mod3 : opcode_timings_p6_81;
deps = mod3 ? opcode_deps_81_mod3 : opcode_deps_81; deps = mod3 ? opcode_deps_81_mod3 : opcode_deps_81;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
@@ -1161,36 +1161,36 @@ codegen_timing_pentium_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNUS
case 0xc1: case 0xc1:
case 0xd0: case 0xd0:
case 0xd1: case 0xd1:
timings = mod3 ? opcode_timings_shift_mod3 : opcode_timings_shift; timings = mod3 ? opcode_timings_p6_shift_mod3 : opcode_timings_p6_shift;
deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift; deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xd2: case 0xd2:
case 0xd3: case 0xd3:
timings = mod3 ? opcode_timings_shift_mod3 : opcode_timings_shift; timings = mod3 ? opcode_timings_p6_shift_mod3 : opcode_timings_p6_shift;
deps = mod3 ? opcode_deps_shift_cl_mod3 : opcode_deps_shift_cl; deps = mod3 ? opcode_deps_shift_cl_mod3 : opcode_deps_shift_cl;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xf6: case 0xf6:
timings = mod3 ? opcode_timings_f6_mod3 : opcode_timings_f6; timings = mod3 ? opcode_timings_p6_f6_mod3 : opcode_timings_p6_f6;
deps = mod3 ? opcode_deps_f6_mod3 : opcode_deps_f6; deps = mod3 ? opcode_deps_f6_mod3 : opcode_deps_f6;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xf7: case 0xf7:
timings = mod3 ? opcode_timings_f7_mod3 : opcode_timings_f7; timings = mod3 ? opcode_timings_p6_f7_mod3 : opcode_timings_p6_f7;
deps = mod3 ? opcode_deps_f7_mod3 : opcode_deps_f7; deps = mod3 ? opcode_deps_f7_mod3 : opcode_deps_f7;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xff: case 0xff:
timings = mod3 ? opcode_timings_ff_mod3 : opcode_timings_ff; timings = mod3 ? opcode_timings_p6_ff_mod3 : opcode_timings_p6_ff;
deps = mod3 ? opcode_deps_ff_mod3 : opcode_deps_ff; deps = mod3 ? opcode_deps_ff_mod3 : opcode_deps_ff;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
default: default:
timings = mod3 ? opcode_timings_mod3 : opcode_timings; timings = mod3 ? opcode_timings_p6_mod3 : opcode_timings_p6;
deps = mod3 ? opcode_deps_mod3 : opcode_deps; deps = mod3 ? opcode_deps_mod3 : opcode_deps;
break; break;
} }

View File

@@ -18,7 +18,7 @@
#define CYCLES(c) (int *) c #define CYCLES(c) (int *) c
#define CYCLES2(c16, c32) (int *) ((-1 & ~0xffff) | c16 | (c32 << 8)) #define CYCLES2(c16, c32) (int *) ((-1 & ~0xffff) | c16 | (c32 << 8))
static int *opcode_timings[256] = { static int *opcode_timings_winchip[256] = {
// clang-format off // clang-format off
/*00*/ &timing_mr, &timing_mr, &timing_rm, &timing_rm, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), &timing_mr, &timing_mr, &timing_rm, &timing_rm, &timing_rr, &timing_rr, CYCLES(2), NULL, /*00*/ &timing_mr, &timing_mr, &timing_rm, &timing_rm, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), &timing_mr, &timing_mr, &timing_rm, &timing_rm, &timing_rr, &timing_rr, CYCLES(2), NULL,
/*10*/ &timing_mr, &timing_mr, &timing_rm, &timing_rm, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), &timing_mr, &timing_mr, &timing_rm, &timing_rm, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), /*10*/ &timing_mr, &timing_mr, &timing_rm, &timing_rm, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), &timing_mr, &timing_mr, &timing_rm, &timing_rm, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3),
@@ -42,7 +42,7 @@ static int *opcode_timings[256] = {
// clang-format on // clang-format on
}; };
static int *opcode_timings_mod3[256] = { static int *opcode_timings_winchip_mod3[256] = {
// clang-format off // clang-format off
/*00*/ &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, CYCLES(2), NULL, /*00*/ &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, CYCLES(2), NULL,
/*10*/ &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), /*10*/ &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3), &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, &timing_rr, CYCLES(2), CYCLES(3),
@@ -66,7 +66,7 @@ static int *opcode_timings_mod3[256] = {
// clang-format on // clang-format on
}; };
static int *opcode_timings_0f[256] = { static int *opcode_timings_winchip_0f[256] = {
// clang-format off // clang-format off
/*00*/ CYCLES(20), CYCLES(11), CYCLES(11), CYCLES(10), NULL, CYCLES(195), CYCLES(7), NULL, CYCLES(1000), CYCLES(10000), NULL, NULL, NULL, NULL, NULL, NULL, /*00*/ CYCLES(20), CYCLES(11), CYCLES(11), CYCLES(10), NULL, CYCLES(195), CYCLES(7), NULL, CYCLES(1000), CYCLES(10000), NULL, NULL, NULL, NULL, NULL, NULL,
/*10*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /*10*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -89,7 +89,7 @@ static int *opcode_timings_0f[256] = {
/*f0*/ NULL, &timing_rm, &timing_rm, &timing_rm, NULL, &timing_rm, NULL, NULL, &timing_rm, &timing_rm, &timing_rm, NULL, &timing_rm, &timing_rm, &timing_rm, NULL, /*f0*/ NULL, &timing_rm, &timing_rm, &timing_rm, NULL, &timing_rm, NULL, NULL, &timing_rm, &timing_rm, &timing_rm, NULL, &timing_rm, &timing_rm, &timing_rm, NULL,
// clang-format on // clang-format on
}; };
static int *opcode_timings_0f_mod3[256] = { static int *opcode_timings_winchip_0f_mod3[256] = {
// clang-format off // clang-format off
/*00*/ CYCLES(20), CYCLES(11), CYCLES(11), CYCLES(10), NULL, CYCLES(195), CYCLES(7), NULL, CYCLES(1000), CYCLES(10000), NULL, NULL, NULL, NULL, NULL, NULL, /*00*/ CYCLES(20), CYCLES(11), CYCLES(11), CYCLES(10), NULL, CYCLES(195), CYCLES(7), NULL, CYCLES(1000), CYCLES(10000), NULL, NULL, NULL, NULL, NULL, NULL,
/*10*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /*10*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -113,68 +113,68 @@ static int *opcode_timings_0f_mod3[256] = {
// clang-format on // clang-format on
}; };
static int *opcode_timings_shift[8] = { static int *opcode_timings_winchip_shift[8] = {
// clang-format off // clang-format off
CYCLES(7), CYCLES(7), CYCLES(10), CYCLES(10), CYCLES(7), CYCLES(7), CYCLES(7), CYCLES(7) CYCLES(7), CYCLES(7), CYCLES(10), CYCLES(10), CYCLES(7), CYCLES(7), CYCLES(7), CYCLES(7)
// clang-format on // clang-format on
}; };
static int *opcode_timings_shift_mod3[8] = { static int *opcode_timings_winchip_shift_mod3[8] = {
// clang-format off // clang-format off
CYCLES(3), CYCLES(3), CYCLES(9), CYCLES(9), CYCLES(3), CYCLES(3), CYCLES(3), CYCLES(3) CYCLES(3), CYCLES(3), CYCLES(9), CYCLES(9), CYCLES(3), CYCLES(3), CYCLES(3), CYCLES(3)
// clang-format on // clang-format on
}; };
static int *opcode_timings_f6[8] = { static int *opcode_timings_winchip_f6[8] = {
// clang-format off // clang-format off
&timing_rm, NULL, &timing_mm, &timing_mm, CYCLES(13), CYCLES(14), CYCLES(16), CYCLES(19) &timing_rm, NULL, &timing_mm, &timing_mm, CYCLES(13), CYCLES(14), CYCLES(16), CYCLES(19)
// clang-format on // clang-format on
}; };
static int *opcode_timings_f6_mod3[8] = { static int *opcode_timings_winchip_f6_mod3[8] = {
// clang-format off // clang-format off
&timing_rr, NULL, &timing_rr, &timing_rr, CYCLES(13), CYCLES(14), CYCLES(16), CYCLES(19) &timing_rr, NULL, &timing_rr, &timing_rr, CYCLES(13), CYCLES(14), CYCLES(16), CYCLES(19)
// clang-format on // clang-format on
}; };
static int *opcode_timings_f7[8] = { static int *opcode_timings_winchip_f7[8] = {
// clang-format off // clang-format off
&timing_rm, NULL, &timing_mm, &timing_mm, CYCLES(21), CYCLES2(22,38), CYCLES2(24,40), CYCLES2(27,43) &timing_rm, NULL, &timing_mm, &timing_mm, CYCLES(21), CYCLES2(22,38), CYCLES2(24,40), CYCLES2(27,43)
// clang-format on // clang-format on
}; };
static int *opcode_timings_f7_mod3[8] = { static int *opcode_timings_winchip_f7_mod3[8] = {
// clang-format off // clang-format off
&timing_rr, NULL, &timing_rr, &timing_rr, CYCLES(21), CYCLES2(22,38), CYCLES2(24,40), CYCLES2(27,43) &timing_rr, NULL, &timing_rr, &timing_rr, CYCLES(21), CYCLES2(22,38), CYCLES2(24,40), CYCLES2(27,43)
// clang-format on // clang-format on
}; };
static int *opcode_timings_ff[8] = { static int *opcode_timings_winchip_ff[8] = {
// clang-format off // clang-format off
&timing_mm, &timing_mm, CYCLES(5), CYCLES(0), CYCLES(5), CYCLES(0), CYCLES(5), NULL &timing_mm, &timing_mm, CYCLES(5), CYCLES(0), CYCLES(5), CYCLES(0), CYCLES(5), NULL
// clang-format on // clang-format on
}; };
static int *opcode_timings_ff_mod3[8] = { static int *opcode_timings_winchip_ff_mod3[8] = {
// clang-format off // clang-format off
&timing_rr, &timing_rr, CYCLES(5), CYCLES(0), CYCLES(5), CYCLES(0), CYCLES(5), NULL &timing_rr, &timing_rr, CYCLES(5), CYCLES(0), CYCLES(5), CYCLES(0), CYCLES(5), NULL
// clang-format on // clang-format on
}; };
static int *opcode_timings_d8[8] = { static int *opcode_timings_winchip_d8[8] = {
// clang-format off // clang-format off
/* FADDil FMULil FCOMil FCOMPil FSUBil FSUBRil FDIVil FDIVRil*/ /* FADDil FMULil FCOMil FCOMPil FSUBil FSUBRil FDIVil FDIVRil*/
CYCLES(10), CYCLES(12), CYCLES(9), CYCLES(9), CYCLES(10), CYCLES(10), CYCLES(78), CYCLES(78) CYCLES(10), CYCLES(12), CYCLES(9), CYCLES(9), CYCLES(10), CYCLES(10), CYCLES(78), CYCLES(78)
// clang-format on // clang-format on
}; };
static int *opcode_timings_d8_mod3[8] = { static int *opcode_timings_winchip_d8_mod3[8] = {
// clang-format off // clang-format off
/* FADD FMUL FCOM FCOMP FSUB FSUBR FDIV FDIVR*/ /* FADD FMUL FCOM FCOMP FSUB FSUBR FDIV FDIVR*/
CYCLES(4), CYCLES(6), CYCLES(3), CYCLES(3), CYCLES(4), CYCLES(4), CYCLES(72), CYCLES(72) CYCLES(4), CYCLES(6), CYCLES(3), CYCLES(3), CYCLES(4), CYCLES(4), CYCLES(72), CYCLES(72)
// clang-format on // clang-format on
}; };
static int *opcode_timings_d9[8] = { static int *opcode_timings_winchip_d9[8] = {
// clang-format off // clang-format off
/* FLDs FSTs FSTPs FLDENV FLDCW FSTENV FSTCW*/ /* FLDs FSTs FSTPs FLDENV FLDCW FSTENV FSTCW*/
CYCLES(2), NULL, CYCLES(7), CYCLES(7), CYCLES(34), CYCLES(4), CYCLES(67), CYCLES(3) CYCLES(2), NULL, CYCLES(7), CYCLES(7), CYCLES(34), CYCLES(4), CYCLES(67), CYCLES(3)
// clang-format on // clang-format on
}; };
static int *opcode_timings_d9_mod3[64] = { static int *opcode_timings_winchip_d9_mod3[64] = {
// clang-format off // clang-format off
/*FLD*/ /*FLD*/
CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1),
@@ -195,25 +195,25 @@ static int *opcode_timings_d9_mod3[64] = {
// clang-format on // clang-format on
}; };
static int *opcode_timings_da[8] = { static int *opcode_timings_winchip_da[8] = {
// clang-format off // clang-format off
/* FADDil FMULil FCOMil FCOMPil FSUBil FSUBRil FDIVil FDIVRil*/ /* FADDil FMULil FCOMil FCOMPil FSUBil FSUBRil FDIVil FDIVRil*/
CYCLES(10), CYCLES(12), CYCLES(9), CYCLES(9), CYCLES(10), CYCLES(10), CYCLES(78), CYCLES(78) CYCLES(10), CYCLES(12), CYCLES(9), CYCLES(9), CYCLES(10), CYCLES(10), CYCLES(78), CYCLES(78)
// clang-format on // clang-format on
}; };
static int *opcode_timings_da_mod3[8] = { static int *opcode_timings_winchip_da_mod3[8] = {
// clang-format off // clang-format off
NULL, NULL, NULL, NULL, NULL, CYCLES(5), NULL, NULL NULL, NULL, NULL, NULL, NULL, CYCLES(5), NULL, NULL
// clang-format on // clang-format on
}; };
static int *opcode_timings_db[8] = { static int *opcode_timings_winchip_db[8] = {
// clang-format off // clang-format off
/* FLDil FSTil FSTPil FLDe FSTPe*/ /* FLDil FSTil FSTPil FLDe FSTPe*/
CYCLES(6), NULL, CYCLES(7), CYCLES(7), NULL, CYCLES(8), NULL, CYCLES(8) CYCLES(6), NULL, CYCLES(7), CYCLES(7), NULL, CYCLES(8), NULL, CYCLES(8)
// clang-format on // clang-format on
}; };
static int *opcode_timings_db_mod3[64] = { static int *opcode_timings_winchip_db_mod3[64] = {
// clang-format off // clang-format off
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -227,71 +227,71 @@ static int *opcode_timings_db_mod3[64] = {
// clang-format on // clang-format on
}; };
static int *opcode_timings_dc[8] = { static int *opcode_timings_winchip_dc[8] = {
// clang-format off // clang-format off
/* opFADDd_a16 opFMULd_a16 opFCOMd_a16 opFCOMPd_a16 opFSUBd_a16 opFSUBRd_a16 opFDIVd_a16 opFDIVRd_a16*/ /* opFADDd_a16 opFMULd_a16 opFCOMd_a16 opFCOMPd_a16 opFSUBd_a16 opFSUBRd_a16 opFDIVd_a16 opFDIVRd_a16*/
CYCLES(6), CYCLES(8), CYCLES(5), CYCLES(5), CYCLES(6), CYCLES(6), CYCLES(74), CYCLES(74) CYCLES(6), CYCLES(8), CYCLES(5), CYCLES(5), CYCLES(6), CYCLES(6), CYCLES(74), CYCLES(74)
// clang-format on // clang-format on
}; };
static int *opcode_timings_dc_mod3[8] = { static int *opcode_timings_winchip_dc_mod3[8] = {
// clang-format off // clang-format off
/* opFADDr opFMULr opFSUBRr opFSUBr opFDIVRr opFDIVr*/ /* opFADDr opFMULr opFSUBRr opFSUBr opFDIVRr opFDIVr*/
CYCLES(4), CYCLES(6), NULL, NULL, CYCLES(4), CYCLES(4), CYCLES(72), CYCLES(72) CYCLES(4), CYCLES(6), NULL, NULL, CYCLES(4), CYCLES(4), CYCLES(72), CYCLES(72)
// clang-format on // clang-format on
}; };
static int *opcode_timings_dd[8] = { static int *opcode_timings_winchip_dd[8] = {
// clang-format off // clang-format off
/* FLDd FSTd FSTPd FRSTOR FSAVE FSTSW*/ /* FLDd FSTd FSTPd FRSTOR FSAVE FSTSW*/
CYCLES(2), NULL, CYCLES(8), CYCLES(8), CYCLES(131), NULL, CYCLES(154), CYCLES(5) CYCLES(2), NULL, CYCLES(8), CYCLES(8), CYCLES(131), NULL, CYCLES(154), CYCLES(5)
// clang-format on // clang-format on
}; };
static int *opcode_timings_dd_mod3[8] = { static int *opcode_timings_winchip_dd_mod3[8] = {
// clang-format off // clang-format off
/* FFFREE FST FSTP FUCOM FUCOMP*/ /* FFFREE FST FSTP FUCOM FUCOMP*/
CYCLES(3), NULL, CYCLES(1), CYCLES(1), CYCLES(3), CYCLES(3), NULL, NULL CYCLES(3), NULL, CYCLES(1), CYCLES(1), CYCLES(3), CYCLES(3), NULL, NULL
// clang-format on // clang-format on
}; };
static int *opcode_timings_de[8] = { static int *opcode_timings_winchip_de[8] = {
// clang-format off // clang-format off
/* FADDiw FMULiw FCOMiw FCOMPiw FSUBil FSUBRil FDIVil FDIVRil*/ /* FADDiw FMULiw FCOMiw FCOMPiw FSUBil FSUBRil FDIVil FDIVRil*/
CYCLES(10), CYCLES(12), CYCLES(9), CYCLES(9), CYCLES(10), CYCLES(10), CYCLES(78), CYCLES(78) CYCLES(10), CYCLES(12), CYCLES(9), CYCLES(9), CYCLES(10), CYCLES(10), CYCLES(78), CYCLES(78)
// clang-format on // clang-format on
}; };
static int *opcode_timings_de_mod3[8] = { static int *opcode_timings_winchip_de_mod3[8] = {
// clang-format off // clang-format off
/* FADD FMUL FCOMPP FSUB FSUBR FDIV FDIVR*/ /* FADD FMUL FCOMPP FSUB FSUBR FDIV FDIVR*/
CYCLES(4), CYCLES(6), NULL, CYCLES(3), CYCLES(4), CYCLES(4), CYCLES(72), CYCLES(72) CYCLES(4), CYCLES(6), NULL, CYCLES(3), CYCLES(4), CYCLES(4), CYCLES(72), CYCLES(72)
// clang-format on // clang-format on
}; };
static int *opcode_timings_df[8] = { static int *opcode_timings_winchip_df[8] = {
// clang-format off // clang-format off
/* FILDiw FISTiw FISTPiw FILDiq FBSTP FISTPiq*/ /* FILDiw FISTiw FISTPiw FILDiq FBSTP FISTPiq*/
CYCLES(6), NULL, CYCLES(7), CYCLES(7), NULL, CYCLES(8), CYCLES(172), CYCLES(8) CYCLES(6), NULL, CYCLES(7), CYCLES(7), NULL, CYCLES(8), CYCLES(172), CYCLES(8)
// clang-format on // clang-format on
}; };
static int *opcode_timings_df_mod3[8] = { static int *opcode_timings_winchip_df_mod3[8] = {
// clang-format off // clang-format off
/* FFREE FST FSTP FUCOM FUCOMP*/ /* FFREE FST FSTP FUCOM FUCOMP*/
CYCLES(3), NULL, CYCLES(1), CYCLES(1), CYCLES(3), CYCLES(3), NULL, NULL CYCLES(3), NULL, CYCLES(1), CYCLES(1), CYCLES(3), CYCLES(3), NULL, NULL
// clang-format on // clang-format on
}; };
static int *opcode_timings_8x[8] = { static int *opcode_timings_winchip_8x[8] = {
// clang-format off // clang-format off
&timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_rm &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_rm
}; };
static int *opcode_timings_8x_mod3[8] = static int *opcode_timings_winchip_8x_mod3[8] =
{ {
&timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_rm &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_rm
}; };
static int *opcode_timings_81[8] = static int *opcode_timings_winchip_81[8] =
{ {
&timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_rm &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_rm
}; };
static int *opcode_timings_81_mod3[8] = static int *opcode_timings_winchip_81_mod3[8] =
{ {
&timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_rm &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_mr, &timing_rm
// clang-format on // clang-format on
@@ -330,7 +330,7 @@ codegen_timing_winchip_start(void)
void void
codegen_timing_winchip_prefix(uint8_t prefix, uint32_t fetchdat) codegen_timing_winchip_prefix(uint8_t prefix, uint32_t fetchdat)
{ {
timing_count += COUNT(opcode_timings[prefix], 0); timing_count += COUNT(opcode_timings_winchip[prefix], 0);
last_prefix = prefix; last_prefix = prefix;
} }
@@ -344,47 +344,47 @@ codegen_timing_winchip_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNUS
switch (last_prefix) { switch (last_prefix) {
case 0x0f: case 0x0f:
timings = mod3 ? opcode_timings_0f_mod3 : opcode_timings_0f; timings = mod3 ? opcode_timings_winchip_0f_mod3 : opcode_timings_winchip_0f;
deps = mod3 ? opcode_deps_0f_mod3 : opcode_deps_0f; deps = mod3 ? opcode_deps_0f_mod3 : opcode_deps_0f;
break; break;
case 0xd8: case 0xd8:
timings = mod3 ? opcode_timings_d8_mod3 : opcode_timings_d8; timings = mod3 ? opcode_timings_winchip_d8_mod3 : opcode_timings_winchip_d8;
deps = mod3 ? opcode_deps_d8_mod3 : opcode_deps_d8; deps = mod3 ? opcode_deps_d8_mod3 : opcode_deps_d8;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xd9: case 0xd9:
timings = mod3 ? opcode_timings_d9_mod3 : opcode_timings_d9; timings = mod3 ? opcode_timings_winchip_d9_mod3 : opcode_timings_winchip_d9;
deps = mod3 ? opcode_deps_d9_mod3 : opcode_deps_d9; deps = mod3 ? opcode_deps_d9_mod3 : opcode_deps_d9;
opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7; opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7;
break; break;
case 0xda: case 0xda:
timings = mod3 ? opcode_timings_da_mod3 : opcode_timings_da; timings = mod3 ? opcode_timings_winchip_da_mod3 : opcode_timings_winchip_da;
deps = mod3 ? opcode_deps_da_mod3 : opcode_deps_da; deps = mod3 ? opcode_deps_da_mod3 : opcode_deps_da;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdb: case 0xdb:
timings = mod3 ? opcode_timings_db_mod3 : opcode_timings_db; timings = mod3 ? opcode_timings_winchip_db_mod3 : opcode_timings_winchip_db;
deps = mod3 ? opcode_deps_db_mod3 : opcode_deps_db; deps = mod3 ? opcode_deps_db_mod3 : opcode_deps_db;
opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7; opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7;
break; break;
case 0xdc: case 0xdc:
timings = mod3 ? opcode_timings_dc_mod3 : opcode_timings_dc; timings = mod3 ? opcode_timings_winchip_dc_mod3 : opcode_timings_winchip_dc;
deps = mod3 ? opcode_deps_dc_mod3 : opcode_deps_dc; deps = mod3 ? opcode_deps_dc_mod3 : opcode_deps_dc;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdd: case 0xdd:
timings = mod3 ? opcode_timings_dd_mod3 : opcode_timings_dd; timings = mod3 ? opcode_timings_winchip_dd_mod3 : opcode_timings_winchip_dd;
deps = mod3 ? opcode_deps_dd_mod3 : opcode_deps_dd; deps = mod3 ? opcode_deps_dd_mod3 : opcode_deps_dd;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xde: case 0xde:
timings = mod3 ? opcode_timings_de_mod3 : opcode_timings_de; timings = mod3 ? opcode_timings_winchip_de_mod3 : opcode_timings_winchip_de;
deps = mod3 ? opcode_deps_de_mod3 : opcode_deps_de; deps = mod3 ? opcode_deps_de_mod3 : opcode_deps_de;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdf: case 0xdf:
timings = mod3 ? opcode_timings_df_mod3 : opcode_timings_df; timings = mod3 ? opcode_timings_winchip_df_mod3 : opcode_timings_winchip_df;
deps = mod3 ? opcode_deps_df_mod3 : opcode_deps_df; deps = mod3 ? opcode_deps_df_mod3 : opcode_deps_df;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
@@ -394,12 +394,12 @@ codegen_timing_winchip_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNUS
case 0x80: case 0x80:
case 0x82: case 0x82:
case 0x83: case 0x83:
timings = mod3 ? opcode_timings_8x_mod3 : opcode_timings_8x; timings = mod3 ? opcode_timings_winchip_8x_mod3 : opcode_timings_winchip_8x;
deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x; deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0x81: case 0x81:
timings = mod3 ? opcode_timings_81_mod3 : opcode_timings_81; timings = mod3 ? opcode_timings_winchip_81_mod3 : opcode_timings_winchip_81;
deps = mod3 ? opcode_deps_81_mod3 : opcode_deps_81; deps = mod3 ? opcode_deps_81_mod3 : opcode_deps_81;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
@@ -410,29 +410,29 @@ codegen_timing_winchip_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNUS
case 0xd1: case 0xd1:
case 0xd2: case 0xd2:
case 0xd3: case 0xd3:
timings = mod3 ? opcode_timings_shift_mod3 : opcode_timings_shift; timings = mod3 ? opcode_timings_winchip_shift_mod3 : opcode_timings_winchip_shift;
deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift; deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xf6: case 0xf6:
timings = mod3 ? opcode_timings_f6_mod3 : opcode_timings_f6; timings = mod3 ? opcode_timings_winchip_f6_mod3 : opcode_timings_winchip_f6;
deps = mod3 ? opcode_deps_f6_mod3 : opcode_deps_f6; deps = mod3 ? opcode_deps_f6_mod3 : opcode_deps_f6;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xf7: case 0xf7:
timings = mod3 ? opcode_timings_f7_mod3 : opcode_timings_f7; timings = mod3 ? opcode_timings_winchip_f7_mod3 : opcode_timings_winchip_f7;
deps = mod3 ? opcode_deps_f7_mod3 : opcode_deps_f7; deps = mod3 ? opcode_deps_f7_mod3 : opcode_deps_f7;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xff: case 0xff:
timings = mod3 ? opcode_timings_ff_mod3 : opcode_timings_ff; timings = mod3 ? opcode_timings_winchip_ff_mod3 : opcode_timings_winchip_ff;
deps = mod3 ? opcode_deps_ff_mod3 : opcode_deps_ff; deps = mod3 ? opcode_deps_ff_mod3 : opcode_deps_ff;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
default: default:
timings = mod3 ? opcode_timings_mod3 : opcode_timings; timings = mod3 ? opcode_timings_winchip_mod3 : opcode_timings_winchip;
deps = mod3 ? opcode_deps_mod3 : opcode_deps; deps = mod3 ? opcode_deps_mod3 : opcode_deps;
break; break;
} }

View File

@@ -63,7 +63,7 @@
#define INVALID 0 #define INVALID 0
static uint32_t opcode_timings[256] = { static uint32_t opcode_timings_winchip2[256] = {
// clang-format off // clang-format off
/*00*/ CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(1), CYCLES(1), CYCLES(2), CYCLES(3), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(1), CYCLES(1), CYCLES(2), INVALID, /*00*/ CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(1), CYCLES(1), CYCLES(2), CYCLES(3), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(1), CYCLES(1), CYCLES(2), INVALID,
/*10*/ CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(1), CYCLES(1), CYCLES(2), CYCLES(3), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(1), CYCLES(1), CYCLES(2), CYCLES(3), /*10*/ CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(1), CYCLES(1), CYCLES(2), CYCLES(3), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(1), CYCLES(1), CYCLES(2), CYCLES(3),
@@ -87,7 +87,7 @@ static uint32_t opcode_timings[256] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_mod3[256] = { static uint32_t opcode_timings_winchip2_mod3[256] = {
// clang-format off // clang-format off
/*00*/ CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(2), CYCLES(3), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(2), INVALID, /*00*/ CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(2), CYCLES(3), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(2), INVALID,
/*10*/ CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(2), CYCLES(3), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(2), CYCLES(3), /*10*/ CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(2), CYCLES(3), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(1), CYCLES(2), CYCLES(3),
@@ -111,7 +111,7 @@ static uint32_t opcode_timings_mod3[256] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_0f[256] = { static uint32_t opcode_timings_winchip2_0f[256] = {
// clang-format off // clang-format off
/*00*/ CYCLES(20), CYCLES(11), CYCLES(11), CYCLES(10), INVALID, CYCLES(195), CYCLES(7), INVALID, CYCLES(1000), CYCLES(10000), INVALID, INVALID, INVALID, CYCLES_3DNOW(1), CYCLES(1), CYCLES_3DNOW(1), /*00*/ CYCLES(20), CYCLES(11), CYCLES(11), CYCLES(10), INVALID, CYCLES(195), CYCLES(7), INVALID, CYCLES(1000), CYCLES(10000), INVALID, INVALID, INVALID, CYCLES_3DNOW(1), CYCLES(1), CYCLES_3DNOW(1),
/*10*/ INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, /*10*/ INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
@@ -134,7 +134,7 @@ static uint32_t opcode_timings_0f[256] = {
/*f0*/ INVALID, CYCLES_MMX_SHIFT(2), CYCLES_MMX_SHIFT(2), CYCLES_MMX_SHIFT(2), INVALID, CYCLES_MMX_MUL(2), INVALID, INVALID, CYCLES_MMX_ANY(2), CYCLES_MMX_ANY(2), CYCLES_MMX_ANY(2), INVALID, CYCLES_MMX_ANY(2), CYCLES_MMX_ANY(2), CYCLES_MMX_ANY(2), INVALID, /*f0*/ INVALID, CYCLES_MMX_SHIFT(2), CYCLES_MMX_SHIFT(2), CYCLES_MMX_SHIFT(2), INVALID, CYCLES_MMX_MUL(2), INVALID, INVALID, CYCLES_MMX_ANY(2), CYCLES_MMX_ANY(2), CYCLES_MMX_ANY(2), INVALID, CYCLES_MMX_ANY(2), CYCLES_MMX_ANY(2), CYCLES_MMX_ANY(2), INVALID,
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_0f_mod3[256] = { static uint32_t opcode_timings_winchip2_0f_mod3[256] = {
// clang-format off // clang-format off
/*00*/ CYCLES(20), CYCLES(11), CYCLES(11), CYCLES(10), INVALID, CYCLES(195), CYCLES(7), INVALID, CYCLES(1000), CYCLES(10000), INVALID, INVALID, INVALID, CYCLES_3DNOW(1), CYCLES(1), CYCLES_3DNOW(1), /*00*/ CYCLES(20), CYCLES(11), CYCLES(11), CYCLES(10), INVALID, CYCLES(195), CYCLES(7), INVALID, CYCLES(1000), CYCLES(10000), INVALID, INVALID, INVALID, CYCLES_3DNOW(1), CYCLES(1), CYCLES_3DNOW(1),
/*10*/ INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, /*10*/ INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
@@ -158,49 +158,49 @@ static uint32_t opcode_timings_0f_mod3[256] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_shift[8] = { static uint32_t opcode_timings_winchip2_shift[8] = {
// clang-format off // clang-format off
CYCLES(7), CYCLES(7), CYCLES(10), CYCLES(10), CYCLES(7), CYCLES(7), CYCLES(7), CYCLES(7) CYCLES(7), CYCLES(7), CYCLES(10), CYCLES(10), CYCLES(7), CYCLES(7), CYCLES(7), CYCLES(7)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_shift_mod3[8] = { static uint32_t opcode_timings_winchip2_shift_mod3[8] = {
// clang-format off // clang-format off
CYCLES(3), CYCLES(3), CYCLES(9), CYCLES(9), CYCLES(3), CYCLES(3), CYCLES(3), CYCLES(3) CYCLES(3), CYCLES(3), CYCLES(9), CYCLES(9), CYCLES(3), CYCLES(3), CYCLES(3), CYCLES(3)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_f6[8] = { static uint32_t opcode_timings_winchip2_f6[8] = {
// clang-format off // clang-format off
CYCLES(2), INVALID, CYCLES(2), CYCLES(2), CYCLES(13), CYCLES(14), CYCLES(16), CYCLES(19) CYCLES(2), INVALID, CYCLES(2), CYCLES(2), CYCLES(13), CYCLES(14), CYCLES(16), CYCLES(19)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_f6_mod3[8] = { static uint32_t opcode_timings_winchip2_f6_mod3[8] = {
// clang-format off // clang-format off
CYCLES(1), INVALID, CYCLES(1), CYCLES(1), CYCLES(13), CYCLES(14), CYCLES(16), CYCLES(19) CYCLES(1), INVALID, CYCLES(1), CYCLES(1), CYCLES(13), CYCLES(14), CYCLES(16), CYCLES(19)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_f7[8] = { static uint32_t opcode_timings_winchip2_f7[8] = {
// clang-format off // clang-format off
CYCLES(2), INVALID, CYCLES(2), CYCLES(2), CYCLES(21), CYCLES2(22,38), CYCLES2(24,40), CYCLES2(27,43) CYCLES(2), INVALID, CYCLES(2), CYCLES(2), CYCLES(21), CYCLES2(22,38), CYCLES2(24,40), CYCLES2(27,43)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_f7_mod3[8] = { static uint32_t opcode_timings_winchip2_f7_mod3[8] = {
// clang-format off // clang-format off
CYCLES(1), INVALID, CYCLES(1), CYCLES(1), CYCLES(21), CYCLES2(22,38), CYCLES2(24,40), CYCLES2(27,43) CYCLES(1), INVALID, CYCLES(1), CYCLES(1), CYCLES(21), CYCLES2(22,38), CYCLES2(24,40), CYCLES2(27,43)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_ff[8] = { static uint32_t opcode_timings_winchip2_ff[8] = {
// clang-format off // clang-format off
CYCLES(2), CYCLES(2), CYCLES(5), CYCLES(0), CYCLES(5), CYCLES(0), CYCLES(5), INVALID CYCLES(2), CYCLES(2), CYCLES(5), CYCLES(0), CYCLES(5), CYCLES(0), CYCLES(5), INVALID
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_ff_mod3[8] = { static uint32_t opcode_timings_winchip2_ff_mod3[8] = {
// clang-format off // clang-format off
CYCLES(1), CYCLES(1), CYCLES(5), CYCLES(0), CYCLES(5), CYCLES(0), CYCLES(5), INVALID CYCLES(1), CYCLES(1), CYCLES(5), CYCLES(0), CYCLES(5), CYCLES(0), CYCLES(5), INVALID
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_d8[8] = { static uint32_t opcode_timings_winchip2_d8[8] = {
// clang-format off // clang-format off
/* FADDs FMULs FCOMs FCOMPs*/ /* FADDs FMULs FCOMs FCOMPs*/
FPU_CYCLES(3,2,2), FPU_CYCLES(3,2,2), FPU_CYCLES(1,0,0), FPU_CYCLES(1,0,0), FPU_CYCLES(3,2,2), FPU_CYCLES(3,2,2), FPU_CYCLES(1,0,0), FPU_CYCLES(1,0,0),
@@ -208,7 +208,7 @@ static uint32_t opcode_timings_d8[8] = {
FPU_CYCLES(3,2,2), FPU_CYCLES(3,2,2), FPU_CYCLES(39,38,2), FPU_CYCLES(39,38,2) FPU_CYCLES(3,2,2), FPU_CYCLES(3,2,2), FPU_CYCLES(39,38,2), FPU_CYCLES(39,38,2)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_d8_mod3[8] = { static uint32_t opcode_timings_winchip2_d8_mod3[8] = {
// clang-format off // clang-format off
/* FADD FMUL FCOM FCOMP*/ /* FADD FMUL FCOM FCOMP*/
FPU_CYCLES(3,2,2), FPU_CYCLES(3,2,2), FPU_CYCLES(1,0,0), FPU_CYCLES(1,0,0), FPU_CYCLES(3,2,2), FPU_CYCLES(3,2,2), FPU_CYCLES(1,0,0), FPU_CYCLES(1,0,0),
@@ -217,7 +217,7 @@ static uint32_t opcode_timings_d8_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_d9[8] = { static uint32_t opcode_timings_winchip2_d9[8] = {
// clang-format off // clang-format off
/* FLDs FSTs FSTPs*/ /* FLDs FSTs FSTPs*/
FPU_CYCLES(1,0,0), INVALID, FPU_CYCLES(2,0,0), FPU_CYCLES(2,0,0), FPU_CYCLES(1,0,0), INVALID, FPU_CYCLES(2,0,0), FPU_CYCLES(2,0,0),
@@ -225,7 +225,7 @@ static uint32_t opcode_timings_d9[8] = {
FPU_CYCLES(32,0,0), FPU_CYCLES(8,0,0), FPU_CYCLES(48,0,0), FPU_CYCLES(2,0,0) FPU_CYCLES(32,0,0), FPU_CYCLES(8,0,0), FPU_CYCLES(48,0,0), FPU_CYCLES(2,0,0)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_d9_mod3[64] = { static uint32_t opcode_timings_winchip2_d9_mod3[64] = {
// clang-format off // clang-format off
/*FLD*/ /*FLD*/
FPU_CYCLES(1,0,0), FPU_CYCLES(1,0,0), FPU_CYCLES(1,0,0), FPU_CYCLES(1,0,0), FPU_CYCLES(1,0,0), FPU_CYCLES(1,0,0), FPU_CYCLES(1,0,0), FPU_CYCLES(1,0,0),
@@ -258,7 +258,7 @@ static uint32_t opcode_timings_d9_mod3[64] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_da[8] = { static uint32_t opcode_timings_winchip2_da[8] = {
// clang-format off // clang-format off
/* FIADDl FIMULl FICOMl FICOMPl*/ /* FIADDl FIMULl FICOMl FICOMPl*/
FPU_CYCLES(6,2,2), FPU_CYCLES(6,2,2), FPU_CYCLES(4,0,0), FPU_CYCLES(4,0,0), FPU_CYCLES(6,2,2), FPU_CYCLES(6,2,2), FPU_CYCLES(4,0,0), FPU_CYCLES(4,0,0),
@@ -266,7 +266,7 @@ static uint32_t opcode_timings_da[8] = {
FPU_CYCLES(6,2,2), FPU_CYCLES(6,2,2), FPU_CYCLES(42,38,2), FPU_CYCLES(42,38,2) FPU_CYCLES(6,2,2), FPU_CYCLES(6,2,2), FPU_CYCLES(42,38,2), FPU_CYCLES(42,38,2)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_da_mod3[8] = { static uint32_t opcode_timings_winchip2_da_mod3[8] = {
// clang-format off // clang-format off
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
/* FCOMPP*/ /* FCOMPP*/
@@ -274,7 +274,7 @@ static uint32_t opcode_timings_da_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_db[8] = { static uint32_t opcode_timings_winchip2_db[8] = {
// clang-format off // clang-format off
/* FLDil FSTil FSTPil*/ /* FLDil FSTil FSTPil*/
FPU_CYCLES(3,2,2), INVALID, FPU_CYCLES(6,0,0), FPU_CYCLES(6,0,0), FPU_CYCLES(3,2,2), INVALID, FPU_CYCLES(6,0,0), FPU_CYCLES(6,0,0),
@@ -282,7 +282,7 @@ static uint32_t opcode_timings_db[8] = {
INVALID, FPU_CYCLES(3,0,0), INVALID, FPU_CYCLES(3,0,0) INVALID, FPU_CYCLES(3,0,0), INVALID, FPU_CYCLES(3,0,0)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_db_mod3[64] = { static uint32_t opcode_timings_winchip2_db_mod3[64] = {
// clang-format off // clang-format off
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
@@ -312,7 +312,7 @@ static uint32_t opcode_timings_db_mod3[64] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_dc[8] = { static uint32_t opcode_timings_winchip2_dc[8] = {
// clang-format off // clang-format off
/* FADDd FMULd FCOMd FCOMPd*/ /* FADDd FMULd FCOMd FCOMPd*/
FPU_CYCLES(3,2,2), FPU_CYCLES(3,2,2), FPU_CYCLES(1,0,0), FPU_CYCLES(1,0,0), FPU_CYCLES(3,2,2), FPU_CYCLES(3,2,2), FPU_CYCLES(1,0,0), FPU_CYCLES(1,0,0),
@@ -320,7 +320,7 @@ static uint32_t opcode_timings_dc[8] = {
FPU_CYCLES(3,2,2), FPU_CYCLES(3,2,2), FPU_CYCLES(39,38,2), FPU_CYCLES(39,38,2) FPU_CYCLES(3,2,2), FPU_CYCLES(3,2,2), FPU_CYCLES(39,38,2), FPU_CYCLES(39,38,2)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_dc_mod3[8] = { static uint32_t opcode_timings_winchip2_dc_mod3[8] = {
// clang-format off // clang-format off
/* opFADDr opFMULr*/ /* opFADDr opFMULr*/
FPU_CYCLES(3,2,2), FPU_CYCLES(3,2,2),INVALID, INVALID, FPU_CYCLES(3,2,2), FPU_CYCLES(3,2,2),INVALID, INVALID,
@@ -329,7 +329,7 @@ static uint32_t opcode_timings_dc_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_dd[8] = { static uint32_t opcode_timings_winchip2_dd[8] = {
// clang-format off // clang-format off
/* FLDd FSTd FSTPd*/ /* FLDd FSTd FSTPd*/
FPU_CYCLES(1,0,0), INVALID, FPU_CYCLES(2,0,0), FPU_CYCLES(2,0,0), FPU_CYCLES(1,0,0), INVALID, FPU_CYCLES(2,0,0), FPU_CYCLES(2,0,0),
@@ -337,7 +337,7 @@ static uint32_t opcode_timings_dd[8] = {
FPU_CYCLES(70,0,0), INVALID, FPU_CYCLES(127,0,0), FPU_CYCLES(6,0,0) FPU_CYCLES(70,0,0), INVALID, FPU_CYCLES(127,0,0), FPU_CYCLES(6,0,0)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_dd_mod3[8] = { static uint32_t opcode_timings_winchip2_dd_mod3[8] = {
// clang-format off // clang-format off
/* FFFREE FST FSTP*/ /* FFFREE FST FSTP*/
FPU_CYCLES(2,0,0), INVALID, FPU_CYCLES(1,0,0), FPU_CYCLES(1,0,0), FPU_CYCLES(2,0,0), INVALID, FPU_CYCLES(1,0,0), FPU_CYCLES(1,0,0),
@@ -346,7 +346,7 @@ static uint32_t opcode_timings_dd_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_de[8] = { static uint32_t opcode_timings_winchip2_de[8] = {
// clang-format off // clang-format off
/* FIADDw FIMULw FICOMw FICOMPw*/ /* FIADDw FIMULw FICOMw FICOMPw*/
FPU_CYCLES(6,2,2), FPU_CYCLES(6,2,2), FPU_CYCLES(4,0,0), FPU_CYCLES(4,0,0), FPU_CYCLES(6,2,2), FPU_CYCLES(6,2,2), FPU_CYCLES(4,0,0), FPU_CYCLES(4,0,0),
@@ -354,7 +354,7 @@ static uint32_t opcode_timings_de[8] = {
FPU_CYCLES(6,2,2), FPU_CYCLES(6,2,2), FPU_CYCLES(42,38,2), FPU_CYCLES(42,38,2) FPU_CYCLES(6,2,2), FPU_CYCLES(6,2,2), FPU_CYCLES(42,38,2), FPU_CYCLES(42,38,2)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_de_mod3[8] = { static uint32_t opcode_timings_winchip2_de_mod3[8] = {
// clang-format off // clang-format off
/* FADDP FMULP FCOMPP*/ /* FADDP FMULP FCOMPP*/
FPU_CYCLES(3,2,2), FPU_CYCLES(3,2,2), INVALID, FPU_CYCLES(1,0,0), FPU_CYCLES(3,2,2), FPU_CYCLES(3,2,2), INVALID, FPU_CYCLES(1,0,0),
@@ -363,7 +363,7 @@ static uint32_t opcode_timings_de_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_df[8] = { static uint32_t opcode_timings_winchip2_df[8] = {
// clang-format off // clang-format off
/* FILDiw FISTiw FISTPiw*/ /* FILDiw FISTiw FISTPiw*/
FPU_CYCLES(3,2,2), INVALID, FPU_CYCLES(6,0,0), FPU_CYCLES(6,0,0), FPU_CYCLES(3,2,2), INVALID, FPU_CYCLES(6,0,0), FPU_CYCLES(6,0,0),
@@ -371,7 +371,7 @@ static uint32_t opcode_timings_df[8] = {
INVALID, FPU_CYCLES(3,2,2), FPU_CYCLES(148,0,0), FPU_CYCLES(6,0,0) INVALID, FPU_CYCLES(3,2,2), FPU_CYCLES(148,0,0), FPU_CYCLES(6,0,0)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_df_mod3[8] = { static uint32_t opcode_timings_winchip2_df_mod3[8] = {
// clang-format off // clang-format off
INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID, INVALID,
/* FSTSW AX*/ /* FSTSW AX*/
@@ -379,22 +379,22 @@ static uint32_t opcode_timings_df_mod3[8] = {
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_8x[8] = { static uint32_t opcode_timings_winchip2_8x[8] = {
// clang-format off // clang-format off
CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2) CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_8x_mod3[8] = { static uint32_t opcode_timings_winchip2_8x_mod3[8] = {
// clang-format off // clang-format off
CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2) CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_81[8] = { static uint32_t opcode_timings_winchip2_81[8] = {
// clang-format off // clang-format off
CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2) CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2)
// clang-format on // clang-format on
}; };
static uint32_t opcode_timings_81_mod3[8] = { static uint32_t opcode_timings_winchip2_81_mod3[8] = {
// clang-format off // clang-format off
CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2) CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2), CYCLES(2)
// clang-format on // clang-format on
@@ -613,47 +613,47 @@ codegen_timing_winchip2_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNU
switch (last_prefix) { switch (last_prefix) {
case 0x0f: case 0x0f:
timings = mod3 ? opcode_timings_0f_mod3 : opcode_timings_0f; timings = mod3 ? opcode_timings_winchip2_0f_mod3 : opcode_timings_winchip2_0f;
deps = mod3 ? opcode_deps_0f_mod3 : opcode_deps_0f; deps = mod3 ? opcode_deps_0f_mod3 : opcode_deps_0f;
break; break;
case 0xd8: case 0xd8:
timings = mod3 ? opcode_timings_d8_mod3 : opcode_timings_d8; timings = mod3 ? opcode_timings_winchip2_d8_mod3 : opcode_timings_winchip2_d8;
deps = mod3 ? opcode_deps_d8_mod3 : opcode_deps_d8; deps = mod3 ? opcode_deps_d8_mod3 : opcode_deps_d8;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xd9: case 0xd9:
timings = mod3 ? opcode_timings_d9_mod3 : opcode_timings_d9; timings = mod3 ? opcode_timings_winchip2_d9_mod3 : opcode_timings_winchip2_d9;
deps = mod3 ? opcode_deps_d9_mod3 : opcode_deps_d9; deps = mod3 ? opcode_deps_d9_mod3 : opcode_deps_d9;
opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7; opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7;
break; break;
case 0xda: case 0xda:
timings = mod3 ? opcode_timings_da_mod3 : opcode_timings_da; timings = mod3 ? opcode_timings_winchip2_da_mod3 : opcode_timings_winchip2_da;
deps = mod3 ? opcode_deps_da_mod3 : opcode_deps_da; deps = mod3 ? opcode_deps_da_mod3 : opcode_deps_da;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdb: case 0xdb:
timings = mod3 ? opcode_timings_db_mod3 : opcode_timings_db; timings = mod3 ? opcode_timings_winchip2_db_mod3 : opcode_timings_winchip2_db;
deps = mod3 ? opcode_deps_db_mod3 : opcode_deps_db; deps = mod3 ? opcode_deps_db_mod3 : opcode_deps_db;
opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7; opcode = mod3 ? opcode & 0x3f : (opcode >> 3) & 7;
break; break;
case 0xdc: case 0xdc:
timings = mod3 ? opcode_timings_dc_mod3 : opcode_timings_dc; timings = mod3 ? opcode_timings_winchip2_dc_mod3 : opcode_timings_winchip2_dc;
deps = mod3 ? opcode_deps_dc_mod3 : opcode_deps_dc; deps = mod3 ? opcode_deps_dc_mod3 : opcode_deps_dc;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdd: case 0xdd:
timings = mod3 ? opcode_timings_dd_mod3 : opcode_timings_dd; timings = mod3 ? opcode_timings_winchip2_dd_mod3 : opcode_timings_winchip2_dd;
deps = mod3 ? opcode_deps_dd_mod3 : opcode_deps_dd; deps = mod3 ? opcode_deps_dd_mod3 : opcode_deps_dd;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xde: case 0xde:
timings = mod3 ? opcode_timings_de_mod3 : opcode_timings_de; timings = mod3 ? opcode_timings_winchip2_de_mod3 : opcode_timings_winchip2_de;
deps = mod3 ? opcode_deps_de_mod3 : opcode_deps_de; deps = mod3 ? opcode_deps_de_mod3 : opcode_deps_de;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
case 0xdf: case 0xdf:
timings = mod3 ? opcode_timings_df_mod3 : opcode_timings_df; timings = mod3 ? opcode_timings_winchip2_df_mod3 : opcode_timings_winchip2_df;
deps = mod3 ? opcode_deps_df_mod3 : opcode_deps_df; deps = mod3 ? opcode_deps_df_mod3 : opcode_deps_df;
opcode = (opcode >> 3) & 7; opcode = (opcode >> 3) & 7;
break; break;
@@ -663,12 +663,12 @@ codegen_timing_winchip2_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNU
case 0x80: case 0x80:
case 0x82: case 0x82:
case 0x83: case 0x83:
timings = mod3 ? opcode_timings_8x_mod3 : opcode_timings_8x; timings = mod3 ? opcode_timings_winchip2_8x_mod3 : opcode_timings_winchip2_8x;
deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x; deps = mod3 ? opcode_deps_8x_mod3 : opcode_deps_8x;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0x81: case 0x81:
timings = mod3 ? opcode_timings_81_mod3 : opcode_timings_81; timings = mod3 ? opcode_timings_winchip2_81_mod3 : opcode_timings_winchip2_81;
deps = mod3 ? opcode_deps_81_mod3 : opcode_deps_81; deps = mod3 ? opcode_deps_81_mod3 : opcode_deps_81;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
@@ -679,29 +679,29 @@ codegen_timing_winchip2_opcode(uint8_t opcode, uint32_t fetchdat, int op_32, UNU
case 0xd1: case 0xd1:
case 0xd2: case 0xd2:
case 0xd3: case 0xd3:
timings = mod3 ? opcode_timings_shift_mod3 : opcode_timings_shift; timings = mod3 ? opcode_timings_winchip2_shift_mod3 : opcode_timings_winchip2_shift;
deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift; deps = mod3 ? opcode_deps_shift_mod3 : opcode_deps_shift;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xf6: case 0xf6:
timings = mod3 ? opcode_timings_f6_mod3 : opcode_timings_f6; timings = mod3 ? opcode_timings_winchip2_f6_mod3 : opcode_timings_winchip2_f6;
deps = mod3 ? opcode_deps_f6_mod3 : opcode_deps_f6; deps = mod3 ? opcode_deps_f6_mod3 : opcode_deps_f6;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xf7: case 0xf7:
timings = mod3 ? opcode_timings_f7_mod3 : opcode_timings_f7; timings = mod3 ? opcode_timings_winchip2_f7_mod3 : opcode_timings_winchip2_f7;
deps = mod3 ? opcode_deps_f7_mod3 : opcode_deps_f7; deps = mod3 ? opcode_deps_f7_mod3 : opcode_deps_f7;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
case 0xff: case 0xff:
timings = mod3 ? opcode_timings_ff_mod3 : opcode_timings_ff; timings = mod3 ? opcode_timings_winchip2_ff_mod3 : opcode_timings_winchip2_ff;
deps = mod3 ? opcode_deps_ff_mod3 : opcode_deps_ff; deps = mod3 ? opcode_deps_ff_mod3 : opcode_deps_ff;
opcode = (fetchdat >> 3) & 7; opcode = (fetchdat >> 3) & 7;
break; break;
default: default:
timings = mod3 ? opcode_timings_mod3 : opcode_timings; timings = mod3 ? opcode_timings_winchip2_mod3 : opcode_timings_winchip2;
deps = mod3 ? opcode_deps_mod3 : opcode_deps; deps = mod3 ? opcode_deps_mod3 : opcode_deps;
break; break;
} }