-
Omer Katz authored
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/+/2199345Reviewed-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}
cc6dfd5d