public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v1 0/4] Add Loongson SX/ASX instruction support to LoongArch
@ 2023-09-06 10:43 Xiaolong Chen
  2023-09-06 10:43 ` [PATCH v1 1/4] LoongArch: Add tests of -mstrict-align option Xiaolong Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Xiaolong Chen @ 2023-09-06 10:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: xry111, i, xuchenghua, chenglulu, Xiaolong Chen

In order to better test the function of the vector instruction, the 128 and 256 
bit test cases are further split according to the function of the instruction.

Xiaolong Chen (4):
  LoongArch: Add tests of -mstrict-align option.
  LoongArch: Add testsuite framework for Loongson SX/ASX.
  LoongArch: Add tests for Loongson SX builtin functions.
  LoongArch: Add tests for Loongson SX floating-point conversion
    instructions.

 .../gcc.target/loongarch/strict-align.c       |   13 +
 .../loongarch/vector/loongarch-vector.exp     |   42 +
 .../loongarch/vector/lsx/lsx-builtin.c        | 1461 +++++++++++++++++
 .../loongarch/vector/lsx/lsx-vfcvt-1.c        |  397 +++++
 .../loongarch/vector/lsx/lsx-vfcvt-2.c        |  277 ++++
 .../loongarch/vector/lsx/lsx-vffint-1.c       |  160 ++
 .../loongarch/vector/lsx/lsx-vffint-2.c       |  263 +++
 .../loongarch/vector/lsx/lsx-vffint-3.c       |  101 ++
 .../loongarch/vector/lsx/lsx-vfrint_d.c       |  229 +++
 .../loongarch/vector/lsx/lsx-vfrint_s.c       |  349 ++++
 .../loongarch/vector/lsx/lsx-vftint-1.c       |  348 ++++
 .../loongarch/vector/lsx/lsx-vftint-2.c       |  694 ++++++++
 .../loongarch/vector/lsx/lsx-vftint-3.c       | 1027 ++++++++++++
 .../loongarch/vector/lsx/lsx-vftint-4.c       |  344 ++++
 .../loongarch/vector/simd_correctness_check.h |   39 +
 15 files changed, 5744 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/loongarch/strict-align.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/loongarch-vector.exp
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-builtin.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcvt-1.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfcvt-2.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vffint-1.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vffint-2.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vffint-3.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_d.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vfrint_s.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-1.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-2.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-3.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-vftint-4.c
 create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/simd_correctness_check.h

-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1 1/4] LoongArch: Add tests of -mstrict-align option.
  2023-09-06 10:43 [PATCH v1 0/4] Add Loongson SX/ASX instruction support to LoongArch Xiaolong Chen
@ 2023-09-06 10:43 ` Xiaolong Chen
  2023-09-06 11:10   ` Xi Ruoyao
  0 siblings, 1 reply; 4+ messages in thread
From: Xiaolong Chen @ 2023-09-06 10:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: xry111, i, xuchenghua, chenglulu, Xiaolong Chen

gcc/testsuite/ChangeLog:

	* gcc.target/loongarch/strict-align.c: New test.
---
 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];
+}
+
-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/4] LoongArch: Add tests of -mstrict-align option.
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Xi Ruoyao @ 2023-09-06 11:10 UTC (permalink / raw)
  To: Xiaolong Chen, gcc-patches; +Cc: i, xuchenghua, chenglulu

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.

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

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/4] LoongArch: Add tests of -mstrict-align option.
  2023-09-06 11:10   ` Xi Ruoyao
@ 2023-09-07  1:28     ` chenglulu
  0 siblings, 0 replies; 4+ messages in thread
From: chenglulu @ 2023-09-07  1:28 UTC (permalink / raw)
  To: Xi Ruoyao, Xiaolong Chen, gcc-patches; +Cc: i, xuchenghua


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-07  1:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).