From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 709413858C52 for ; Mon, 26 Sep 2022 05:41:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 709413858C52 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28Q4ZPgs005636; Mon, 26 Sep 2022 05:41:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=7MAQez2oj7MaYHrPQ0LKg4CnpYjsxoEj3byaEyYm7yg=; b=BPH0xlmTAOXjesL2+Rjwh7eGZxAgRwnJo2qH0SQC7OUZe0Dp4pmYDcf6kayn+AL1rWsp 5isoaBMlQXTWdtzQwtfn5u5pvaGPVno+6MxGyIod2mbbVKfGbnE7dv9qGhL3rwYc6W2e skgSqCeJylnQmPZvji7vblCkf0R835YnYwidQTN0OfoIN3WuaLImSfXs5tfMfq2+6J2L 5fb+62YThqgaGeJrR6pnbV89NGeyGPKwG1KEF20Uhs05RhHHLTchmr2gMZyan9aUib8c LvWHkzTpQtdyLewk4ZHtOOckgB9BB4rV1g2gQgHxu/qfa/HtuF41xoRRafNp2NUzZVbU yA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jtbq8b18e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Sep 2022 05:41:12 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 28Q5axW4011626; Mon, 26 Sep 2022 05:41:11 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 3jtbq8b17n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Sep 2022 05:41:11 +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 28Q5ZedM009153; Mon, 26 Sep 2022 05:41:09 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma06ams.nl.ibm.com with ESMTP id 3jss5j1x6f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Sep 2022 05:41:09 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 28Q5f61g54657502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Sep 2022 05:41:07 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DC04911C04A; Mon, 26 Sep 2022 05:41:06 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EE33211C04C; Mon, 26 Sep 2022 05:41:04 +0000 (GMT) Received: from [9.197.236.181] (unknown [9.197.236.181]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 26 Sep 2022 05:41:04 +0000 (GMT) Message-ID: <6b067dfb-5091-5773-e9c8-ab9fad8042f7@linux.ibm.com> Date: Mon, 26 Sep 2022 13:41:03 +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 Subject: Re: [PATCH] rs6000: Fix condition of define_expand vec_shr_ [PR100645] Content-Language: en-US To: Segher Boessenkool Cc: GCC Patches , David Edelsohn , Peter Bergner References: <354edbb1-e0b0-07b3-ceb7-456442781b0b@linux.ibm.com> <20220922213923.GJ25951@gate.crashing.org> From: "Kewen.Lin" In-Reply-To: <20220922213923.GJ25951@gate.crashing.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: cFsIfF0GP8Bov4WfUvEwuxFmQj8bCiGT X-Proofpoint-ORIG-GUID: QEh8dEbhI-oeYgtHpJ73CGvvf6mfu5ug X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-26_04,2022-09-22_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 priorityscore=1501 phishscore=0 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 adultscore=0 mlxscore=0 malwarescore=0 impostorscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209260033 X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,KAM_SHORT,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Segher, Thanks for the comments! on 2022/9/23 05:39, Segher Boessenkool wrote: > Hi! > > Heh, I first thought I had mistyped thgew PR #, but it is this one after > all :-) > > On Thu, Sep 22, 2022 at 09:41:34AM +0800, Kewen.Lin wrote: >> PR100645 exposes one latent bug in define_expand vec_shr_ >> that the current condition TARGET_ALTIVEC is too loose. The >> mode iterator VEC_L contains a few modes, they are not always >> supported as vector mode, VECTOR_UNIT_ALTIVEC_OR_VSX_P should >> be used like some other VEC_L usages. > >> --- a/gcc/config/rs6000/vector.md >> +++ b/gcc/config/rs6000/vector.md >> @@ -1475,7 +1475,7 @@ (define_expand "vec_shr_" >> [(match_operand:VEC_L 0 "vlogical_operand") >> (match_operand:VEC_L 1 "vlogical_operand") >> (match_operand:QI 2 "reg_or_short_operand")] >> - "TARGET_ALTIVEC" >> + "VECTOR_UNIT_ALTIVEC_OR_VSX_P (mode)" > >> --- /dev/null >> +++ b/gcc/testsuite/gcc.target/powerpc/pr100645.c >> @@ -0,0 +1,13 @@ >> +/* { dg-require-effective-target powerpc_altivec_ok } */ >> +/* { dg-options "-mdejagnu-cpu=power6 -maltivec" } */ > > This is a strange choice: we normally do not enable VMX on p6. Just use > p7 instead? There is no need for altivec_ok in any case, the -mcpu= > guarantees it is satisfied. Unfortunately a single power7 doesn't work for this case, since it (VSX) makes rs6000_vector_mem[TImode] not VECTOR_NONE any more, we need one extra -mno-vsx to reproduce this. As you mentioned above, power6 doesn't enable altivec by default, I noticed altivec_ok excludes some envs like aix 5.3 etc., and also ensures it's fine to have an explicit maltivec there, so I added it for robustness. > >> +/* It's to verify no ICE here. */ > > "This used to ICE."? Updated. > > Please commit this now, looks good. Thanks! > Committed in r13-2844. Thanks! BR, Kewen