From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 07A213858D39 for ; Mon, 3 Apr 2023 11:31:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 07A213858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 333BUsbR006234; Mon, 3 Apr 2023 06:30:54 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 333BUscC006233; Mon, 3 Apr 2023 06:30:54 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 3 Apr 2023 06:30:53 -0500 From: Segher Boessenkool To: "Kewen.Lin" Cc: HAO CHEN GUI , David , Peter Bergner , gcc-patches Subject: Re: [PATCH, rs6000] rs6000: correct vector sign extend built-ins on Big Endian [PR108812] Message-ID: <20230403113053.GZ25951@gate.crashing.org> References: <5c8378a8-03fc-7003-6ad8-f3cf30a78c45@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5c8378a8-03fc-7003-6ad8-f3cf30a78c45@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no 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 Mon, Mar 27, 2023 at 03:14:26PM +0800, Kewen.Lin wrote: > on 2023/3/27 14:16, HAO CHEN GUI wrote: > > This patch removes byte reverse operation before vector integer sign > > extension on Big Endian. These built-ins require to sign extend the rightmost > > element. So both BE and LE should do the same operation and the byte reversion > > is no need. This patch fixes it. Now these built-ins have the same behavior on > > all compilers. The test case is modified also. When extending from sizes A to B the rightmost A in every B. That is the same in every endianness, yes -- it is what the machine insns do after all, it has nothing to do with how the elements are numbered in the ABI :-) > I think the whole define_expand can be removed, we can just use the > define_insn names vsx_sign_extend_qi_* in rs6000-builtins.def (just > like what you changed for __builtin_altivec_vsignextsw2d). A very welcome cleanup :-) > One interesting thing is that we used qi/hi/si in the name for > V16QI/V8HI/V4SI but used v2di for V2DI, could you also adjust the > names from vsx_sign_extend_{qi,hi,si}_* to ..._{v16qi,v8hi,v4si}_* > then make them adopt the same naming style? Yes please :-) Segher