RFR(S): 8214922: Add vectorization support for fmin/fmax

Pengfei Li (Arm Technology China) Pengfei.Li at arm.com
Wed Dec 19 14:53:37 UTC 2018


JBS: https://bugs.openjdk.java.net/browse/JDK-8214922
Webrev: http://cr.openjdk.java.net/~pli/rfr/8214922/webrev.00/

This is the vectorization support of floating-point min/max. Both vector binary operations and reduction operations are added.

For C2 vectorization nodes, I see similar code in project panama (http://hg.openjdk.java.net/panama/dev/). So to reduce duplicate work and help future code merge between jdk/jdk and panama/dev, most of the hotspot shared codes in this patch are copied from panama/dev.

I still made one thing different from panama code. It is that for reduction min/max, scalar operations are transformed only when the number of lanes in the vector is greater than 2. I did this as on some architectures, such as AArch64, there is no reduction min/max for 2 floats or 2 doubles. We can surely add a fallback matching rule in ad file for these cases just like reduce_add2F or reduce_add2D in aarch64.ad. But based on my test[1], the fallback implementations show worse performance than the original scalar version. Please let me know if you agree with this change or not.

[1] http://cr.openjdk.java.net/~pli/rfr/8214922/TestSIMDFpMinMax.java


More information about the hotspot-compiler-dev mailing list