[PATCH v1] LoongArch: testsuite:Fix problems with incorrect results in vector test cases.

2024-03-06 Thread chenxiaolong
In simd_correctness_check.h, the role of the macro ASSERTEQ_64 is to check the result of the passed vector values for the 64-bit data of each array element. It turns out that it uses the abs() function to check only the lower 32 bits of the data at a time, so it replaces abs() with the llabs()

[PATCH v3] LoongArch: testsuite:Added additional vectorization "-mlsx" option.

2024-01-25 Thread chenxiaolong
gcc/testsuite/ChangeLog: * gcc.dg/signbit-2.c: Added additional "-mlsx" compilation options. * gfortran.dg/graphite/vect-pr40979.f90: Dito. * gfortran.dg/vect/fast-math-mgrid-resid.f: Dito. --- gcc/testsuite/gcc.dg/signbit-2.c | 1 +

Re: [PATCH] testsuite: Make pr104992.c irrelated to target vector feature [PR113418]

2024-01-24 Thread chenxiaolong
At 19:00 +0800 on Wednesday, 2024-01-24, Xi Ruoyao wrote: > On Wed, 2024-01-24 at 18:32 +0800, chenxiaolong wrote: > > On 20:09 +0800 on Tuesday, 2024-01-23, Xi Ruoyao wrote: > > > The vect_int_mod target selector is evaluated with the options in > > > D

Re: [PATCH] testsuite: Make pr104992.c irrelated to target vector feature [PR113418]

2024-01-24 Thread chenxiaolong
On 20:09 +0800 on Tuesday, 2024-01-23, Xi Ruoyao wrote: > The vect_int_mod target selector is evaluated with the options in > DEFAULT_VECTCFLAGS in effect, but these options are not automatically > passed to tests out of the vect directories. So this test fails on > targets where integer vector

[PATCH v1] LoongArch: doc:Combined with the content of target-supports.exp, add the attribute description related to LoongArch.

2024-01-16 Thread chenxiaolong
gcc/ChangeLog: * doc/sourcebuild.texi: Add attributes for keywords. --- gcc/doc/sourcebuild.texi | 20 1 file changed, 20 insertions(+) diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 8082100a3c9..6c33237ac78 100644 ---

Re: [PATCH v2] LoongArch: testsuite:Added additional vectorization "-mlsx" option.

2024-01-15 Thread chenxiaolong
在 2024-01-15一的 15:50 +0800,Xi Ruoyao写道: > 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: > > > On Mon, 2024-01-15 at 14:32 +0800, YunQiang Su wrote: > > > > Xi Ruoyao wrote at 12:11pm on Mond

Re: [PATCH v2] LoongArch: testsuite:Added additional vectorization "-mlsx" option.

2024-01-14 Thread chenxiaolong
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:

Re: [PATCH v2] LoongArch: testsuite:Added additional vectorization "-mlsx" option.

2024-01-14 Thread chenxiaolong
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/signbi

[PATCH v2] LoongArch: testsuite:Fix fail in gen-vect-{2,25}.c file.

2024-01-12 Thread chenxiaolong
1.Added dg-do compile on LoongArch. When binutils does not support vector instruction sets, an error occurs because the assembler does not recognize vector instructions. 2.Added "-mlsx" option for vectorization on LoongArch. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/gen-vect-2.c:

[PATCH v2] LoongArch: testsuite:Added additional vectorization "-mlsx" option.

2024-01-12 Thread chenxiaolong
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. ---

[PATCH v1] LoongArch: testsuite:Fix fail in gen-vect-{2,25}.c file.

2024-01-11 Thread chenxiaolong
1.Delete "dg-do run". When binutils do not support vectorization, an error occurs during the assembly phase that does not recognize vector instructions. 2.Added "-mlsx" option for vectorization on LoongArch. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/gen-vect-2.c: Remove the program's

[PATCH v1] LoongArch: testsuite:Added additional vectorization "-mlsx" option.

2024-01-11 Thread chenxiaolong
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. ---

[PATCH v1] LoongArch: testsuite:Fixed a bug that added a target check error.

2024-01-09 Thread chenxiaolong
After the code is committed in r14-6948, GCC regression testing on some architectures will produce the following error: "error executing dg-final: unknown effective target keyword `loongarch*-*-*'" gcc/testsuite/ChangeLog: * lib/target-supports.exp: Removed an issue with "target

[PATCH v2] LoongArch: testsuite:Added support for loongarch.

2024-01-09 Thread chenxiaolong
The function of this test is to check that the compiler supports vectorization using SLP and vec_{load/store/*}_lanes. However, vec_{load/store/*}_lanes are not supported on LoongArch, such as the corresponding "st4/ld4" directives on aarch64. gcc/testsuite/ChangeLog: *

[PATCH v3] LoongArch: testsuite:Added support for vector object detection.

2024-01-04 Thread chenxiaolong
- Change the default vectorization "-mlasx" option to "-mlsx" because there are many non-aligned memory accesses when using 256-bit vectorization. - The following detection procedure is added to the target-supports.exp file: 1.check_effective_target_scalar_all_fma

[PATCH v2 6/7] LoongArch: testsuite:Added additional vectorization "-mlasx" compilation option.

2024-01-04 Thread chenxiaolong
In the LoongArch architecture, the reason for not adding the 128-bit vector-width-*hi* instruction template in the GCC back end is that it causes program performance loss, so we can only add the "-mlasx" compilation option to use 256-bit vectorization functions in test files.

[PATCH v2 5/7] LoongArch: testsuite:Delete the default run behavior in pr60510.f.

2024-01-04 Thread chenxiaolong
When binutils does not support vector instruction sets, the test program fails because it does not recognize vectorization at the assembly stage. Therefore, the default run behavior of the program is deleted, so that the behavior of the program depends on whether the software supports

[PATCH v2 4/7] LoongArch: testsuite:Fix FAIL in file bind_c_array_params_2.f90.

2024-01-04 Thread chenxiaolong
On the LoongArch architecture, an error was found in the bind_c_array_params_2.f90 file because there was no proper assembly code for the regular expression detection function call, such as bl %plt(myBindC). gcc/testsuite/ChangeLog: * gfortran.dg/bind_c_array_params_2.f90: Add code test

[PATCH v2 3/7] LoongArch: testsuite:Added detection support for LoongArch architecture in vect-{82, 83}.c.

2024-01-04 Thread chenxiaolong
gcc/testsuite/ChangeLog: * gcc.dg/vect/vect-82.c: Add the LoongArch architecture to the object detection framework. * gcc.dg/vect/vect-83.c: Dito. --- gcc/testsuite/gcc.dg/vect/vect-82.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-83.c | 2 +- 2 files changed, 2 insertions(+),

[PATCH v2 1/7] LoongArch: testsuite:Added support for vector object detection.

2024-01-04 Thread chenxiaolong
In the GCC of LoongArch architecture, the detection function of common vectorization test cases is enabled. The following detection procedure is added to the target-supports.exp file: 1.check_effective_target_scalar_all_fma 2.check_effective_target_vect_int

[PATCH v2 7/7] LoongArch: testsuite:Give up the detection of the gcc.dg/fma-{3, 4, 6, 7}.c file.

2024-01-04 Thread chenxiaolong
On the LoongArch architecture, the above four test cases need to be waived during testing. There are two situations: 1. The function of fma-{3,6}.c test is to find the value of c-a*b, but on the LoongArch architecture, the function of the existing fnmsub instruction is to find the value of -(a*b

[PATCH v2 2/7] LoongArch: testsuite:Modify the test behavior of the vect-bic-bitmask-{12, 23}.c file.

2024-01-04 Thread chenxiaolong
Before modifying the test behavior of the program, dg-do is set to assemble in vect-bic-bitmask-{12,23}.c. However, when the binutils library does not support the vector instruction set, it will FAIL to recognize the vector instruction and fail item will appear in the assembly stage. So set the

[PATCH v2 0/7] LoongArch:Enable testing for common

2024-01-04 Thread chenxiaolong
ion of targets Rules, lack of vectorization options, lack of specific compilation options, check for instruction set differences and test behavior for program Settings, etc. For details, see the following patches: chenxiaolong (7): LoongArch: testsuite:Added support for vector object detect

Re: [PATCH v1 1/8] LoongArch: testsuite:Add detection procedures supported by the target.

2023-12-29 Thread chenxiaolong
At 14:28 +0800 on 2023-12-29th, Chenghua Xu wrote: > chenxiaolong writes: > > > In order to improve and check the function of vector quantization > > in > > LoongArch architecture, tests on vector instruction set are > > provided > > in target-support.e

[PATCH v1] LoongArch: testsuite:Add loongarch to gcc.dg/vect/slp-26.c.

2023-12-28 Thread chenxiaolong
In the LoongArch architecture, GCC supports the vectorization function tested by vect/slp-26.c, but there is no detection of loongarch in dg-finals. Add loongarch to the appropriate dg-finals. gcc/testsuite/ChangeLog: * gcc.dg/vect/slp-26.c: Add loongarch. ---

[PATCH v1] LoongArch: testsuite:Add loongarch to gcc.dg/vect/slp-21.c.

2023-12-28 Thread chenxiaolong
In the GCC code of LoongArch architecture, IFN_STORE_LANES optimization operation is not supported, and four SLP statements are used for vectorization in slp-21.c. So add loongarch*-*-* to the corresponding dg-finals. gcc/testsuite/ChangeLog: * gcc.dg/vect/slp-21.c: Add loongarch. ---

[PATCH v1] LoongArch: testsuite:Add the "-ffast-math" compilation option for the file vect-fmin-3.c.

2023-12-28 Thread chenxiaolong
After the detection of maximum reduction is enabled on LoongArch architecture, the regression test of GCC finds that vect-fmin-3.c fails. Currently, in the target-supports.exp file, only aarch64,arm,riscv, and LoongArch architectures are supported. Through analysis, the "-ffast-math" compilation

[PATCH v1 8/8] LoongArch: testsuite:Modify the result check in the FMA file.

2023-12-28 Thread chenxiaolong
When gcc enabled the vectorization of the common layer, some FAIL items appeared in GCC regression tests, such as gcc.dg/fma-{3,4,6,7}.c. On LoongArch architecture, for example, the result of fmsub.s instruction is a*b-c, and there is a problem of positive and negative zero inequality between the

[PATCH v1 4/8] LoongArch: testsuite:Fix FAIL in file bind_c_array_params_2.f90.

2023-12-28 Thread chenxiaolong
In the GCC regression test result, it is found that the bind_c_array_params_2.f90 test fails. After analysis, it is found that the reason why the test fails is that the regular expression in the test result cannot correctly detect the correct assembly code (such as bl %plt(myBindC)) generated on

[PATCH v1 3/8] LoongArch: testsuite:Added test support for vect-{82, 83}.c.

2023-12-28 Thread chenxiaolong
When gcc enables the file test under gcc.dg/vect, it is found that vect-{82, 83}.c does not support the test. Through analysis, LoongArch architecture supports the detection function of this test case. Therefore, the detection of LoongArch architecture is added to the test rules to solve the

[PATCH v1 6/8] LoongArch: testsuite:Added additional vectorization "-mlasx" compilation option.

2023-12-28 Thread chenxiaolong
After the detection procedure under the gcc.dg/vect directory was added to GCC, FAIL entries of vector multiplication transformations of different types appeared in the gcc regression test results. After debugging analysis, the main problem is that the 128-bit vector of LoongArch architecture does

[PATCH v1 7/8] LoongArch: testsuite:Added additional vectorization "-mlsx" compilation option.

2023-12-28 Thread chenxiaolong
When GCC is able to detect vectorized test cases in the common layer, FAIL entries appear in some test cases after regression testing. The cause of the error is that the vectorization option was not set when testing the program, and the vectorization code could not be generated, so additional

[PATCH v1 5/8] LoongArch: testsuite:Modify the test behavior in file pr60510.f.

2023-12-28 Thread chenxiaolong
When using binutils that does not support vectorization and gcc compiler toolchain that supports vectorization, regression tests found that pr60510.f had a FAIL entry. The reason is that the default setting of the program is the execution state, which will cause problems in the assembly stage when

[PATCH v1 2/8] LoongArch: testsuite:Modify the test behavior of the vect-bic-bitmask-{12, 23}.c file.

2023-12-28 Thread chenxiaolong
When the toolchain is built using binutils that does not support vectorization and gcc that supports vectorization, the regression test results of GCC show that the vect-bic-bitmask-{12,23}.c file fails. The reason is that it carries out two stages of compilation and assembly test, in the

[PATCH v1 1/8] LoongArch: testsuite:Add detection procedures supported by the target.

2023-12-28 Thread chenxiaolong
In order to improve and check the function of vector quantization in LoongArch architecture, tests on vector instruction set are provided in target-support.exp. gcc/testsuite/ChangeLog: * lib/target-supports.exp:Add LoongArch to the list of supported targets. ---

[PATCH v1 0/8] LoongArch:Enable testing for common

2023-12-28 Thread chenxiaolong
for instruction set differences and test behavior for program Settings, etc. For details, see the following patches: chenxiaolong (8): LoongArch: testsuite:Add detection procedures supported by the target. LoongArch: testsuite:Modify the test behavior of the vect-bic-bitmask-{12,23}.c file

[PATCH v1] LoongArch: testsuite:Fix FAIL in lasx-xvstelm.c file.

2023-12-28 Thread chenxiaolong
After implementing the cost model on the LoongArch architecture, the GCC compiler code has this feature turned on by default, which causes the lasx-xvstelm.c file test to fail. Through analysis, this test case can generate vectorization instructions required for detection only after disabling the

[PATCH v1] LoongArch: Fix builtin function prototypes for LASX in doc.

2023-12-19 Thread chenxiaolong
gcc/ChangeLog: * doc/extend.texi:According to the documents submitted earlier, Two problems with function return types and using the actual types of parameters instead of variable names were found and fixed. --- gcc/doc/extend.texi | 24 1 file

Re: Fwd: [PATCH v2] extend.texi: Fix typos in LSX intrinsics

2023-12-14 Thread chenxiaolong
在 2023-12-14四的 20:27 +0800,chenglulu写道: > > > > > > > > 转发的消息 > > > > 主题: > [PATCH v2] extend.texi: Fix typos in LSX intrinsics > > > 日期: > Wed, 13

[PATCH v2] LoongArch: Modify the check type of the vector builtin function.

2023-12-12 Thread chenxiaolong
On LoongArch architecture, using the latest gcc14 in regression test, it is found that the vector test cases in vector directory appear FAIL entries with unmatched pointer types. In order to solve this kind of problem, the type of the variable in the check result is modified with the parameter

Re: [PATCH v1] LoongArch: Modify the check type of the vector builtin function.

2023-12-06 Thread chenxiaolong
在 2023-12-05二的 20:44 +0800,Xi Ruoyao写道: > On Tue, 2023-12-05 at 17:21 +0800, chenxiaolong wrote: > > According to your suggestion, the check of the built-in function > > was modifiedin the simd_correctness_check.h file, and the types of > > the actual parameters > > of

Re: [PATCH v1] LoongArch: Modify the check type of the vector builtin function.

2023-12-05 Thread chenxiaolong
在 2023-12-04一的 20:38 +0800,Xi Ruoyao写道: > On Mon, 2023-12-04 at 20:31 +0800, Xi Ruoyao wrote: > > On Mon, 2023-12-04 at 20:14 +0800, chenxiaolong wrote: > > > On LoongArch architecture, using the latest gcc14 in regression > > > test, > > > it is found

[PATCH v2] LoongArch: Add asm modifiers to the LSX and LASX directives in the doc.

2023-12-04 Thread chenxiaolong
gcc/ChangeLog: * doc/extend.texi:Add modifiers to the vector of asm in the doc. * doc/md.texi:Refine the description of the modifier 'f' in the doc. --- gcc/doc/extend.texi | 47 + gcc/doc/md.texi | 2 +- 2 files changed, 48

[PATCH v1] LoongArch: Modify the check type of the vector builtin function.

2023-12-04 Thread chenxiaolong
On LoongArch architecture, using the latest gcc14 in regression test, it is found that the vector test cases in vector directory appear FAIL entries with unmatched pointer types. In order to solve this kind of problem, the type of the variable in the check result is modified with the parameter

[PATCH v1] LoongArch: Add modifiers for lsx and lasx.

2023-11-06 Thread chenxiaolong
gcc/ChangeLog: * doc/extend.texi:Added modifiers for LoongArch architecture lsx and lasx in the manual. --- gcc/doc/extend.texi | 27 +++ 1 file changed, 27 insertions(+) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index

[PATCH v1] LoongArch: Add instructions for the use of vector functions.

2023-11-06 Thread chenxiaolong
gcc/ChangeLog: * doc/extend.texi:Add instructions for SX and ASX vector functions to GCC documentation, including definitions and usage of function type aliases, constant types, and vector function prototypes. --- gcc/doc/extend.texi | 1673

[PATCH v1] LoongArch: Implement __builtin_thread_pointer for TLS.

2023-10-24 Thread chenxiaolong
gcc/ChangeLog: * config/loongarch/loongarch.md (get_thread_pointer):Adds the instruction template corresponding to the __builtin_thread_pointer function. * doc/extend.texi:Add the __builtin_thread_pointer function support description to the documentation.

Re: [PATCH v1 4/4] LoongArch: Add tests for Loongson SX floating-point conversion instructions.

2023-09-06 Thread chenxiaolong
在 2023-09-06三的 18:56 +0800,Xi Ruoyao写道: > On Wed, 2023-09-06 at 18:45 +0800, Xiaolong Chen wrote: > > + *((int*)& __m128_op0[3]) = 0x004200a0; > > + *((int*)& __m128_op0[2]) = 0x; > > + *((int*)& __m128_op0[1]) = 0x004200a0; > > + *((int*)& __m128_op0[0]) = 0x0021; > > These are

[PATCH v6] LoongArch:Implement 128-bit floating point functions in gcc.

2023-08-31 Thread chenxiaolong
Brief version history of patch set: v1 -> v2: According to the GNU code specification, adjust the format of the function implementation with "q" as the suffix function. v2 - >v3: 1.On the LoongArch architecture, refer to the functionality of 64-bit functions and modify the underlying

Re: [PATCH v5] LoongArch:Implement 128-bit floating point functions in gcc.

2023-08-31 Thread chenxiaolong
在 2023-08-31四的 15:57 +0800,Xi Ruoyao写道: > On Thu, 2023-08-31 at 15:02 +0800, chenxiaolong wrote: > > +;; Implement __builtin_copysignf128 function. > > + > > +(define_insn_and_split "copysigntf3" > > + [(set (match_operand:TF 0 "register_operand" &

[PATCH v5] LoongArch:Implement 128-bit floating point functions in gcc.

2023-08-31 Thread chenxiaolong
Brief version history of patch set: v1 -> v2: According to the GNU code specification, adjust the format of the function implementation with "q" as the suffix function. v2 - >v3: 1.On the LoongArch architecture, refer to the functionality of 64-bit functions and modify the underlying

[PATCH v4] LoongArch:Implement 128-bit floating point functions in gcc.

2023-08-30 Thread chenxiaolong
Brief version history of patch set: v1 -> v2: According to the GNU code specification, adjust the format of the function implementation with "q" as the suffix function. v2 - >v3: 1.On the LoongArch architecture, refer to the functionality of 64-bit functions and modify the underlying

Re: [PATCH v3] LoongArch:Implement 128-bit floating point functions in gcc.

2023-08-18 Thread chenxiaolong
在 2023-08-18五的 15:19 +0800,Xi Ruoyao写道: > On Fri, 2023-08-18 at 15:05 +0800, Xi Ruoyao via Gcc-patches wrote: > > On Fri, 2023-08-18 at 14:58 +0800, Xi Ruoyao via Gcc-patches wrote: > > > On Fri, 2023-08-18 at 14:39 +0800, chenxiaolong wrote: > > > > 在 2023-08-1

Re: [PATCH v3] LoongArch:Implement 128-bit floating point functions in gcc.

2023-08-18 Thread chenxiaolong
在 2023-08-17四的 15:08 +,Joseph Myers写道: > On Thu, 17 Aug 2023, Xi Ruoyao via Gcc-patches wrote: > > > So I guess we just need > > > > builtin_define ("__builtin_fabsq=__builtin_fabsf128"); > > builtin_define ("__builtin_nanq=__builtin_nanf128"); > > > > etc. to map the "q" builtins to "f128"

Re: [PATCH v3] LoongArch:Implement 128-bit floating point functions in gcc.

2023-08-17 Thread chenxiaolong
g-format --style GNU -i filename.c" to do the work > automatically. > > On Tue, 2023-08-15 at 18:39 +0800, chenxiaolong wrote: > > In the implementation process, the "q" suffix function is > > Re-register and associate the "__float128"

Re: [PATCH v3] LoongArch:Implement 128-bit floating point functions in gcc.

2023-08-16 Thread chenxiaolong
, 15 Aug 2023, chenxiaolong wrote: > > > In the implementation process, the "q" suffix function is > > Re-register and associate the "__float128" type with the > > "long double" type so that the compiler can handle the > &g

[PATCH v3] LoongArch:Implement 128-bit floating point functions in gcc.

2023-08-15 Thread chenxiaolong
In the implementation process, the "q" suffix function is Re-register and associate the "__float128" type with the "long double" type so that the compiler can handle the corresponding function correctly. The functions implemented include __builtin_{huge_valq

[PATCH v2] LoongArch:Implement 128-bit floating point functions in gcc.

2023-08-07 Thread chenxiaolong
In the implementation process, the "q" suffix function is Re-register and associate the "__float128" type with the "long double" type so that the compiler can handle the corresponding function correctly. The functions implemented include __builtin_{huge_valq

[PATCH v2] LoongArch:Implement 128-bit floating point functions in gcc.

2023-08-07 Thread chenxiaolong
In the implementation process, the "q" suffix function is Re-register and associate the "__float128" type with the "long double" type so that the compiler can handle the corresponding function correctly. The functions implemented include __builtin_{huge_valq

[PATCH v1] LoongArch:Implement 128-bit floating point functions in gcc.

2023-08-06 Thread chenxiaolong
From: Xiaolong Chen In the implementation process, the "q" suffix function is Re-register and associate the "__float128" type with the "long double" type so that the compiler can handle the corresponding function correctly. The functions implemented