public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: chenglulu <chenglulu@loongson.cn>
To: Xi Ruoyao <xry111@xry111.site>,
	Xiaolong Chen <chenxiaolong@loongson.cn>,
	gcc-patches@gcc.gnu.org
Cc: i@xen0n.name, xuchenghua@loongson.cn
Subject: Re: [PATCH v1 1/4] LoongArch: Add tests of -mstrict-align option.
Date: Thu, 7 Sep 2023 09:28:10 +0800	[thread overview]
Message-ID: <0ed89bc8-e1ea-454c-63be-7bf202250a00@loongson.cn> (raw)
In-Reply-To: <923e96652d4310b2b4a6e4b38c6f5a3bde2c852d.camel@xry111.site>


在 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];
>> +}
>> +


      reply	other threads:[~2023-09-07  1:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06 10:43 [PATCH v1 0/4] Add Loongson SX/ASX instruction support to LoongArch Xiaolong Chen
2023-09-06 10:43 ` [PATCH v1 1/4] LoongArch: Add tests of -mstrict-align option Xiaolong Chen
2023-09-06 11:10   ` Xi Ruoyao
2023-09-07  1:28     ` chenglulu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ed89bc8-e1ea-454c-63be-7bf202250a00@loongson.cn \
    --to=chenglulu@loongson.cn \
    --cc=chenxiaolong@loongson.cn \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=i@xen0n.name \
    --cc=xry111@xry111.site \
    --cc=xuchenghua@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).