Add VZEROUPPER to memset-vec-unaligned-erms.S [BZ #21081]

Since memset-vec-unaligned-erms.S has VDUP_TO_VEC0_AND_SET_RETURN at
function entry, memset optimized for AVX2 and AVX512 will always use
ymm/zmm register. VZEROUPPER should be placed before ret in

L(stosb):
        movq    %rdx, %rcx
        movzbl  %sil, %eax
        movq    %rdi, %rdx
        rep stosb
        movq    %rdx, %rax
        ret

since it can be reached from

L(stosb_more_2x_vec):
        cmpq    $REP_STOSB_THRESHOLD, %rdx
        ja      L(stosb)

	[BZ #21081]
	* sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S
	(L(stosb)): Add VZEROUPPER before ret.
This commit is contained in:
H.J. Lu 2017-01-30 10:59:15 -08:00
parent f8bf15febc
commit 02b78ff749
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2017-01-30 H.J. Lu <hongjiu.lu@intel.com>
[BZ #21081]
* sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S
(L(stosb)): Add VZEROUPPER before ret.
2016-01-28 Carlos O'Donell <carlos@redhat.com>
Alexey Makhalov <amakhalov@vmware.com>
Florian Weimer <fweimer@redhat.com>

View File

@ -110,6 +110,8 @@ ENTRY (__memset_erms)
ENTRY (MEMSET_SYMBOL (__memset, erms))
# endif
L(stosb):
/* Issue vzeroupper before rep stosb. */
VZEROUPPER
movq %rdx, %rcx
movzbl %sil, %eax
movq %rdi, %rdx