RFR: 8252847: New AVX512 optimized stubs for both conjoint and disjoint arraycopy

Nils Eliasson neliasso at openjdk.java.net
Tue Sep 15 13:18:30 UTC 2020


On Mon, 7 Sep 2020 14:28:18 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

> Summary:
> 
> 1)  New AVX3 optimized stubs for both conjoint and disjoint arraycopy.
> 2)  Special instruction sequence blocks for copy sizes b/w 32-192 bytes.
> 3)  Block copy operation above 192 bytes is performed using destination address aligned PRE-MAIN-POST loop. Main loop
> copies 192 byte in one iteration and tail part fall over special instruction sequence blocks. 4)  Both small copy block
> and aligned loop use 32 byte vector register to prevent and frequency penalty for copy sizes less than AVX3Threshold.
> 5)  For block size above AVX3Theshold both special blocks and loop operate using 64 byte register. 6)  In case user
> sets the maximum vector size to 32 bytes, forward copy (disjoint) operations are done using efficient REP MOVS for copy
> sizes above 4096 bytes.  JMH Results:
>   System     :  CascadeLake Server, Intel(R) Xeon(R) Platinum 8280L CPU @ 2.70GHz
>   Micros     :  test/micro/org/openjdk/bench/java/lang/ArrayCopy*.java
>   Baseline   :  [http://cr.openjdk.java.net/~jbhateja/8252847/JMH_results/ArrayCopy_AVX3_Stubs_Baseline.txt]()
>   WithOpt  :  [http://cr.openjdk.java.net/~jbhateja/8252847/JMH_results/ArrayCopy_AVX3_Stubs_WithOpts.txt]()

Changes requested by neliasso (Reviewer).

src/hotspot/cpu/x86/macroAssembler_x86.cpp line 7972:

> 7970:   assert(MaxVectorSize >= 32, "vector length < 32");
> 7971:   use64byteVector |= MaxVectorSize > 32 && AVX3Threshold == 0;
> 7972:   if (use64byteVector == false) {

Change to "!use64byteVector"

src/hotspot/cpu/x86/macroAssembler_x86.cpp line 8012:

> 8010:   assert(MaxVectorSize == 64 || MaxVectorSize == 32, "vector length mismatch");
> 8011:   use64byteVector |= MaxVectorSize > 32 && AVX3Threshold == 0;
> 8012:   if (use64byteVector == false) {

Change to "!use64byteVector"

src/hotspot/cpu/x86/macroAssembler_x86.cpp line 8026:

> 8024:   assert(MaxVectorSize == 64 || MaxVectorSize == 32, "vector length mismatch");
> 8025:   use64byteVector |= MaxVectorSize > 32 && AVX3Threshold == 0;
> 8026:   if (use64byteVector == false) {

Change to "!use64byteVector"

src/hotspot/cpu/x86/vm_version_x86.cpp line 1167:

> 1165:
> 1166:   if (!FLAG_IS_DEFAULT(AVX3Threshold)) {
> 1167:     if (AVX3Threshold !=0 && !is_power_of_2(AVX3Threshold)) {

Missing space before '0'

src/hotspot/cpu/x86/macroAssembler_x86.cpp line 7970:

> 7968:                                        KRegister mask, Register length, Register temp,
> 7969:                                        BasicType type, int offset, bool use64byteVector) {
> 7970:   assert(MaxVectorSize >= 32, "vector length < 32");

Why does "MaxVectorSize >= 32" imply that "vector length < 32"?

This assert appears in multiple locations.

src/hotspot/cpu/x86/macroAssembler_x86.cpp line 7971:

> 7969:                                        BasicType type, int offset, bool use64byteVector) {
> 7970:   assert(MaxVectorSize >= 32, "vector length < 32");
> 7971:   use64byteVector |= MaxVectorSize > 32 && AVX3Threshold == 0;

When do you expect AVX3Threshold to be 0?

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

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


More information about the hotspot-compiler-dev mailing list