startup: lower binary32 class SDWA compares #1962
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1969"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by avt0m4t48 on 2026-11-24T22:17:29Z.
Refs #1906. Lower
v_cmp_class_f32_sdwaandv_cmpx_class_f32_sdwawhen the float value usesSRC0_SEL:DWORD. Read the class mask through SRC1's byte, word or dword selector with optional sign extension. Reuse the existing class helper and EXEC rules. The regular floating-point comparison predicates stay in their separate follow-ups.python3 -B tests/startup_gfx2hlsl_vopc_sdwa_check.pyreproduced the refusal on the old lowering and now passes 42 class forms across all ten classes and both lane states. LLVM 15 round-tripped 9,931 VOPC SDWA forms and both encoded pixel fixtures. The existing classifier still matches its independent reference on 68,626 source patterns. Documentation and bidi checks passed.ctest --preset release --no-tests=error -R '^startup_gfx2hlsl_vopc_sdwa_warp$' -Vpassed on the Windows Server 2025 runner with WARP (Microsoft Basic Render Driver 10.0.26100.33648, debug layer enabled). Default FXC and DXC builds both matched all 256 pixels. Dropping the mask select failed against the reference and matched the separate whole-dword image. Physical GPU and title results remain unverified. WARP verificationSource-built inputs only. AI-assisted using Codex.
Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-24T22:24:42Z.
Ran it, broke four things, and one survivor turned out to be a better diagnostic rather than a gap
Windows 11 build 26300.9974, device-free:
Mutations to
tools/startup/gfx2hlsl.py, each reverted:DWORDselectionfloat_src0ignored, so the float source goes through the integer mask pathif selection != 'DWORD' or sext:→if selection != 'DWORD':(sign extension accepted)I checked the fourth one before calling it a hole
It is not a hole. Driving the stage directly with the two-source form:
So the
sexthalf of the condition does not decide whether the instruction is refused —self.f()rejects thesext(...)tokenanyway — it only decides which message a reader gets. Nothing wrong is emitted either way, so the missing case is a diagnostic
nicety, not missing coverage:
If you would rather keep the suite at behaviour only, leaving it out is defensible — I am flagging it because I expected it to be a
gap and it was not.
What the class path gets right
self.f(), and SRC1's selected byte/word/dword becomes the mask — the split the ISAdescribes, and the two mutations that break either half both fail.
check_compare_sdwa_destinationseparatesv_cmpx(sources only) fromv_cmp(scalar destination first) and refuses adestination that is not
vcc/exec/an SGPR, which is the same rule the non-SDWA path already had.base.removesuffix('_sdwa')keeps one predicate table for both encodings instead of a parallel one, so the ten class bits cannotdrift between them.
What this does not establish
Nothing device-side from me: the WARP result (
Microsoft Basic Render Driver 10.0.26100.33648, 256 pixels,-Gis/defaultdifferences) is your run, and the physical-GPU and title parts stay unverified as the description says. The 68,626-pattern
classifier cross-check I did not rerun here — it lives in the other fixture.
Verdict
Reviewed. Three behaviours pinned, one guard is belt-and-braces, no acceptance hole found.
Notes