From patchwork Tue Apr 15 16:06:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeny Stupachenko X-Patchwork-Id: 339313 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 7C53F140099 for ; Wed, 16 Apr 2014 02:06:16 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; q=dns; s=default; b=udUbC8gDo87fk2/Xg6kMrEMAVfZ8RiVvW10sU62DeGA y6tLVgoSYUu8jntDDBPaohwDIyDMw/wH6RWcWp1Ym+nU4Ov5r0Gvjn5eIN/unReT mInphRczMnQFQr/wW4lWJdzSEb+d2yYcDicUJEUXJRK2AkuHWIb6+cldZzyfPGL0 = 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 :mime-version:date:message-id:subject:from:to:cc:content-type; s=default; bh=HS9vcdRGgX15knlmEaMaRxDpWxQ=; b=UxoodMMAwKQTyam2J PjaMzthd6/TR2M8LXJa3xDnMfeXGrC0CNbFF16XUrGNiGmy0Kadr1AfiQOztxmJN byAYnoDDXCevGfJNRXKQbxMZ1ciBAduS1dk13DQIsfSrGNYzk7QFZlF9gE1Xn9mi yUOo07TObj7abAIqd0pQiydNxU= Received: (qmail 29580 invoked by alias); 15 Apr 2014 16:06:09 -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 29562 invoked by uid 89); 15 Apr 2014 16:06:08 -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-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-oa0-f54.google.com Received: from mail-oa0-f54.google.com (HELO mail-oa0-f54.google.com) (209.85.219.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 15 Apr 2014 16:06:07 +0000 Received: by mail-oa0-f54.google.com with SMTP id n16so10989181oag.41 for ; Tue, 15 Apr 2014 09:06:05 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.55.97 with SMTP id r1mr2157050oep.5.1397577965000; Tue, 15 Apr 2014 09:06:05 -0700 (PDT) Received: by 10.76.170.39 with HTTP; Tue, 15 Apr 2014 09:06:04 -0700 (PDT) Date: Tue, 15 Apr 2014 20:06:04 +0400 Message-ID: Subject: [PATCH 1/3, x86] X86 Silvermont vector cost model tune From: Evgeny Stupachenko To: Uros Bizjak Cc: "H.J. Lu" , GCC Patches , uros@gcc.gnu.org X-IsSubscribed: yes Hi, I've separated the patch into 3. The patch passes x86 bootstrap. 1st part: 2014-04-15 Evgeny Stupachenko * config/i386/i386.c (slm_cost): Fixing vec_to_scalar_cost for Silvermont according latency table. (intel_cost): Ditto. Evgeny On Thu, Mar 6, 2014 at 12:58 AM, Evgeny Stupachenko wrote: > slm_cost/intel_cost and TARGET_SLOW_PSHUFB are just preparation to a > next vectorization patch. > Changes in ix86_add_stmt_cost gives real performance to Silvermont. > Let's move all to stage1. > > On Wed, Mar 5, 2014 at 9:29 PM, Uros Bizjak wrote: >> On Wed, Mar 5, 2014 at 5:46 PM, H.J. Lu wrote: >>> On Wed, Mar 5, 2014 at 7:58 AM, Evgeny Stupachenko wrote: >>>> Hi, >>>> >>>> The patch is for x86 Silvermont. >>>> It improves x86 Silvermont vector cost model. >>>> It gives +20% on facerec spec on Silvermont. >>>> It passes make check and bootstrap on x86. >>>> >>>> Is this patch ok for stage1? >>>> >>>> ChangeLog: >>>> >>>> 2014-03-05 Evgeny Stupachenko >>>> >>>> * config/i386/x86-tune.def (TARGET_SLOW_PSHUFB): Target for slow byte >>>> shuffle on some x86 architectures. >>>> * config/i386/i386.h (TARGET_SLOW_PSHUFB): Ditto. >>>> * config/i386/i386.c (processor_costs): Fixing vec_to_scalar_cost for >>>> Silvermont according latency table. >>>> (expand_vec_perm_even_odd_1): Avoid byte shuffles in architectures >>>> where they are slow (TARGET_SLOW_PSHUFB). >>>> (x86_add_stmt_cost): Fixing vector cost model for Silvermont. >>>> >>>> Thanks, >>>> Evgeny >>> >>> There are 3 separate changes in this patch: >>> >>> 1. Update slm_cost, which doesn't have a ChangeLog entry. >>> 2. Add TARGET_SLOW_PSHUFB. >>> 3. Update ix86_add_stmt_cost. >>> >>> I suggest you break it into 3 independent patches. >> >> I think that slm_cost/intel_cost and TARGET_SLOW_PSHUFB changes can >> still go into mainline at this stage since they are trivial tuning >> changes that should not destabilize the compiler. >> >> The ix86_add_stmt_cost should wait for stage 1. >> >> Uros. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index f2e6957..bf4d576 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1738,7 +1738,7 @@ struct processor_costs slm_cost = { 1, /* scalar load_cost. */ 1, /* scalar_store_cost. */ 1, /* vec_stmt_cost. */ - 1, /* vec_to_scalar_cost. */ + 4, /* vec_to_scalar_cost. */ 1, /* scalar_to_vec_cost. */ 1, /* vec_align_load_cost. */ 2, /* vec_unalign_load_cost. */ @@ -1815,7 +1815,7 @@ struct processor_costs intel_cost = { 1, /* scalar load_cost. */ 1, /* scalar_store_cost. */ 1, /* vec_stmt_cost. */ - 1, /* vec_to_scalar_cost. */ + 4, /* vec_to_scalar_cost. */ 1, /* scalar_to_vec_cost. */ 1, /* vec_align_load_cost. */ 2, /* vec_unalign_load_cost. */