shader: lower the remaining binary16 DPP unary forms #3586
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3586"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-30T11:02:27Z.
Part of the f16 VOP1 DPP slice (Refs #839).
This adds the ten remaining quad-local binary16 VOP1 DPP unary forms:
v_rsq_f16_dpp,v_exp_f16_dpp,v_log_f16_dpp,v_sin_f16_dppandv_cos_f16_dpp, each in the DPP16 (quad_permwithrow_mask:0xf bank_mask:0xf) and DPP8 encodings. The lowering reuses the plain opcode semantics exactly: the selected quad word's low half is widened, the same binary32rsqrt/exp2/log2/sin16/cos16operation runs, the result is narrowed to nearest even, and the same RDNA 2 special-result helpers (f16_rsq_result,f16_exp2_result,f16_log_result,f16_sin_result,f16_cos_result) apply. The value-tracking selectors are the same as the plain forms, so a finite proof is only recorded where the plain path records one.v_rcp_f16_dppandv_sqrt_f16_dppkeep their existing lowering unchanged.DPP16 accepts bit-15
abs/neg; DPP8, partial masks,bound_ctrl,fi, cross-quad or non-repeated DPP8, mixed controls, clamp, omod, a non-VGPR source and a non-entry EXEC mask stay refused.v_dot2c_f32_f16_dppand the SDWA spellings are out of this slice.Tests
pixel_aot_f16_dpp_unary_rest_warpand_hardwarepass: four programs over exact and inexact values, signed zeros, subnormals,rsqof zero and negatives,expof 2^-25 and two midpoint rows,logof zero and negatives, exactsin/coszeros, the canonical NaN of a negativersq, and DPP16↔DPP8 chains. Two mutations (mnemonic cycle and high-half source read) reportpixel_mismatchon WARP and on the AMD Radeon RX 9060 XT (driver 32.0.32029.2010).check_f16_dpp_unary_rest_controlspins the reference rows and every spelling, proof, control, modifier, mode, scheduling and reader refusal, and checks the four existingrcp/sqrtDPP forms still pass.draw-f16-dpp-unaryanddraw-dpp-f16still pass on both adapters.form_coverage_check.pypins exactly the ten new forms;rdna2_tools_check.pypasses 160 tests (19 skipped) including the scanner/translator agreement.mainatc7cbdf96: 1,579/1,968 and 1,564/1,863; this PR adds ten forms).Limits
The high half of the destination is not observed; the D3D error windows of
rsqrt/exp2/log2/sin/cosare not reproduced beyond the midpoint tables and exact references; runtime sources and NaN/infinity constants stay refused before lowering; lane routing is not measured because every lane of a statically proven source carries the same word. No title is known to execute these paths.AI-assisted.