RFR: 8311847: Fix -Wconversion for assembler.hpp emit_int8,16 callers

Coleen Phillimore coleenp at openjdk.org
Tue Jul 11 12:19:13 UTC 2023


On Tue, 11 Jul 2023 02:56:01 GMT, Dean Long <dlong at openjdk.org> wrote:

>> src/hotspot/share/asm/assembler.hpp line 328:
>> 
>>> 326:                                                                                                  narrow_cast<uint8_t>(x2),
>>> 327:                                                                                                  narrow_cast<uint8_t>(x3),
>>> 328:                                                                                                  narrow_cast<uint8_t>(x4)); }
>> 
>> I'd rather add new alternative entry points for "int", so the existing callers using uint8_t don't need to perform unnecessary widening and narrowing.
>> Instead of narrow_cast<uint8_t>(x), how about (uint8_t)checked_cast<int8_t>(x)?
>
> How many callers are passing in negative values and actually need these convenience functions?

The overloading was really unhappy with the version of the functions that pass uint8_t for all the arguments.  The callers might pass a couple uint8_t but then also a random selection of int and for one or more of the other parameters.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14822#discussion_r1259648687


More information about the hotspot-compiler-dev mailing list