Skip to content

Commit 9b372e2

Browse files
author
Sandhya Viswanathan
committedNov 17, 2023
8320206: Some intrinsics/stubs missing vzeroupper on x86_64
Reviewed-by: kvn, jbhateja
1 parent b5a7562 commit 9b372e2

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed
 

‎src/hotspot/cpu/x86/stubGenerator_x86_64_adler.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ address StubGenerator::generate_updateBytesAdler32() {
330330
__ movq(r13, xtmp4);
331331
__ movq(r12, xtmp3);
332332

333+
__ vzeroupper();
333334
__ leave();
334335
__ ret(0);
335336

‎src/hotspot/cpu/x86/stubGenerator_x86_64_chacha.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ address StubGenerator::generate_chacha20Block_avx() {
291291
// registers. That length should be returned through %rax.
292292
__ mov64(rax, outlen);
293293

294+
if (outlen == 256) {
295+
__ vzeroupper();
296+
}
294297
__ leave();
295298
__ ret(0);
296299
return start;
@@ -460,6 +463,7 @@ address StubGenerator::generate_chacha20Block_avx512() {
460463
// and that length should be returned through %rax.
461464
__ mov64(rax, 1024);
462465

466+
__ vzeroupper();
463467
__ leave();
464468
__ ret(0);
465469
return start;

‎src/hotspot/share/opto/library_call.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,7 @@ bool LibraryCallKit::inline_countPositives() {
11121112
Node* ba_start = array_element_address(ba, offset, T_BYTE);
11131113
Node* result = new CountPositivesNode(control(), memory(TypeAryPtr::BYTES), ba_start, len);
11141114
set_result(_gvn.transform(result));
1115+
clear_upper_avx();
11151116
return true;
11161117
}
11171118

@@ -1366,6 +1367,7 @@ bool LibraryCallKit::inline_string_indexOfChar(StrIntrinsicNode::ArgEnc ae) {
13661367
set_control(_gvn.transform(region));
13671368
record_for_igvn(region);
13681369
set_result(_gvn.transform(phi));
1370+
clear_upper_avx();
13691371

13701372
return true;
13711373
}

0 commit comments

Comments
 (0)
Please sign in to comment.