Repository navigation
perf(shader): pick the f32 NaN result with one quiet and one fallback select - #5343
Closed
ErenYeager1836 wants to merge 1 commit into
Closed
ErenYeager1836 wants to merge 1 commit into
ErenYeager1836 wants to merge 1 commit into
Conversation
… select nanResultF32 gives the f32 add, sub, subrev, mul and fma forms, the legacy mul, mad and fma forms, v_div_fmas_f32 and v_fma_mix_f32 with f32 sources the AMD NaN result: the first NaN source, quieted in IEEE mode, else the default NaN 0xffc00000 when the result is NaN, else the result. It started from the fallback and then, for each source, tested it for NaN with an integer and and compare, quieted it with its own or, and selected it. The addend's test was also combined with the inverse of the invalid-product flag. The chain now carries only source bits. The addend starts it, replaced by 0 when the product is 0 * inf. Each earlier source that FPIsNan32 finds NaN takes its place. One quiet and one select then choose between that source, when it is NaN, and the fallback. The candidate is NaN exactly when some eligible source is, and it is then the first one, so every result is the same. agc_driver_f32_arithmetic_nan already checks the source order and the 0 * inf product with a NaN addend for every form.
Contributor
Author
|
Closing in favor of earlier open PR #4287 by @karanvora2599. |
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.
What
nanResultF32selects AMD-compliant NaN results for f32add,sub,subrev,mul,fma,v_div_fmas_f32, andv_fma_mix_f32(returning the first NaN source quieted in IEEE mode, else fallback default NaN0xffc00000). Previously, every source performed an independent integerand, comparison, quietor, andselect.0 * inf.agc_driver_f32_arithmetic_nantest cases.Carried from @karanvora2599 with author attribution preserved.
Tested
agc_driver_f32_arithmetic_nanin AgcDriver execution suite. Passes conventions check.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)