diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_poly_mont.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_poly_mont.cpp index a897fe2e6942d..d142414be5ec2 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64_poly_mont.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_poly_mont.cpp @@ -564,7 +564,16 @@ address StubGenerator::generate_intpoly_montgomeryMult_P256() { address start = __ pc(); __ enter(); - if (EnableX86ECoreOpts && UseAVX > 1) { + if (VM_Version::supports_avx512ifma() && VM_Version::supports_avx512vlbw()) { + // Register Map + const Register aLimbs = c_rarg0; // rdi | rcx + const Register bLimbs = c_rarg1; // rsi | rdx + const Register rLimbs = c_rarg2; // rdx | r8 + const Register tmp = r9; + + montgomeryMultiply(aLimbs, bLimbs, rLimbs, tmp, _masm); + } else { + assert(VM_Version::supports_avxifma(), "Require AVX_IFMA support"); __ push(r12); __ push(r13); __ push(r14); @@ -607,14 +616,6 @@ address StubGenerator::generate_intpoly_montgomeryMult_P256() { __ pop(r14); __ pop(r13); __ pop(r12); - } else { - // Register Map - const Register aLimbs = c_rarg0; // rdi | rcx - const Register bLimbs = c_rarg1; // rsi | rdx - const Register rLimbs = c_rarg2; // rdx | r8 - const Register tmp = r9; - - montgomeryMultiply(aLimbs, bLimbs, rLimbs, tmp, _masm); } __ leave();