Message ID | 1f9aab5c-ee1b-a676-551c-3f7e4671c26b@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 84B4E385AC1F for <patchwork@sourceware.org>; Thu, 18 Nov 2021 16:10:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 84B4E385AC1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1637251830; bh=4LAmu/02UqepK33tUMqWj44VkAxel+mIbu1LP9c0xTc=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Ph7z0ozes0c82Pe+w4QYrpuThyx0QdWqOaDsAm1D+PBww5sZFJn5M5ONCWuAT6jtx oa1mxoicth5sErABqqqbc6GcIi5ihMKXehDWMlzaaQJCcGOonLkRdf2+Pt7lWf7OoV TwJwMNUgo3KtrSkKqSupUJO9KEtmLl0ocRSSU6hY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id D4E4A385843A for <gcc-patches@gcc.gnu.org>; Thu, 18 Nov 2021 16:10:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D4E4A385843A Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AIFIScc020961; Thu, 18 Nov 2021 16:09:59 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3cdqkecn6n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Nov 2021 16:09:59 +0000 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1AIFo6wX005997; Thu, 18 Nov 2021 16:09:58 GMT Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0b-001b2d01.pphosted.com with ESMTP id 3cdqkecn5y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Nov 2021 16:09:58 +0000 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1AIG3mfX007347; Thu, 18 Nov 2021 16:09:57 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma02wdc.us.ibm.com with ESMTP id 3cd81dvnj3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Nov 2021 16:09:57 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1AIG9vsh59376026 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Nov 2021 16:09:57 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 65752B20BF; Thu, 18 Nov 2021 16:09:55 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 82840B2112; Thu, 18 Nov 2021 16:09:54 +0000 (GMT) Received: from [9.211.84.243] (unknown [9.211.84.243]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 18 Nov 2021 16:09:54 +0000 (GMT) Message-ID: <1f9aab5c-ee1b-a676-551c-3f7e4671c26b@linux.ibm.com> Date: Thu, 18 Nov 2021 10:09:53 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 To: GCC Patches <gcc-patches@gcc.gnu.org> Subject: [PATCH] rs6000: Builtin test changes for int_128bit-runnable.c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: plqprHO1IUY-EpqQCmEkVhX2RcmewPJ6 X-Proofpoint-GUID: 2uXKfOGLTE0SFYl6hq95W63Qfko3VwOF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-18_12,2021-11-17_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 priorityscore=1501 mlxlogscore=999 mlxscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 impostorscore=0 suspectscore=0 clxscore=1015 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111180089 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Bill Schmidt via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: wschmidt@linux.ibm.com Cc: David Edelsohn <dje.gcc@gmail.com>, Segher Boessenkool <segher@kernel.crashing.org> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
rs6000: Builtin test changes for int_128bit-runnable.c
|
|
Commit Message
Li, Pan2 via Gcc-patches
Nov. 18, 2021, 4:09 p.m. UTC
Hi! This patch is broken out from the test case patch for the new builtins support. The old builtins code performs gimple folding on 128-bit compares. This results in correct but very inefficient code. (I suspect we may be missing some optab entries, misleading gimple into 64-bit emulation.) In the new support, I disabled this gimple folding, which results in us directly generating the 128-bit comparison instructions. This patch adjusts the scan-assembler-times counts for those instructions. I've opened PR103316 to track this. Tested on powerpc64le-linux-gnu and powerpc64-linux-gnu (-m32/-m64) with no regressions. Is this okay for trunk? Thanks! Bill 2021-11-17 Bill Schmidt <wschmidt@linux.ibm.com> gcc/testsuite/ * gcc.target/powerpc/int_128bit-runnable.c: Adjust instruction counts since we do better by not gimple-folding some builtins. --- gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Comments
On Thu, Nov 18, 2021 at 10:09:53AM -0600, Bill Schmidt wrote: > Hi! This patch is broken out from the test case patch for the new builtins > support. > > The old builtins code performs gimple folding on 128-bit compares. This > results in correct but very inefficient code. (I suspect we may be > missing some optab entries, misleading gimple into 64-bit emulation.) It is sub-optimal if Gimple ever does this: it is better done later, at expand time. > In > the new support, I disabled this gimple folding, which results in us > directly generating the 128-bit comparison instructions. This patch > adjusts the scan-assembler-times counts for those instructions. > > I've opened PR103316 to track this. Thanks. So when the generic code wisens up this testcase will still pass? But you do then need to re-introduce the folding here? > gcc/testsuite/ > * gcc.target/powerpc/int_128bit-runnable.c: Adjust instruction > counts since we do better by not gimple-folding some builtins. Wrap later please? 80 chars is fine, 79 chars is fine, 10 chars or 70 chars is not :-( (Not that it matters much *here* of course; it just annoys me Also, s/ since.*/./ please. Changelogs say what changed, not why, and the "why" you say here is only half of the story, pretty misleading for future archaeologists. > --- a/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c > +++ b/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c > @@ -11,9 +11,9 @@ > /* { dg-final { scan-assembler-times {\mvrlq\M} 2 } } */ > /* { dg-final { scan-assembler-times {\mvrlqnm\M} 2 } } */ > /* { dg-final { scan-assembler-times {\mvrlqmi\M} 2 } } */ > -/* { dg-final { scan-assembler-times {\mvcmpequq\M} 16 } } */ > -/* { dg-final { scan-assembler-times {\mvcmpgtsq\M} 16 } } */ > -/* { dg-final { scan-assembler-times {\mvcmpgtuq\M} 16 } } */ > +/* { dg-final { scan-assembler-times {\mvcmpequq\M} 24 } } */ > +/* { dg-final { scan-assembler-times {\mvcmpgtsq\M} 26 } } */ > +/* { dg-final { scan-assembler-times {\mvcmpgtuq\M} 26 } } */ > /* { dg-final { scan-assembler-times {\mvmuloud\M} 1 } } */ > /* { dg-final { scan-assembler-times {\mvmulesd\M} 1 } } */ > /* { dg-final { scan-assembler-times {\mvmulosd\M} 1 } } */ If you think it actually generates better code now, and this is expected code, then okay for trunk. Thanks! Segher
Hi! On 11/18/21 10:22 AM, Segher Boessenkool wrote: > On Thu, Nov 18, 2021 at 10:09:53AM -0600, Bill Schmidt wrote: >> Hi! This patch is broken out from the test case patch for the new builtins >> support. >> >> The old builtins code performs gimple folding on 128-bit compares. This >> results in correct but very inefficient code. (I suspect we may be >> missing some optab entries, misleading gimple into 64-bit emulation.) > It is sub-optimal if Gimple ever does this: it is better done later, at > expand time. > >> In >> the new support, I disabled this gimple folding, which results in us >> directly generating the 128-bit comparison instructions. This patch >> adjusts the scan-assembler-times counts for those instructions. >> >> I've opened PR103316 to track this. > Thanks. > > So when the generic code wisens up this testcase will still pass? But > you do then need to re-introduce the folding here? Right. If we fix the generic code, the test will still pass. We need to re-introduce the folding to leverage it, and will only do that if the test still passes. We always want these single-instruction comparisons to fall out for simple tests like these. > >> gcc/testsuite/ >> * gcc.target/powerpc/int_128bit-runnable.c: Adjust instruction >> counts since we do better by not gimple-folding some builtins. > Wrap later please? 80 chars is fine, 79 chars is fine, 10 chars or 70 > chars is not :-( > > (Not that it matters much *here* of course; it just annoys me A slight argument in favor of earlier wrapping: With Git, the ChangeLog entries in the commit messages get indented, so wrapping a little earlier makes those much easier to read. That's why I started reducing the length of my entries a little. Not a big deal either way, but it's really noticeable in git log output. > > Also, s/ since.*/./ please. Changelogs say what changed, not why, and > the "why" you say here is only half of the story, pretty misleading for > future archaeologists. Good call. > >> --- a/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c >> +++ b/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c >> @@ -11,9 +11,9 @@ >> /* { dg-final { scan-assembler-times {\mvrlq\M} 2 } } */ >> /* { dg-final { scan-assembler-times {\mvrlqnm\M} 2 } } */ >> /* { dg-final { scan-assembler-times {\mvrlqmi\M} 2 } } */ >> -/* { dg-final { scan-assembler-times {\mvcmpequq\M} 16 } } */ >> -/* { dg-final { scan-assembler-times {\mvcmpgtsq\M} 16 } } */ >> -/* { dg-final { scan-assembler-times {\mvcmpgtuq\M} 16 } } */ >> +/* { dg-final { scan-assembler-times {\mvcmpequq\M} 24 } } */ >> +/* { dg-final { scan-assembler-times {\mvcmpgtsq\M} 26 } } */ >> +/* { dg-final { scan-assembler-times {\mvcmpgtuq\M} 26 } } */ >> /* { dg-final { scan-assembler-times {\mvmuloud\M} 1 } } */ >> /* { dg-final { scan-assembler-times {\mvmulesd\M} 1 } } */ >> /* { dg-final { scan-assembler-times {\mvmulosd\M} 1 } } */ > If you think it actually generates better code now, and this is expected > code, then okay for trunk. Thanks! Thanks very much for the review! Bill > > > Segher
diff --git a/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c b/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c index 1255ee9f0ab..1356793635a 100644 --- a/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c +++ b/gcc/testsuite/gcc.target/powerpc/int_128bit-runnable.c @@ -11,9 +11,9 @@ /* { dg-final { scan-assembler-times {\mvrlq\M} 2 } } */ /* { dg-final { scan-assembler-times {\mvrlqnm\M} 2 } } */ /* { dg-final { scan-assembler-times {\mvrlqmi\M} 2 } } */ -/* { dg-final { scan-assembler-times {\mvcmpequq\M} 16 } } */ -/* { dg-final { scan-assembler-times {\mvcmpgtsq\M} 16 } } */ -/* { dg-final { scan-assembler-times {\mvcmpgtuq\M} 16 } } */ +/* { dg-final { scan-assembler-times {\mvcmpequq\M} 24 } } */ +/* { dg-final { scan-assembler-times {\mvcmpgtsq\M} 26 } } */ +/* { dg-final { scan-assembler-times {\mvcmpgtuq\M} 26 } } */ /* { dg-final { scan-assembler-times {\mvmuloud\M} 1 } } */ /* { dg-final { scan-assembler-times {\mvmulesd\M} 1 } } */ /* { dg-final { scan-assembler-times {\mvmulosd\M} 1 } } */