Repository navigation
Fix/neg avx512f - #1423
Open
emrys53 wants to merge 3 commits into
Open
Fix/neg avx512f#1423emrys53 wants to merge 3 commits into
emrys53 wants to merge 3 commits into
Conversation
…lar implementation in signed zero case and made it similar to avx/sse implementations
The existing neg tests compare with ==, under which +0 == -0, so they pass against a kernel that evaluates 0 - x instead of flipping the sign bit. Check the sign bit explicitly: across every lane of the batch arithmetic test, and for the scalar and batch overloads in the api test. Both are guarded by __FAST_MATH__, which implies -fno-signed-zeros and makes the property untestable. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
Thanks for disclosing AI usage for the tests. Implementation and tests looks good. |
Contributor
|
looks like the s390x build fails on the new test case. @emrys53 would you mind having a look? |
This branch has not been deployed
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.
The
negfunction for avx512f was different from the implementations of avx and sse. It produced different results from scalar counterpart in the case of signed zero.neg(+0.0)returned+0.0instead of-0.0. It now uses a similar implementation in avx512f as avx and sse.I also added a missing
XSIMD_INLINEandnoexceptthat I realized was missing in the avxnegfunction. (This is unrelated to the fix, but since it was one line change I added it anyway).The tests were written by AI and now it tests for signbit when
__FAST_MATH__is not defined.