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

Closed
opened 2026-11-27 13:49:15 +00:00 by RonLogic · 0 comments
RonLogic commented 2026-11-27 13:49:15 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-27T13:49:15Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6647728921 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3069). Originally posted by [RonLogic](https://github.com/RonLogic) on 2026-11-27T13:49:15Z. --- 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.
Sign in to join this conversation.
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#3069
No description provided.