RFR: 8285868: x86_64 intrinsics for floating point methods isNaN, isFinite and isInfinite [v4]

Jatin Bhateja jbhateja at openjdk.java.net
Wed May 18 19:23:57 UTC 2022


On Wed, 18 May 2022 07:44:25 GMT, Srinivas Vamsi Parasa <duke at openjdk.java.net> wrote:

>> @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.
>
> @merykitty You might be right. `setb` was causing a wierd jdk build error in `java.lang.HashMap` due to to error in `isNaN()`. It got fixed by clearing the higher bytes of `dst` register which is being set by `setb`.

> @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.

For explicit widening from byte to int compiler will emit an explicit zero extension instruction (movzbl).  There will not be any case where byte will be directly read along with unmodified bits  a consumer.

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

PR: https://git.openjdk.java.net/jdk/pull/8459


More information about the hotspot-compiler-dev mailing list