RFR: 8291649: multiple tests failing with -Xcomp after JDK-8290034
Kim Barrett
kbarrett at openjdk.org
Thu Aug 25 01:09:34 UTC 2022
On Thu, 25 Aug 2022 00:54:29 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> src/hotspot/share/utilities/moveBits.hpp line 31:
>>
>>> 29: #include "utilities/globalDefinitions.hpp"
>>> 30:
>>> 31: inline uint64_t bit_reverse(uint64_t x) {
>>
>> It's probably worth having comments referring to the corresponding Hacker's Delight sections for both of these functions.
>
>> It's probably worth having comments referring to the corresponding Hacker's Delight sections for both of these functions.
>
> Hm, except this *isn't* the Hacker's Delight algorithm (which is the same as the seander bithacks algorithm). Is there a reference for this algorithm? I'd prefer something "well known" to something whose correctness I need to think hard about. I'm not spotting anything wrong here (though I think there should be more parenthesis so I don't need to think about the precedence between shift operators and bitwise-or), but @vnkozlov is reporting failures with these changes.
On further consideration, I don't care whether this code is correct. It should be replaced with the Hacker's Delight algorithm, which is simply better because it uses half as many large constants (which can be expensive to form on some platforms).
-------------
PR: https://git.openjdk.org/jdk/pull/9987
More information about the hotspot-compiler-dev
mailing list