cpu: sync scalar float docs and tighten SETcc/CMOVcc controls #770

Manually merged
github merged 1 commit from gh-pr/770/head into gh-pr/770/base 2026-11-26 22:17:02 +00:00
Owner

@⁠Ammmae0x on GitHub · 2026-11-23 01:59 UTC · original
Ammmae0x:cpu/sse-aot-followup-controls → main · +10 −13 · 3 files · 1 commits · merged 2026-11-23 02:28 UTC

Change

Follow-up to PR #753 (Refs #743, Refs #753) to tighten the SETcc/CMOVcc scalar float test controls and sync the corresponding documentation in docs/experiments.md:

  • tests/cpu/scalar_float.asm:
    • Seed RAX with 123456789abcde5ah (non-zero AL) in setcc_mix so SETcc byte writes are verified to overwrite AL on both true and false outcomes while preserving bits 8..63.
    • Remove the post-cmovg shl rax, 32 / or rax, r9 sequence in cmovcc_mix so 32-bit zero-extension of bits 63..32 (0xfedcba98 -> 0 on taken, preserved on not-taken) is directly observable in the return value.
  • tests/cpu/scalar_float_check.py:
    • Update cmovcc_mix known_answers() for the direct 32-bit zero-extended return and pass a 64-bit value (0x12345678deadbeef) at [r8] to verify 32-bit load and upper-half zero-extension.
  • docs/experiments.md:
    • Sync the Scalar SSE and SSE2 leaf functions section with SETcc/CMOVcc/NEG flag rules, 14 exports, 13,690 differential calls, 43 fixed answers, and 20 patched-instruction rejection controls, and remove SETcc and CMOVcc after a compare from Not covered:.

Verification

Verified on Windows (commit 65d27a1 on main fdd7158) in both dev (Debug) and release (/O2) after loading .\tools\dev.ps1:

  • cmake --build --preset dev --target cpu_float_original cpu_float_original_lifted cpu_float_swapped cpu_float_swapped_lifted -> passed (0 errors, 0 warnings).
  • ctest --preset dev --no-tests=error -R "^cpu_aot_scalar_float$" -V -> 1/1 passed (43 fixed results, 13,690 differential calls across 14 exports, 20 patched-instruction rejections, 8 signature rejections).
  • cmake --build --preset release --target cpu_float_original cpu_float_original_lifted cpu_float_swapped cpu_float_swapped_lifted -> passed (0 errors, 0 warnings).
  • ctest --preset release --no-tests=error -R "^cpu_aot_scalar_float$" -V -> 1/1 passed (43 fixed results, 13,690 differential calls across 14 exports, 20 patched-instruction rejections, 8 signature rejections).
  • .\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py -> passed (13 Markdown files, 144 links, 0 failed; self-test passed).
  • .\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py -> passed (626 tracked files, 0 bidirectional controls; self-test passed).
  • .\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py -> passed.

Evidence and follow-up

All changes reuse the existing source-built tests/cpu/scalar_float.asm fixture (assembled by ML64 and lifted via tools/cpu_sse_aot.py). Existing negative controls (20 patched-instruction rejections and 8 wrong-signature rejections) remain intact and passing, and the strengthened setcc_mix/cmovcc_mix controls directly catch unpreserved high bits or missing 32-bit zero-extension.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

**@⁠Ammmae0x** on GitHub · 2026-11-23 01:59 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/770) `Ammmae0x:cpu/sse-aot-followup-controls` → `main` · +10 −13 · 3 files · 1 commits · merged 2026-11-23 02:28 UTC ## Change Follow-up to PR #753 (Refs #743, Refs #753) to tighten the `SETcc`/`CMOVcc` scalar float test controls and sync the corresponding documentation in `docs/experiments.md`: - `tests/cpu/scalar_float.asm`: - Seed `RAX` with `123456789abcde5ah` (non-zero `AL`) in `setcc_mix` so `SETcc` byte writes are verified to overwrite `AL` on both true and false outcomes while preserving bits `8..63`. - Remove the post-`cmovg` `shl rax, 32` / `or rax, r9` sequence in `cmovcc_mix` so 32-bit zero-extension of bits `63..32` (`0xfedcba98` -> `0` on taken, preserved on not-taken) is directly observable in the return value. - `tests/cpu/scalar_float_check.py`: - Update `cmovcc_mix` `known_answers()` for the direct 32-bit zero-extended return and pass a 64-bit value (`0x12345678deadbeef`) at `[r8]` to verify 32-bit load and upper-half zero-extension. - `docs/experiments.md`: - Sync the `Scalar SSE and SSE2 leaf functions` section with `SETcc`/`CMOVcc`/`NEG` flag rules, 14 exports, 13,690 differential calls, 43 fixed answers, and 20 patched-instruction rejection controls, and remove `SETcc and CMOVcc after a compare` from `Not covered:`. ## Verification Verified on Windows (commit `65d27a1` on `main` `fdd7158`) in both `dev` (`Debug`) and `release` (`/O2`) after loading `.\tools\dev.ps1`: - `cmake --build --preset dev --target cpu_float_original cpu_float_original_lifted cpu_float_swapped cpu_float_swapped_lifted` -> passed (`0` errors, `0` warnings). - `ctest --preset dev --no-tests=error -R "^cpu_aot_scalar_float$" -V` -> `1/1` passed (`43` fixed results, `13,690` differential calls across `14` exports, `20` patched-instruction rejections, `8` signature rejections). - `cmake --build --preset release --target cpu_float_original cpu_float_original_lifted cpu_float_swapped cpu_float_swapped_lifted` -> passed (`0` errors, `0` warnings). - `ctest --preset release --no-tests=error -R "^cpu_aot_scalar_float$" -V` -> `1/1` passed (`43` fixed results, `13,690` differential calls across `14` exports, `20` patched-instruction rejections, `8` signature rejections). - `.\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py` -> passed (`13` Markdown files, `144` links, `0` failed; self-test passed). - `.\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py` -> passed (`626` tracked files, `0` bidirectional controls; self-test passed). - `.\out\pe-env\Scripts\python.exe -B tests/form_coverage_check.py` -> passed. ## Evidence and follow-up All changes reuse the existing source-built `tests/cpu/scalar_float.asm` fixture (assembled by ML64 and lifted via `tools/cpu_sse_aot.py`). Existing negative controls (20 patched-instruction rejections and 8 wrong-signature rejections) remain intact and passing, and the strengthened `setcc_mix`/`cmovcc_mix` controls directly catch unpreserved high bits or missing 32-bit zero-extension. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:17:01 +00:00
github manually merged commit 65d27a10ca into gh-pr/770/base 2026-11-26 22:17:02 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.