RFR(S) 8192846: Extend cmov vectorization to work for float

Vladimir Kozlov vladimir.kozlov at oracle.com
Thu Nov 30 23:45:51 UTC 2017


Thank you, Razvan

I have one question: why you removed _do_vector_loop checks in superword.cpp?

Also I think it is late for jdk 10. I will test and push when jdk 10 is forked.

Thanks,
Vladimir

On 11/30/17 1:48 PM, Lupusoru, Razvan A wrote:
> Hi all,
> 
> This submission is to the issue noted in JDK-8192846  - namely that vectorized cmov for floats is 
> not supported.
> 
> This patch rectifies the situation so that when scalar Cmov for float and double is generated (or 
> forced generated by passing -XX:+UseCMoveUnconditionally), it stands a chance for Vectorization 
> using existing functionality previously enabled for doubles. The following code pattern will get 
> vectorized with patch above:
> 
> private void cmove_kernel_float(float[] in1, float[] in2, int length, float[] out) {
> 
>    for (int i = 0; i < length; i++) {
> 
>      out[i] = (in1[i] > in2[i]) ? in1[i] : in2[i];
> 
>    }
> 
> }
> 
> Instructions generated for loop are:
> 
>    vmovdqu 0x10(%rcx,%r10,4),%ymm0
> 
>    vmovdqu 0x10(%rdx,%r10,4),%ymm1
> 
>    vcmpleps %ymm0,%ymm1,%ymm2
> 
>    vblendvps %ymm2,%ymm0,%ymm1,%ymm2
> 
>    vmovdqu %ymm2,0x10(%r9,%r10,4)
> 
> The patch is available for review here:
> 
> http://cr.openjdk.java.net/~rlupusoru/jdk_hs/webrev_cmovevf_00/
> 
> Jtreg testing with compiler tests has successfully passed. Thanks for review!
> 
> --Razvan
> 


More information about the hotspot-compiler-dev mailing list