From patchwork Sat Mar 7 13:34:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 447576 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 56580140182 for ; Sun, 8 Mar 2015 00:34:49 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=OgEHYQkG; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=xWPNuxcLIBf4O6s/vE C72pwaGC9k2440zl52lZZ3o23E29QD3aZT/jJju8Mc4H+ZJ1cugy8XcUENR2dgN3 AuLjDGvJ9Wq1ijRwQlUdaYls7TQwx+Pv6O30NB2GNFhYOPPGx/AioCVK7dp95Fih DeUnL55X8+z3o6ftMT9peeJIo= 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:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=Vy1oXMUz1MtneEglZEOc3QLy 9Mk=; b=OgEHYQkGKaqzwqQavxQPYrD1MXUFRhttQ9ZTKv8qXDk0LZ1xtjzYV3cD V+R4dm//gMM7zIqZCRXfM2MnwA5BLxW9OQKmM+9/3AcFoIvX6cMVl1znx2axY756 CSSWU5SrSlTqkSb1RHvghJ1t2OnuKBhjG6z8uAjzbUQajHd5IRk= Received: (qmail 54577 invoked by alias); 7 Mar 2015 13:34:41 -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 54544 invoked by uid 89); 7 Mar 2015 13:34:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KAM_FROM_URIBL_PCCC, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-oi0-f53.google.com Received: from mail-oi0-f53.google.com (HELO mail-oi0-f53.google.com) (209.85.218.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 07 Mar 2015 13:34:40 +0000 Received: by oifu20 with SMTP id u20so22164815oif.11 for ; Sat, 07 Mar 2015 05:34:38 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.62.42 with SMTP id v10mr14817323oer.45.1425735278145; Sat, 07 Mar 2015 05:34:38 -0800 (PST) Received: by 10.76.134.102 with HTTP; Sat, 7 Mar 2015 05:34:37 -0800 (PST) In-Reply-To: References: <000101d051e9$e923c610$bb6b5230$@com> <54EF9C44.7000207@redhat.com> <000401d05696$ce28d510$6a7a7f30$@com> <54F73C7E.2050209@redhat.com> <000601d05828$44899db0$cd9cd910$@com> Date: Sat, 7 Mar 2015 05:34:37 -0800 Message-ID: Subject: Re: [PATCH] Remove inefficient branchless conditional negate optimization From: "H.J. Lu" To: Jiong Wang Cc: Wilco Dijkstra , "gcc-patches@gcc.gnu.org" , Jeff Law X-IsSubscribed: yes On Fri, Mar 6, 2015 at 8:36 AM, Jiong Wang wrote: > > Wilco Dijkstra writes: > >>> Jeff Law wrote: >>> Can you move pr45685.c into gcc.target/i386? >>> >>> I know Richi said next stage1, but given this fixes a performance >>> regression for ARM and it's reverting rather than adding new code, I >>> think this is OK for the trunk with the testcase moved. >>> >>> So, OK with the testcase moved into gcc.target/i386/ >> >> I've moved it and changed the compile condition: >> >> /* { dg-do compile { target { ! { ia32 } } } } */ >> >> Jiong, can you commit this please? > > Done as 221246. > >> >> Wilco >> >> 2015-03-06 Wilco Dijkstra >> >> * gcc/tree-ssa-phiopt.c (neg_replacement): Remove. >> (tree_ssa_phiopt_worker): Remove negate optimization. >> * gcc/testsuite/gcc.dg/tree-ssa/pr45685.c: Move to gcc.target/i386. >> * gcc/testsuite/gcc.target/aarch64/csneg-1.c (test_csneg_cmp): >> New test. >> * gcc/gcc.target/i386/pr45685.c: Moved test, check for conditional >> move on x64. > I checked in this as an obvious fix to make it pass on x32. Index: ChangeLog =================================================================== --- ChangeLog (revision 221254) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2015-03-07 H.J. Lu + + * gcc.target/i386/pr45685.c (uint64_t): Replace long with long + long. + (int64_t): Likewise. + 2015-03-07 Marek Polacek Martin Uecker Index: gcc.target/i386/pr45685.c =================================================================== --- gcc.target/i386/pr45685.c (revision 221254) +++ gcc.target/i386/pr45685.c (working copy) @@ -1,8 +1,8 @@ /* { dg-do compile { target { ! { ia32 } } } } */ /* { dg-options "-O3" } */ -typedef unsigned long int uint64_t; -typedef long int int64_t; +typedef unsigned long long int uint64_t; +typedef long long int int64_t; int summation_helper_1(int64_t* products, uint64_t count) { int s = 0;