Skip to content

Fix CPU-dependent CPUID test mismatches - #788

Open
Ninja3047 wants to merge 1 commit into
masterfrom
codex/fix-cpuid-test-determinism
Open

Ninja3047 wants to merge 1 commit into
masterfrom
codex/fix-cpuid-test-determinism

Conversation

@Ninja3047

Copy link
Copy Markdown
Collaborator

Native and lifted CPUID calls can run on different CPUs and return different APIC IDs. Pin the Linux test runner to its current CPU and keep the dedicated fixture Linux-only, with leaf 1 coverage and full output comparisons.

Preserve all four CPUID-clobbered registers in POPCNT and CRC32 feature checks. The shared macros preserve the branch flags and use matching stack slots for native and lifted execution, including 32-bit fixtures.

Validation on x86-64 Linux with LLVM 19:

  • All 26 CPUID/POPCNT/CRC32 cases pass across x86, x86_avx, amd64, and amd64_avx, with verified low stack addresses for 32-bit tests.
  • 41,984 native value/flag checks and 30,000 pinned CPUID comparisons pass.
  • Both amd64 suites, differential, Thumb, and PPC pass. The only remaining failures are the baseline CALLrel_1 and RETnear_1 cases in both 32-bit runners.

Related to #466.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant