diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_adler.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_adler.cpp index bb8e8f6b1ea..84f5cc80b0d 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64_adler.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_adler.cpp @@ -330,6 +330,7 @@ address StubGenerator::generate_updateBytesAdler32() { __ movq(r13, xtmp4); __ movq(r12, xtmp3); + __ vzeroupper(); __ leave(); __ ret(0); diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_chacha.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_chacha.cpp index f94297ce82d..47354f4fc7c 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64_chacha.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_chacha.cpp @@ -291,6 +291,9 @@ address StubGenerator::generate_chacha20Block_avx() { // registers. That length should be returned through %rax. __ mov64(rax, outlen); + if (outlen == 256) { + __ vzeroupper(); + } __ leave(); __ ret(0); return start; @@ -460,6 +463,7 @@ address StubGenerator::generate_chacha20Block_avx512() { // and that length should be returned through %rax. __ mov64(rax, 1024); + __ vzeroupper(); __ leave(); __ ret(0); return start; diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp index 62d78580953..6e104f09b9d 100644 --- a/src/hotspot/share/opto/library_call.cpp +++ b/src/hotspot/share/opto/library_call.cpp @@ -1112,6 +1112,7 @@ bool LibraryCallKit::inline_countPositives() { Node* ba_start = array_element_address(ba, offset, T_BYTE); Node* result = new CountPositivesNode(control(), memory(TypeAryPtr::BYTES), ba_start, len); set_result(_gvn.transform(result)); + clear_upper_avx(); return true; } @@ -1366,6 +1367,7 @@ bool LibraryCallKit::inline_string_indexOfChar(StrIntrinsicNode::ArgEnc ae) { set_control(_gvn.transform(region)); record_for_igvn(region); set_result(_gvn.transform(phi)); + clear_upper_avx(); return true; }