From 36d8c169193ccde14e18a6d0290e7594640cd4a6 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Fri, 29 May 2026 19:00:38 +0300 Subject: [PATCH] cputester update --- cputest.cpp | 36 +++++++++++++++++++++++----- cputest/cputestgen.ini | 30 +++++++++++++---------- od-win32/cputester/cputester.vcxproj | 22 ++++++++++------- 3 files changed, 60 insertions(+), 28 deletions(-) diff --git a/cputest.cpp b/cputest.cpp index 251e326e..b3951f28 100644 --- a/cputest.cpp +++ b/cputest.cpp @@ -192,6 +192,7 @@ static uaecptr lm_safe_address1, lm_safe_address2; static uae_u8 ccr_cnt; static int condition_cnt; static int subtest_count; +static int test_count_missed; struct uae_prefs currprefs; @@ -2139,7 +2140,7 @@ static bool regchange(int reg, uae_u32 *regs) static void fill_memory_buffer(uae_u8 *p, int size) { - uae_u8 *pend = p - 64; + uae_u8 *pend = p + size - 64; int i = 0; while (p < pend) { int x = (i & 3); @@ -5072,6 +5073,7 @@ static void test_mnemo(const TCHAR *path, const TCHAR *mnemo, const TCHAR *ovrfi interrupt_delay_cnt = 0; interrupt_pc = 0; waitstate_delay_cnt = 0; + test_count_missed = 0; int sr_override = 0; @@ -6145,8 +6147,12 @@ static void test_mnemo(const TCHAR *path, const TCHAR *mnemo, const TCHAR *ovrfi regs.usp = regs.regs[15]; regs.isp = super_stack_memory - 0x80; - // copy user stack to super stack, for RTE etc support - memcpy(test_memory + (regs.isp - test_memory_start), test_memory + (regs.usp - test_memory_start), 0x20); + if (regs.usp >= test_memory_start && regs.usp < test_memory_start + test_memory_size) { + // copy user stack to super stack, for RTE etc support + memcpy(test_memory + (regs.isp - test_memory_start), test_memory + (regs.usp - test_memory_start), 0x20); + } else { + skipped = 1; + } regs.msp = super_stack_memory; // data size optimization, only store data @@ -6243,7 +6249,7 @@ static void test_mnemo(const TCHAR *path, const TCHAR *mnemo, const TCHAR *ovrfi } // skip exceptions if loop mode and not CC instruction - if (test_exception >= 2 && feature_loop_mode_jit && !isccinst(dp)) { + if (test_exception >= 2 && test_exception != 4 && feature_loop_mode_jit && !isccinst(dp)) { skipped = 1; } @@ -6460,7 +6466,9 @@ static void test_mnemo(const TCHAR *path, const TCHAR *mnemo, const TCHAR *ovrfi instructionendpc_old = instructionendpc_old_prev; startpc_old = startpc_old_prev; interrupt_count = interrupt_count_old_prev; + test_count_missed++; } else { + test_count_missed = 0; full_format_cnt++; data_saved = 1; // if test used data or fpu register as a source or destination: modify it @@ -6634,11 +6642,27 @@ static void test_mnemo(const TCHAR *path, const TCHAR *mnemo, const TCHAR *ovrfi } } + if (test_count_missed > 10000) { + break; + } + if (nextround >= 0) { + for (;;) { + int r = rand8() & 7; + if (regchange(r, cur_regs.regs)) { + break; + } + } + for (;;) { + int r = rand8() & 7; + if (regchange(r + 8, cur_regs.regs)) { + break; + } + } cur_regs.regs[0] &= 0xffff; - cur_regs.regs[8] &= 0xffff; + cur_regs.regs[8 + 0] &= 0xffff; cur_regs.regs[8 + 6]--; - cur_regs.regs[15] -= 2; + cur_regs.regs[8 + 7] -= 2; rnd_seed_prev = rnd_seed; rand8_cnt_prev = rand8_cnt; rand16_cnt_prev = rand16_cnt; diff --git a/cputest/cputestgen.ini b/cputest/cputestgen.ini index aefb8412..97085557 100644 --- a/cputest/cputestgen.ini +++ b/cputest/cputestgen.ini @@ -1,7 +1,7 @@ [cputest] ; CPU model (68000, 68020, 68030, 68040 or 68060). -cpu=68040 +cpu=68020 ; CPU address space. ; If 24-bit, tester will assume upper 8-bits of addresses gets ignored. @@ -50,31 +50,31 @@ max_file_size=0 ; Low address space limits. Real hardware must have RAM in this space. Comment out to disable. ; Start should be zero if Amiga, set to 0x0800 if Atari ST. ; Must be disabled if cycle counting (instruction/interrupt), cycle count tests must only access real Fast RAM. -;test_low_memory_start=0x0000 -;test_low_memory_end=0x8000 +test_low_memory_start=0x0000 +test_low_memory_end=0x8000 ; High address space limits (0x00ff8000 to 0x01000000 is complete space if 24-bit). Comment out to disable. ; Automatically disabled if 32-bit CPU and end == 0x01000000 ;test_high_memory_start=0x00ff8000 -test_high_memory_end=0x01000000 +;test_high_memory_end=0x01000000 ; ROM high address space. High memory is only used for read tests, uses last 32k of ROM image file. high_rom=D:\amiga\roms\Kickstart v3.1 rev 40.63 (1993)(Commodore)(A500-A600-A2000)[!].rom ; main test memory start and size (real hardware must have RAM in this address space) -test_memory_start=0x00460000 +test_memory_start=0x00500000 ;test_memory_start=0x68800000 ;test_memory_start=0x43800000 ;test_memory_start=0x07800000 -test_memory_size=0xa0000 +test_memory_size=0x200000 ; -;test_memory_start=0x340000 -;test_memory_size=0x80000 +;test_memory_start=0x42000000 +;test_memory_size=0x1000000 ; address where test instructions are located ; if not defined: mid point of test memory -opcode_memory_start=0x87ffa0 +;opcode_memory_start=0x87ffa0 ; number of test rounds ; registers are re-randomized after each round if not in target ea mode. @@ -258,7 +258,7 @@ mode=all ; interrupt timing test [test=IPL] cpu=68000-68010 -enabled=1 +enabled=0 verbose=0 feature_undefined_ccr=1 feature_interrupts=2 @@ -599,9 +599,10 @@ cpu=68020-68060 cpu_address_space=68020 feature_loop_mode=1 opcode_memory_start=-1 -mode=mvmel,mvmle,link,unlk +mode=all feature_flags_mode=1 test_rounds=3 +min_opcode_test_rounds=5000 verbose=0 ; basic tests @@ -609,8 +610,11 @@ verbose=0 enabled=0 cpu=68020-68060 cpu_address_space=68020 -feature_flags_mode=0 -verbose=1 +feature_loop_mode=1 +opcode_memory_start=-1 +test_rounds=4 +verbose=0 +min_opcode_test_rounds=5000 mode=all ; 68020+ addressing mode tests diff --git a/od-win32/cputester/cputester.vcxproj b/od-win32/cputester/cputester.vcxproj index b63ac048..eac8a09f 100644 --- a/od-win32/cputester/cputester.vcxproj +++ b/od-win32/cputester/cputester.vcxproj @@ -99,17 +99,19 @@ c:\dev\include;$(IncludePath) - C:\dev\lib;$(LibraryPath) + C:\dev\lib\x86;$(LibraryPath) c:\dev\include;$(IncludePath) - C:\dev\lib;$(LibraryPath) + C:\dev\lib\x86;$(LibraryPath) - $(IncludePath) + c:\dev\include;$(IncludePath) + C:\dev\lib\x64;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64) - $(IncludePath) + C:\dev\include;$(IncludePath) + C:\dev\lib\arm64;$(VC_LibraryPath_ARM64);$(WindowsSDK_LibraryPath_ARM64) c:\dev\include;$(IncludePath) @@ -118,7 +120,7 @@ c:\dev\include;$(IncludePath) - C:\dev\lib\x64;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64) + C:\dev\lib\arm64;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64) cputestgen64 @@ -141,7 +143,7 @@ Console true true - zlibstat.lib;%(AdditionalDependencies) + zs.lib;%(AdditionalDependencies) @@ -158,7 +160,7 @@ Console - zlibstat.lib;%(AdditionalDependencies) + zs.lib;%(AdditionalDependencies) @@ -175,6 +177,7 @@ Console + zs.lib;%(AdditionalDependencies) @@ -191,6 +194,7 @@ Console + zs.lib;%(AdditionalDependencies) @@ -211,7 +215,7 @@ Console true true - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies);zlibstat.lib + zs.lib;%(AdditionalDependencies) @@ -232,7 +236,7 @@ Console true true - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies);zlibstat.lib + zs.lib;%(AdditionalDependencies) -- 2.47.3