RFR: 8318158: RISC-V: implement roundD/roundF intrinsics [v12]
Olga Mikhaltsova
omikhaltcova at openjdk.org
Fri Dec 29 15:37:27 UTC 2023
On Fri, 22 Dec 2023 09:35:08 GMT, Hamlin Li <mli at openjdk.org> wrote:
>> Olga Mikhaltsova has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Moved the code up + comments
>
> For normal cases, I guess `RUP` of riscv will work; but for some corner cases, we need the trick of `+0.5`, am I right?
> But all this information is just mentioned with `some inputs produce incorrect results`, which is unclear for potential readers and maintainers in the future.
> So, in the comments, can you add some information about this corner case, a simple example will definitely help here.
@Hamlin-Li thank you for reviewing! You suggested to write comments similar to aarch64 https://github.com/openjdk/jdk/pull/16382#issuecomment-1866476680. IMHO `java.math.round` doesn't bring any mess but I've just replaced `java.math.round` with `java.lang.Math.round` in order to be more accurate.
Concerning comments about Integer.MIN_VALUE/Integer.MAX_VALUE, I don't think it's worth writing about because:
- none platform contains such comments;
- the other cases should be mentioned as well in this case such as: +/-0, +/-subnormal numbers, signaling/quiet NaN, +/-inf;
- during this review the entire 32-bit range was tested against the current Java implementation and @RealFYang rechecked and confirmed it.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16382#issuecomment-1872172421
More information about the hotspot-dev
mailing list