mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
[PR #232] [MERGED] Bit counting functions (CountBits, CountBits64) #253
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/ultimatepp#253
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ultimatepp/ultimatepp/pull/232
Author: @ismail-yilmaz
Created: 2/8/2025
Status: ✅ Merged
Merged: 2/14/2025
Merged by: @mirek-fidler
Base:
master← Head:count_bits📝 Commits (3)
85f5186Core: CountBits and CountBits64 functions are added.fe1ba6aautotest: CountBits test added.85d6270Core: inline force on CountBits and CountBits64📊 Changes
5 files changed (+112 additions, -0 deletions)
View changed files
➕
autotest/CountBits/CountBits.cpp(+33 -0)➕
autotest/CountBits/CountBits.upp(+10 -0)➕
autotest/CountBits/Etalon.log(+21 -0)📝
uppsrc/Core/Ops.h(+41 -0)📝
uppsrc/Core/src.tpp/Mem_en-us.tpp(+7 -0)📄 Description
This PR adds
CountBits()andCountBits64()functions toUpp/Coreand provides API docs & a simple autotest.These functions are useful for counting set bits in a bitmask.
Default implementation uses platform specific popcount variants for popular compilers (GCC/CLANG/MSVC). Otherwise it uses a well-known custom implementation for fallback, which can be easily vectorized by the compiler as well.
Please check.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.