RFR: 8297539: Consolidate the uses of the int<->float union conversion trick [v2]

Afshin Zafari duke at openjdk.org
Mon Feb 6 10:32:51 UTC 2023


On Thu, 2 Feb 2023 22:27:33 GMT, Justin King <jcking at openjdk.org> wrote:

>> src/hotspot/share/utilities/globalDefinitions.hpp line 28:
>> 
>>> 26: #define SHARE_UTILITIES_GLOBALDEFINITIONS_HPP
>>> 27: 
>>> 28: #include "metaprogramming/primitiveConversions.hpp"
>> 
>> I think this should not be done, for the same reasons as not including the suggested bit_cast
>> (https://git.openjdk.org/jdk/pull/11865).  There is substantial overlap between this proposed
>> change and that one, though I think the bit_cast proposal is more problematic.
>> 
>> Rather than adding a new dependency here, separate out the code that uses the conversions
>> into new files and update the (much smaller number than use globalDefinitions.hpp) users
>> of those functions to include the new headers.
>
> I previously updated the bit_cast PR to just be `PrimitiveConversions::cast` implementation, but using __builtin_bit_cast when available. So this and that are basically the same.

Dependencies to `globalDefinitions` and `primitiveCopnversions` are broken down to smaller header files and all the dependencies in other headers are addressed correspondingly.

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

PR: https://git.openjdk.org/jdk/pull/12384


More information about the hotspot-dev mailing list