Skip to content
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

<bit>: fix countl_zero on arm64 #2647

Merged
merged 3 commits into from
Apr 16, 2022

Conversation

barcharcraz
Copy link
Member

@barcharcraz barcharcraz commented Apr 11, 2022

Fix countl_zero on arm64 to properly subtract the zeros resulting from widening.

Because of a lack of test coverage, we forgot that _CountLeadingZeros takes unsigned long, and thus for types shorter than that we need to subtract the extra zeros from the result.

@barcharcraz barcharcraz requested a review from a team as a code owner April 11, 2022 22:37
@CaseyCarter CaseyCarter added bug Something isn't working ARM64 Related to the ARM64 architecture labels Apr 11, 2022
@CaseyCarter CaseyCarter changed the title <bit>: fix countl_zero on arm64 <bit>: fix countl_zero on arm64 Apr 11, 2022
@MikeGitb
Copy link

Did the buggy version make it into a release?

stl/inc/bit Outdated Show resolved Hide resolved
stl/inc/bit Outdated Show resolved Hide resolved
@StephanTLavavej
Copy link
Member

@MikeGitb

Did the buggy version make it into a release?

Yes, this was introduced by #795 merged on 2020-07-01, shipped in VS 2019 16.8.

@StephanTLavavej
Copy link
Member

@barcharcraz @CaseyCarter I went ahead and pushed changes for the issue that Alex noticed, as we talked about it during the maintainer meeting.

@StephanTLavavej StephanTLavavej self-assigned this Apr 15, 2022
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 3ab44c2 into microsoft:main Apr 16, 2022
@StephanTLavavej
Copy link
Member

Thanks for finding and fixing this silent bad codegen! 🐞 🔍 ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM64 Related to the ARM64 architecture bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants