RFR: 8287835: Add support for additional float/double to integral conversion for x86

Vladimir Kozlov kvn at openjdk.java.net
Mon Jun 6 20:36:01 UTC 2022


On Mon, 6 Jun 2022 14:32:43 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:

>> src/hotspot/cpu/x86/x86.ad line 1889:
>> 
>>> 1887:         return false;
>>> 1888:       }
>>> 1889:       if ((bt == T_LONG) && !VM_Version::supports_avx512dq()) {
>> 
>> Again overlapping conditions. So T_LONG requires both: AVX512, avx512vl and avx512dq?
>> 
>> What about T_INT?
>
> T_INT doesn't need AVX512dq. Float to long conversion (T_LONG) uses evcvttps2qq, which needs AVX512dq.

Okay. I see that there are 2 instructions to support F2I by using avx or evex encoding. They cover all cases.
No you are introducing sub_integer and long types only for evex encoding.

You need comment that F2I is supported in all cases. For other integral types you need 512vl  and additionally 512dq for T_LONG.

Note, you don't need to check (UseAVX <= 2) because avx512vl bit is cleaned in such case. It is the same for VectorCastD2X code.

In such case I suggest:


  if (is_subword_type(bt) && !VM_Version::supports_avx512vl() ||
      (bt == T_LONG) && !VM_Version::supports_avx512vldq()) {
    return false;
  }

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

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


More information about the hotspot-compiler-dev mailing list