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 5C9203858D35 for ; Thu, 7 Sep 2023 01:28:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C9203858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=loongson.cn Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qe3oi-0007hj-NM for gcc-patches@gcc.gnu.org; Wed, 06 Sep 2023 21:28:23 -0400 Received: from loongson.cn (unknown [10.20.4.107]) by gateway (Coremail) with SMTP id _____8Dxg_AqJ_lksvMgAA--.810S3; Thu, 07 Sep 2023 09:28:10 +0800 (CST) Received: from [10.20.4.107] (unknown [10.20.4.107]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxjiMqJ_lkz79vAA--.31521S3; Thu, 07 Sep 2023 09:28:10 +0800 (CST) Subject: Re: [PATCH v1 1/4] LoongArch: Add tests of -mstrict-align option. To: Xi Ruoyao , Xiaolong Chen , gcc-patches@gcc.gnu.org Cc: i@xen0n.name, xuchenghua@loongson.cn References: <20230906104307.37244-1-chenxiaolong@loongson.cn> <20230906104307.37244-2-chenxiaolong@loongson.cn> <923e96652d4310b2b4a6e4b38c6f5a3bde2c852d.camel@xry111.site> From: chenglulu Message-ID: <0ed89bc8-e1ea-454c-63be-7bf202250a00@loongson.cn> Date: Thu, 7 Sep 2023 09:28:10 +0800 User-Agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <923e96652d4310b2b4a6e4b38c6f5a3bde2c852d.camel@xry111.site> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID:AQAA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wI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJV W8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07jUsqXU UUUU= Received-SPF: pass client-ip=114.242.206.163; envelope-from=chenglulu@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9,NICE_REPLY_A=-1.473,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00,BODY_8BITS,GIT_PATCH_0,KAM_DMARC_STATUS,KAM_SHORT,NICE_REPLY_A,SPF_FAIL,SPF_HELO_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: 在 2023/9/6 下午7:10, Xi Ruoyao 写道: > On Wed, 2023-09-06 at 18:43 +0800, Xiaolong Chen wrote: >> gcc/testsuite/ChangeLog: >> >>         * gcc.target/loongarch/strict-align.c: New test. > A question: is there really a CPU model with LSX/LASX but without > unaligned access support? If not I think we'd just reject -mstrict- > align -mlsx. > > Currently Glibc assumes if LSX is available then unaligned access must > be available too. This is not a question of support or unsupport, the original intention is to need to naturally align memory access to improve performance after enabling LSX, but this part of the code has not been ported to the main branch, so we will submit this test example after adding the corresponding function. Thanks! > >> --- >>  gcc/testsuite/gcc.target/loongarch/strict-align.c | 13 +++++++++++++ >>  1 file changed, 13 insertions(+) >>  create mode 100644 gcc/testsuite/gcc.target/loongarch/strict-align.c >> >> diff --git a/gcc/testsuite/gcc.target/loongarch/strict-align.c >> b/gcc/testsuite/gcc.target/loongarch/strict-align.c >> new file mode 100644 >> index 00000000000..bcad2b84f68 >> --- /dev/null >> +++ b/gcc/testsuite/gcc.target/loongarch/strict-align.c >> @@ -0,0 +1,13 @@ >> +/* { dg-do compile } */ >> +/* { dg-options "-Ofast -mstrict-align -mlasx" } */ >> +/* { dg-final { scan-assembler-not "vfadd.s" } } */ >> + >> +void >> +foo (float* restrict x, float* restrict y) >> +{ >> +  x[0] = x[0] + y[0]; >> +  x[1] = x[1] + y[1]; >> +  x[2] = x[2] + y[2]; >> +  x[3] = x[3] + y[3]; >> +} >> +