v8/test/unittests/base
Omer Katz cc6dfd5d67 Fix CountPopulation non-builtin implementation
The existing non-builtin implementation is returning wrong results.
For example, given the value 63 as a uint8_t it returns 38 (should be 6).

The new implementation follows the naive algorithm presented in figure 5-1
in Hacker's Delight section 5-1.
Note that the algorithm in the book is designed for 32 bit numbers, so we
extended it to support 64 bit as well.

Bug: chromium:1056170
Change-Id: I8fed9c449f80b01b8cc93d339529c0e1e0863fc0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2199345
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67801}
2020-05-14 14:24:13 +00:00
..
platform base: Add Stack utilities 2020-03-27 13:47:58 +00:00
utils [test] Add the missing algorithm header 2020-01-21 12:05:14 +00:00
address-region-unittest.cc [ptr-compr] Re-imlpement BoundedPageAllocator::ReleasePages() 2018-09-28 10:41:06 +00:00
atomic-utils-unittest.cc Reland "[d8] Remove maximum workers limitation" 2019-07-30 07:56:17 +00:00
bits-unittest.cc Fix CountPopulation non-builtin implementation 2020-05-14 14:24:13 +00:00
cpu-unittest.cc [x86] Disable AVX unless the operating system explicitly claims to support it. 2015-01-27 09:59:24 +00:00
division-by-constant-unittest.cc [cleanup] Replace simple typedefs by using 2019-05-27 12:39:49 +00:00
flags-unittest.cc [cleanup] Replace simple typedefs by using 2019-05-27 12:39:49 +00:00
functional-unittest.cc [cleanup] Replace simple typedefs by using 2019-05-27 12:39:49 +00:00
ieee754-unittest.cc [ubsan] Fix various cases of undefined behavior 2019-01-10 13:52:04 +00:00
iterator-unittest.cc Improve iterator_range to take non-&& arguments 2020-01-28 13:03:43 +00:00
logging-unittest.cc [base] Improve logging for long error messages 2020-01-10 15:24:11 +00:00
macros-unittest.cc Account for different interpretations of "trivially copyable" 2018-03-02 15:45:14 +00:00
ostreams-unittest.cc Move utility code to src/utils 2019-05-23 14:13:34 +00:00
region-allocator-unittest.cc [unittests] Randomize RegionAllocatorTests 2020-01-30 11:54:06 +00:00
sys-info-unittest.cc Remove NaCl support. 2016-07-27 07:50:31 +00:00
template-utils-unittest.cc Replace base::make_unique by std::make_unique 2019-09-10 11:21:51 +00:00
threaded-list-unittest.cc Move remaining files in src/ 2019-05-24 18:24:36 +00:00
vlq-base64-unittest.cc Add Base64 VLQ decoding support 2019-07-16 16:16:24 +00:00