From patchwork Thu Oct 23 02:02:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 402331 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 18CD6140082 for ; Thu, 23 Oct 2014 13:03:08 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=A76EoOLvENl1iO2MOYejA125nQ6W1mLOOW3VGq27F/4ns6Sm9S I7zxfNxAGVSdyzM09YpoGaDytl7hwSU4FAg81ticocRNnk4iAJzR6FCJ8UAwBKRU EWxXTOjLwVXqGIz4vMJfsqSRd0QYH+uNPq/UDSNvW7xBtYu+7LgKWL4Es= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=9Hk35Abg1jGDZh4/x33tiEFwPDw=; b=H6gxka9WBELBiSXrcy62 logbUfE6S6pb8hf98KrkxMw+6VVAVtKLkaAhPyUC0b27ufPTJ/B0pQ9wrmpvEraJ O0SK/JiwATRCaP0bYtMaVfCFWcxciXJREu6MR8LiQDpXeU7zVXiJqm9o9IypBQCg fTpTPJlupxJRjZ+vZeiHQ8A= Received: (qmail 19226 invoked by alias); 23 Oct 2014 02:02:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 18797 invoked by uid 89); 23 Oct 2014 02:02:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, URIBL_BLACK autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 Oct 2014 02:02:52 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Xh7jk-0003K1-Ut from joseph_myers@mentor.com ; Wed, 22 Oct 2014 19:02:49 -0700 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.3.181.6; Thu, 23 Oct 2014 03:02:47 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.82) (envelope-from ) id 1Xh7ji-00017g-V2; Thu, 23 Oct 2014 02:02:47 +0000 Date: Thu, 23 Oct 2014 02:02:46 +0000 From: "Joseph S. Myers" To: CC: Subject: Optimize powerpc*-*-linux* 32-bit classic hard/soft float hardfp/soft-fp use Message-ID: MIME-Version: 1.0 Continuing the cleanups of libgcc soft-fp configuration for powerpc*-*-linux* in preparation for implementing TARGET_ATOMIC_ASSIGN_EXPAND_FENV for soft-float and e500, this patch optimizes the choice of which functions to build for the 32-bit classic hard-float and soft-float cases. (e500 will be dealt with in a separate patch which will need to add new features to t-hardfp and t-softfp; this patch keeps the status quo for e500.) For hard-float, while the functions in question are part of the libgcc ABI there is no need for them to contain software floating point code: no newly built code should use them, and if anything does use them it's most efficient (space and speed) for them to pass straight through to floating-point hardware instructions; this case is made to use t-hardfp to achieve that. For soft-float, direct use of soft-fp functions for operations involving DImode or unsigned integers is more efficient than using the libgcc2.c versions of those operations to convert to operations on other types (which then end up calling soft-fp functions for those other types, possibly more than once); this case is thus stopped from using t-softfp-excl. (A future patch will stop the e500 cases from using t-softfp-excl as well.) Tested with no regressions for crosses to powerpc-linux-gnu (soft float and classic hard float); also checked that the same set of symbols and versions is exported from shared libgcc before and after the patch. OK to commit? 2014-10-23 Joseph Myers * configure.ac (ppc_fp_type): Set variable on powerpc*-*-linux*. * configure: Regenerate. * config.host (powerpc*-*-linux*): Use $ppc_fp_type to determine additions to tmake_file. Use t-hardfp-sfdf and t-hardfp instead of soft-fp for 32-bit classic hard float. Do not use t-softfp-excl for soft float. Index: libgcc/config.host =================================================================== --- libgcc/config.host (revision 216564) +++ libgcc/config.host (working copy) @@ -991,9 +991,23 @@ ;; powerpc*-*-linux*) tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-savresfgpr rs6000/t-crtstuff rs6000/t-linux t-dfprules rs6000/t-ppc64-fp t-slibgcc-libgcc" - if test "${host_address}" = 32; then + case $ppc_fp_type in + 64) + ;; + hard) + tmake_file="${tmake_file} t-hardfp-sfdf t-hardfp" + ;; + soft) + tmake_file="${tmake_file} t-softfp-sfdf t-softfp" + ;; + e500v1|e500v2) tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp" - fi + ;; + *) + echo "Unknown ppc_fp_type $ppc_fp_type" 1>&2 + exit 1 + ;; + esac extra_parts="$extra_parts ecrti.o ecrtn.o ncrti.o ncrtn.o" md_unwind_header=rs6000/linux-unwind.h ;; Index: libgcc/configure =================================================================== --- libgcc/configure (revision 216564) +++ libgcc/configure (working copy) @@ -4376,6 +4376,29 @@ $as_echo "$libgcc_cv_mips_hard_float" >&6; } esac +# Determine floating-point type for powerpc*-*-linux*. +# Single-precision-only FPRs are not a supported configuration for +# this target, so are not allowed for in this test. +case ${host} in +powerpc*-*-linux*) + cat > conftest.c < conftest.c <