RFR: 8285868: x86_64 intrinsics for floating point methods isNaN, isFinite and isInfinite [v4]
Quan Anh Mai
duke at openjdk.java.net
Wed May 18 07:03:58 UTC 2022
On Wed, 18 May 2022 06:34:34 GMT, Srinivas Vamsi Parasa <duke at openjdk.java.net> wrote:
>> Actually `setb` only writes the byte portion and leaves the remaining of the register intact, so it would be wrong without clearing the register beforehand.
>
> `setb` is producing the correct results and also adding the `xor dst, dst` didn't give any performance improvement. Is it still necessary?
@vamsi-parasa Other boolean producers such as `Conv2B` or `VectorTest` widen the byte value to 32 bit after `setb` so I believe a zeroing is necessary here. You accidentally achieve correct results in tests because the boolean stores only read the least significant 8 bits of the `dst` registers. Other operations such as `test` will read full `int` and may lead to incorrect results.
@jatin-bhateja Boolean is just dressed-up int except in stores so most readers will consume 32 bits of the register.
Thanks.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8459
More information about the hotspot-compiler-dev
mailing list