RFR: 8297539: Use PrimitiveConversions::cast for local uses of the int<->float union conversion trick

Coleen Phillimore coleenp at openjdk.org
Mon Mar 27 14:20:42 UTC 2023


On Wed, 22 Mar 2023 10:59:18 GMT, Afshin Zafari <duke at openjdk.org> wrote:

> **Only** the instances of using `union` for converting `int` to `float` are replaced with call to `PrimitiveConversions::cast<To>(From)` method. Some few cases with conversion of `long` <->`double` are also replaced with `PrimitiveConversions::cast<To>(From)`. The other instances where the union contains other types of fields than `int` and `float` are left unchanged.
> 
> ### Test
> local hotspot:tier1
> mach5 tiers 1-5

Looks good.  There are a couple of minor include file ordering things to fix.

src/hotspot/cpu/aarch64/assembler_aarch64.cpp line 30:

> 28: #include "asm/macroAssembler.hpp"
> 29: #include "compiler/disassembler.hpp"
> 30: #include "metaprogramming/primitiveConversions.hpp"

This needs to be after immediate_aarch64.hpp (alphabetical order).

src/hotspot/cpu/aarch64/immediate_aarch64.cpp line 30:

> 28: 
> 29: #include "precompiled.hpp"
> 30: #include "metaprogramming/primitiveConversions.hpp"

pre-existing, immediate_aarch64.hpp should be above this include.

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

Marked as reviewed by coleenp (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/13136#pullrequestreview-1359155332
PR Review Comment: https://git.openjdk.org/jdk/pull/13136#discussion_r1149314837
PR Review Comment: https://git.openjdk.org/jdk/pull/13136#discussion_r1149315717


More information about the hotspot-dev mailing list