]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add VZEROUPPER to memset-vec-unaligned-erms.S [BZ #21081]
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 30 Jan 2017 18:59:15 +0000 (10:59 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 24 Feb 2017 17:46:15 +0000 (09:46 -0800)
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.

(cherry picked from commit 02b78ff749f0c88771713368dbb2a09b1979814f)

ChangeLog
sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S

index a9b7540017d7bd124f2d8088153f8d7b7a0a7a66..1b7d40adc068589c16c57a336bec3b21774f3ff4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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-11-28  H.J. Lu  <hongjiu.lu@intel.com>
 
        [BZ #20750]
index 28e71fd57681a13bb82cdeb871136f08d6818f04..acf448c9a66dcaf0785da97d0460907dca60405e 100644 (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