RFR: 8311847: Fix -Wconversion for assembler.hpp emit_int8,16 callers
Andrew Haley
aph at openjdk.org
Tue Jul 11 13:55:12 UTC 2023
On Tue, 11 Jul 2023 12:45:02 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> val comes in signed, so we want to just chop off the sign. checked_cast<unsigned>(signed val) will assert. checked_cast<> doesn't do sign conversion. We don't have a cast that does sign conversion.
>
> Not sure I trust this either. I'm going to write a gtest for this.
We already have a hard guarantee that this signed value fits in the signed field. There's no need for any more asserting for that: just chop it off.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14822#discussion_r1259768367
More information about the hotspot-dev
mailing list