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

Remove indexOfTheOnlyBit in IntSet.Internal #1037

Merged
merged 1 commit into from
Sep 14, 2024

Conversation

meooow25
Copy link
Contributor

@meooow25 meooow25 commented Sep 12, 2024

  • This was used for 32-bit GHC, which isn't necessary
  • Drop a CPP check for 32/64-bit GHC, GHC doesn't support anything else

Related to #1018

I can't tell why the special case for 32-bit GHC exists. #379 started using the GHC functions but I can't find an explanation for why only on 64-bit. @treeowl do you know?

This PR should improve performance on 32-bit systems, don't know if we want to test that. I don't have a 32-bit system.

Copy link
Contributor

@treeowl treeowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there may have been some reluctance to change the implementation on 32-bit without benchmarking on 32-bit, but I think the change is good anyway.

It has a complicated definition used only for 32-bit GHC. This isn't
necessary because we can use countTrailingZeros as we do for 64-bit.
Also drop a CPP check for 32/64-bit GHC, GHC doesn't support anything
else.
@meooow25 meooow25 changed the title Remove a complicated bitwise function in IntSet Remove indexOfTheOnlyBit in IntSet.Internal Sep 14, 2024
@meooow25 meooow25 merged commit 6a6c007 into haskell:master Sep 14, 2024
11 checks passed
@meooow25 meooow25 deleted the intset-bitwise branch September 14, 2024 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants