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

Merged
Ammmae0x merged 1 commit from upstream-pr/770 into main 2026-11-23 02:28:45 +00:00
Ammmae0x commented 2026-11-23 01:59:36 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Ammmae0x on 2026-11-23T01:59:36Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6550716689 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/770). Originally posted by [Ammmae0x](https://github.com/Ammmae0x) on 2026-11-23T01:59:36Z. --- ## 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.
upstream-sync closed this pull request 2026-11-24 06:44:42 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!764
No description provided.