Re: [PATCH] LoongArch: Replace UNSPEC_FCOPYSIGN with copysign RTL

2023-10-03 Thread chenglulu
LGTM! Thanks! 在 2023/10/3 上午11:46, Xi Ruoyao 写道: When I added copysign support for LoongArch (r13-3702), we did not have a copysign RTL insn, so I had to use UNSPEC to represent the copysign instruction. Now the copysign RTX code has been added in r14-1586, so this patch removes those UNSPECs,

Re: [pushed][PATCH v2] LoongArch: Adjust makefile dependency for loongarch headers.

2023-10-12 Thread chenglulu
Pushed to r14-4584. 在 2023/10/11 下午5:59, Yang Yujie 写道: gcc/ChangeLog: * config.gcc: Add loongarch-driver.h to tm_files. * config/loongarch/loongarch.h: Do not include loongarch-driver.h. * config/loongarch/t-loongarch: Append loongarch-multilib.h to $(GTM_H) ins

Re: [pushed][PATCH v3 0/2] LoongArch: Update target-supports.exp for LoongArch SX/ASX.

2023-10-12 Thread chenglulu
Pushed to r14-4585. 在 2023/9/28 下午6:05, Chenghui Pan 写道: This is the update of: https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631379.html This version does not include changes for codes, but fixes the commit title format and appends the missing PR info. Chenghui Pan (2): LoongArc

Re: [pushed][PATCH v1] LoongArch: Fix vec_initv32qiv16qi template to avoid ICE.

2023-10-16 Thread chenglulu
Pushed to r14-4675. 在 2023/10/11 下午4:41, Chenghui Pan 写道: Following test code triggers unrecognized insn ICE on LoongArch target with "-O3 -mlasx": void foo (unsigned char *dst, unsigned char *src) { for (int y = 0; y < 16; y++) { for (int x = 0; x < 16; x++) dst[x] = sr

Re:[pushed] [PATCH v2] LoongArch: Delete macro definition ASM_OUTPUT_ALIGN_WITH_NOP.

2023-10-16 Thread chenglulu
Pushed to r14-4674. 在 2023/10/12 下午3:00, Lulu Cheng 写道: There are two reasons for removing this macro definition: 1. The default in the assembler is to use the nop instruction for filling. 2. For assembly directives: .align [abs-expr[, abs-expr[, abs-expr]]] The third expression it is the ma

Re: [PATCH] LoongArch: Use fcmp.caf.s instead of movgr2cf for zeroing a fcc

2023-10-17 Thread chenglulu
在 2023/10/17 下午10:24, WANG Xuerui 写道: On 10/17/23 22:06, Xi Ruoyao wrote: During the review of a LLVM change [1], on LA464 we found that zeroing "an" LLVM change (because the word LLVM is pronounced letter-by-letter) a fcc with fcmp.caf.s is much faster than a movgr2cf from $r0. Similarly,

Re:[pushed] [PATCH 0/3] Optimize loongarch vector implementation.

2023-10-18 Thread chenglulu
Pushed to r14-4730. 在 2023/10/16 上午10:00, Jiahao Xu 写道: The following three patches further enhance loongarch’s vectorization capabilities. Patch one add LoongArch support for AVG_CEIL/FLOOR. Patch 2 add LoongArch support for vec_widen_mult/add/sub_lo/hi patterns. patch 3 make loongarch use

Re: [PATCH v4 0/6] Add Loongson SX/ASX instruction support to LoongArch target.

2023-10-19 Thread chenglulu
在 2023/8/20 下午4:25, Xi Ruoyao 写道: On Thu, 2023-08-17 at 15:20 +0800, Chenghui Pan wrote: Seems ARMv8-A only guarantees to preserve low 64-bit value of NEON/floating-point register value. I'm not sure that I modify the testcase in the right way and maybe we need more investigations. Any ideas o

Re: [PATCH] LoongArch: Allow using --with-arch=native if host CPU is LoongArch

2023-07-22 Thread chenglulu
在 2023/7/20 下午9:28, Xi Ruoyao 写道: If the host triple and the target triple are different but the host is LoongArch, in some cases --with-arch=native can be useful. For example, if we are bootstrapping a loongarch64-linux-musl toolchain on a Glibc-based system and we don't intend to use the too

Re: [PATCH] Loongarch: Fix plugin header missing install.

2023-08-17 Thread chenglulu
LGTM! 在 2023/8/16 上午9:48, Guo Jie 写道: gcc/ChangeLog: * config/loongarch/t-loongarch: Add loongarch-driver.h into TM_H. Add loongarch-def.h and loongarch-tune.h into OPTIONS_H_EXTRA. Co-authored-by: Lulu Cheng --- gcc/config/loongarch/t-loongarch | 4 1 file cha

[PATCH] LoongArch: Fix bug in loongarch_emit_stack_tie [PR110484].

2023-06-29 Thread chenglulu
From: Lulu Cheng Which may result in implicit references to $fp when frame_pointer_needed is false, causing regs_ever_live[$fp] to be true when $fp is not explicitly used, resulting in $fp being used as the target replacement register in the rnreg pass. The bug originates from SPEC2017 541.lee

Re: [PATCH 2/5] LoongArch: Use explicit relocs for GOT access when -mexplicit-relocs=auto and LTO during a final link with linker plugin

2023-10-21 Thread chenglulu
/* snip */ +/* If -mexplicit-relocs=auto, we use machine operations with reloc hints + for cases where the linker is unable to relax so we can schedule the + machine operations, otherwise use an assembler pseudo-op so the + assembler will generate R_LARCH_RELAX. */ + +bool +loongarch_expl

Re: [PATCH 2/5] LoongArch: Use explicit relocs for GOT access when -mexplicit-relocs=auto and LTO during a final link with linker plugin

2023-10-22 Thread chenglulu
在 2023/10/21 下午4:42, Xi Ruoyao 写道: On Sat, 2023-10-21 at 15:32 +0800, chenglulu wrote: +  /* If we are performing LTO for a final link, and we have the linker + plugin so we know the resolution of the symbols, then all GOT + references are binding to external symbols or preemptable

Re:[pushed] [PATCH] LoongArch: Define macro CLEAR_INSN_CACHE.

2023-10-22 Thread chenglulu
Pushed to r14-4836. 在 2023/10/20 下午3:15, Lulu Cheng 写道: LoongArch's microstructure ensures cache consistency by hardware. Due to out-of-order execution, ibar is required to ensure the visibility of the store (invalidated icache) executed by this CPU before ibar (to the instance). ibar will not i

Re: [pushed][PATCH v1] LoongArch: Implement __builtin_thread_pointer for TLS.

2023-10-25 Thread chenglulu
Pushed to r14-4925. 在 2023/10/24 下午2:40, 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_pointe

Re: [pushed][PATCH v1] LoongArch: Fix vfrint-releated comments in lsxintrin.h and lasxintrin.h

2023-10-25 Thread chenglulu
Pushed to r14-4926. 在 2023/10/23 上午10:13, Chenghui Pan 写道: The comment of vfrint-related intrinsic functions does not match the return value type in definition. This patch fixes these comments. gcc/ChangeLog: * config/loongarch/lasxintrin.h (__lasx_xvftintrnel_l_s): Fix comments.

Re: [pushed][PATCH] LoongArch:Enable vcond_mask_mn expanders for SF/DF modes.

2023-10-26 Thread chenglulu
Pushed to r14-4939. 在 2023/10/23 下午5:46, Jiahao Xu 写道: If the vcond_mask patterns don't support fp modes, the vector FP comparison instructions will not be generated. gcc/ChangeLog: * config/loongarch/lasx.md (vcond_mask_): Change to (vcond_mask_): this. * conf

Re: [PATCH] LoongArch: Define HAVE_AS_TLS to 0 if it's undefined

2023-10-30 Thread chenglulu
在 2023/10/30 下午7:42, Xi Ruoyao 写道: Now loongarch.md uses HAVE_AS_TLS, we need this to fix the failure building a cross compiler if the cross assembler is not installed yet. gcc/ChangeLog: * config/loongarch/loongarch-opts.h (HAVE_AS_TLS): Define to 0 if not defined yet. --- O

Re: [PATCH] LoongArch: Define HAVE_AS_TLS to 0 if it's undefined

2023-10-30 Thread chenglulu
在 2023/10/30 下午8:26, Xi Ruoyao 写道: On Mon, 2023-10-30 at 19:50 +0800, chenglulu wrote: 在 2023/10/30 下午7:42, Xi Ruoyao 写道: Now loongarch.md uses HAVE_AS_TLS, we need this to fix the failure building a cross compiler if the cross assembler is not installed yet. gcc/ChangeLog

[PATCH v9 00/12] Add LoongArch support.

2022-03-19 Thread chenglulu
7 -> v8 1. Add new addressing type ADDRESS_REG_REG support. 2. Modify documentation. 3. Eliminate compile-time warnings. v8 -> v9 1. Undefine the hook TARGET_TRULY_NOOP_TRUNCATION under the architecture. 2. Delete some unsed hooks. 3. Change some code style. 4. Modify documentation. *** BLURB

[PATCH v9 01/12] LoongArch Port: Regenerate configure

2022-03-19 Thread chenglulu
* config/picflag.m4: Default add build option '-fpic' for LoongArch. * configure: Add LoongArch tuples. * configure.ac: Like wise. --- config/picflag.m4 | 3 +++ configure | 10 +- configure.ac | 10 +- 3 files changed, 21 insertions(+), 2 dele

[PATCH v9 09/12] LoongArch Port: Regenerate libgcc/configure.

2022-03-19 Thread chenglulu
libgcc/ * configure: Regenerate file. --- libgcc/configure | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libgcc/configure b/libgcc/configure index 52bf25d4e94..1f9b2ac578b 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -2403,6 +2403,9 @@ case "${host}" in

[PATCH v9 03/12] LoongArch Port: Regenerate gcc/configure.

2022-03-19 Thread chenglulu
gcc/ * configure: Regenerate file. --- gcc/configure | 66 ++- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/gcc/configure b/gcc/configure index 14b19c8fe0c..1c1195e95cb 100755 --- a/gcc/configure +++ b/gcc/configure @@ -5442

[PATCH v9 07/12] LoongArch Port: Builtin macros.

2022-03-19 Thread chenglulu
gcc/ * config/loongarch/loongarch-c.cc --- gcc/config/loongarch/loongarch-c.cc | 109 1 file changed, 109 insertions(+) create mode 100644 gcc/config/loongarch/loongarch-c.cc diff --git a/gcc/config/loongarch/loongarch-c.cc b/gcc/config/loongarch/loongarch-

[PATCH v9 11/12] LoongArch Port: gcc/testsuite

2022-03-19 Thread chenglulu
gcc/testsuite/ * g++.dg/cpp0x/constexpr-rom.C: Add build options for LoongArch. * g++.old-deja/g++.abi/ptrmem.C: Add LoongArch support. * g++.old-deja/g++.pt/ptrmem6.C: xfail for LoongArch. * gcc.dg/20020312-2.c: Add LoongArch support. * c-c++-common/zero-sc

[PATCH v9 10/12] LoongArch Port: libgomp

2022-03-19 Thread chenglulu
libgomp/ * configure.tgt: Add LoongArch triplet. --- libgomp/configure.tgt | 4 1 file changed, 4 insertions(+) diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt index d4f1e741b5a..2cd7272fcd8 100644 --- a/libgomp/configure.tgt +++ b/libgomp/configure.tgt @@ -56,6 +56,10 @@

[PATCH v9 06/12] LoongArch Port: Builtin functions.

2022-03-19 Thread chenglulu
gcc/ * config/loongarch/larchintrin.h: New file. * config/loongarch/loongarch-builtins.cc: New file. --- gcc/config/loongarch/larchintrin.h | 409 + gcc/config/loongarch/loongarch-builtins.cc | 511 + 2 files changed, 920 insertions(+)

[PATCH v9 12/12] LoongArch Port: Add doc.

2022-03-19 Thread chenglulu
* contrib/config-list.mk: Add LoongArch triplet. * gcc/doc/install.texi: Add LoongArch options section. * gcc/doc/invoke.texi: Add LoongArch options section. * gcc/doc/md.texi: Add LoongArch options section. --- contrib/config-list.mk | 4 +- gcc/doc/install.texi

[PATCH v9 02/12] LoongArch Port: gcc build

2022-03-19 Thread chenglulu
gcc/ * common/config/loongarch/loongarch-common.cc: New file. * config/loongarch/genopts/genstr.sh: New file. * config/loongarch/genopts/loongarch-strings: New file. * config/loongarch/genopts/loongarch.opt.in: New file. * config/loongarch/loongarch-str.h: N

[PATCH v9 08/12] LoongArch Port: libgcc

2022-03-19 Thread chenglulu
libgcc/ * config/loongarch/crtfastmath.c: New file. * config/loongarch/linux-unwind.h: Like wise. * config/loongarch/sfp-machine.h: Like wise. * config/loongarch/t-crtstuff: Like wise. * config/loongarch/t-loongarch: Like wise. * config/loongarch/t-l

[PATCH v10 00/12] Add LoongArch support.

2022-03-24 Thread chenglulu
t; v10 1. Modify code style. *** BLURB HERE *** chenglulu (12): LoongArch Port: Regenerate configure LoongArch Port: gcc build LoongArch Port: Regenerate gcc/configure. LoongArch Port: Machine description files. LoongArch Port: Machine description C files and .h files. LoongArch Port: Bui

[PATCH v10 01/12] LoongArch Port: Regenerate configure

2022-03-24 Thread chenglulu
* config/picflag.m4: Default add build option '-fpic' for LoongArch. * configure: Add LoongArch tuples. * configure.ac: Like wise. --- config/picflag.m4 | 3 +++ configure | 10 +- configure.ac | 10 +- 3 files changed, 21 insertions(+), 2 dele

[PATCH v10 10/12] LoongArch Port: libgomp

2022-03-24 Thread chenglulu
libgomp/ * configure.tgt: Add LoongArch triplet. --- libgomp/configure.tgt | 4 1 file changed, 4 insertions(+) diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt index d4f1e741b5a..2cd7272fcd8 100644 --- a/libgomp/configure.tgt +++ b/libgomp/configure.tgt @@ -56,6 +56,10 @@

[PATCH v10 03/12] LoongArch Port: Regenerate gcc/configure.

2022-03-24 Thread chenglulu
gcc/ * configure: Regenerate file. --- gcc/configure | 66 ++- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/gcc/configure b/gcc/configure index 14b19c8fe0c..1c1195e95cb 100755 --- a/gcc/configure +++ b/gcc/configure @@ -5442

[PATCH v10 07/12] LoongArch Port: Builtin macros.

2022-03-24 Thread chenglulu
gcc/ * config/loongarch/loongarch-c.cc --- gcc/config/loongarch/loongarch-c.cc | 109 1 file changed, 109 insertions(+) create mode 100644 gcc/config/loongarch/loongarch-c.cc diff --git a/gcc/config/loongarch/loongarch-c.cc b/gcc/config/loongarch/loongarch-

[PATCH v10 09/12] LoongArch Port: Regenerate libgcc/configure.

2022-03-24 Thread chenglulu
libgcc/ * configure: Regenerate file. --- libgcc/configure | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libgcc/configure b/libgcc/configure index 52bf25d4e94..1f9b2ac578b 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -2403,6 +2403,9 @@ case "${host}" in

[PATCH v10 02/12] LoongArch Port: gcc build

2022-03-24 Thread chenglulu
gcc/ * common/config/loongarch/loongarch-common.cc: New file. * config/loongarch/genopts/genstr.sh: New file. * config/loongarch/genopts/loongarch-strings: New file. * config/loongarch/genopts/loongarch.opt.in: New file. * config/loongarch/loongarch-str.h: N

[PATCH v10 11/12] LoongArch Port: gcc/testsuite

2022-03-24 Thread chenglulu
gcc/testsuite/ * g++.dg/cpp0x/constexpr-rom.C: Add build options for LoongArch. * g++.old-deja/g++.abi/ptrmem.C: Add LoongArch support. * g++.old-deja/g++.pt/ptrmem6.C: xfail for LoongArch. * gcc.dg/20020312-2.c: Add LoongArch support. * c-c++-common/zero-sc

[PATCH v10 06/12] LoongArch Port: Builtin functions.

2022-03-24 Thread chenglulu
gcc/ * config/loongarch/larchintrin.h: New file. * config/loongarch/loongarch-builtins.cc: New file. --- gcc/config/loongarch/larchintrin.h | 355 + gcc/config/loongarch/loongarch-builtins.cc | 424 + 2 files changed, 779 insertions(+)

[PATCH v10 08/12] LoongArch Port: libgcc

2022-03-24 Thread chenglulu
libgcc/ * config/loongarch/crtfastmath.c: New file. * config/loongarch/linux-unwind.h: Like wise. * config/loongarch/sfp-machine.h: Like wise. * config/loongarch/t-crtstuff: Like wise. * config/loongarch/t-loongarch: Like wise. * config/loongarch/t-l

[PATCH v10 12/12] LoongArch Port: Add doc.

2022-03-24 Thread chenglulu
* contrib/config-list.mk: Add LoongArch triplet. * gcc/doc/install.texi: Add LoongArch options section. * gcc/doc/invoke.texi: Add LoongArch options section. * gcc/doc/md.texi: Add LoongArch options section. --- contrib/config-list.mk | 4 +- gcc/doc/install.texi

[PATCH v6 01/12] LoongArch Port: Regenerate configure

2022-01-28 Thread chenglulu
* config/picflag.m4: Default add build option '-fpic' for LoongArch. * configure: Add LoongArch tuples. * configure.ac: Like wise. --- config/picflag.m4 | 3 +++ configure | 10 +- configure.ac | 10 +- 3 files changed, 21 insertions(+), 2 dele

[PATCH v6 00/12] Add LoongArch support.

2022-01-28 Thread chenglulu
in macros. v4 -> v5 1. delete wrong insn zero_extendsidi2_internal. 2. Adjust some build options. 3. Change some .c files to .cc. v5 -> v6 1. Fix compilation issues. The generated files *.opt and *.h are generated to $(objdir). chenglulu (12): LoongArch Port: Regenerate configure Loon

[PATCH v6 03/12] LoongArch Port: Regenerate gcc/configure.

2022-01-28 Thread chenglulu
--- gcc/configure | 66 ++- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/gcc/configure b/gcc/configure index bd4d4721868..3823bc4e783 100755 --- a/gcc/configure +++ b/gcc/configure @@ -5442,6 +5442,9 @@ case "${target}" in #

[PATCH v6 07/12] LoongArch Port: Builtin macros.

2022-01-28 Thread chenglulu
gcc/ *config/loongarch/loongarch-c.cc --- gcc/config/loongarch/loongarch-c.cc | 109 1 file changed, 109 insertions(+) create mode 100644 gcc/config/loongarch/loongarch-c.cc diff --git a/gcc/config/loongarch/loongarch-c.cc b/gcc/config/loongarch/loongarch-c

[PATCH v6 09/12] LoongArch Port: Regenerate libgcc/configure.

2022-01-28 Thread chenglulu
--- libgcc/configure | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libgcc/configure b/libgcc/configure index 4919a56f518..ce04c4f529f 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -2412,6 +2412,9 @@ case "${host}" in # sets the default TLS model and affe

[PATCH v6 10/12] LoongArch Port: libgomp

2022-01-28 Thread chenglulu
libgomp/ * configure.tgt: Add LoongArch triplet. --- libgomp/configure.tgt | 4 1 file changed, 4 insertions(+) diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt index d4f1e741b5a..2cd7272fcd8 100644 --- a/libgomp/configure.tgt +++ b/libgomp/configure.tgt @@ -56,6 +56,10 @@

[PATCH v6 08/12] LoongArch Port: libgcc

2022-01-28 Thread chenglulu
libgcc/ * config/loongarch/crtfastmath.c: New file. * config/loongarch/crti.S: Like wise. * config/loongarch/crtn.S: Like wise. * config/loongarch/linux-unwind.h: Like wise. * config/loongarch/sfp-machine.h: Like wise. * config/loongarch/t-crtstuff:

[PATCH v6 02/12] LoongArch Port: gcc build

2022-01-28 Thread chenglulu
gcc/ * common/config/loongarch/loongarch-common.cc: New file. * config/loongarch/genopts/genstr.sh: New file. * config/loongarch/genopts/loongarch-strings: New file. * config/loongarch/genopts/loongarch.opt.in: New file. * config/loongarch/loongarch-str.h: N

[PATCH v6 06/12] LoongArch Port: Builtin functions.

2022-01-28 Thread chenglulu
gcc/ * config/loongarch/larchintrin.h: New file. * config/loongarch/loongarch-builtins.cc: New file. --- gcc/config/loongarch/larchintrin.h | 413 + gcc/config/loongarch/loongarch-builtins.cc | 511 + 2 files changed, 924 insertions(+)

[PATCH v6 11/12] LoongArch Port: gcc/testsuite

2022-01-28 Thread chenglulu
gcc/testsuite/ * g++.dg/cpp0x/constexpr-rom.C: Add build options for LoongArch. * g++.old-deja/g++.abi/ptrmem.C: Add LoongArch support. * g++.old-deja/g++.pt/ptrmem6.C: xfail for LoongArch. * gcc.dg/20020312-2.c: Add LoongArch support. * gcc.dg/loop-8.c: Ski

[PATCH v6 12/12] LoongArch Port: Add doc.

2022-01-28 Thread chenglulu
* contrib/config-list.mk: Add LoongArch triplet. * gcc/doc/install.texi: Add LoongArch options section. * gcc/doc/invoke.texi: Add LoongArch options section. * gcc/doc/md.texi: Add LoongArch options section. --- contrib/config-list.mk | 5 +- gcc/doc/install.texi

LoongArch Port

2021-11-27 Thread chenglulu
/commit/aacb0bf860f02aa5a7dcb76dd0e392bf871c7586 (will be submitted to upstream soon) chenglulu (12): LoongArch Port: gcc build LoongArch Port: Regenerate gcc/configure. LoongArch Port: Machine Decsription files. LoongArch Port: Machine description C files and .h LoongArch Port: Builtin functions

[PATCH 02/12] LoongArch Port: Regenerate gcc/configure.

2021-11-27 Thread chenglulu
--- gcc/configure | 66 ++- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/gcc/configure b/gcc/configure index 74b9d9be4c8..6e53dec9663 100755 --- a/gcc/configure +++ b/gcc/configure @@ -5317,6 +5317,9 @@ case "${target}" in #

[PATCH 09/12] LoongArch Port: libgomp

2021-11-27 Thread chenglulu
libgomp/ * configure.tgt: Add LoongArch triplet. --- libgomp/configure.tgt | 4 1 file changed, 4 insertions(+) diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt index d4f1e741b5a..2cd7272fcd8 100644 --- a/libgomp/configure.tgt +++ b/libgomp/configure.tgt @@ -56,6 +56,10 @@

[PATCH 06/12] LoongArch Port: Builtin macros.

2021-11-27 Thread chenglulu
gcc/ *config/loongarch/loongarch-c.c --- gcc/config/loongarch/loongarch-c.c | 136 + 1 file changed, 136 insertions(+) create mode 100644 gcc/config/loongarch/loongarch-c.c diff --git a/gcc/config/loongarch/loongarch-c.c b/gcc/config/loongarch/loongarch-c.c

[PATCH 08/12] LoongArch Port: Regenerate libgcc/configure.

2021-11-27 Thread chenglulu
--- libgcc/configure | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libgcc/configure b/libgcc/configure index 4919a56f518..ce04c4f529f 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -2412,6 +2412,9 @@ case "${host}" in # sets the default TLS model and affe

[PATCH 10/12] LoongArch Port: gcc/testsuite

2021-11-27 Thread chenglulu
gcc/testsuite/ * g++.dg/cpp0x/constexpr-rom.C: Add build options for LoongArch. * g++.old-deja/g++.abi/ptrmem.C: Add LoongArch support. * g++.old-deja/g++.pt/ptrmem6.C: xfail for LoongArch. * gcc.dg/20020312-2.c: Add LoongArch support. * gcc.dg/loop-8.c: Ski

[PATCH 05/12] LoongArch Port: Builtin functions.

2021-11-27 Thread chenglulu
gcc/ * config/loongarch/larchintrin.h: New file. * config/loongarch/loongarch-builtins.c: New file. --- gcc/config/loongarch/larchintrin.h| 413 + gcc/config/loongarch/loongarch-builtins.c | 511 ++ 2 files changed, 924 insertions(+) cr

[PATCH 12/12] LoongArch Port: Add doc.

2021-11-27 Thread chenglulu
* contrib/config-list.mk: Add LoongArch triplet. * gcc/doc/install.texi: Add LoongArch options section. * gcc/doc/invoke.texi: Add LoongArch options section. * gcc/doc/md.texi: Add LoongArch options section. --- contrib/config-list.mk | 5 +- gcc/doc/install.texi

[PATCH 07/12] LoongArch Port: libgcc

2021-11-27 Thread chenglulu
libgcc/ * config/loongarch/crtfastmath.c: New file. * config/loongarch/crti.S: Like wise. * config/loongarch/crtn.S: Like wise. * config/loongarch/lib2funcs.c: Like wise. * config/loongarch/linux-unwind.h: Like wise. * config/loongarch/sfp-machine.h:

[PATCH 01/12] LoongArch Port: gcc build

2021-11-27 Thread chenglulu
gcc/ * common/config/loongarch/loongarch-common.c: New file. * config/loongarch/genopts/genstr.sh: New file. * config/loongarch/genopts/loongarch-strings: New file. * config/loongarch/genopts/loongarch.opt.in: New file. * config/loongarch/gnu-user.h: New fil

[PATCH 11/12] LoongArch Port: Regenerate configure

2021-11-27 Thread chenglulu
* config/picflag.m4: Default add build option '-fpic' for LoongArch. * configure: Add LoongArch tuples. * configure.ac: Like wise. --- config/picflag.m4 | 3 +++ configure | 10 +- configure.ac | 10 +- 3 files changed, 21 insertions(+), 2 dele

Re: [PATCH v3] LoongArch: Libvtv add loongarch support.

2022-10-28 Thread chenglulu
在 2022/10/28 17:38, WANG Xuerui 写道: Hi, The code change seems good but a few grammatical nits. Patch subject should be a verb phrase, something like "libvtv: add LoongArch support" could be better. Ok, thank you. I'll make the changes. On 2022/10/28 16:01, Lulu Cheng wrote: After sever

Re: [PATCH] LoongArch: Allow s9 as a register alias

2024-02-29 Thread chenglulu
在 2024/2/29 下午3:14, Xi Ruoyao 写道: The psABI allows using s9 as an alias of r22. gcc/ChangeLog: * config/loongarch/loongarch.h (ADDITIONAL_REGISTER_NAMES): Add s9 as an alias of r22. --- Bootstrapped and regtested on loongarch64-linux-gnu. Ok for trunk? I think a test is ne

Re: [PATCH v2] LoongArch: Allow s9 as a register alias

2024-03-05 Thread chenglulu
在 2024/3/5 下午7:50, Xi Ruoyao 写道: The psABI allows using s9 as an alias of r22. gcc/ChangeLog: * config/loongarch/loongarch.h (ADDITIONAL_REGISTER_NAMES): Add s9 as an alias of r22. --- v1 -> v2: Add a test case. Ok for trunk? Ok. Thanks! gcc/config/loongarch/loongarch.h

Re: [PATCH] LoongArch: testsuite: Rewrite {x, }vfcmp-{d, f}.c to avoid named registers

2024-03-06 Thread chenglulu
This test case is so cleverly designed! I have no problem. Thank you! 在 2024/3/5 下午9:00, Xi Ruoyao 写道: Loops on named vector register are not vectorized (see comment 11 of PR113622), so the these test cases have been failing for a while. Rewrite them using check-function-bodies to remove hard c

Re: [PATCH] LoongArch: Emit R_LARCH_RELAX for TLS IE with non-extreme code model to allow the IE to LE linker relaxation

2024-03-06 Thread chenglulu
在 2024/3/7 下午12:05, mengqinggang 写道: Hi, Thanks, this patch is LGTM. I don't have a problem either. Thanks. 在 2024/3/7 上午10:56, Xi Ruoyao 写道: On Thu, 2024-03-07 at 10:43 +0800, mengqinggang wrote: Hi, Whether to add an option to control the generation of R_LARCH_RELAX, similar to as

Re: [PATCH v2] LoongArch: Add support for TLS descriptors

2024-03-07 Thread chenglulu
在 2024/3/1 下午5:39, mengqinggang 写道: Thanks, I try to send a new version patch next week. 在 2024/2/29 下午2:08, Xi Ruoyao 写道: On Thu, 2024-02-29 at 09:42 +0800, mengqinggang wrote: Generate la.tls.desc macro instruction for TLS descriptors model. la.tls.desc expand to    pcalau12i $a0, %desc_p

Re:[pushed] [PATCH] LoongArch: Use /lib instead of /lib64 as the library search path for MUSL.

2024-03-07 Thread chenglulu
Pushed to r14-9351. 在 2024/3/6 上午9:19, Yang Yujie 写道: gcc/ChangeLog: * config.gcc: Add a case for loongarch*-*-linux-musl*. * config/loongarch/linux.h: Disable the multilib-compatible treatment for *musl* targets. * config/loongarch/musl.h: New file. --- gcc/co

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

2024-03-07 Thread chenglulu
Pushed to r14-9352. 在 2024/3/6 下午4:54, 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

Re: [PATCH v1] LoongArch: Fixed an issue with the implementation of the template atomic_compare_and_swapsi.

2024-03-07 Thread chenglulu
在 2024/3/7 下午8:52, Xi Ruoyao 写道: It should be better to extend the expected value before the ll/sc loop (like what LLVM does), instead of repeating the extending in each iteration. Something like: I wanted to do this at first, but it didn't work out. But then I thought about it, and there a

Re: [PATCH v1] LoongArch: Fixed an issue with the implementation of the template atomic_compare_and_swapsi.

2024-03-08 Thread chenglulu
在 2024/3/8 下午2:22, Xi Ruoyao 写道: On Thu, 2024-03-07 at 21:07 +0800, chenglulu wrote: 在 2024/3/7 下午8:52, Xi Ruoyao 写道: It should be better to extend the expected value before the ll/sc loop (like what LLVM does), instead of repeating the extending in each iteration.  Something like: I wanted

Re: [pushed][PATCH] LoongArch: testsuite: Add compilation options to the regname-fp-s9.c.

2024-03-08 Thread chenglulu
Pushed to r14-9408. 在 2024/3/7 上午9:50, Lulu Cheng 写道: When the value of the macro DEFAULT_CFLAGS is set to '-ansi -pedantic-errors', regname-s9-fp.c will test to fail. To solve this problem, add the compilation option '-Wno-pedantic -std=gnu90' to this test case. gcc/testsuite/ChangeLog:

Re: [pushed][PATCH v1] LoongArch: Fixed an issue with the implementation of the template atomic_compare_and_swapsi.

2024-03-08 Thread chenglulu
Pushed to r14-9407. 在 2024/3/7 上午9:12, Lulu Cheng 写道: If the hardware does not support LAMCAS, atomic_compare_and_swapsi needs to be implemented through "ll.w+sc.w". In the implementation of the instruction sequence, it is necessary to determine whether the two registers are equal. Since LoongA

Re: [pushed][PATCH v1] LoongArch: Fixed an issue with the implementation of the template atomic_compare_and_swapsi.

2024-03-08 Thread chenglulu
在 2024/3/9 上午9:48, chenglulu 写道: Pushed to r14-9407. Cherry picked to r13-8413 and r12-10200. 在 2024/3/7 上午9:12, Lulu Cheng 写道: If the hardware does not support LAMCAS, atomic_compare_and_swapsi needs to be implemented through "ll.w+sc.w". In the implementation of the instructio

Re: [PATCH] LoongArch: Remove unused and incorrect "sge_" define_insn

2024-03-14 Thread chenglulu
在 2024/3/13 下午9:03, Xi Ruoyao 写道: If this insn is really used, we'll have something like slti $r4,$r0,$r5 in the code. The assembler will reject it because slti wants 2 register operands and 1 immediate operand. But we've not got any bug report for this, indicating this define_insn is

Re:[pushed] [PATCH v2] LoongArch: Remove masking process for operand 3 of xvpermi.q.

2024-03-14 Thread chenglulu
Pushed to r14-9486. 在 2024/3/14 上午9:26, Chenghui Pan 写道: The behavior of non-zero unused bits in xvpermi.q instruction's third operand is undefined on LoongArch, according to our discussion (https://github.com/llvm/llvm-project/pull/83540), we think that keeping original insn operand as unmodifi

Re: [PATCH] LoongArch: Fix C23 (...) functions returning large aggregates [PR114175]

2024-03-18 Thread chenglulu
在 2024/3/18 下午5:34, Xi Ruoyao 写道: We were assuming TYPE_NO_NAMED_ARGS_STDARG_P don't have any named arguments and there is nothing to advance, but that is not the case for (...) functions returning by hidden reference which have one such artificial argument. This is causing gcc.dg/c23-stdarg-6

Re: [pushed][PATCH v2 0/3] LoongArch: Cleanup unused/redundant codes.

2024-03-19 Thread chenglulu
Pushed to r14-9562...r14-9564. 在 2024/3/15 上午9:30, Chenghui Pan 写道: Changes from v1: Some correction about ChangeLog format. There's some unused/redundant definitions inside LoongArch target support codes, these patches make a simple cleanup. Regression test passed. Chenghui Pan (3): LoongA

Re: [PATCH] LoongArch: Increase division costs

2024-03-26 Thread chenglulu
在 2024/3/26 下午5:48, Xi Ruoyao 写道: The latency of LA464 and LA664 division instructions depends on the input. When I updated the costs in r14-6642, I unintentionally set the division costs to the best-case latency (when the first operand is 0). Per a recent discussion [1] we should use "somethi

Re: [PATCH] LoongArch: Increase division costs

2024-03-27 Thread chenglulu
在 2024/3/27 下午8:42, Xi Ruoyao 写道: On Wed, 2024-03-27 at 18:39 +0800, Xi Ruoyao wrote: On Wed, 2024-03-27 at 10:38 +0800, chenglulu wrote: 在 2024/3/26 下午5:48, Xi Ruoyao 写道: The latency of LA464 and LA664 division instructions depends on the input.  When I updated the costs in r14-6642, I

Re: [PATCH] LoongArch: Increase division costs

2024-03-28 Thread chenglulu
在 2024/3/27 下午8:42, Xi Ruoyao 写道: On Wed, 2024-03-27 at 18:39 +0800, Xi Ruoyao wrote: On Wed, 2024-03-27 at 10:38 +0800, chenglulu wrote: 在 2024/3/26 下午5:48, Xi Ruoyao 写道: The latency of LA464 and LA664 division instructions depends on the input.  When I updated the costs in r14-6642, I

Re:[pushed] [PATCH] LoongArch: Add descriptions of the compilation options.

2024-03-31 Thread chenglulu
Pushed to r14-9736. 在 2024/3/30 下午3:58, Lulu Cheng 写道: Add descriptions for the compilation options '-mfrecipe' '-mdiv32' '-mlam-bh' '-mlamcas' and '-mld-seq-sa'. gcc/ChangeLog: * doc/invoke.texi: Add descriptions for the compilation options. --- gcc/doc/invoke.texi | 45

Re: [pushed][PATCH v4] LoongArch: Split loongarch_option_override_internal into smaller procedures

2024-03-31 Thread chenglulu
Pushed to r14-9737. 在 2024/3/30 下午4:43, Yang Yujie 写道: gcc/ChangeLog: * config/loongarch/genopts/loongarch.opt.in: Mark -m[no-]recip as aliases to -mrecip={all,none}, respectively. * config/loongarch/loongarch.opt: Regenerate. * config/loongarch/loongarch-def.h (

Re: [PATCH] LoongArch: Increase division costs

2024-03-31 Thread chenglulu
在 2024/4/1 上午9:29, Xi Ruoyao 写道: On Fri, 2024-03-29 at 09:23 +0800, chenglulu wrote: I tested spec2006. In the floating-point program, the test items with large fluctuations are removed, and the rest is basically unchanged. The fixed-point 464.h264ref (10,10) was 6.7% higher than (5,5) and

Re: [pushed][PATCH] LoongArch: gcc13: Implement option save/restore.

2024-03-31 Thread chenglulu
Pushed to r13-8545. 在 2024/3/17 上午10:02, Lulu Cheng 写道: LTO option streaming and target attributes both require per-function target configuration, which is achieved via option save/restore. We implement TARGET_OPTION_{SAVE,RESTORE} to switch the la_target context in addition to other automatica

Re:[pushed] [PATCH] LoongArch: gcc12: Implement option save/restore.

2024-03-31 Thread chenglulu
Pushed to r12-10303. 在 2024/3/17 上午10:02, Lulu Cheng 写道: LTO option streaming and target attributes both require per-function target configuration, which is achieved via option save/restore. We implement TARGET_OPTION_{SAVE,RESTORE} to switch the la_target context in addition to other automatic

Re: [PATCH v5] LoongArch: Add support for TLS descriptors

2024-04-01 Thread chenglulu
在 2024/4/1 下午9:51, Xi Ruoyao 写道: Is this patch targeting GCC 14 or 15? If 14 I guess we'd commit now... Generally we don't add features in stage 4, but if we keep trad as the default I think it'd be OK. And RISC-V guys plan to push their TLS desc implementation this week too. I've rebase t

Re: [PATCH] Regenerate loongarch.opt.urls.

2024-04-01 Thread chenglulu
在 2024/4/1 下午7:24, Mark Wielaard 写道: Hi, On Mon, Apr 01, 2024 at 11:08:08AM +0800, Lulu Cheng wrote: Fixes: d28ea8e5a704 ("LoongArch: Split loongarch_option_override_internal into smaller procedures") gcc/ChangeLog: * config/loongarch/loongarch.opt.urls: Regene

Re:[pushed] [PATCH] Regenerate loongarch.opt.urls.

2024-04-01 Thread chenglulu
Pushed to r14-9741. 在 2024/4/1 上午11:08, Lulu Cheng 写道: Fixes: d28ea8e5a704 ("LoongArch: Split loongarch_option_override_internal into smaller procedures") gcc/ChangeLog: * config/loongarch/loongarch.opt.urls: Regenerate. --- gcc/config/loongarch/loongarch.opt.ur

Re: [pushed][PATCH v5] LoongArch: Add support for TLS descriptors

2024-04-01 Thread chenglulu
Pushed to r14-9742. Rebase to the latest, and modify invoke.texi to add a description of the TLS DESC compilation option. 在 2024/3/19 上午9:54, mengqinggang 写道: Add support for TLS descriptors on normal code model and extreme code model. Normal code model instruction sequence: -mno-explicit

Re: [pushed][PATCH] LoongArch: Fix missing plugin header

2024-04-02 Thread chenglulu
Pushed to r14-9743. 在 2024/4/2 上午9:20, Yang Yujie 写道: gcc/ChangeLog: * config/loongarch/t-loongarch: Add loongarch-def-arrays.h to OPTION_H_EXTRA. --- gcc/config/loongarch/t-loongarch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/config/loongarc

Re: [pushed][PATCH v2] LoongArch: Modify the address calculation logic for obtaining array element values through fp.

2024-02-01 Thread chenglulu
Pushed to r14-8716. 在 2024/1/30 下午3:55, Lulu Cheng 写道: Modify address calculation logic from (((a x C) + fp) + offset) to ((fp + offset) + a x C). Thereby modifying the register dependencies and optimizing the code. The value of C is 2 4 or 8. The following is the assembly code before and afte

Re: [pushed][PATCH v5 0/5] When cmodel=extreme, add macro implementation and fix problems with explicit relos implementation.

2024-02-01 Thread chenglulu
Pushed to r14-8717...r14-8721. 在 2024/1/29 下午4:21, Lulu Cheng 写道: When cmodel=extreme, since the symbol address is obtained through four instructions, errors may occur in some cases during linking. Xi Ruoyao fixes this problem. https://github.com/loongson/la-abi-specs/blob/release/laelf.adoc#e

Re:[pushed] [PATCH v2] LoongArch: Adjust cost of vector_stmt that match multiply-add pattern.

2024-02-01 Thread chenglulu
Pushed to r14-8722. 在 2024/1/26 下午4:41, Li Wei 写道: We found that when only 128-bit vectorization was enabled, 549.fotonik3d_r failed to vectorize effectively. For this reason, we adjust the cost of 128-bit vector_stmt that match the multiply-add pattern to facilitate 128-bit vectorization. The e

Re: [PATCH] LoongArch: libsanitizer: Enable build lsan and tsan for loongarch64.

2024-02-01 Thread chenglulu
Ping? 在 2024/1/30 上午10:09, Lulu Cheng 写道: From: chenguoqi libsanitizer/ChangeLog: * configure.tgt: Enable tsan and lsan for loongarch64. * tsan/Makefile.am: Add tsan_rtl_loongarch64.S to EXTRA_libtsan_la_SOURCES. * tsan/Makefile.in: Regenerate. --- libsanitizer/conf

Re: [pushed][PATCH] LoongArch: Fix incorrect return type for frecipe/frsqrte intrinsic functions

2024-02-01 Thread chenglulu
Pushed to r14-8723. 在 2024/1/24 下午5:19, Jiahao Xu 写道: gcc/ChangeLog: * config/loongarch/larchintrin.h (__frecipe_s): Update function return type. (__frecipe_d): Ditto. (__frsqrte_s): Ditto. (__frsqrte_d): Ditto. gcc/testsuite/ChangeLog: * gcc.ta

Re: [PATCH] LoongArch: Fix an ODR violation

2024-02-01 Thread chenglulu
LGTM! Thanks! 在 2024/2/2 上午5:54, Xi Ruoyao 写道: When bootstrapping GCC 14 --with-build-config=bootstrap-lto, an ODR violation is detected: ../../gcc/config/loongarch/loongarch-opts.cc:57: warning: 'abi_minimal_isa' violates the C++ One Definition Rule [-Wodr] 57 | abi_minimal_isa

Re: [PATCH] LoongArch: libsanitizer: Enable build lsan and tsan for loongarch64.

2024-02-03 Thread chenglulu
在 2024/2/2 下午6:01, Jakub Jelinek 写道: On Tue, Jan 30, 2024 at 10:09:51AM +0800, Lulu Cheng wrote: From: chenguoqi libsanitizer/ChangeLog: * configure.tgt: Enable tsan and lsan for loongarch64. * tsan/Makefile.am: Add tsan_rtl_loongarch64.S to EXTRA_libtsan_la_SOURCES. This

  1   2   3   4   >