From patchwork Tue Feb 21 01:41:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 142230 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]) by ozlabs.org (Postfix) with SMTP id CA366B6EEE for ; Tue, 21 Feb 2012 12:42:07 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1330393329; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: Message-Id:To:Subject:From:Mime-Version:Content-Type: Content-Transfer-Encoding:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=3VJ50oSjwRWvav3fTe2tjQnJuQU=; b=ef6gMhFX9tHHp7M IHVe9jWVBTdiMEMXarIbiEQBRfNw10SgXh+Y44fbUJZ1FLWlolE9pzgrmlnIpp/F jH739hUIEET9NWnoIzHT/Phxm5zEeqccu83u88hZLf2cup/KCU3E3a3iA85EoUhq 6pzkjDTpPF4dMDgm1GJNu6z63b8U= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:Message-Id:To:Subject:From:Mime-Version:Content-Type:Content-Transfer-Encoding:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=jAhd5HOtxxqDvfFzY2EsiEFFZGD3E8pRkzcoYWaLI6GzsvLGyyKNT8Xecs3PgS w1EAmtfmBwWNKJU6VhS/AsqyWUJhVp9hjBdYRnvp6ia6+ORGaLSoOkTCxx3csgra pt4Jbw2Ms70Hg6OtsHOivlLhNLbZNTOy26qc3gBayHbis=; Received: (qmail 2712 invoked by alias); 21 Feb 2012 01:42:04 -0000 Received: (qmail 2699 invoked by uid 22791); 21 Feb 2012 01:42:03 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,TW_SV X-Spam-Check-By: sourceware.org Received: from shards.monkeyblade.net (HELO shards.monkeyblade.net) (198.137.202.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Feb 2012 01:41:49 +0000 Received: from localhost (cpe-66-65-56-15.nyc.res.rr.com [66.65.56.15]) (authenticated bits=0) by shards.monkeyblade.net (8.14.4/8.14.4) with ESMTP id q1L1fjJw009752 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO) for ; Mon, 20 Feb 2012 17:41:48 -0800 Date: Mon, 20 Feb 2012 20:41:44 -0500 (EST) Message-Id: <20120220.204144.705218939798493339.davem@davemloft.net> To: gcc-patches@gcc.gnu.org Subject: [PATCH] Explain why we don't use RDPC for sparc PIC register setup. From: David Miller Mime-Version: 1.0 X-IsSubscribed: yes 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 Richard Henderson asked me to add an explanatory comments to explain this decision. * config/sparc/sparc.md (load_pcrel_sym): Explain why we don't use the "rd %pc" instruction on v9 for PIC register loads. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184422 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/config/sparc/sparc.md | 4 ++++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e12e596..df2419a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2012-02-20 David S. Miller + + * config/sparc/sparc.md (load_pcrel_sym): Explain why we + don't use the "rd %pc" instruction on v9 for PIC register loads. + 2012-02-20 Aldy Hernandez PR middle-end/52141 diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md index f70acd3..c0c1ef8 100644 --- a/gcc/config/sparc/sparc.md +++ b/gcc/config/sparc/sparc.md @@ -1352,6 +1352,10 @@ ;; Load in operand 0 the (absolute) address of operand 1, which is a symbolic ;; value subject to a PC-relative relocation. Operand 2 is a helper function ;; that adds the PC value at the call point to register #(operand 3). +;; +;; Even on V9 we use this call sequence with a stub, instead of "rd %pc, ..." +;; because the RDPC instruction is extremely expensive and incurs a complete +;; instruction pipeline flush. (define_insn "load_pcrel_sym" [(set (match_operand:P 0 "register_operand" "=r")