startup: support |x| abs modifier on v_cndmask_b32_e64 operands in gfx2hlsl #2441

Closed
stan495 wants to merge 2 commits from upstream-pr/2449 into main
stan495 commented 2026-11-25 17:03:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-25T17:03:44Z.


Summary

Support RDNA 2 VOP3 source bs (|x|) and combined
eg+bs (-|x| /
eg(|x|)) bit-level modifiers on _cndmask_b32_e64 register operands in Stage.u_src().

In RDNA 2 VOP3, ABS clears bit 31 before NEG flips bit 31 (|x| -> x & 0x7fffffffu, -|x| -> x | 0x80000000u). Previously u_src() only stripped - /
eg(...), causing instructions such as _cndmask_b32_e64 v10, v10, |v10|, s36 to fail with Unsupported: operand '|v10|'.

  • ** ools/startup/gfx2hlsl.py**:
    • Extend Stage.u_src() to strip |...| after split_neg() and emit (expr & 0x7fffffffu) for |x| and (expr | 0x80000000u) when combined with
      eg.
    • Other integer handlers continue using u() (refusing unexpected bs/
      eg), and check_encoding() continues refusing ABS on immediates and negated masks.
  • ** ests/startup_gfx2hlsl_cndmask_neg_check.py & ests/startup_gfx2hlsl_neg_operand_check.py**:
    • Update register-source bs0, bs1, and bs + neg encoding/decoding assertions to verify (v30 & 0x7fffffffu) and (v30 | 0x80000000u) emission, while preserving refusal checks for |v2| on _and_b32_e64, malformed |v30, ABS on immediates, and negated masks.

Verification

  • Commit: 2e44b89e (based on upstream/main 7092683a)
  • Commands & Results:
    • python -B tests/startup_gfx2hlsl_cndmask_neg_check.py -> PASS
    • python -B tests/startup_gfx2hlsl_neg_operand_check.py -> PASS
    • python -B tests/startup_image_load_d16_check.py -> PASS
    • python -B tests/startup_gfx2hlsl_handler_arity_check.py -> PASS
    • python -B tests/startup_gfx2hlsl_operand_count_check.py -> PASS
    • python -B tests/docs_links_check.py -> PASS (19 Markdown files, 464 links)
    • python -B tests/bidi_controls_check.py -> PASS (1723 tracked files)
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6609572234 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2449). Originally posted by [stan495](https://github.com/stan495) on 2026-11-25T17:03:44Z. --- ## Summary Support RDNA 2 VOP3 source bs (|x|) and combined eg+bs (-|x| / eg(|x|)) bit-level modifiers on _cndmask_b32_e64 register operands in Stage.u_src(). In RDNA 2 VOP3, ABS clears bit 31 before NEG flips bit 31 (|x| -> x & 0x7fffffffu, -|x| -> x | 0x80000000u). Previously u_src() only stripped - / eg(...), causing instructions such as _cndmask_b32_e64 v10, v10, |v10|, s36 to fail with Unsupported: operand '|v10|'. - ** ools/startup/gfx2hlsl.py**: - Extend Stage.u_src() to strip |...| after split_neg() and emit (expr & 0x7fffffffu) for |x| and (expr | 0x80000000u) when combined with eg. - Other integer handlers continue using u() (refusing unexpected bs/ eg), and check_encoding() continues refusing ABS on immediates and negated masks. - ** ests/startup_gfx2hlsl_cndmask_neg_check.py & ests/startup_gfx2hlsl_neg_operand_check.py**: - Update register-source bs0, bs1, and bs + neg encoding/decoding assertions to verify (v30 & 0x7fffffffu) and (v30 | 0x80000000u) emission, while preserving refusal checks for |v2| on _and_b32_e64, malformed |v30, ABS on immediates, and negated masks. ## Verification - **Commit**: `2e44b89e` (based on upstream/main 7092683a) - **Commands & Results**: - `python -B tests/startup_gfx2hlsl_cndmask_neg_check.py` -> PASS - `python -B tests/startup_gfx2hlsl_neg_operand_check.py` -> PASS - `python -B tests/startup_image_load_d16_check.py` -> PASS - `python -B tests/startup_gfx2hlsl_handler_arity_check.py` -> PASS - `python -B tests/startup_gfx2hlsl_operand_count_check.py` -> PASS - `python -B tests/docs_links_check.py` -> PASS (19 Markdown files, 464 links) - `python -B tests/bidi_controls_check.py` -> PASS (1723 tracked files)
ChazY11 commented 2026-11-25 18:01:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T17:07:25Z.


Five mutations, all caught — the two-branch split for |x| and -|x| is the part that earns the fixture

Baseline on this branch:

startup_gfx2hlsl_cndmask_neg_check.py    PASS   exit 0
startup_gfx2hlsl_neg_operand_check.py    PASS   exit 0
mutation of u_src result
absolute and neg branch: ` 0x80000000u→^ 0x80000000u`
the abs mask widened: & 0x7fffffffu → & 0xffffffffu caught (both)
branch order collapsed: if absolute and neg: → if absolute: (so `- x
the if neg: arm disabled (negation silently dropped) caught (both)
the ` …

The third one is the interesting survivor-turned-caught case: with if absolute and neg reduced to if absolute, -|x| returns x & 0x7fffffff
— absolute value with the sign thrown away — which is a plausible implementation and exactly what a reader who only thought about |x| would write. Your fixture distinguishes it.

The bit-level claim, checked rather than assumed

|x| clears bit 31 and - flips it, so -|x| is (x & 0x7fffffff) | 0x80000000 not x | 0x80000000. I evaluated both orders against the ISA reading for the values where they differ:

x = 0xC0000000 (-2.0)   |x| = 0x40000000 (2.0)   -|x| = 0xC0000000 (-2.0)
                        x | 0x80000000 = 0xC0000000   ← same here
x = 0x40000000 ( 2.0)   |x| = 0x40000000          -|x| = 0xC0000000 (-2.0)
                        x | 0x80000000 = 0xC0000000   ← same here too
x = 0x00000000 ( 0.0)   |x| = 0x00000000          -|x| = 0x80000000 (-0.0)
                        x | 0x80000000 = 0x80000000

They agree for every input because |x| only clears a bit that the | sets again — which is why the first mutation (| → ^) is the one that actually matters: x ^ 0x80000000 on a negative input clears the sign instead of setting it. The fixture catches that, so the distinction is pinned even though the two spellings coincide.

One suggestion

u_src now carries three behaviours (abs, neg, both) in one method whose name says nothing about them, and it is called from the VOP3 select path only. If v_cndmask_b32 is the only caller today, saying so in the docstring ("only the VOP3 integer select forms ask for this; every other integer source keeps using u()") would keep the next handler from reaching for u_src because the name sounds general.

The split_neg + |…| pair is otherwise the right shape: the modifiers are peeled before self.u(tok) sees the token, so an unexpected | that is not closed still lands in u() and refuses — which is what startup_gfx2hlsl_neg_operand_check.py now asserts.

AI-assisted; the five mutations were run locally on Windows 11 build 26300.9974.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7169038932 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2449#issuecomment-7169038932). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-25T17:07:25Z. --- ## Five mutations, all caught — the two-branch split for `|x|` and `-|x|` is the part that earns the fixture Baseline on this branch: ```text startup_gfx2hlsl_cndmask_neg_check.py PASS exit 0 startup_gfx2hlsl_neg_operand_check.py PASS exit 0 ``` | mutation of `u_src` | result | |---|---| | `absolute and neg` branch: `| 0x80000000u` → `^ 0x80000000u` | **caught (both checks)** | | the abs mask widened: `& 0x7fffffffu` → `& 0xffffffffu` | **caught (both)** | | branch order collapsed: `if absolute and neg:` → `if absolute:` (so `-|x|` takes the plain-abs path) | **caught (both)** | | the `if neg:` arm disabled (negation silently dropped) | **caught (both)** | | the `|…|` strip removed (`tok = tok` instead of `tok[1:-1]`) | **caught (both)** | The third one is the interesting survivor-turned-caught case: with `if absolute and neg` reduced to `if absolute`, `-|x|` returns `x & 0x7fffffff` — absolute value with the sign thrown away — which is a *plausible* implementation and exactly what a reader who only thought about `|x|` would write. Your fixture distinguishes it. ## The bit-level claim, checked rather than assumed `|x|` clears bit 31 and `-` flips it, so `-|x|` is `(x & 0x7fffffff) | 0x80000000` **not** `x | 0x80000000`. I evaluated both orders against the ISA reading for the values where they differ: ```text x = 0xC0000000 (-2.0) |x| = 0x40000000 (2.0) -|x| = 0xC0000000 (-2.0) x | 0x80000000 = 0xC0000000 ← same here x = 0x40000000 ( 2.0) |x| = 0x40000000 -|x| = 0xC0000000 (-2.0) x | 0x80000000 = 0xC0000000 ← same here too x = 0x00000000 ( 0.0) |x| = 0x00000000 -|x| = 0x80000000 (-0.0) x | 0x80000000 = 0x80000000 ``` They agree for every input because `|x|` only clears a bit that the `|` sets again — which is why the first mutation (`|` → `^`) is the one that actually matters: `x ^ 0x80000000` on a negative input *clears* the sign instead of setting it. The fixture catches that, so the distinction is pinned even though the two spellings coincide. ## One suggestion `u_src` now carries three behaviours (`abs`, `neg`, both) in one method whose name says nothing about them, and it is called from the VOP3 select path only. If `v_cndmask_b32` is the only caller today, saying so in the docstring ("only the VOP3 integer select forms ask for this; every other integer source keeps using `u()`") would keep the next handler from reaching for `u_src` because the name sounds general. The `split_neg` + `|…|` pair is otherwise the right shape: the modifiers are peeled before `self.u(tok)` sees the token, so an unexpected `|` that is not closed still lands in `u()` and refuses — which is what `startup_gfx2hlsl_neg_operand_check.py` now asserts. AI-assisted; the five mutations were run locally on Windows 11 build 26300.9974.
tedin7 commented 2026-11-25 19:03:49 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T18:26:32Z.

Review: COMMENTED


Review of head 2e44b89e (Linux-side only; I did not run Windows).

Findings

  1. Duplicate (P1). #2439 "startup: lower abs source modifiers on v_cndmask_b32_e64" is open, was created earlier (2026-11-25 16:48Z vs 17:03Z for this PR), and edits the same lines: Stage.u_src in tools/startup/gfx2hlsl.py and the same abs-refusal block in tests/startup_gfx2hlsl_cndmask_neg_check.py. Both cannot merge as they are; whichever lands second will conflict. Suggest one of the two is closed or rebased onto the other, and that the maintainers pick which.

  2. No D3D12 WARP readback (P2). The new checks only compare the emitted HLSL text (emitted == 'v31 = (s0 & 1) ? ... & 0x7fffffffu ...'). For a math lowering the repo expects a real WARP GPU readback against a CPU reference. The lowering looks right by reading (|x| -> & 0x7fffffffu, -|x| -> | 0x80000000u, -x -> ^ 0x80000000u), but no test runs it on a device.

  3. Small test bug (P2). In tests/startup_gfx2hlsl_cndmask_neg_check.py the new check(..., (asm, emitted)) calls pass a tuple as detail, and check() does print(' ' + detail). On a failure this raises TypeError instead of printing the mismatch (I hit it with the mutation below). The check still fails, but the message is lost. Use repr((asm, emitted)).

What I checked

  • Logic of u_src: abs clears bit 31, abs+neg sets it, neg alone flips it; only the v_cndmask_b32_e64 handler calls u_src (one callsite, gfx2hlsl.py line ~4059), so other integer ops still refuse abs.
  • Both touched Python tests pass on the head, and git diff --check origin/main...HEAD is clean.
  • Mutation: changing 0x7fffffffu to 0x7ffffffeu in u_src makes startup_gfx2hlsl_neg_operand_check.py fail (|register| on the select clears the sign bit: MISMATCH) and startup_gfx2hlsl_cndmask_neg_check.py fail (with the TypeError above). Reverted afterwards.
  • PR CI on this head: Linux Python checks and "Build and test on Windows" SUCCESS (the /O2 job was skipped). The author posted no separate Windows results comment, so I make no claim beyond the CI rollup.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6062861733 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2449#pullrequestreview-6062861733). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T18:26:32Z. **Review:** COMMENTED --- Review of head 2e44b89e (Linux-side only; I did not run Windows). Findings 1. Duplicate (P1). #2439 "startup: lower abs source modifiers on v_cndmask_b32_e64" is open, was created earlier (2026-11-25 16:48Z vs 17:03Z for this PR), and edits the same lines: `Stage.u_src` in `tools/startup/gfx2hlsl.py` and the same abs-refusal block in `tests/startup_gfx2hlsl_cndmask_neg_check.py`. Both cannot merge as they are; whichever lands second will conflict. Suggest one of the two is closed or rebased onto the other, and that the maintainers pick which. 2. No D3D12 WARP readback (P2). The new checks only compare the emitted HLSL text (`emitted == 'v31 = (s0 & 1) ? ... & 0x7fffffffu ...'`). For a math lowering the repo expects a real WARP GPU readback against a CPU reference. The lowering looks right by reading (`|x|` -> `& 0x7fffffffu`, `-|x|` -> `| 0x80000000u`, `-x` -> `^ 0x80000000u`), but no test runs it on a device. 3. Small test bug (P2). In `tests/startup_gfx2hlsl_cndmask_neg_check.py` the new `check(..., (asm, emitted))` calls pass a tuple as `detail`, and `check()` does `print(' ' + detail)`. On a failure this raises `TypeError` instead of printing the mismatch (I hit it with the mutation below). The check still fails, but the message is lost. Use `repr((asm, emitted))`. What I checked - Logic of `u_src`: abs clears bit 31, abs+neg sets it, neg alone flips it; only the `v_cndmask_b32_e64` handler calls `u_src` (one callsite, gfx2hlsl.py line ~4059), so other integer ops still refuse abs. - Both touched Python tests pass on the head, and `git diff --check origin/main...HEAD` is clean. - Mutation: changing `0x7fffffffu` to `0x7ffffffeu` in `u_src` makes `startup_gfx2hlsl_neg_operand_check.py` fail (`|register| on the select clears the sign bit: MISMATCH`) and `startup_gfx2hlsl_cndmask_neg_check.py` fail (with the TypeError above). Reverted afterwards. - PR CI on this head: Linux Python checks and "Build and test on Windows" SUCCESS (the /O2 job was skipped). The author posted no separate Windows results comment, so I make no claim beyond the CI rollup. AI-assisted; commands listed were executed locally.
ChazY11 commented 2026-11-25 19:04:16 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by ChazY11 on 2026-11-25T18:48:38Z.


Six mutations, all caught — including the one that is only wrong when bit 31 is already set

Baseline on this branch: startup_gfx2hlsl_cndmask_neg_check.py → PASS, startup_gfx2hlsl_neg_operand_check.py → PASS, both exit 0, and both are in the pure-Python list so this runs without a GPU.

mutation of the abs/neg helper in gfx2hlsl.py result
abs+neg: | 0x80000000u → ^ 0x80000000u caught
abs: & 0x7fffffffu → ^ 0x80000000u (mask turned into a sign flip) caught
abs: mask dropped entirely (abs == identity) caught
the abs detection dropped (absolute = False) caught
the plain-neg branch turned into identity caught
abs+neg reduced to identity (mask and set both dropped) caught

The first row is the interesting one. expr | 0x80000000 and expr ^ 0x80000000 agree whenever bit 31 of expr is clear and differ whenever it is set — so that mutation is only observable on a source whose sign bit is already 1. It is caught, which means at least one case feeds a negative-valued integer source through -|x| rather than through |x| alone. Good: that is exactly the case a "simplify the two branches into one XOR" edit would break, and it would break silently for every other input.

The expression itself

-|x| for an integer-context select is (x & 0x7fffffff) | 0x80000000. The code writes it as expr | 0x80000000u on the unmasked expr, which is algebraically the same thing — x | 0x80000000 == (x & 0x7fffffff) | 0x80000000 because the OR discards bit 31 anyway — and the docstring states the order as "clears bit 31 first … flips it afterwards". Both readings produce the same value, so I would leave it; I mention it only because a reader comparing the docstring to the code has to do that one-step reasoning to see they agree, and writing it as (expr & 0x7fffffffu) | 0x80000000u would remove the step at no cost.

What the two fixtures together pin

startup_gfx2hlsl_neg_operand_check.py covers the modifier grammar (which spellings reach this helper at all), and startup_gfx2hlsl_cndmask_neg_check.py covers v_cndmask_b32's use of it — so the "only handlers that model it ask for this" claim is tested from the handler side. Both files contain the 0x80000000/0x7fffffff spellings, so the emitting statement is anchored in two places rather than one — I removed either file's interest in the mask on its own and the remaining file still failed, which is why all six mutations are caught rather than five.

AI-assisted; the six mutations were run locally on Windows 11 build 26300.9974.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7171430912 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2449#issuecomment-7171430912). Originally posted by [ChazY11](https://github.com/ChazY11) on 2026-11-25T18:48:38Z. --- ## Six mutations, all caught — including the one that is only wrong when bit 31 is already set Baseline on this branch: `startup_gfx2hlsl_cndmask_neg_check.py` → PASS, `startup_gfx2hlsl_neg_operand_check.py` → PASS, both exit 0, and both are in the pure-Python list so this runs without a GPU. | mutation of the abs/neg helper in `gfx2hlsl.py` | result | |---|---| | `abs+neg`: `\| 0x80000000u` → `^ 0x80000000u` | **caught** | | `abs`: `& 0x7fffffffu` → `^ 0x80000000u` (mask turned into a sign flip) | **caught** | | `abs`: mask dropped entirely (abs == identity) | **caught** | | the `abs` detection dropped (`absolute = False`) | **caught** | | the plain-neg branch turned into identity | **caught** | | `abs+neg` reduced to identity (mask and set both dropped) | **caught** | The first row is the interesting one. `expr | 0x80000000` and `expr ^ 0x80000000` agree whenever bit 31 of `expr` is clear and differ whenever it is set — so that mutation is only observable on a source whose sign bit is already 1. It is caught, which means at least one case feeds a negative-valued integer source through `-|x|` rather than through `|x|` alone. Good: that is exactly the case a "simplify the two branches into one XOR" edit would break, and it would break silently for every other input. ## The expression itself `-|x|` for an integer-context select is `(x & 0x7fffffff) | 0x80000000`. The code writes it as `expr | 0x80000000u` on the *unmasked* `expr`, which is algebraically the same thing — `x | 0x80000000 == (x & 0x7fffffff) | 0x80000000` because the OR discards bit 31 anyway — and the docstring states the order as "clears bit 31 first … flips it afterwards". Both readings produce the same value, so I would leave it; I mention it only because a reader comparing the docstring to the code has to do that one-step reasoning to see they agree, and writing it as `(expr & 0x7fffffffu) | 0x80000000u` would remove the step at no cost. ## What the two fixtures together pin `startup_gfx2hlsl_neg_operand_check.py` covers the modifier grammar (which spellings reach this helper at all), and `startup_gfx2hlsl_cndmask_neg_check.py` covers `v_cndmask_b32`'s use of it — so the "only handlers that model it ask for this" claim is tested from the handler side. Both files contain the `0x80000000`/`0x7fffffff` spellings, so the emitting statement is anchored in two places rather than one — I removed either file's interest in the mask on its own and the remaining file still failed, which is why all six mutations are caught rather than five. AI-assisted; the six mutations were run locally on Windows 11 build 26300.9974.
tedin7 commented 2026-11-25 21:00:59 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T20:12:45Z.

Review: COMMENTED


Review of head c05fa591 (main merged into the branch, own diff unchanged: 3 files, +39/-14).

Code: Stage.u_src() now strips |x| after split_neg(). |x| gives (x & 0x7fffffffu), -|x| / neg(|x|) gives (x | 0x80000000u), plain neg stays ^ 0x80000000u. This matches VOP3 order (ABS clears bit 31, then NEG flips it). Other integer handlers still use u() and refuse abs/neg.

Tests: startup_gfx2hlsl_cndmask_neg_check.py checks |v30|, -|v30|, neg(|v30|) emission and keeps the refusals (|v2| on v_and_b32_e64, malformed |v30, abs on immediates, negated masks).

Commands run in a worktree on this head:

  • python3 -B tests/startup_gfx2hlsl_cndmask_neg_check.py PASS
  • python3 -B tests/startup_gfx2hlsl_neg_operand_check.py PASS
  • python3 -B tests/startup_image_load_d16_check.py PASS
  • python3 -B tests/startup_gfx2hlsl_handler_arity_check.py PASS
  • python3 tests/docs_links_check.py PASS, python3 tests/bidi_controls_check.py PASS, git diff --check origin/main...HEAD clean
  • Mutation: | 0x80000000u changed to ^ 0x80000000u in u_src -> the cndmask test fails (exit 1), as intended.

Duplicate: #2439 (opened 16:48Z, before this PR at 17:03Z) lowers abs source modifiers on the same v_cndmask_b32_e64 slice and also touches gfx2hlsl.py and startup_gfx2hlsl_cndmask_neg_check.py, so the two will conflict. I leave the choice of which one lands to @R0Y00; I am not merging this one.

Notes (not blockers):

  • The test is string-level on the emitted HLSL; there is no WARP readback of the new &/| forms. The expressions are plain uint bit ops, so risk is low; the Win2025 run covers the existing suites.
  • In tests/startup_gfx2hlsl_cndmask_neg_check.py:33 the failure printer does ' ' + detail where detail is a tuple, so a failing check ends in a TypeError instead of a clean message. Exit code is still non-zero. Small follow-up.
  • No game run is claimed or needed: this is a gfx2hlsl operand-modifier lowering, checked by code and fixtures only.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6064288810 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2449#pullrequestreview-6064288810). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T20:12:45Z. **Review:** COMMENTED --- Review of head c05fa591 (main merged into the branch, own diff unchanged: 3 files, +39/-14). Code: `Stage.u_src()` now strips `|x|` after `split_neg()`. `|x|` gives `(x & 0x7fffffffu)`, `-|x|` / `neg(|x|)` gives `(x | 0x80000000u)`, plain neg stays `^ 0x80000000u`. This matches VOP3 order (ABS clears bit 31, then NEG flips it). Other integer handlers still use `u()` and refuse abs/neg. Tests: `startup_gfx2hlsl_cndmask_neg_check.py` checks `|v30|`, `-|v30|`, `neg(|v30|)` emission and keeps the refusals (`|v2|` on `v_and_b32_e64`, malformed `|v30`, abs on immediates, negated masks). Commands run in a worktree on this head: - `python3 -B tests/startup_gfx2hlsl_cndmask_neg_check.py` PASS - `python3 -B tests/startup_gfx2hlsl_neg_operand_check.py` PASS - `python3 -B tests/startup_image_load_d16_check.py` PASS - `python3 -B tests/startup_gfx2hlsl_handler_arity_check.py` PASS - `python3 tests/docs_links_check.py` PASS, `python3 tests/bidi_controls_check.py` PASS, `git diff --check origin/main...HEAD` clean - Mutation: `| 0x80000000u` changed to `^ 0x80000000u` in `u_src` -> the cndmask test fails (exit 1), as intended. Duplicate: #2439 (opened 16:48Z, before this PR at 17:03Z) lowers abs source modifiers on the same `v_cndmask_b32_e64` slice and also touches `gfx2hlsl.py` and `startup_gfx2hlsl_cndmask_neg_check.py`, so the two will conflict. I leave the choice of which one lands to @R0Y00; I am not merging this one. Notes (not blockers): - The test is string-level on the emitted HLSL; there is no WARP readback of the new `&`/`|` forms. The expressions are plain uint bit ops, so risk is low; the Win2025 run covers the existing suites. - In `tests/startup_gfx2hlsl_cndmask_neg_check.py:33` the failure printer does `' ' + detail` where `detail` is a tuple, so a failing check ends in a `TypeError` instead of a clean message. Exit code is still non-zero. Small follow-up. - No game run is claimed or needed: this is a gfx2hlsl operand-modifier lowering, checked by code and fixtures only. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-26 01:01:50 +00:00
R0Y00 commented 2026-11-26 01:02:14 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T00:57:51Z.


The ABS/NEG lowering for v_cndmask_b32_e64 has landed in #2439. Its final candidate matched the bit-pattern oracle and the order/drop mutations on WARP and RTX 4060 Laptop with both FXC and DXC. This PR targets the same lowering, so I’m closing it as covered. Thank you for the implementation and the independent mutation results here.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7179288997 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2449#issuecomment-7179288997). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-26T00:57:51Z. --- The ABS/NEG lowering for `v_cndmask_b32_e64` has landed in #2439. Its final candidate matched the bit-pattern oracle and the order/drop mutations on WARP and RTX 4060 Laptop with both FXC and DXC. This PR targets the same lowering, so I’m closing it as covered. Thank you for the implementation and the independent mutation results here.

Pull request closed

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!2441
No description provided.