From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 5290F3858D20 for ; Mon, 15 Jan 2024 07:10:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5290F3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5290F3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705302621; cv=none; b=q/Cs2MJSnIfxIBlr/xI+GLVz41IThLK04QD+wF+04rPQGajkVhx9+vH8BRnWhEVH7XzqdhcOC1lRNNYfbhM58xJ7c7vJHay8iA98v9nL7xcF3MdAz0nBPJxXxYi7D7Q+iiquBQAn8xPZbUPv24NgQI0bABmOd7G7yTtjgnLbCAs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705302621; c=relaxed/simple; bh=lJK+IEtCgTNOmk4IlIokn4BR50JXgzfqwMUEFHuujLM=; h=Message-ID:Subject:From:To:Date:MIME-Version; b=DUE2DhicYfHMTUzacnoSqQ0oCHCz2ULF99Kw4OiDvlUiitfhp/GnO1yjUU96j37hLLYqfoVRfbaIzPMmZrAyxhDOVOe2/si9MYSpeaZBjO6wrnmOLz+RZiwPXBCkaYPW+qPi/S/lA1q6Nb1Qm9AhEt6zjNIuq1OFzY70pz5+fg8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from loongson.cn (unknown [10.20.4.86]) by gateway (Coremail) with SMTP id _____8AxjutW2qRlmEQAAA--.996S3; Mon, 15 Jan 2024 15:10:15 +0800 (CST) Received: from [10.20.4.86] (unknown [10.20.4.86]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxTs1V2qRl8LUBAA--.6688S3; Mon, 15 Jan 2024 15:10:13 +0800 (CST) Message-ID: <72675360c53a3d73a2171ca9e45d7e3049025c25.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: Mon, 15 Jan 2024 15:10:13 +0800 In-Reply-To: <7b74e3f09cd083e489850774f2c85079bd470301.camel@xry111.site> References: <20240113072817.31932-1-chenxiaolong@loongson.cn> <36fa3e47dfb106a150f113a300ecff6a7c869237.camel@xry111.site> <8654a1de861c86eda083dced141bc928df3930f4.camel@loongson.cn> <7b74e3f09cd083e489850774f2c85079bd470301.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:AQAAf8AxTs1V2qRl8LUBAA--.6688S3 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQAPBWWh4SoAzQAHsO X-Coremail-Antispam: 1Uk129KBj93XoW7AF1fGw18Aw4xJFWDArW7WrX_yoW8tw18pF y0k3Zxta1kGF1xZr42qrs2qr4Fk34fGw4DXw1rKw1I9ryDKw1vqr43t3yrua43W3WfJw1a vayUJ347u34DZFcCm3ZEXasCq-sJn29KB7ZKAUJUUUU5529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUvYb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxYO2xFxVAFwI0_JF0_Jw1lx2IqxVAqx4xG 67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MI IYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E 14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJV W8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07j1WlkU UUUU= X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: 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.