New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG, SIMD: Fix 64-bit/8-bit integer division by a scalar #20153
Merged
Merged
Conversation
This file contains 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
The multiplier factor that used for integer division wasn't correctly calculated due inaccurate implementation of the emulated version of intrinsic `_udiv128`.
I don't think it matters, we will just delete it later. A test might be nice, but I can add it also. Thanks for taking such a quick look Sayed! |
@seiko2plus Could you add a test for this? |
…several data ranges
Same as 64-bit divistion, except quad wide divison leads to inaccurate multiplier in certain cases when the log2 of the divisor overflow to zero.
seiko2plus
force-pushed
the
issue_20025
branch
from
October 23, 2021 06:15
8fe431b
to
4682087
Compare
seiko2plus
changed the title
BUG, SIMD: Fix 64-bit integer divison by a scalar on MSVC <= 2017
BUG, SIMD: Fix 64-bit/8-bit integer divison by a scalar
Oct 23, 2021
seiko2plus
changed the title
BUG, SIMD: Fix 64-bit/8-bit integer divison by a scalar
BUG, SIMD: Fix 64-bit/8-bit integer division by a scalar
Oct 23, 2021
Thanks Sayed |
charris
added
component: SIMD
Issues in SIMD (fast instruction sets) code or machinery
and removed
09 - Backport-Candidate
PRs tagged should be backported
labels
Nov 3, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
This pull request fixes two bugs:
64-bit integer division by a scalar for both unsigned and signed division,
which was discovered by BUG: Bad SIMD integer
//
on windows in numpy 1.21.2 #20025.It's only limited to old versions of msvc <= 2017, due to inaccurate
implementation of the emulated version for intrinsic
_udiv128
,which leads to producing an inaccurate multiplier.
8-bit unsigned integer division, similar to the above except it is not limited to a certain compiler
and the inaccurate multiplier was caused due to wrong casting leads to perform quad division.
it can be triggered if the ceil(log2(divisor)) == 8.
closes #20025, #20168