From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id C575A3858C41 for ; Mon, 15 Jan 2024 07:50:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C575A3858C41 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C575A3858C41 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=89.208.246.23 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705305032; cv=none; b=iW8iDrO523nPwiwmw0u3UCnSfuM1Qr/4h3fkqzTxN8pgH+5PwIBayCe2AvrvYGKkxxUdyUmdOC6bCSEKJF2z5Jl2eQ8DQ71vV1z5Ex9dSi4ir+Cxx1t31BCAoR5WcZWiBzOotRxd3HqjqDbHNTceDjMl0FKf2uTPJHmLJGKaopc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705305032; c=relaxed/simple; bh=zBLybeQmVMIYjU0LnEnCY4YfUr5DAhgFhTc6ccVcpqc=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=RWo+uI8n0W96ptJ9q5/CBdF4dX6FL+IX4xYZVHh/E8G0nuwHeGm5r+IM2Hcvm883wbEsCVlpmFjGnDT/YtGn24tbNDRp99bJgMjWEgOpN7SInbwg3c5PFzxpcSA9oBZRD8T5ofG+2+is35peDLDWIGsX8PK3kgeNCjL+jfWvzi8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1705305028; bh=zBLybeQmVMIYjU0LnEnCY4YfUr5DAhgFhTc6ccVcpqc=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=YDuIkHOCN12T+LE39HdDuI8hR8Gh3WErZOQ3d2DOwlzrED7YnCm1fP7/hz3NxfTPs ajC9mWBGmEfEBU5OEb5iLdr4FdfsBw8D3t58WCqxq1qLEHabMU+2hmGES7JpZ4yxrP /FS8BgB3r4MEdpvLXxfv5q0otlQey1YtdRezJsvM= Received: from [127.0.0.1] (unknown [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 3885A66CB5; Mon, 15 Jan 2024 02:50:25 -0500 (EST) Message-ID: <870c3b36f3d88d56f38cbdeeb7c4301e6fa32cb2.camel@xry111.site> Subject: Re: [PATCH v2] LoongArch: testsuite:Added additional vectorization "-mlsx" option. From: Xi Ruoyao To: chenxiaolong , 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:50:24 +0800 In-Reply-To: <72675360c53a3d73a2171ca9e45d7e3049025c25.camel@loongson.cn> References: <20240113072817.31932-1-chenxiaolong@loongson.cn> <36fa3e47dfb106a150f113a300ecff6a7c869237.camel@xry111.site> <8654a1de861c86eda083dced141bc928df3930f4.camel@loongson.cn> <7b74e3f09cd083e489850774f2c85079bd470301.camel@xry111.site> <72675360c53a3d73a2171ca9e45d7e3049025c25.camel@loongson.cn> Autocrypt: addr=xry111@xry111.site; prefer-encrypt=mutual; keydata=mDMEYnkdPhYJKwYBBAHaRw8BAQdAsY+HvJs3EVKpwIu2gN89cQT/pnrbQtlvd6Yfq7egugi0HlhpIFJ1b3lhbyA8eHJ5MTExQHhyeTExMS5zaXRlPoiTBBMWCgA7FiEEkdD1djAfkk197dzorKrSDhnnEOMFAmJ5HT4CGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQrKrSDhnnEOPHFgD8D9vUToTd1MF5bng9uPJq5y3DfpcxDp+LD3joA3U2TmwA/jZtN9xLH7CGDHeClKZK/ZYELotWfJsqRcthOIGjsdAPuDgEYnkdPhIKKwYBBAGXVQEFAQEHQG+HnNiPZseiBkzYBHwq/nN638o0NPwgYwH70wlKMZhRAwEIB4h4BBgWCgAgFiEEkdD1djAfkk197dzorKrSDhnnEOMFAmJ5HT4CGwwACgkQrKrSDhnnEOPjXgD/euD64cxwqDIqckUaisT3VCst11RcnO5iRHm6meNIwj0BALLmWplyi7beKrOlqKfuZtCLbiAPywGfCNg8LOTt4iMD Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.3 MIME-Version: 1.0 X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,LIKELY_SPAM_FROM,SPF_HELO_PASS,SPF_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: 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=EF=BC=9A > > On Mon, 2024-01-15 at 14:32 +0800, YunQiang Su wrote: > > > Xi Ruoyao wrote at 12:11pm on Monday, January > > > 15, 2024=EF=BC=9A > > > > On Mon, 2024-01-15 at 09:29 +0800, chenxiaolong wrote: > > > > > At 21:13 +0800 on Saturday, 2024-01-13, Xi Ruoyao wrote=EF=BC=9A > > > > > > At 15:28 +0800 on Saturday 2024-01-13, chenxiaolong wrote=EF=BC= =9A > > > > > > > gcc/testsuite/ChangeLog: > > > > > > >=20 > > > > > > > =C2=A0=C2=A0 * gcc.dg/pr104992.c: Added additional "-mlsx" co= mpilation > > > > > > > options. > > > > > > > =C2=A0=C2=A0 * gcc.dg/signbit-2.c: Dito. > > > > > > > =C2=A0=C2=A0 * gcc.dg/tree-ssa/scev-16.c: Dito. > > > > > > > =C2=A0=C2=A0 * gfortran.dg/graphite/vect-pr40979.f90: Dito. > > > > > > > =C2=A0=C2=A0 * gfortran.dg/vect/fast-math-mgrid-resid.f: Dito= . > > > > > >=20 > > > > > > I don't feel it right about the changes to pr104992.c and > > > > > > scev-16.c > > > > > > because no other architectures add special options there.=20 > > > > > > 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. > > > >=20 > > > > But no.=C2=A0 The default baseline of 32-bit x86 is i686, which is > > > > basically > > > > a Pentium III launched in 1999 without any vector instructions. > > > >=20 > > > > We are still missing something here. > > > >=20 > > > There is a line > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #define vector __attribute__((vector_s= ize(4*sizeof(int)))) > > > I guess it is the syntax needs to be supported. > >=20 > > This is always supported.=C2=A0 If the target does not have vector > > instructions GCC will just expand vector arithmetic as a loop. > >=20 > > Maybe we should just move this test into gcc.dg/vect where the > > framework > > automatically add options like -mlsx or -msse2? > >=20 >=20 > 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. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University