]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
cputester update
authorToni Wilen <twilen@winuae.net>
Fri, 29 May 2026 16:00:38 +0000 (19:00 +0300)
committerToni Wilen <twilen@winuae.net>
Fri, 29 May 2026 16:00:38 +0000 (19:00 +0300)
cputest.cpp
cputest/cputestgen.ini
od-win32/cputester/cputester.vcxproj

index 251e326eb93412e981c2d1238003dfaceb8f4b88..b3951f2801b73d81c1c0f48bf9da0401f2e79699 100644 (file)
@@ -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;
index aefb841228748607f07d33e1afc234881d6e14a1..970855572f4232925f092105c91796821ac28215 100644 (file)
@@ -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
index b63ac04843b76b95ff1b0f851b3cc5de9bfbd939..eac8a09fbed02df3b675522c0e144e2fe7db07af 100644 (file)
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Test|Win32'">
     <IncludePath>c:\dev\include;$(IncludePath)</IncludePath>
-    <LibraryPath>C:\dev\lib;$(LibraryPath)</LibraryPath>
+    <LibraryPath>C:\dev\lib\x86;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <IncludePath>c:\dev\include;$(IncludePath)</IncludePath>
-    <LibraryPath>C:\dev\lib;$(LibraryPath)</LibraryPath>
+    <LibraryPath>C:\dev\lib\x86;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Test|x64'">
-    <IncludePath>$(IncludePath)</IncludePath>
+    <IncludePath>c:\dev\include;$(IncludePath)</IncludePath>
+    <LibraryPath>C:\dev\lib\x64;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Test|ARM64'">
-    <IncludePath>$(IncludePath)</IncludePath>
+    <IncludePath>C:\dev\include;$(IncludePath)</IncludePath>
+    <LibraryPath>C:\dev\lib\arm64;$(VC_LibraryPath_ARM64);$(WindowsSDK_LibraryPath_ARM64)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <IncludePath>c:\dev\include;$(IncludePath)</IncludePath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
     <IncludePath>c:\dev\include;$(IncludePath)</IncludePath>
-    <LibraryPath>C:\dev\lib\x64;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath>
+    <LibraryPath>C:\dev\lib\arm64;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64)</LibraryPath>
     <TargetName>cputestgen64</TargetName>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
       <SubSystem>Console</SubSystem>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>zlibstat.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>zs.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Test|Win32'">
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
-      <AdditionalDependencies>zlibstat.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>zs.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Test|x64'">
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
+      <AdditionalDependencies>zs.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Test|ARM64'">
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>
+      <AdditionalDependencies>zs.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
       <SubSystem>Console</SubSystem>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>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</AdditionalDependencies>
+      <AdditionalDependencies>zs.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
       <SubSystem>Console</SubSystem>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>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</AdditionalDependencies>
+      <AdditionalDependencies>zs.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>