From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 131423858C2C for ; Tue, 16 Jan 2024 02:57:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 131423858C2C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 131423858C2C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705373841; cv=none; b=AQyXHaSAG4glTeLVnTgcvnIbJMhC6CyPfmewMgqJtBchP9RJtnMCdqhAS6HLen4DeP04yQfS/0grqyfHYxwwcgNEqW4d574N+XhrcfuPPdwW3B/lOr6S5MYcOBY//0gAfofpv40ruIwQxEOtNqhhVgY8fhu4stG06hZb4/9QsEQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705373841; c=relaxed/simple; bh=Fhyt+Oemqe9hLzRVL0Scbzjw6NuMKG2G2cEMVtVrFzw=; h=Message-ID:Subject:From:To:Date:MIME-Version; b=kaHfRaocglQMK5EiYR0cx5805+KfLN2XclRJt7JqwmTnfiE20NzwFLkgLoSvEJzy0Q7ro9uqmf3RZTKyhEqoC9UGANLXAnXRAFAExgPsB9ok3f5E/c73nFC/LEXA8U8rwGhlpeom0tpVvZj13citWdpsQiPAMJXgsJk3/15S0fQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPZda-0007oF-WF for gcc-patches@gcc.gnu.org; Mon, 15 Jan 2024 21:57:18 -0500 Received: from loongson.cn (unknown [10.20.4.86]) by gateway (Coremail) with SMTP id _____8BxXeuA8KVl8Y0AAA--.2531S3; Tue, 16 Jan 2024 10:57:05 +0800 (CST) Received: from [10.20.4.86] (unknown [10.20.4.86]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Bx7c5_8KVlFScDAA--.16444S3; Tue, 16 Jan 2024 10:57:03 +0800 (CST) Message-ID: <6e608699db17a4f37b4bddf156d5c59759672e34.camel@loongson.cn> Subject: Re: [PATCH v2] LoongArch: testsuite:Added additional vectorization "-mlsx" option. From: chenxiaolong To: Xi Ruoyao , YunQiang Su Cc: gcc-patches@gcc.gnu.org, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, schwab@linux-m68k.org, ci_notify@linaro.org Date: Tue, 16 Jan 2024 10:57:03 +0800 In-Reply-To: <870c3b36f3d88d56f38cbdeeb7c4301e6fa32cb2.camel@xry111.site> References: <20240113072817.31932-1-chenxiaolong@loongson.cn> <36fa3e47dfb106a150f113a300ecff6a7c869237.camel@xry111.site> <8654a1de861c86eda083dced141bc928df3930f4.camel@loongson.cn> <7b74e3f09cd083e489850774f2c85079bd470301.camel@xry111.site> <72675360c53a3d73a2171ca9e45d7e3049025c25.camel@loongson.cn> <870c3b36f3d88d56f38cbdeeb7c4301e6fa32cb2.camel@xry111.site> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:AQAAf8Bx7c5_8KVlFScDAA--.16444S3 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQASBWWk7N8INgABsb X-Coremail-Antispam: 1Uk129KBj93XoWxWrW5KFykCrWfWrW7Jr47Awc_yoWrJw47pF yUCasrtFs5GF1xAr12qr40qr4Fk34fJw4UXr1rK3yIgr90gr1kJr45t3y5ua47Wr1fGw1Y v3yUXry3uw1UAFcCm3ZEXasCq-sJn29KB7ZKAUJUUUU3529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUU9Eb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4j6r4UJwAaw2AFwI0_JF0_Jw1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0c Ia020Ex4CE44I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JF0_ Jw1lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrw CY1x0262kKe7AKxVWUAVWUtwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8 JwCFI7km07C267AKxVWUAVWUtwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14 v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY 67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2 IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_ Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU8nmRUUUUUU== Received-SPF: pass client-ip=114.242.206.163; envelope-from=chenxiaolong@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9,SPF_HELO_NONE=0.001,SPF_PASS=-0.001,T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,BODY_8BITS,KAM_DMARC_STATUS,SPF_FAIL,SPF_HELO_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: 在 2024-01-15一的 15:50 +0800,Xi Ruoyao写道: > On Mon, 2024-01-15 at 15:10 +0800, chenxiaolong wrote: > > At 14:42 +0800 on the first day of 2024-01-15, Xi Ruoyao wrote: > > > On Mon, 2024-01-15 at 14:32 +0800, YunQiang Su wrote: > > > > Xi Ruoyao wrote at 12:11pm on Monday, > > > > January > > > > 15, 2024: > > > > > On Mon, 2024-01-15 at 09:29 +0800, chenxiaolong wrote: > > > > > > At 21:13 +0800 on Saturday, 2024-01-13, Xi Ruoyao wrote: > > > > > > > At 15:28 +0800 on Saturday 2024-01-13, chenxiaolong > > > > > > > wrote: > > > > > > > > gcc/testsuite/ChangeLog: > > > > > > > > > > > > > > > > * gcc.dg/pr104992.c: Added additional "-mlsx" > > > > > > > > compilation > > > > > > > > options. > > > > > > > > * gcc.dg/signbit-2.c: Dito. > > > > > > > > * gcc.dg/tree-ssa/scev-16.c: Dito. > > > > > > > > * gfortran.dg/graphite/vect-pr40979.f90: Dito. > > > > > > > > * gfortran.dg/vect/fast-math-mgrid-resid.f: Dito. > > > > > > > > > > > > > > I don't feel it right about the changes to pr104992.c and > > > > > > > scev-16.c > > > > > > > because no other architectures add special options > > > > > > > there. > > > > > > > Why are we > > > > > > > so special? > > > > > > Because on the LoongArch architecture, GCC requires the > > > > > > addition of > > > > > > vectorization options in order to generate vector code. Use > > > > > > the > > > > > > check_effective_target_vect_cmdline_needed command in the > > > > > > lib/target- > > > > > > supports.exp file to set whether the command line option is > > > > > > needed to > > > > > > enable vectorizations. For example, ia64,x86,aarch64, and > > > > > > riscv > > > > > > architectures, vectorization is enabled by default. > > > > > > > > > > But no. The default baseline of 32-bit x86 is i686, which is > > > > > basically > > > > > a Pentium III launched in 1999 without any vector > > > > > instructions. > > > > > > > > > > We are still missing something here. > > > > > > > > > There is a line > > > > #define vector > > > > __attribute__((vector_size(4*sizeof(int)))) > > > > I guess it is the syntax needs to be supported. > > > > > > This is always supported. If the target does not have vector > > > instructions GCC will just expand vector arithmetic as a loop. > > > > > > Maybe we should just move this test into gcc.dg/vect where the > > > framework > > > automatically add options like -mlsx or -msse2? > > > > > > > The "-mlsx" option is turned on by default after vectorization > > testing > > is turned on. However, the use of dg-options in some files resets > > the > > compilation options for testing this file. Therefore, to detect > > vectorization on LoongArch, it is necessary to add an additional "- > > mlsx" option. > > Then it should use dg-additional-options instead of dg-options. > According to your advice, I have tried the following two ways: (1)Replace dg-options directly with dg-additional-options. The "-ansi- pedantic-errors" set in the dg.exp file is used, and the following problems occur: gcc.dg/pr104992.c:ISO C90 does not support complex types. gcc.dg/tree-ssa/scev-16.c:‘for’ loop initial declarations are only allowed in C99 or C11 mode Note: The ISO required by the program is inconsistent with the default standard, resulting in an error. (2)Move pr104992.c and scev-16.c to the gcc.dg/vect directory and replace dg-options with dg-additional-options. The problems are as follows: gcc.dg/vect/scev-16.c: Because there is no test rule starting with scev* in the vect.exp file, you need to add a new test rule or change the file name before the test can be performed. Summary: It is more appropriate to add the additional "-mlsx" option directly to the pr104992.c and scev-16.c files. This supports vectorization testing of the LoongArch architecture and does not modify the testing behavior of other architectures.