]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Don't disable SSE in x86-64 ld.so
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 26 Aug 2015 14:55:42 +0000 (07:55 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 26 Aug 2015 14:55:42 +0000 (07:55 -0700)
Since x86-64 ld.so preserves vector registers now, we can use SSE in
x86-64 ld.so.  We should run tst-ld-sse-use.sh only on i386.

* sysdeps/x86/Makefile [$(subdir) == elf] (CFLAGS-.os,
tests-special, $(objpfx)tst-ld-sse-use.out): Moved to ...
* sysdeps/i386/Makefile [$(subdir) == elf] (CFLAGS-.os,
tests-special, $(objpfx)tst-ld-sse-use.out): Here.  Update
comments.
* sysdeps/x86_64/Makefile [$(subdir) == elf] (CFLAGS-.os): Add
-mno-mmx for $(all-rtld-routines).
* sysdeps/x86/tst-ld-sse-use.sh: Moved to ...
* sysdeps/i386/tst-ld-sse-use.sh: Here.  Replace x86-64 with
i386.

ChangeLog
sysdeps/i386/Makefile
sysdeps/i386/tst-ld-sse-use.sh [moved from sysdeps/x86/tst-ld-sse-use.sh with 97% similarity]
sysdeps/x86/Makefile
sysdeps/x86_64/Makefile

index 72255512a573cf87907862edc3663444ee42f501..478a00965799d7f9c611338b7c99cc08d8dc367c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2015-08-26  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * sysdeps/x86/Makefile [$(subdir) == elf] (CFLAGS-.os,
+       tests-special, $(objpfx)tst-ld-sse-use.out): Moved to ...
+       * sysdeps/i386/Makefile [$(subdir) == elf] (CFLAGS-.os,
+       tests-special, $(objpfx)tst-ld-sse-use.out): Here.  Update
+       comments.
+       * sysdeps/x86_64/Makefile [$(subdir) == elf] (CFLAGS-.os): Add
+       -mno-mmx for $(all-rtld-routines).
+       * sysdeps/x86/tst-ld-sse-use.sh: Moved to ...
+       * sysdeps/i386/tst-ld-sse-use.sh: Here.  Replace x86-64 with
+       i386.
+
 2015-08-26  Stefan Liebler  <stli@linux.vnet.ibm.com>
 
        * sysdeps/generic/unwind.h
index 717d8e74544ca654a24edff121805e5a895a0c27..168512fc327e85b248fb037211e4617f3e0fd5a7 100644 (file)
@@ -83,3 +83,17 @@ endif
 ifeq ($(subdir),csu)
 gen-as-const-headers += tlsdesc.sym
 endif
+
+ifeq ($(subdir),elf)
+# Make sure no code in ld.so uses mm/xmm/ymm/zmm registers on i386 since
+# the first 3 mm/xmm/ymm/zmm registers are used to pass vector parameters
+# which must be preserved.
+CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
+                  -mno-sse -mno-mmx)
+
+tests-special += $(objpfx)tst-ld-sse-use.out
+$(objpfx)tst-ld-sse-use.out: ../sysdeps/i386/tst-ld-sse-use.sh $(objpfx)ld.so
+       @echo "Checking ld.so for SSE register use.  This will take a few seconds..."
+       $(BASH) $< $(objpfx) '$(NM)' '$(OBJDUMP)' '$(READELF)' > $@; \
+       $(evaluate-test)
+endif
similarity index 97%
rename from sysdeps/x86/tst-ld-sse-use.sh
rename to sysdeps/i386/tst-ld-sse-use.sh
index 839de18546dce6035361c00a1e7e996a184a96c3..85a06510b992bc7e5d2d9d1ba079eb6eb5a28bcc 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/bash
-# Make sure no code in ld.so uses xmm/ymm/zmm registers on x86-64.
+# Make sure no code in ld.so uses xmm/ymm/zmm registers on i386.
 # Copyright (C) 2009-2015 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
index c262fdf487739fede7dcf640f413828cbdf30d3b..0de4f42168c0d3b601aebfe27dfd9d30df514bd7 100644 (file)
@@ -1,14 +1,3 @@
-ifeq ($(subdir),elf)
-CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
-                  -mno-sse -mno-mmx)
-
-tests-special += $(objpfx)tst-ld-sse-use.out
-$(objpfx)tst-ld-sse-use.out: ../sysdeps/x86/tst-ld-sse-use.sh $(objpfx)ld.so
-       @echo "Checking ld.so for SSE register use.  This will take a few seconds..."
-       $(BASH) $< $(objpfx) '$(NM)' '$(OBJDUMP)' '$(READELF)' > $@; \
-       $(evaluate-test)
-endif
-
 ifeq ($(subdir),csu)
 gen-as-const-headers += cpu-features-offsets.sym rtld-global-offsets.sym
 endif
index e50bcadf5102ecb425d49e362976c7283c276329..6c283187a863e8fda9e1bc60572a74ab95a38eb0 100644 (file)
@@ -19,6 +19,10 @@ gen-as-const-headers += locale-defines.sym
 endif
 
 ifeq ($(subdir),elf)
+# There is no good reason to use MMX in x86-64 ld.so with GCC.
+CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
+                  -mno-mmx)
+
 sysdep-dl-routines += tlsdesc dl-tlsdesc
 
 tests += ifuncmain8