Closed
Bug 906368
Opened 11 years ago
Closed 11 years ago
Factor out popcount from RegisterSets::size()
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: sunfish, Unassigned)
References
Details
Attachments
(1 file)
4.87 KB,
patch
|
nbp
:
review+
|
Details | Diff | Splinter Review |
RegisterSets::size() contains a manual popcount implementation. This patch moves it into mfbt/MathAlgorithms.h and uses __builtin_popcount on compilers which support it.
Attachment #791746 -
Flags: review?(nicolas.b.pierron)
Comment 1•11 years ago
|
||
Comment on attachment 791746 [details] [diff] [review] popcount.patch Review of attachment 791746 [details] [diff] [review]: ----------------------------------------------------------------- Nice. Thanks for adding a test with it.
Attachment #791746 -
Flags: review?(nicolas.b.pierron) → review+
Reporter | ||
Comment 2•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/8d3b2cb5d698
Comment 3•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/8d3b2cb5d698
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Comment 4•10 years ago
|
||
The long implementation seems to be incorrect, it needs an extra line:
> uint32_t sum32 = (sum16 & 0x0000ffff) + ((sum16 & 0xffff0000) >> 16);
to correctly figure out the population in all 32 bits.
You need to log in
before you can comment on or make changes to this bug.
Description
•