From patchwork Tue Apr 8 10:41:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 337617 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 5C9B01400BD for ; Tue, 8 Apr 2014 20:41:57 +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:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=wKJhrVIBBE60Gt6Wu 7nti9HoWJYTm6XAKars7wJzW8bqWAspUWIqhVp8YpGA/uBOoKyzx1sxgRuUyDPs+ nm48sxKJzE1v5BsCwTRbjgxCc2nsxFrFnamB4YZz7Xfm0lAebf3vjEfNwJYX84Pi wvXKXp2hZQ95Pncm2f3VPMWs68= 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:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=tdtNaqTvgCCvcbg1SieAVq1 jg30=; b=dm/grGKlvfwzBJDAOymipxrn0Z2XmrO4fZhMQ9gMrx7VosUhGKb7J8M +c+aOTkY4obc/OWifAlhW4/s7cxazaMLjTmxm5M5MwvuZlunFmwivHrDeoqaW9oQ ogmvVgf1hjh10oHN7Z1RI16ZgH9Hy3NRa1zWCncJ8f9aGkHDkTWw= Received: (qmail 5563 invoked by alias); 8 Apr 2014 10:41:50 -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 5548 invoked by uid 89); 8 Apr 2014 10:41:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp13.uk.ibm.com Received: from e06smtp13.uk.ibm.com (HELO e06smtp13.uk.ibm.com) (195.75.94.109) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 08 Apr 2014 10:41:48 +0000 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Apr 2014 11:41:45 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 8 Apr 2014 11:41:43 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id D5F3B1B0804B for ; Tue, 8 Apr 2014 11:41:41 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps3075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s38AfVwV131492 for ; Tue, 8 Apr 2014 10:41:31 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s38Afghp013920 for ; Tue, 8 Apr 2014 04:41:42 -0600 Received: from bart (dyn-9-152-212-211.boeblingen.de.ibm.com [9.152.212.211]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id s38AffaQ013904; Tue, 8 Apr 2014 04:41:41 -0600 Received: by bart (sSMTP sendmail emulation); Tue, 08 Apr 2014 12:41:41 +0200 Date: Tue, 8 Apr 2014 12:41:41 +0200 From: Andreas Krebbel To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Adjust builtin-bswap-6/7 Message-ID: <20140408104141.GA29650@maggie> References: <20140404161818.GA26795@bart> <533EF13A.8010001@redhat.com> <20140407162214.GA25019@maggie> <20140408084138.GA1817@tucnak.redhat.com> <5343B8FF.6080904@linux.vnet.ibm.com> <20140408091221.GB1817@tucnak.redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140408091221.GB1817@tucnak.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14040810-2966-0000-0000-00000ADBCD21 X-IsSubscribed: yes Hi, what about that one? Tested on x86_64, s390, and s390x. Bye, -Andreas- 2014-04-08 Andreas Krebbel * gcc.dg/builtin-bswap-6.c: Use -mbranch-cost=0 for s390. * gcc.dg/builtin-bswap-7.c: Likewise. Revert 2014-04-04 Andreas Krebbel * gcc.dg/builtin-bswap-6.c: Adjust return value to disable GCC optimization. * gcc.dg/builtin-bswap-7.c: Likewise. diff --git a/gcc/testsuite/gcc.dg/builtin-bswap-6.c b/gcc/testsuite/gcc.dg/builtin-bswap-6.c index 6f0c782..efda870 100644 --- a/gcc/testsuite/gcc.dg/builtin-bswap-6.c +++ b/gcc/testsuite/gcc.dg/builtin-bswap-6.c @@ -1,11 +1,10 @@ /* { dg-do compile { target arm*-*-* alpha*-*-* i?86-*-* powerpc*-*-* rs6000-*-* x86_64-*-* s390*-*-* } } */ /* { dg-require-effective-target stdint_types } */ /* { dg-options "-O -fdump-rtl-combine" } */ -/* { dg-options "-O -fdump-rtl-combine -march=z900" { target s390-*-* } } */ -/* The test intentionally returns 1/2 instead of the obvious 0/1 to - prevent GCC from calculating the return value with arithmetic - instead of a comparison. */ +/* The branch cost setting prevents the return value from being + calculated with arithmetic instead of doing a compare. */ +/* { dg-additional-options "-march=z900 -mbranch-cost=0" { target s390*-*-* } } */ #include @@ -15,28 +14,28 @@ int foo1 (uint32_t a) { if (BS (a) == 0xA0000) return 1; - return 2; + return 0; } int foo2 (uint32_t a) { if (BS (a) != 0xA0000) return 1; - return 2; + return 0; } int foo3 (uint32_t a, uint32_t b) { if (BS (a) == BS (b)) return 1; - return 2; + return 0; } int foo4 (uint32_t a, uint32_t b) { if (BS (a) != BS (b)) return 1; - return 2; + return 0; } /* { dg-final { scan-rtl-dump-not "bswapsi" "combine" } } */ diff --git a/gcc/testsuite/gcc.dg/builtin-bswap-7.c b/gcc/testsuite/gcc.dg/builtin-bswap-7.c index 0eecdd8..035c736 100644 --- a/gcc/testsuite/gcc.dg/builtin-bswap-7.c +++ b/gcc/testsuite/gcc.dg/builtin-bswap-7.c @@ -3,9 +3,9 @@ /* { dg-require-effective-target lp64 } */ /* { dg-options "-O -fdump-rtl-combine" } */ -/* The test intentionally returns 1/2 instead of the obvious 0/1 to - prevent GCC from calculating the return value with arithmetic - instead of a comparison. */ +/* The branch cost setting prevents the return value from being + calculated with arithmetic instead of doing a compare. */ +/* { dg-additional-options "-mbranch-cost=0" { target s390x-*-* } } */ #include @@ -15,28 +15,28 @@ int foo1 (uint64_t a) { if (BS (a) == 0xA00000000) return 1; - return 2; + return 0; } int foo2 (uint64_t a) { if (BS (a) != 0xA00000000) return 1; - return 2; + return 0; } int foo3 (uint64_t a, uint64_t b) { if (BS (a) == BS (b)) return 1; - return 2; + return 0; } int foo4 (uint64_t a, uint64_t b) { if (BS (a) != BS (b)) return 1; - return 2; + return 0; } /* { dg-final { scan-rtl-dump-not "bswapdi" "combine" } } */