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

Expose popcount #10212

Closed
polux opened this issue Apr 25, 2013 · 2 comments
Closed

Expose popcount #10212

polux opened this issue Apr 25, 2013 · 2 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-duplicate Closed in favor of an existing report library-core type-enhancement A request for a change that isn't a bug

Comments

@polux
Copy link
Contributor

polux commented Apr 25, 2013

Most CPUs have a popcount (http://en.wikipedia.org/wiki/Hamming_weight) instruction but it is not accessible in Dart.

Yet certain algorithms and datastructures rely on it (http://en.wikipedia.org/wiki/Hash_array_mapped_trie for instance).

So far I have used software emulations of popcount but it's a pain because
  1. it's potentially slower than a C++ version and definitely slower than a CPU instruction
  2. I don't know any fast implementation that works on both 32 and 64 bits architectures

Would it be possible to expose it as a method of int or num? (With a fallback to a C++ version in the VM for CPUs that don't support it and a software version in dart2js.)

@rakudrama
Copy link
Member

See also Issue #5798, Issue #6486.


Added Area-Library, Library-Core, Triaged labels.

@floitschG
Copy link
Contributor

Added this to the Later milestone.
Added Duplicate label.
Marked as being merged into #5798.

@polux polux added Type-Enhancement area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-core closed-duplicate Closed in favor of an existing report labels Apr 30, 2013
@polux polux added this to the Later milestone Apr 30, 2013
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-duplicate Closed in favor of an existing report library-core type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants