shader: lower the six packed 16-bit min/max forms in direct DXIL #3069

Closed
opened 2026-11-27 13:59:39 +00:00 by github-bot · 0 comments
Owner

@⁠RonLogic on GitHub · 2026-11-27 13:49 UTC · original

Refs #2935 and #2022. The direct frontend refuses the canonical v_pk_min/max_{i16,u16,f16} encodings even though the startup HLSL frontend already handles the family. Synthetic wave32 inputs reach direct ALU operand modifiers at +0x30 with the current native compiler. I’ll take the direct DXIL slice.

Use the two independent half selectors for each source, write both halves under the original lane mask, and preserve numeric ordering for signed, unsigned and binary16 pairs. Check the float cases against the repository’s existing raw-bit contract for signed zero, subnormals and NaNs. Reject unsupported encodings and float modes. Verify synthetic Compute on a wave32 adapter and Pixel on WARP and RTX, with a selector or result-order control.

Cross-project reference: shadPS4’s public packed FP16 PR, merge 34b35b526e3bfbb8a6f22c11035cb051174ac6f1, observed 2026-11-27 (GPL-2.0, behavioral reference only). Instruction and selector sources are the AMD RDNA 2 ISA and AMD LLVM syntax guide. The DXIL implementation and fixture are written here.

**@⁠RonLogic** on GitHub · 2026-11-27 13:49 UTC · [original](https://github.com/R0Y00/Xbox2Windows/issues/3069) Refs #2935 and #2022. The direct frontend refuses the canonical `v_pk_min/max_{i16,u16,f16}` encodings even though the startup HLSL frontend already handles the family. Synthetic wave32 inputs reach `direct ALU operand modifiers` at `+0x30` with the current native compiler. I’ll take the direct DXIL slice. Use the two independent half selectors for each source, write both halves under the original lane mask, and preserve numeric ordering for signed, unsigned and binary16 pairs. Check the float cases against the repository’s existing raw-bit contract for signed zero, subnormals and NaNs. Reject unsupported encodings and float modes. Verify synthetic Compute on a wave32 adapter and Pixel on WARP and RTX, with a selector or result-order control. Cross-project reference: shadPS4’s public [packed FP16 PR](https://github.com/shadps4-emu/shadPS4/pull/4354), merge `34b35b526e3bfbb8a6f22c11035cb051174ac6f1`, observed 2026-11-27 (GPL-2.0, behavioral reference only). Instruction and selector sources are the [AMD RDNA 2 ISA](https://www.amd.com/content/dam/amd/en/documents/radeon-tech-docs/instruction-set-architectures/rdna2-shader-instruction-set-architecture.pdf) and [AMD LLVM syntax guide](https://rocmdocs.amd.com/projects/llvm-project/en/latest/LLVM/llvm/html/AMDGPU/AMDGPUAsmGFX1030.html). The DXIL implementation and fixture are written here.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 13:59:39 +00:00
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/R0Y00--Xbox2Windows#3069
No description provided.