diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp index c3c2a59cf9a..05b55348658 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp @@ -2760,26 +2760,38 @@ address StubGenerator::generate_updateBytesCRC32C(bool is_pclmulqdq_supported) { BLOCK_COMMENT("Entry:"); __ enter(); // required for proper stackwalking of RuntimeStub frame + Label L_continue; + if (VM_Version::supports_sse4_1() && VM_Version::supports_avx512_vpclmulqdq() && VM_Version::supports_avx512bw() && VM_Version::supports_avx512vl()) { + Label L_doSmall; + + __ cmpl(len, 384); + __ jcc(Assembler::lessEqual, L_doSmall); + __ lea(j, ExternalAddress(StubRoutines::x86::crc32c_table_avx512_addr())); __ kernel_crc32_avx512(crc, buf, len, j, l, k); - } else { -#ifdef _WIN64 - __ push(y); - __ push(z); -#endif - __ crc32c_ipl_alg2_alt2(crc, buf, len, - a, j, k, - l, y, z, - c_farg0, c_farg1, c_farg2, - is_pclmulqdq_supported); -#ifdef _WIN64 - __ pop(z); - __ pop(y); -#endif + + __ jmp(L_continue); + + __ bind(L_doSmall); } +#ifdef _WIN64 + __ push(y); + __ push(z); +#endif + __ crc32c_ipl_alg2_alt2(crc, buf, len, + a, j, k, + l, y, z, + c_farg0, c_farg1, c_farg2, + is_pclmulqdq_supported); +#ifdef _WIN64 + __ pop(z); + __ pop(y); +#endif + + __ bind(L_continue); __ movl(rax, crc); __ vzeroupper(); __ leave(); // required for proper stackwalking of RuntimeStub frame