From patchwork Tue Aug 25 21:30:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 510633 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id ADC9E1401F0 for ; Wed, 26 Aug 2015 07:30:24 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=FE4sMK7G; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; q=dns; s=default; b= Xdh0bTlrSZjH4EKdIATOw20UbF9cpxAGtxOd1oeVLji0oM67nk1xM6OEU8wiTSO2 gqjrYPyriJuVkQhpf8n70IBY28gVLK/nZHzfOQLeOi+2KBvaE5tlu1YIhxBl2ZuJ s/luJX+zHq9xj4eQFXii05CGH9L7p6cnWlKYkEyxGhY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; s=default; bh=qzW2Q JXFA/TJA4smJDeE3/gBJIM=; b=FE4sMK7GF+QqADXXtTPk35IngNFFW1VlWV6su G5YNKvFe5fVKPywkvU9+S4BTYxmo/MKZXjbEJv4DPSHUq0O/5JhAvIk1Dctrk1An fk/ASyycFb4Hx4VMIv8otbbn89ZJ1gnVeQgHBBsu5gJSB2C6h7zUqVbqueOMOd1u Ft0a2Y= Received: (qmail 88794 invoked by alias); 25 Aug 2015 21:30:15 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 88705 invoked by uid 89); 25 Aug 2015 21:30:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f54.google.com MIME-Version: 1.0 X-Received: by 10.202.71.10 with SMTP id u10mr27641975oia.108.1440538200995; Tue, 25 Aug 2015 14:30:00 -0700 (PDT) In-Reply-To: <20150825210854.AF8382C3A94@topped-with-meat.com> References: <20150825122223.GA1588@gmail.com> <20150825183521.2898C2C3A73@topped-with-meat.com> <20150825210854.AF8382C3A94@topped-with-meat.com> Date: Tue, 25 Aug 2015 14:30:00 -0700 Message-ID: Subject: Re: [PATCH 2/7] Don't disable SSE in x86-64 ld.so From: "H.J. Lu" To: Roland McGrath Cc: GNU C Library On Tue, Aug 25, 2015 at 2:08 PM, Roland McGrath wrote: > I meant comments in sysdeps/i386/Makefile. Here is the updated patch. OK for master? From 92ca9e8d613f9f891e12e3e59d7e9a5855cb129c Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 28 Jul 2015 18:56:18 -0700 Subject: [PATCH] Don't disable SSE in x86-64 ld.so 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. --- sysdeps/i386/Makefile | 14 ++++++++++++++ sysdeps/{x86 => i386}/tst-ld-sse-use.sh | 2 +- sysdeps/x86/Makefile | 11 ----------- sysdeps/x86_64/Makefile | 3 +++ 4 files changed, 18 insertions(+), 12 deletions(-) rename sysdeps/{x86 => i386}/tst-ld-sse-use.sh (97%) diff --git a/sysdeps/i386/Makefile b/sysdeps/i386/Makefile index 717d8e7..4f83c82 100644 --- a/sysdeps/i386/Makefile +++ b/sysdeps/i386/Makefile @@ -83,3 +83,17 @@ endif ifeq ($(subdir),csu) gen-as-const-headers += tlsdesc.sym endif + +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 +# Make sure no code in ld.so uses xmm/ymm/zmm registers on i386 since +# the first 3 xmm/ymm/zmm registers are used to pass vector parameters +# which must be preserved. +$(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 diff --git a/sysdeps/x86/tst-ld-sse-use.sh b/sysdeps/i386/tst-ld-sse-use.sh similarity index 97% rename from sysdeps/x86/tst-ld-sse-use.sh rename to sysdeps/i386/tst-ld-sse-use.sh index 839de18..85a0651 100755 --- a/sysdeps/x86/tst-ld-sse-use.sh +++ b/sysdeps/i386/tst-ld-sse-use.sh @@ -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. diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile index c262fdf..0de4f42 100644 --- a/sysdeps/x86/Makefile +++ b/sysdeps/x86/Makefile @@ -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 diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile index e50bcad..7bcfd87 100644 --- a/sysdeps/x86_64/Makefile +++ b/sysdeps/x86_64/Makefile @@ -19,6 +19,9 @@ gen-as-const-headers += locale-defines.sym endif ifeq ($(subdir),elf) +CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\ + -mno-mmx) + sysdep-dl-routines += tlsdesc dl-tlsdesc tests += ifuncmain8 -- 2.4.3