[arm64] Optimize counting set half-words
The {CountClearHalfWords} method is called whenever loading a constant into a register. It showed up with >0.5% in Liftoff compilation profiles. This CL refactors the method to return the number of *set* halfwords instead of *cleared* halfwords and avoids the loop in the implementation. This makes the method roughly twice as fast, and makes the code more readable. R=zhin@chromium.org Bug: v8:11879 Change-Id: I7da8160b3c045e5fc1e97fc0e575083b3920cb5b Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3151962Reviewed-by: Zhi An Ng <zhin@chromium.org> Commit-Queue: Clemens Backes <clemensb@chromium.org> Cr-Commit-Position: refs/heads/main@{#76771}
Showing
Please
register
or
sign in
to comment