Message ID | 1fb4035e-a15e-5031-3b2f-9ba5dfcb1786@linux.ibm.com |
---|---|
State | New, archived |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:ecc5:0:0:0:0:0 with SMTP id s5csp1311401wro; Wed, 24 Aug 2022 01:19:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR6bN95w9cIIXpCen50qMd6IeemV2xHre2DMPDqMMLyL5n5WjRi1uUdAjvwWsNQWtRU0s+17 X-Received: by 2002:a17:906:8a69:b0:73d:8e42:abf9 with SMTP id hy9-20020a1709068a6900b0073d8e42abf9mr2180798ejc.547.1661329146151; Wed, 24 Aug 2022 01:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661329146; cv=none; d=google.com; s=arc-20160816; b=Xm55gdY5+swdss4i18AFHYQmbqjSY6860Nsoc/ApD0rT7nQypiJ5Pu1nMkXISiAF01 uqWZXXSDsXjieSbJyoqLpLgRpJ7Ah7/mmKMjCFaab02+E5v6gH2K1cBP7GMUl0KN3I4G JTYnGfVy404Jt1xhcV9u0Xmg7cC5t5fsnQw7BOHAONuJzBXDIRuTKeo7YnQS/FbQcduj SNIaC8nbl0zbVlAdILKgdQUjreBgSA4syIxx5xCBTIAB2vbw6TPiNEbFLV4eRHgef1zh qEQWDyV+OvCSMmIPWEey378NOXvNkehYuSOXONpugSF1idfRZvYCKSkHG19PqiJ6DKsQ grcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:subject:to:content-language:user-agent :mime-version:date:message-id:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=J7kYsQS8uINFmWrtw77xzAsDi2sHWjWBddXBhQHnK58=; b=P+x1LGgAtPuBdT/FGHxX/NJ/IFao0Cwjy3Quy01HPlGkCzveaYYbt/C7KRurm1RQFJ a5E+/Z9KvqF1xRI/mAohY4pM/7qt1Kglv3xN2wZEVY9k5prlILIvEoLqLtR8LDpD9zUf a2gtOmpWJ8c6nJRV6viuGH+iOkAvPAKeQlfzEmSGBTrVqAijMk0d3ummpMkrFzt1AHny unuzpwGMUp12Pj2yRVxxc4q59pMAH5KNcTz9wjT3LuNII8rPgWz12Mg3NY7wqwN2YFhM E83xfAF49Aza3VNfsDlBxVcdur0ZY50uEB0YlG1lyMnrQU3FYZEdU5sX3CN5vcpTOu4O p5qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=i3Ba7yjL; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id 28-20020a50875c000000b00446137df433si3454675edv.612.2022.08.24.01.19.05 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 01:19:06 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=i3Ba7yjL; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D30493856DDF for <ouuuleilei@gmail.com>; Wed, 24 Aug 2022 08:19:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D30493856DDF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661329143; bh=J7kYsQS8uINFmWrtw77xzAsDi2sHWjWBddXBhQHnK58=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=i3Ba7yjLVBGTrWZ84grSHPNJlk0fOmjSjP58e9ec5bwPqQsUlaj+tRFXUb6Iu4Jh4 xgP0tUibTo6s3/EiEOwM5h2IGVzCy78rH3As++le3gpR+9aOHPxWhYdMhReg0l91uZ wK3LhIbalP/sR1l1gdtiTE17c7hd4buQqGlVNuxY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id C8257385AC3C for <gcc-patches@gcc.gnu.org>; Wed, 24 Aug 2022 08:18:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C8257385AC3C Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27O8Dahh008740; Wed, 24 Aug 2022 08:18:04 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3j5g9kr452-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Aug 2022 08:18:04 +0000 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 27O8EAvd010084; Wed, 24 Aug 2022 08:18:03 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3j5g9kr44e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Aug 2022 08:18:03 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 27O856nV008308; Wed, 24 Aug 2022 08:18:01 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma06ams.nl.ibm.com with ESMTP id 3j2pvj4uvv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Aug 2022 08:18:01 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 27O8Ex1Y29098456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Aug 2022 08:14:59 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 57B22A4040; Wed, 24 Aug 2022 08:17:59 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 88504A404D; Wed, 24 Aug 2022 08:17:57 +0000 (GMT) Received: from [9.197.255.133] (unknown [9.197.255.133]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 24 Aug 2022 08:17:57 +0000 (GMT) Message-ID: <1fb4035e-a15e-5031-3b2f-9ba5dfcb1786@linux.ibm.com> Date: Wed, 24 Aug 2022 16:17:55 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Content-Language: en-US To: GCC Patches <gcc-patches@gcc.gnu.org> Subject: [PATCH] rs6000/test: Adjust pr104992.c with vect_int_mod [PR106516] Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: JRzFDoSANav4xfo8wQ543lMGV8u5QtvF X-Proofpoint-ORIG-GUID: cZb17RWEZMWXIGx-RKovhP5KmeyFfmCj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-24_04,2022-08-22_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 adultscore=0 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 spamscore=0 phishscore=0 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208240032 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: "Kewen.Lin via Gcc-patches" <gcc-patches@gcc.gnu.org> Reply-To: "Kewen.Lin" <linkw@linux.ibm.com> Cc: Richard Sandiford <richard.sandiford@arm.com>, David Edelsohn <dje.gcc@gmail.com>, Segher Boessenkool <segher@kernel.crashing.org> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1742029870624260406?= X-GMAIL-MSGID: =?utf-8?q?1742029870624260406?= |
Series |
rs6000/test: Adjust pr104992.c with vect_int_mod [PR106516]
|
|
Commit Message
Kewen.Lin
Aug. 24, 2022, 8:17 a.m. UTC
Hi, As PR106516 shows, we can get unexpected gimple outputs for function thud on some target which supports modulus operation for vector int. This patch introduces one effective target vect_int_mod for it, then adjusts the test case with it. Tested on x86_64-redhat-linux and powerpc64{,le}-linux-gnu, especially powerpc64le Power10. Is it ok for trunk? BR, Kewen ----- PR testsuite/106516 gcc/testsuite/ChangeLog: * gcc.dg/pr104992.c: Adjust with vect_int_mod. * lib/target-supports.exp (check_effective_target_vect_int_mod): New proc for effective target vect_int_mod. --- gcc/testsuite/gcc.dg/pr104992.c | 3 ++- gcc/testsuite/lib/target-supports.exp | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) -- 2.27.0
Comments
Hi, I assumed the generic part introducing check_effective_target_vect_int_mod needs the approval from global maintainers. So gentle ping https://gcc.gnu.org/pipermail/gcc-patches/2022-August/600191.html BR, Kewen on 2022/8/24 16:17, Kewen.Lin via Gcc-patches wrote: > Hi, > > As PR106516 shows, we can get unexpected gimple outputs for > function thud on some target which supports modulus operation > for vector int. This patch introduces one effective target > vect_int_mod for it, then adjusts the test case with it. > > Tested on x86_64-redhat-linux and powerpc64{,le}-linux-gnu, > especially powerpc64le Power10. > > Is it ok for trunk? > > BR, > Kewen > ----- > PR testsuite/106516 > > gcc/testsuite/ChangeLog: > > * gcc.dg/pr104992.c: Adjust with vect_int_mod. > * lib/target-supports.exp (check_effective_target_vect_int_mod): New > proc for effective target vect_int_mod. > --- > gcc/testsuite/gcc.dg/pr104992.c | 3 ++- > gcc/testsuite/lib/target-supports.exp | 8 ++++++++ > 2 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/gcc/testsuite/gcc.dg/pr104992.c b/gcc/testsuite/gcc.dg/pr104992.c > index 217c89a458c..82f8c75559c 100644 > --- a/gcc/testsuite/gcc.dg/pr104992.c > +++ b/gcc/testsuite/gcc.dg/pr104992.c > @@ -54,4 +54,5 @@ __attribute__((noipa)) unsigned waldo (unsigned x, unsigned y, unsigned z) { > return x / y * z == x; > } > > -/* { dg-final {scan-tree-dump-times " % " 9 "optimized" } } */ > +/* { dg-final { scan-tree-dump-times " % " 9 "optimized" { target { ! vect_int_mod } } } } */ > +/* { dg-final { scan-tree-dump-times " % " 6 "optimized" { target vect_int_mod } } } */ > diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp > index 04a2a8e8659..a4bdd23bed0 100644 > --- a/gcc/testsuite/lib/target-supports.exp > +++ b/gcc/testsuite/lib/target-supports.exp > @@ -8239,6 +8239,14 @@ proc check_effective_target_vect_long_mult { } { > return $answer > } > > +# Return 1 if the target supports vector int modulus, 0 otherwise. > + > +proc check_effective_target_vect_int_mod { } { > + return [check_cached_effective_target_indexed vect_int_mod { > + expr { [istarget powerpc*-*-*] > + && [check_effective_target_power10_ok] }}] > +} > + > # Return 1 if the target supports vector even/odd elements extraction, 0 otherwise. > > proc check_effective_target_vect_extract_even_odd { } { > -- > 2.27.0
Hi! On Wed, Aug 24, 2022 at 04:17:55PM +0800, Kewen.Lin wrote: > As PR106516 shows, we can get unexpected gimple outputs for > function thud on some target which supports modulus operation > for vector int. This patch introduces one effective target > vect_int_mod for it, then adjusts the test case with it. > +# Return 1 if the target supports vector int modulus, 0 otherwise. > + > +proc check_effective_target_vect_int_mod { } { > + return [check_cached_effective_target_indexed vect_int_mod { > + expr { [istarget powerpc*-*-*] > + && [check_effective_target_power10_ok] }}] > +} power10_ok does not mean the vmod[su][wdq] instructions will be generated. You need to test if we have -mcpu=power10 or such, so, check_effective_target_has_arch_pwr10 . <X>_ok tests if it is okay to enable <X>. <X>_hw tests if the hardware can do <X>. has_arch_<X> tests if the compiler is asked to generate code for <X> (which is reflected in the _ARCH_* preprocessor symbols, hence the name). Okay for trunk with the correct check_effective_target_* . Thanks! Segher
On Wed, Sep 28, 2022 at 01:35:09PM +0800, Kewen.Lin wrote: > I assumed the generic part introducing check_effective_target_vect_int_mod > needs the approval from global maintainers. Target-specific testsuite changes can be approved by target maintainers. Currently this can be considered target-specific (since we are the only one implementing it), so :-) I know it is borderline. Segher
Hi Segher! on 2022/9/28 22:55, Segher Boessenkool wrote: > Hi! > > On Wed, Aug 24, 2022 at 04:17:55PM +0800, Kewen.Lin wrote: >> As PR106516 shows, we can get unexpected gimple outputs for >> function thud on some target which supports modulus operation >> for vector int. This patch introduces one effective target >> vect_int_mod for it, then adjusts the test case with it. > >> +# Return 1 if the target supports vector int modulus, 0 otherwise. >> + >> +proc check_effective_target_vect_int_mod { } { >> + return [check_cached_effective_target_indexed vect_int_mod { >> + expr { [istarget powerpc*-*-*] >> + && [check_effective_target_power10_ok] }}] >> +} > > power10_ok does not mean the vmod[su][wdq] instructions will be > generated. You need to test if we have -mcpu=power10 or such, so, > check_effective_target_has_arch_pwr10 . Indeed, the context is different from those cases in gcc.target/powerpc which have -mdejagnu-cpu=power10 normally. Thanks for catching and the correction! > > <X>_ok tests if it is okay to enable <X>. <X>_hw tests if the hardware > can do <X>. has_arch_<X> tests if the compiler is asked to generate > code for <X> (which is reflected in the _ARCH_* preprocessor symbols, > hence the name). > > Okay for trunk with the correct check_effective_target_* . Thanks! > Thanks, re-tested as before, committed in r13-2983. BR, Kewen
diff --git a/gcc/testsuite/gcc.dg/pr104992.c b/gcc/testsuite/gcc.dg/pr104992.c index 217c89a458c..82f8c75559c 100644 --- a/gcc/testsuite/gcc.dg/pr104992.c +++ b/gcc/testsuite/gcc.dg/pr104992.c @@ -54,4 +54,5 @@ __attribute__((noipa)) unsigned waldo (unsigned x, unsigned y, unsigned z) { return x / y * z == x; } -/* { dg-final {scan-tree-dump-times " % " 9 "optimized" } } */ +/* { dg-final { scan-tree-dump-times " % " 9 "optimized" { target { ! vect_int_mod } } } } */ +/* { dg-final { scan-tree-dump-times " % " 6 "optimized" { target vect_int_mod } } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 04a2a8e8659..a4bdd23bed0 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -8239,6 +8239,14 @@ proc check_effective_target_vect_long_mult { } { return $answer } +# Return 1 if the target supports vector int modulus, 0 otherwise. + +proc check_effective_target_vect_int_mod { } { + return [check_cached_effective_target_indexed vect_int_mod { + expr { [istarget powerpc*-*-*] + && [check_effective_target_power10_ok] }}] +} + # Return 1 if the target supports vector even/odd elements extraction, 0 otherwise. proc check_effective_target_vect_extract_even_odd { } {