Repository navigation
Conversation
|
Reviewed at head 1. The lowering is semantically correct — model-checked exhaustively, then hardware-tested. Opcodes check out against the GFX10 table ( 2. 3. Hardware evidence on this machine. 4. Checks: 5. One nit, not blocking (CI has no fmt job): the PR adds 4 new rustfmt diffs of its own — Nothing else found; the new opcodes previously fell through to a refusal, so this strictly widens what translates. |
|
Independent verification of \79a7a60\ on Windows 11 / AMD Radeon RX 9060 XT (RDNA4, \gfx1200) / Rust 1.98.1 MSVC:
Code audit looks solid: \�_mad_u32_u16\ / \�_mad_i32_i16\ products never overflow 32 bits (\65535^2 <= u32::MAX\ and (-32768)^2 = 2^30 <= i32::MAX), so checking overflow on \prod + acc\ alone is exact for both unsigned and signed clamp paths; \�_{min3,max3,med3}_{i16,u16}\ properly uses \half_src(inst, 2)\ with sign extension for _i16. (Minor merge note: #1295 changes \half_src\ arity if both land.) AI-assisted; synthetic tests only, no game files. |
|
Reviewed
Verified reference tests (including inline float constants |
|
Great catch, @fuzeofficlal — thank you for checking the Fixed both items on this branch:
Re-verified on NVIDIA GeForce RTX 3060 Ti, WARP, and (Authored and verified by Gemini 4 Neon — High Mode; synthetic tests only, zero game data.) |
…min3/max3/med3 and mad32_16 Authored and verified by Gemini 4 Neon (High Mode, AI coding agent) with zero game data. Addresses review feedback on Marvisak#1300: 1. `v_mad_{u32_u16,i32_i16}` and `v_{min3,max3,med3}_{i16,u16}` have 16-bit integer operands (`OPERAND_REG_INLINE_C_INT16`), where GFX10 decodes inline float constants (`240..=248`) as 32-bit `f32` bit patterns before selecting the low/high half via `op_sel` (not `f16`). Switch those source reads from `half_src` to `packed_src(inst, k, false, false)`. 2. Return `"integer operand modifiers"` for `v.abs != 0 || v.neg != 0` on `v_mad_{u32_u16,i32_i16}` (keeping `"integer output modifiers"` for `v.omod != 0`). 3. Extend `valu16_min3_max3_med3_and_mad32_16_match_rdna2` with GPU/WARP tests for inline float constant `242` (`1.0f = 0x3F80_0000`) across `op_sel=0` and `op_sel=1` on both `v_mad_u32_u16` and `v_max3_u16`.
|
Verified the new head |
catminou4
left a comment
There was a problem hiding this comment.
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (ffe310e), cargo test -p victory-shader --locked → 96 passed, 0 failed. Execution/valu tests are #[cfg(all(test, windows))] and only run on Windows; macOS covers lowering/structure/IR unit tests.
Lowers v_{min3,max3,med3}{i16,u16} and v_mad{u32_u16,i32_i16} with RDNA2-matched hardware cases (valu16_min3_max3_med3_and_mad32_16_match_rdna2).
|
Automated triage for the maintainers. Verdict: merge candidate. This is now rebased and merges cleanly. It lowers
The GPU test To note: #1295/#1285 route the same operand decode through CI: passing ( Generated by Claude Code |
|
Rebased onto \main\ (\940d32f) at $sha. Verified on RTX 3060 Ti + WARP: \�alu16_min3_max3_med3_and_mad32_16_match_rdna2\ passed, strict Clippy (--all-targets\ and --all-features) clean, \cargo xtask policy\ ok. |
…min3/max3/med3 and mad32_16 Authored and verified by Gemini 4 Neon (High Mode, AI coding agent) with zero game data. Addresses review feedback on Marvisak#1300: 1. `v_mad_{u32_u16,i32_i16}` and `v_{min3,max3,med3}_{i16,u16}` have 16-bit integer operands (`OPERAND_REG_INLINE_C_INT16`), where GFX10 decodes inline float constants (`240..=248`) as 32-bit `f32` bit patterns before selecting the low/high half via `op_sel` (not `f16`). Switch those source reads from `half_src` to `packed_src(inst, k, false, false)`. 2. Return `"integer operand modifiers"` for `v.abs != 0 || v.neg != 0` on `v_mad_{u32_u16,i32_i16}` (keeping `"integer output modifiers"` for `v.omod != 0`). 3. Extend `valu16_min3_max3_med3_and_mad32_16_match_rdna2` with GPU/WARP tests for inline float constant `242` (`1.0f = 0x3F80_0000`) across `op_sel=0` and `op_sel=1` on both `v_mad_u32_u16` and `v_max3_u16`.
7383f54 to
4726c19
Compare
4726c19 to
63bcca4
Compare
Authored and verified by Gemini 4 Neon (High Mode, AI coding agent) with
zero game data.
Lowers 16-bit integer 3-operand min/max/med (�_{min3,max3,med3}_{i16,u16})
and 16x16+32 multiply-add (�_mad_{u32_u16,i32_i16}) in a dedicated
emit::lower::valu16 submodule (keeping lower.rs under the 512 KiB
policy limit):
- Decodes 16-bit integer inline float constants (240..=248) as 32-bit
32 bit patterns before selecting low/high half via op_sel
(packed_src(inst, k, false, false)).
- Rejects �.omod != 0 ("integer output modifiers") and
�.abs != 0 || v.neg != 0 ("integer operand modifiers") on
�_mad_{u32_u16,i32_i16}.
- Supports saturating signed/unsigned �_mad_{i32_i16,u32_u16} clamp.
- Verified with GPU/WARP tests in �alu16_min3_max3_med3_and_mad32_16_match_rdna2
including inline float constant 242 (1.0f = 0x3F80_0000) across
op_sel=0 and op_sel=1, plus census_tests.
Summary
Lowers 8 missing 16-bit integer VALU instructions in
victory-shader:valu16/valu16_op):v_min3_i16(0x352),v_min3_u16(0x353)v_max3_i16(0x355),v_max3_u16(0x356)v_med3_i16(0x358),v_med3_u16(0x359)op_sel[0..2]on all three 16-bit sources andop_sel[3]on the destination, preserving the untouched half ofvdst.valu_op):v_mad_u32_u16(0x373)v_mad_i32_i16(0x375)op_sel[0..1]for the 16-bit multiplicands, reads full 32-bitsrc2, and supports both wrapping and exact 32-bit signed/unsigned saturatingclampusing pure 32-bit DXIL (noINT64required).Verification
Tested locally on Windows 11 with NVIDIA GeForce RTX 3060 Ti (
Driver 32.0.16.1656) + Microsoft WARP +dxil.dllvalidator, Rust1.98.1MSVC:cargo clippy --workspace --all-targets --locked -- -D warnings— 0 warningscargo clippy --workspace --all-targets --all-features --locked -- -D warnings— 0 warningscargo test -p victory-shader --locked— 121 passed, 0 failed, 1 ignored (includingvalu16_min3_max3_med3_and_mad32_16_match_rdna2verifying all 8 opcodes, high-halfop_sel, untouched-half preservation, wrapping, and saturatingclampon RTX 3060 Ti and WARP)cargo xtask policy— 154 files ok