[15] RFR (M): 8239008: C2: Simplify Replicate support for sub-word types on x86

Vladimir Kozlov vladimir.kozlov at oracle.com
Fri Feb 14 18:42:47 UTC 2020


  instruct ReplB_mem(vec dst, memory mem) %{

Original assert was checking for AVX >2 which is avx512 you replaced it with avx ==2 predicate. As I 
understand in avx2 vpbroadcastb can replicate only upto 256 bits.

I did not look for the rest of code. But it seems avx operated only upto 256 in general.

I would like to see test compiler/codegen/Test*Vect.java which verify these instructions in 
different CPU configurations.

Thanks,
Vladimir

On 2/13/20 7:55 AM, Vladimir Ivanov wrote:
> http://cr.openjdk.java.net/~vlivanov/8239008/webrev.00/
> https://bugs.openjdk.java.net/browse/JDK-8239008
> 
> Simplify Replicate support for sub-word types on x86 based on the following observations:
>    * 512-bit vectors of sub-word element types are supported only on AVX512BW-capable hardware [1];
>    * VBROADCASTS[SD]/VPBROADCAST[BWDQ] are available since AVX/AVX2.
> 
> Also, fixed asserts in VBROADCASTS[SD] according to the manual:
>    * reg-to-reg variants are part of AVX2 (while mem-to-reg are introduced in AVX);
>    * VBROADCASTSD doesn't have 128-bit variant.
> 
> Testing: hs-precheckin-comp,hs-tier1,hs-tier2
> 
> Thanks!
> 
> Best regards,
> Vladimir Ivanov
> 
> [1] http://hg.openjdk.java.net/jdk/jdk/file/tip/src/hotspot/cpu/x86/x86.ad#l1524
> 
> const int Matcher::vector_width_in_bytes(BasicType bt) {
> ...
>    if (UseAVX > 2 && (bt == T_BYTE || bt == T_SHORT || bt == T_CHAR))
>      size = (VM_Version::supports_avx512bw()) ? 64 : 32;


More information about the hotspot-compiler-dev mailing list