Skip to content

Commit

Permalink
Adding VZEROUPPER to avoid potential AVX<->SSE transitions.
Browse files Browse the repository at this point in the history
Change-Id: I6a23998f59086549957dc056fd2a42c273c8e78b
  • Loading branch information
mdcornu committed Mar 20, 2018
1 parent 83cfcbf commit e1c591d
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion avx2/mb_mgr_hmac_flush_avx2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ end_loop:
mov [p + 2*4], DWORD(tmp3)

return:

vzeroupper
mov rbp, [rsp + _gpr_save + 8*0]
mov r12, [rsp + _gpr_save + 8*1]
mov r13, [rsp + _gpr_save + 8*2]
Expand Down
1 change: 1 addition & 0 deletions avx2/mb_mgr_hmac_md5_flush_avx2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ end_loop:

return:
DBGPRINTL "---------- exit md5 flush -----------"
vzeroupper

mov rbx, [rsp + _gpr_save + 8*0]
mov rbp, [rsp + _gpr_save + 8*1]
Expand Down
3 changes: 2 additions & 1 deletion avx2/mb_mgr_hmac_md5_submit_avx2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,9 @@ end_loop:
mov [p + 1*4], DWORD(tmp2)
mov [p + 2*4], DWORD(tmp3)

vzeroupper
return:
DBGPRINTL "---------- exit md5 submit -----------"
DBGPRINTL "---------- exit md5 submit -----------"

mov rbx, [rsp + _gpr_save + 8*0]
mov rbp, [rsp + _gpr_save + 8*1]
Expand Down
1 change: 1 addition & 0 deletions avx2/mb_mgr_hmac_sha_256_flush_avx2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ end_loop:
%endif

return:
vzeroupper

mov rbx, [rsp + _gpr_save + 8*0]
mov rbp, [rsp + _gpr_save + 8*1]
Expand Down
2 changes: 1 addition & 1 deletion avx2/mb_mgr_hmac_sha_256_submit_avx2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ end_loop:
%else
mov [p + 3*4], DWORD(tmp4)
%endif
vzeroupper
return:

mov rbx, [rsp + _gpr_save + 8*0]
mov rbp, [rsp + _gpr_save + 8*1]
mov r12, [rsp + _gpr_save + 8*2]
Expand Down
1 change: 1 addition & 0 deletions avx2/mb_mgr_hmac_sha_512_flush_avx2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ end_loop:
%endif

return:
vzeroupper

mov rbx, [rsp + _gpr_save + 8*0]
mov rbp, [rsp + _gpr_save + 8*1]
Expand Down
2 changes: 1 addition & 1 deletion avx2/mb_mgr_hmac_sha_512_submit_avx2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ end_loop:
mov [p + 3*8], QWORD(tmp4)
%endif

vzeroupper
return:

mov rbx, [rsp + _gpr_save + 8*0]
mov rbp, [rsp + _gpr_save + 8*1]
mov r12, [rsp + _gpr_save + 8*2]
Expand Down
4 changes: 2 additions & 2 deletions avx2/mb_mgr_hmac_submit_avx2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,9 @@ end_loop:
mov [p + 0*SHA1_DIGEST_WORD_SIZE], DWORD(tmp)
mov [p + 1*SHA1_DIGEST_WORD_SIZE], DWORD(tmp2)
mov [p + 2*SHA1_DIGEST_WORD_SIZE], DWORD(tmp3)
DBGPRINTL "---------- exit sha1 submit -----------"
vzeroupper
return:

DBGPRINTL "---------- exit sha1 submit -----------"
mov rbp, [rsp + _gpr_save + 8*0]
mov r12, [rsp + _gpr_save + 8*1]
mov r13, [rsp + _gpr_save + 8*2]
Expand Down
2 changes: 2 additions & 0 deletions avx512/mb_mgr_des_avx512.asm
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ extern des3_x16_cbc_dec_avx512
mov rax, [STATE + _des_job_in_lane + MIN_IDX*8]
mov qword [STATE + _des_job_in_lane + MIN_IDX*8], 0
or dword [rax + _status], STS_COMPLETED_AES
vzeroupper
%%_des_submit_return:
%endmacro

Expand Down Expand Up @@ -386,6 +387,7 @@ extern des3_x16_cbc_dec_avx512
;; - clear job pointer
mov qword [STATE + _des_job_in_lane + MIN_IDX*8], 0
%%_des_flush_return:
vzeroupper
%endmacro

;;; ========================================================
Expand Down
1 change: 1 addition & 0 deletions avx512/mb_mgr_hmac_flush_avx512.asm
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ end_loop:

return:
DBGPRINTL "---------- exit hmac flush avx512 -----------"
vzeroupper

mov rbp, [rsp + _gpr_save + 8*0]
mov r12, [rsp + _gpr_save + 8*1]
Expand Down
1 change: 1 addition & 0 deletions avx512/mb_mgr_hmac_sha_256_flush_avx512.asm
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ end_loop:
%endif

return:
vzeroupper

mov rbx, [rsp + _gpr_save + 8*0]
mov rbp, [rsp + _gpr_save + 8*1]
Expand Down
2 changes: 1 addition & 1 deletion avx512/mb_mgr_hmac_sha_256_submit_avx512.asm
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ end_loop:
%else
mov [p + 3*4], DWORD(tmp4)
%endif
vzeroupper
return:

mov rbx, [rsp + _gpr_save + 8*0]
mov rbp, [rsp + _gpr_save + 8*1]
mov r12, [rsp + _gpr_save + 8*2]
Expand Down
1 change: 1 addition & 0 deletions avx512/mb_mgr_hmac_sha_512_flush_avx512.asm
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ end_loop:
%endif

return:
vzeroupper

mov rbx, [rsp + _gpr_save + 8*0]
mov rbp, [rsp + _gpr_save + 8*1]
Expand Down
2 changes: 1 addition & 1 deletion avx512/mb_mgr_hmac_sha_512_submit_avx512.asm
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ end_loop:
%if (SHA_X_DIGEST_SIZE != 384)
mov [p + 3*8], QWORD(tmp4)
%endif

vzeroupper
return:
mov rbx, [rsp + _gpr_save + 8*0]
mov rbp, [rsp + _gpr_save + 8*1]
Expand Down
4 changes: 2 additions & 2 deletions avx512/mb_mgr_hmac_submit_avx512.asm
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ end_loop:
mov [p + 1*SHA1_DIGEST_WORD_SIZE], DWORD(tmp2)
mov [p + 2*SHA1_DIGEST_WORD_SIZE], DWORD(tmp3)

DBGPRINTL "---------- exit sha1 submit -----------"
vzeroupper
return:

DBGPRINTL "---------- exit sha1 submit -----------"
mov rbp, [rsp + _gpr_save + 8*0]
mov r12, [rsp + _gpr_save + 8*1]
mov r13, [rsp + _gpr_save + 8*2]
Expand Down

0 comments on commit e1c591d

Please sign in to comment.