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 D4C633858D1E for ; Tue, 4 Apr 2023 05:19:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D4C633858D1E 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 (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33422n9a023182; Tue, 4 Apr 2023 05:19:55 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=F3y65fJJehrsOPYe6MhQimAoOZrrmHR70O41SSa3yU4=; b=MQ3swok3S2YfcvQqM62UcZxu0TJhpKbVb6v2GCPVAfQDkKvSpGHJmBr5CzH0Y6pvv0Xw iaLssRuS7f8D5OD2o/FbnKhRBKrYnzz5RdJvv0ee3g6kQnFcISYKBZx453mj/ASwiFMR vHdR0QSevhjDAeLUuMW+KWzYnzKIoQGPB/IHpXbemt584Js9cZc+GYlWA6q0yLp+Gbft ztpO++DV4iONlqzT+wkpdB7qmQpGYk+L4yptXLV9CR01nXpzcxSPifvQqKa+q+XHaiPi fryimymcBwgmYMvojQiJM1sRYaQMQDibRywYbeHgNrmJG+BU6FmOLi45F1AXJaa5goly ww== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ppxes1bq9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Apr 2023 05:19:55 +0000 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3345Hgmr030374; Tue, 4 Apr 2023 05:19:55 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ppxes1bpg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Apr 2023 05:19:55 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 33449guj027022; Tue, 4 Apr 2023 05:19:52 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3ppc86sp4n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Apr 2023 05:19:52 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3345JoIu46924282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 4 Apr 2023 05:19:50 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1B2D22004B; Tue, 4 Apr 2023 05:19:50 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D73B820040; Tue, 4 Apr 2023 05:19:48 +0000 (GMT) Received: from [9.43.232.112] (unknown [9.43.232.112]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 4 Apr 2023 05:19:48 +0000 (GMT) Message-ID: Date: Tue, 4 Apr 2023 13:19:47 +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 vector_set_var_p9 by considering BE [PR108807] Content-Language: en-US To: Segher Boessenkool Cc: GCC Patches , David Edelsohn , Peter Bergner References: <737a5392-29f8-763c-8dc7-b48c36edb1a7@linux.ibm.com> <20230403114406.GA25951@gate.crashing.org> From: "Kewen.Lin" In-Reply-To: <20230403114406.GA25951@gate.crashing.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: mJC0ZT5E1MATTnsSpeEBKyUNZhwAj5dO X-Proofpoint-GUID: 18lnC9gWDrUyEzFxmZA1pGTkJW_IxIua X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-03_19,2023-04-03_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 phishscore=0 clxscore=1015 suspectscore=0 bulkscore=0 malwarescore=0 impostorscore=0 mlxscore=0 adultscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304040046 X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,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 review! on 2023/4/3 19:44, Segher Boessenkool wrote: > Hi! > > On Fri, Feb 17, 2023 at 05:55:04PM +0800, Kewen.Lin wrote: >> As PR108807 exposes, the current handling in function >> rs6000_expand_vector_set_var_p9 doesn't take care of big >> endianness. Currently the function is to rotate the >> target vector by moving element to-be-set to element 0, >> set element 0 with the given val, then rotate back. To >> get the permutation control vector for the rotation, it >> makes use of lvsr and lvsl, but the element ordering is >> different for BE and LE (like element 0 is the most >> significant one on BE while the least significant one on >> LE), this patch is to add consideration for BE and make >> sure permutation control vectors for rotations are expected. > >> --- a/gcc/config/rs6000/rs6000.cc >> +++ b/gcc/config/rs6000/rs6000.cc >> @@ -7235,22 +7235,26 @@ rs6000_expand_vector_set_var_p9 (rtx target, rtx val, rtx idx) >> >> machine_mode shift_mode; >> rtx (*gen_ashl)(rtx, rtx, rtx); >> - rtx (*gen_lvsl)(rtx, rtx); >> - rtx (*gen_lvsr)(rtx, rtx); >> + rtx (*gen_pcvr1)(rtx, rtx); >> + rtx (*gen_pcvr2)(rtx, rtx); > > Space before "(" btw, you can fix that at the same time? :-) > Good catch, fixed. > What does "pcvr" mean? You could put that in a short comment? > >> + /* Generate one permutation control vector used for rotating the element > > Ah. Yeah just "/* Permutation control vector */" for the above one > prevents all mysteries :-) One comment line added for gen_* function pointers. > > Patch looks good. Thanks! > Pushed as r13-6994-gd634e6088f139e, thanks! BR, Kewen