shader: lower packed FP16 add, multiply and fused multiply-add in direct DXIL #3145

Closed
opened 2026-11-27 18:20:05 +00:00 by RonLogic · 0 comments
RonLogic commented 2026-11-27 18:20:05 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-27T18:20:05Z.


Refs #2935 and #2022. I’ll take the direct DXIL VOP3P arithmetic slice. Source-built Pixel and Compute containers both reject the canonical v_pk_add_f16, v_pk_mul_f16 and v_pk_fma_f16 forms at guest offset +0x18 on 429f11d5 plus the separate min/max change #3144. #2930 is work on the HLSL frontend.

Preserve independent half selection, round-to-nearest-even and the supported denormal mode. Let ADD and MUL reuse the existing binary16 rounding path. FMA needs a single half rounding, including cases where a rounded binary32 intermediate lands exactly on a binary16 midpoint. Use the earlier Xbox2Windows integer FMA contract and verify with original exact-rational cases, including a double-rounding control, sparse EXEC and both stage entry points. Unsupported mode or operand forms should retain explicit refusals.

The public shadPS4 packed FP16 report was observed at 34b35b526e3bfbb8a6f22c11035cb051174ac6f1 on 2026-11-27, GPL-2.0. It is a capability reference. The instruction semantics and new implementation follow the AMD RDNA 2 ISA and Xbox2Windows tests.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6652293005 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/3145). Originally posted by [RonLogic](https://github.com/RonLogic) on 2026-11-27T18:20:05Z. --- Refs #2935 and #2022. I’ll take the direct DXIL VOP3P arithmetic slice. Source-built Pixel and Compute containers both reject the canonical `v_pk_add_f16`, `v_pk_mul_f16` and `v_pk_fma_f16` forms at guest offset `+0x18` on `429f11d5` plus the separate min/max change #3144. #2930 is work on the HLSL frontend. Preserve independent half selection, round-to-nearest-even and the supported denormal mode. Let ADD and MUL reuse the existing binary16 rounding path. FMA needs a single half rounding, including cases where a rounded binary32 intermediate lands exactly on a binary16 midpoint. Use the earlier Xbox2Windows integer FMA contract and verify with original exact-rational cases, including a double-rounding control, sparse EXEC and both stage entry points. Unsupported mode or operand forms should retain explicit refusals. The [public shadPS4 packed FP16 report](https://github.com/shadps4-emu/shadPS4/pull/4354) was observed at `34b35b526e3bfbb8a6f22c11035cb051174ac6f1` on 2026-11-27, GPL-2.0. It is a capability reference. The instruction semantics and new implementation follow 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 Xbox2Windows tests.
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#3145
No description provided.