Repository navigation
Conversation
lambirou
force-pushed
the
shader/f16-log-trig
branch
from
November 30, 2026 09:04
f706bfd to
e3a3c6e
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the plain VOP1 f16 group. Stacked on #3557; 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 #3542/#3549/#3556/#3557; they drop out of the diff once those land.
AI-assisted.