From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 59054385841F for ; Tue, 25 Oct 2022 05:29:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 59054385841F 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 (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29P5EooB007250 for ; Tue, 25 Oct 2022 05:29:04 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=OqyD8HPaL4Ic9D8hRt7HFuN3oT7Xz7wavGbfAxbUbcE=; b=ZidSAlkX2IZz+yWnGRIFY5uRwJJ8hG2NLFOWdAehmTXKXzuhBsiA/7NDncYRWnqnWrDy Vvyv7w3FSHxlbON/VOUqwhFlo74MSDboEQuUB7TSUogVnHwj1Cgx3WYZShdIdFWPrxQZ zYPmYB1dikaorIfHHojWCHUTYuKw4hNN9pFW1SzgRouogGCsphugPLOICiWD34ZovSEU o30bhSqvcv4J8eucsFbgPnKE0iK4vUZM05NIfzDR44hnjoPhFPVd8FUE0ybfcNHR/4dA 8YsKsy9qgJjFRMnw+uTBERmziSt/kCOw2ZdEVBNVo8ab8sK8557OR+mEVrSckl+Duamz 6w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3ke9fqrcej-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 25 Oct 2022 05:29:03 +0000 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 29P5Fs0A011213 for ; Tue, 25 Oct 2022 05:29:03 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3ke9fqrcdw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Oct 2022 05:29:03 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 29P5KqRC028030; Tue, 25 Oct 2022 05:29:01 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma03ams.nl.ibm.com with ESMTP id 3kdugas2ra-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Oct 2022 05:29:01 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 29P5SxQn65863978 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Oct 2022 05:28:59 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 57EF1A405C; Tue, 25 Oct 2022 05:28:59 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6CCB6A405B; Tue, 25 Oct 2022 05:28:58 +0000 (GMT) Received: from [9.197.227.133] (unknown [9.197.227.133]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 25 Oct 2022 05:28:58 +0000 (GMT) Message-ID: <775d8a6a-00b8-d486-20da-2b4c00dfb555@linux.ibm.com> Date: Tue, 25 Oct 2022 13:28:56 +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: vect: Fix wrong shift_n after widening on BE [PR107338] Content-Language: en-US To: Richard Biener Cc: GCC Patches References: <95d598d7-4f00-ad36-08f9-4b5942e48e42@linux.ibm.com> From: "Kewen.Lin" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: dhnpDZn2LuYZLPsIszeXOEW31AjX4bTk X-Proofpoint-ORIG-GUID: qLve_cgtQHA0ftgNSYKC_eL3VoFy5Edv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-25_01,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 impostorscore=0 mlxlogscore=691 clxscore=1015 bulkscore=0 phishscore=0 malwarescore=0 spamscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210250028 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,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: on 2022/10/24 20:55, Richard Biener wrote: > On Mon, Oct 24, 2022 at 12:43 PM Kewen.Lin wrote: >> >> Hi, >> >> As PR107338 shows, with the use of widening loads, the >> container_type can become a wider type, it causes us to >> get wrong shift_n since the BIT_FIELD_REF offset actually >> becomes bigger on BE. Taking the case in PR107338 as >> example, at the beginning the container type is short and >> BIT_FIELD_REF offset is 8 and size is 4, with unpacking to >> wider type int, the high 16 bits are zero, by viewing it >> as type int, its offset actually becomes to 24. So the >> shift_n should be 4 (32 - 24 - 4) instead of 20 (32 - 8 >> - 4). >> >> I noticed that if we move shift_n calculation early >> before the adjustments for widening loads (container type >> change), it's based on all the stuffs of the original >> container, the shfit_n calculated there is exactly what >> we want, it can be independent of widening. Besides, I >> add prec adjustment together with the current adjustments >> for widening loads, although prec's subsequent uses don't >> require this change for now, since the container type gets >> changed, we should keep the corresponding prec consistent. >> >> Bootstrapped and regtested on x86_64-redhat-linux, >> aarch64-linux-gnu, powerpc64-linux-gnu P7 and P8 and >> powerpc64le-linux-gnu P9 and P10. >> >> Is it ok for trunk? > > OK. Thanks Richi, committed in r13-3474. BR, Kewen