RFR: 8360558: Use hex literals instead of decimal literals in math intrinsic constants

Mohamed Issa missa at openjdk.org
Tue Sep 30 21:51:58 UTC 2025


On Tue, 30 Sep 2025 21:14:19 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> src/hotspot/cpu/x86/stubGenerator_x86_64_cbrt.cpp line 52:
>> 
>>> 50: ATTRIBUTE_ALIGNED(16) static const juint _ABS_MASK[] =
>>> 51: {
>>> 52:     4294967295, 2147483647, 0, 0
>> 
>> The "L" suffix means different things for Windows (MSVC) and gcc/clang and, like the `long`
>> type, should rarely (perhaps never?) be used in HotSpot code.  `long` is a 32bit type on Windows
>> and 32bit gcc/clang platforms, and a 64bit type on 64bit gcc/clang platforms. (Or something like
>> that. I'm not sure what happens when building for windows with gcc/clang, which isn't a
>> supported configuration anyway.)
>
> I was surprised to discover that the "L" suffix is used quite a lot. I think those are likely often mistakes.

So, we could have just used "U" suffix to guarantee 32-bit unsigned integer types because 32-bit platforms are no longer supported in OpenJDK?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27497#discussion_r2392906451


More information about the hotspot-compiler-dev mailing list