shader: lower binary16 VOP1 logarithm, sine and cosine #3564
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3564
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3562"
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?
@lambirou on GitHub · 2026-11-30 07:00 UTC · original
lambirou:shader/f16-log-trig→main· +1353 −28 · 7 files · 3 commits · closed without mergingCompletes the plain VOP1 f16 group. Stacked on #3559; rebase after it lands.
This adds
v_log_f16,v_sin_f16andv_cos_f16in e32 and e64 (six reference rows):log: widen the low half, evaluatelog2in binary32, narrow, then apply the RDNA 2 special results and the 73 midpoint corrections from the source half. +infinity stays +infinity, NaN/negative non-zero gives0x7e00, either zero gives0xfc00.sin/cos: reduce the turn count withturns16, evaluate the same binary32 intrinsic as the direct computetrig_turnshelper, and narrow. Sin preserves -0; infinities/NaNs map to0x7e00; the exact zero at half a turn (sin) or a quarter turn (cos) is selected before the intrinsic.f16_log_trig_resultkeeps the same static-result contract as P4a/P4b; the Python midpoint table is checked against the C++ table.Tests
draw-f16-log-trigpasses on WARP and on the AMD RX 9060 XT.mismatch: cycled operation, high-half source read, a midpoint shifted by one ULP,log2replaced byln, and removed exact zeroes.tests/form_coverage_check.pypasses, includingcheck_f16_log_trig_forms;rdna2_tools_check.pyreports 159 tests and 19LLVM_LIBskips.Limits
DPP/SDWA variants remain out of scope. Sin/cos depend on the D3D intrinsic error; fixture values stay at least 5e-5 away from a binary16 midpoint except the exact zeroes. The high half of the destination is not observed, NaN/infinity sources are refused before lowering, and there is no console measurement.
The branch includes the commits of #3544/#3549/#3556/#3557; they drop out of the diff once those land.
AI-assisted.
f706bfdcc7toe3a3c6e90e@lambirou on GitHub · 2026-11-30 10:06 UTC · original
Merged as part of #3566: that PR was squashed onto
mainatf0a10b12, and the logarithm/sine/cosine lowerings are inmain(the squash body lists this commit). Closing this now-redundant PR. The next DPP slice is #3580.Pull request closed