From patchwork Fri Mar 30 15:03:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Teresa Johnson X-Patchwork-Id: 149667 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 775ECB6EF4 for ; Sat, 31 Mar 2012 02:04:19 +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=1333724660; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:Received:Received:Received:To:Subject: Message-Id:Date:From:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=QnFKn4MR65zMOjUlo8s0BOxXxDE=; b=muubAUOEuOiF9pw Wi+SRAV9Hir2RjJTIXLeYD1x9mmebpZLhifjhS5KF/Nq6xjBNeFKidSTKcpyVDRW YZWZBWdNCkaOMLTq07lrORimPIZWRtnccztgtycpW2stHGlFr4oRyM2usWZydUXA RVdxjJUsSyFEIZ4Id2h+/jJifelM= 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:X-Google-DKIM-Signature:Received:MIME-Version:Received:Received:Received:Received:To:Subject:Message-Id:Date:From:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=TL7ZmeEiCcIuYruyJybHrx1CwnGpwV7YngPlm+44QbLu+iS8OUc3pye6JHw0Y8 3Y5TRGuD6eBnKz0w1zMewHX5+KGX+0swNrBkEckjZuaD0eb+XfJ3ZbjusuPzIEtB UPRTAmguwzqF7vU7c0ODg9T899MD1eFg9ZWG6RVkwT/ms=; Received: (qmail 3439 invoked by alias); 30 Mar 2012 15:04:12 -0000 Received: (qmail 3426 invoked by uid 22791); 30 Mar 2012 15:04:10 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_OV, TW_VH, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-bk0-f73.google.com (HELO mail-bk0-f73.google.com) (209.85.214.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Mar 2012 15:03:42 +0000 Received: by bkcjg15 with SMTP id jg15so44605bkc.2 for ; Fri, 30 Mar 2012 08:03:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:to:subject:message-id:date:from:x-gm-message-state; bh=PQrxeC1xFRrbs3nvle5xw+6z8mx4hLrVaIfV2A5TH4E=; b=HsqbK9esfV+Mhv4yGagH+1gxCPoTjt1db9qhC48dTXU5U3sxuiGUqYQnXXdtoTFCGq Y8i3Cc+ZaRLweTem4Yu7Lhm29A/dUTebMV3oKnYvJyaC/w7sub5tnTqzLMDlCylrmw37 k5uJKhkL3cOwq96fNE3rkZS5LtWEbPnyAJo5OfrgPhGoIHQZlnbYZvtRdBNNHcEtP6qf tfxZ5yL9gGK9UZQReQQcNEnnXb+4mhcUa/RpRMqDyQn9ans8JlAhND1YWe0hR6zKvHyH vt4x8uKSKiRISxCc40vnf1PXot4t/Xo4WJOYWVa+x5Ui2Yzhfs1Bl9BDqgrwfOWnaB1h cc0g== Received: by 10.213.4.83 with SMTP id 19mr473238ebq.16.1333119821347; Fri, 30 Mar 2012 08:03:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.213.4.83 with SMTP id 19mr473229ebq.16.1333119821222; Fri, 30 Mar 2012 08:03:41 -0700 (PDT) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id a14si6801293een.0.2012.03.30.08.03.41 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 30 Mar 2012 08:03:41 -0700 (PDT) Received: from tjsboxrox.mtv.corp.google.com (tjsboxrox.mtv.corp.google.com [172.18.110.68]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 0B2D420004E; Fri, 30 Mar 2012 08:03:41 -0700 (PDT) Received: by tjsboxrox.mtv.corp.google.com (Postfix, from userid 147431) id 4EA5F615CC; Fri, 30 Mar 2012 08:03:40 -0700 (PDT) To: reply@codereview.appspotmail.com,gcc-patches@gcc.gnu.org Subject: [Patch, i386] Avoid LCP stalls (issue5975045) Message-Id: <20120330150340.4EA5F615CC@tjsboxrox.mtv.corp.google.com> Date: Fri, 30 Mar 2012 08:03:40 -0700 (PDT) From: tejohnson@google.com (Teresa Johnson) X-Gm-Message-State: ALoCoQmym8jqIKqnAb/Slyl5JPo/a9mbYLCSED/2vLSeE9JCqQISO7a5n2m69A9DBAXptzBOU3TQxcsXJiU5LN2/bru0e4fBYFh17UWBN/eYGPB7j8JMROUmT2LxlBV3ip4dU3cAi/CEg514Tuj4vlb1L12+j/EmDhzFs6vwFUaBfllLWLuJB6k= 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 Minor update to patch to remove unnecessary check in new movhi_imm_internal define_insn. Retested successfully. Teresa 2012-03-29 Teresa Johnson * config/i386/i386.h (ix86_tune_indices): Add X86_TUNE_LCP_STALL. * config/i386/i386.md (movhi_internal): Split to movhi_internal and movhi_imm_internal. * config/i386/i386.c (initial_ix86_tune_features): Initialize X86_TUNE_LCP_STALL entry. --- This patch is available for review at http://codereview.appspot.com/5975045 Index: config/i386/i386.h =================================================================== --- config/i386/i386.h (revision 185920) +++ config/i386/i386.h (working copy) @@ -262,6 +262,7 @@ enum ix86_tune_indices { X86_TUNE_MOVX, X86_TUNE_PARTIAL_REG_STALL, X86_TUNE_PARTIAL_FLAG_REG_STALL, + X86_TUNE_LCP_STALL, X86_TUNE_USE_HIMODE_FIOP, X86_TUNE_USE_SIMODE_FIOP, X86_TUNE_USE_MOV0, @@ -340,6 +341,8 @@ extern unsigned char ix86_tune_features[X86_TUNE_L #define TARGET_PARTIAL_REG_STALL ix86_tune_features[X86_TUNE_PARTIAL_REG_STALL] #define TARGET_PARTIAL_FLAG_REG_STALL \ ix86_tune_features[X86_TUNE_PARTIAL_FLAG_REG_STALL] +#define TARGET_LCP_STALL \ + ix86_tune_features[X86_TUNE_LCP_STALL] #define TARGET_USE_HIMODE_FIOP ix86_tune_features[X86_TUNE_USE_HIMODE_FIOP] #define TARGET_USE_SIMODE_FIOP ix86_tune_features[X86_TUNE_USE_SIMODE_FIOP] #define TARGET_USE_MOV0 ix86_tune_features[X86_TUNE_USE_MOV0] Index: config/i386/i386.md =================================================================== --- config/i386/i386.md (revision 185920) +++ config/i386/i386.md (working copy) @@ -2262,9 +2262,19 @@ ] (const_string "SI")))]) +(define_insn "*movhi_imm_internal" + [(set (match_operand:HI 0 "memory_operand" "=m") + (match_operand:HI 1 "immediate_operand" "n"))] + "!TARGET_LCP_STALL" +{ + return "mov{w}\t{%1, %0|%0, %1}"; +} + [(set (attr "type") (const_string "imov")) + (set (attr "mode") (const_string "HI"))]) + (define_insn "*movhi_internal" [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,r,m") - (match_operand:HI 1 "general_operand" "r,rn,rm,rn"))] + (match_operand:HI 1 "general_operand" "r,rn,rm,r"))] "!(MEM_P (operands[0]) && MEM_P (operands[1]))" { switch (get_attr_type (insn)) Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 185920) +++ config/i386/i386.c (working copy) @@ -1964,6 +1964,11 @@ static unsigned int initial_ix86_tune_features[X86 /* X86_TUNE_PARTIAL_FLAG_REG_STALL */ m_CORE2I7 | m_GENERIC, + /* X86_TUNE_LCP_STALL: Avoid an expensive length-changing prefix stall + * on 16-bit immediate moves into memory on Core2 and Corei7, + * which may also affect AMD implementations. */ + m_CORE2I7 | m_GENERIC | m_AMD_MULTIPLE, + /* X86_TUNE_USE_HIMODE_FIOP */ m_386 | m_486 | m_K6_GEODE,