From patchwork Thu Nov 24 15:30:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 83932 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp220567obn; Thu, 24 Nov 2016 07:31:10 -0800 (PST) X-Received: by 10.99.208.21 with SMTP id z21mr5177479pgf.79.1480001470669; Thu, 24 Nov 2016 07:31:10 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g1si11347991plb.278.2016.11.24.07.31.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Nov 2016 07:31:10 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-442574-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-442574-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-442574-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=RhpAif1o/OTJsmVE cRnWSVrxtIKseOchaLbuHqloRj0/7cAjGix2dRYUMDftDEybQhGxXB7CFmMwp3er ZgVYCJXTUwtNTxzo1zGEcPWXbdvIQKoQ8l8ujdLTCwz36KXM4PFysGvUdhPFmvfV 53XpAD7NKh8aIFt9c4d9dR9DNxU= 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:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=QaECSmw1hq7iEL7QwajHD4 Ie71s=; b=NzEvi9ua9FRs/wAapX5stgU9uptgN8FxWCGXFevVvt1oc2ZgnvmkQ/ lAuSfJPNFg9Smj0QSnvMX0k6Fe9O6quqIFbJbgU0Aam5PlLnewQgeeZn4knStn7V LWkORFwDqy1Sw6ss+7rwkxXcWV0dbPU/Kc9ZmF4a5FeQztIeDC8pY= Received: (qmail 6829 invoked by alias); 24 Nov 2016 15:30:57 -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 6809 invoked by uid 89); 24 Nov 2016 15:30:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:1585, U*ebotcazou X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 24 Nov 2016 15:30:47 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id AD4DB8138D for ; Thu, 24 Nov 2016 16:30:45 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m_FC0oO6Lplq for ; Thu, 24 Nov 2016 16:30:45 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 8AF168138A for ; Thu, 24 Nov 2016 16:30:45 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [SPARC] Enable REE at -O2 by default in 64-bit mode Date: Thu, 24 Nov 2016 16:30:45 +0100 Message-ID: <2089802.4AkFIGpqyi@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-48-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 Tests showed that it helps to eliminates redundant 32-to-64-bit extensions. Tested on SPARC/Solaris, applied on the mainline. 2016-11-24 Eric Botcazou * common/config/sparc/sparc-common.c (option_optimization_table): Enable REE at -O2 and higher. * config/sparc/sparc.c (sparc_option_override): Disable it by default in 32-bit mode. -- Eric Botcazou Index: common/config/sparc/sparc-common.c =================================================================== --- common/config/sparc/sparc-common.c (revision 242632) +++ common/config/sparc/sparc-common.c (working copy) @@ -28,6 +28,8 @@ along with GCC; see the file COPYING3. static const struct default_options sparc_option_optimization_table[] = { { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 }, + /* Enable redundant extension instructions removal at -O2 and higher. */ + { OPT_LEVELS_2_PLUS, OPT_free, NULL, 1 }, { OPT_LEVELS_NONE, 0, NULL, 0 } }; Index: config/sparc/sparc.c =================================================================== --- config/sparc/sparc.c (revision 242632) +++ config/sparc/sparc.c (working copy) @@ -1713,6 +1713,11 @@ sparc_option_override (void) pessimizes for double floating-point registers. */ if (!global_options_set.x_flag_ira_share_save_slots) flag_ira_share_save_slots = 0; + + /* Only enable REE by default in 64-bit mode where it helps to eliminate + redundant 32-to-64-bit extensions. */ + if (!global_options_set.x_flag_ree && TARGET_ARCH32) + flag_ree = 0; } /* Miscellaneous utilities. */