Ping: [PATCH v3] doc: Correction of Tree SSA Passes info.

2024-05-09 Thread Chenghui Pan
Ping. Is this version of patch ok for trunk? thanks! On 2024/3/26 09:54, Chenghui Pan wrote: Current document of Tree SSA passes contains many parts that is not updated for many years. This patch removes some info that is outdated and not existed in current GCC codebase, and fixes some wrong

[PATCH v3] doc: Correction of Tree SSA Passes info.

2024-03-25 Thread Chenghui Pan
Current document of Tree SSA passes contains many parts that is not updated for many years. This patch removes some info that is outdated and not existed in current GCC codebase, and fixes some wrong code location descriptions based on current codebase status and ChangeLogs. Changes since v1: *

Re: [PATCH v1] doc: Correction of Tree SSA Passes info.

2024-03-25 Thread Chenghui Pan
Seems right. I will reference them. Also I think maybe some documents for the passes are still missing and we can add them in the future... On 2024/3/26 08:11, Andrew Pinski wrote: On Sun, Mar 24, 2024 at 8:46 PM Chenghui Pan wrote: Current document of Tree SSA passes contains many parts

[PATCH v2] doc: Correction of Tree SSA Passes info.

2024-03-25 Thread Chenghui Pan
Current document of Tree SSA passes contains many parts that is not updated for many years. This patch removes some info that is outdated and not existed in current GCC codebase, and fixes some wrong code location descriptions based on current codebase status and ChangeLogs. Changes since v1:

[PATCH v1] doc: Correction of Tree SSA Passes info.

2024-03-24 Thread Chenghui Pan
Current document of Tree SSA passes contains many parts that is not updated for many years. This patch removes some info that is outdated and not existed in current GCC codebase, and fixes some wrong code location descriptions based on current codebase status and ChangeLogs. gcc/ChangeLog:

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

2024-03-14 Thread 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): LoongArch: Remove unused/useless definitions. LoongArch: Change

[PATCH v2 3/3] LoongArch: Combine UNITS_PER_FP_REG and UNITS_PER_FPREG macros.

2024-03-14 Thread Chenghui Pan
These macros are completely same in definition, so we can keep the previous one and eliminate later one. gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_hard_regno_mode_ok_uncached): Combine UNITS_PER_FP_REG and UNITS_PER_FPREG macros.

[PATCH v2 2/3] LoongArch: Change loongarch_expand_vec_cmp()'s return type from bool to void.

2024-03-14 Thread Chenghui Pan
This function is always return true at the end of function implementation, so the return value is useless. gcc/ChangeLog: * config/loongarch/lasx.md (vec_cmp): Remove checking of loongarch_expand_vec_cmp()'s return value. (vec_cmpu): Ditto. *

[PATCH v2 1/3] LoongArch: Remove unused/useless definitions.

2024-03-14 Thread Chenghui Pan
This patch removes some unnecessary definitions of target hook functions according to the documentation of GCC. gcc/ChangeLog: * config/loongarch/loongarch-protos.h (loongarch_cfun_has_cprestore_slot_p): Delete. (loongarch_adjust_insn_length): Delete.

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

2024-03-13 Thread 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 unmodified state is better solution. This patch partially reverts

[PATCH v1] LoongArch: Remove masking process for operand 3 of xvpermi.q.

2024-03-11 Thread 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 unmodified state is better solution. This patch partially reverts

[PATCH v1 1/3] LoongArch: Remove unused/useless definitions.

2024-03-11 Thread Chenghui Pan
This patch removes some unnecessary definitions of target hook functions according to the documentation of GCC. gcc/ChangeLog: * config/loongarch/loongarch-protos.h (loongarch_cfun_has_cprestore_slot_p): Delete. (loongarch_adjust_insn_length): Delete.

[PATCH v1 0/3] LoongArch: Cleanup unused/redundant codes.

2024-03-11 Thread Chenghui Pan
There's some ununsed/useless definition inside LoongArch target support codes, these patches make a simple cleanup. Regression test passed. Chenghui Pan (3): LoongArch: Remove unused/useless definitions. LoongArch: Change loongarch_expand_vec_cmp()'s return type from bool to void

[PATCH v1 3/3] LoongArch: Combine UNITS_PER_FP_REG and UNITS_PER_FPREG macros.

2024-03-11 Thread Chenghui Pan
These macros are completely same in definition, so we can keep the previous one and eliminate later one. gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_hard_regno_mode_ok_uncached): Combine UNITS_PER_FP_REG and UNITS_PER_FPREG macros.

[PATCH v1 2/3] LoongArch: Change loongarch_expand_vec_cmp()'s return type from bool to void.

2024-03-11 Thread Chenghui Pan
This function is always return true at the end of function implementation, so the return value is useless. gcc/ChangeLog: * config/loongarch/lasx.md: Remove checking of loongarch_expand_vec_cmp()'s return value. * config/loongarch/loongarch-protos.h

[PATCH v1] LoongArch: Fix insn output of vec_concat templates for LASX.

2023-12-22 Thread Chenghui Pan
When investigaing failure of gcc.dg/vect/slp-reduc-sad.c, following instruction block are being generated by vec_concatv32qi (which is generated by vec_initv32qiv16qi) at entrance of foo() function: vldx$vr3,$r5,$r6 vld $vr2,$r5,0 xvpermi.q $xr2,$xr3,0x20 causes the reversion

[PATCH v1] LoongArch: Fix ICE when passing two same vector argument consecutively

2023-12-22 Thread Chenghui Pan
Following code will cause ICE on LoongArch target: #include extern void bar (__m128i, __m128i); __m128i a; void foo () { bar (a, a); } It is caused by missing constraint definition in mov_lsx. This patch fixes the template and remove the unnecessary processing from

Re: [PATCH 0/2] LoongArch: Fix PR113033 and clean up code

2023-12-19 Thread Chenghui Pan
The patches are look ok and no problem in spec2017 correctness check. On 2023/12/19 15:26, chenglulu wrote: We will read and test these patches as soon as possible. Thanks! 在 2023/12/19 下午2:59, Xi Ruoyao 写道: Superseds https://gcc.gnu.org/pipermail/gcc-patches/2023-December/640871.html. Per

Re: Fwd: [PATCH] LoongArch: Fix FP vector comparsons [PR113034]

2023-12-19 Thread Chenghui Pan
Hi, I checked the correctness of spec2017 and regression test of gcc, it seems ok! On 2023/12/18 17:04, chenglulu wrote: 转发的消息 主题: [PATCH] LoongArch: Fix FP vector comparsons [PR113034] 日期: Sun, 17 Dec 2023 23:12:18 +0800 发件人:Xi Ruoyao 收件人:

[PATCH v1] LoongArch: Fix instruction name typo in lsx_vreplgr2vr_ template

2023-11-03 Thread Chenghui Pan
gcc/ChangeLog: * config/loongarch/lsx.md: Fix instruction name typo in lsx_vreplgr2vr_ template. --- gcc/config/loongarch/lsx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/loongarch/lsx.md b/gcc/config/loongarch/lsx.md index

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

2023-10-22 Thread 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. (__lasx_xvfrintrne_s): Ditto.

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

2023-10-11 Thread 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] = src[x] + 1; dst += 32; src += 32; } } ICE info:

[PATCH v3 2/2] LoongArch: Modify check_effective_target_vect_int_mod according to SX/ASX capabilities.

2023-09-28 Thread Chenghui Pan
gcc/testsuite/ChangeLog: * lib/target-supports.exp: Add LoongArch in check_effective_target_vect_int_mod according to SX/ASX capabilities. --- gcc/testsuite/lib/target-supports.exp | 18 ++ 1 file changed, 18 insertions(+) diff --git

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

2023-09-28 Thread 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): LoongArch: Enable vect.exp for LoongArch. [PR111424] LoongArch

[PATCH v3 1/2] LoongArch: Enable vect.exp for LoongArch. [PR111424]

2023-09-28 Thread Chenghui Pan
gcc/testsuite/ChangeLog: * lib/target-supports.exp: Enable vect.exp for LoongArch. --- gcc/testsuite/lib/target-supports.exp | 31 +++ 1 file changed, 31 insertions(+) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp

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

2023-09-26 Thread Chenghui Pan
Correction: vect.exp will be set to run when target is capable of running LASX instructions, otherwise it will be compiled only. On Tue, 2023-09-26 at 19:56 +0800, Chenghui Pan wrote: > This is an update of: > https://gcc.gnu.org/pipermail/gcc-patches/2023-September/630953.html > >

[PATCH v2 0/2] Update target-supports.exp for LoongArch SX/ASX.

2023-09-26 Thread Chenghui Pan
"check_effective_target_loongarch_sx" in "proc check_effective_target_vect_int_mod {}" to choose correct dg-final directives for LoongArch, because DEFAULT_VECTCFLAGS cannot affect pr104992.c which is invoked by gcc.dg/dg.exp (not vect.exp). Chenghui Pan (2): Enable vect.exp for LoongA

[PATCH v2 2/2] Add LoongArch in check_effective_target_vect_int_mod according to ISA capabilities.

2023-09-26 Thread Chenghui Pan
gcc/testsuite/ChangeLog: * lib/target-supports.exp: Add LoongArch in check_effective_target_vect_int_mod according to ISA capabilities. --- gcc/testsuite/lib/target-supports.exp | 18 ++ 1 file changed, 18 insertions(+) diff --git

[PATCH v2 1/2] Enable vect.exp for LoongArch.

2023-09-26 Thread Chenghui Pan
gcc/testsuite/ChangeLog: * lib/target-supports.exp: Enable vect.exp for LoongArch. --- gcc/testsuite/lib/target-supports.exp | 31 +++ 1 file changed, 31 insertions(+) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp

Re: [PATCH v1] Update check_effective_target_vect_int_mod according to LoongArch SX/ASX capabilities.

2023-09-25 Thread Chenghui Pan
Thanks! I will try to improve it. On Mon, 2023-09-25 at 17:44 +0800, Xi Ruoyao wrote: > On Mon, 2023-09-25 at 17:38 +0800, Chenghui Pan wrote: > > Hi! > > > > After some attemptions, I think we still ne to check > > "check_effective_target_loongarch_sx" i

Re: [PATCH v1] Update check_effective_target_vect_int_mod according to LoongArch SX/ASX capabilities.

2023-09-25 Thread Chenghui Pan
.c is not affected by DEFAULT_CFLAGS, so we still need to check if LSX/LASX is available in vect_int_mod. Other parts of new patch is still WIP. On Sun, 2023-09-24 at 18:05 +0800, Xi Ruoyao wrote: > On Wed, 2023-09-20 at 09:15 +0800, Chenghui Pan wrote: > > LoongArch failed to pass gcc.dg

Re: [PATCH v1] Update check_effective_target_vect_int_mod according to LoongArch SX/ASX capabilities.

2023-09-24 Thread Chenghui Pan
Thanks for your advice! I will check it out and submit a new version of patch. On Sun, 2023-09-24 at 18:05 +0800, Xi Ruoyao wrote: > On Wed, 2023-09-20 at 09:15 +0800, Chenghui Pan wrote: > > LoongArch failed to pass gcc.dg/pr104992.c with -mlsx and -mlasx. > > This test uses &

[PATCH v1] Update check_effective_target_vect_int_mod according to LoongArch SX/ASX capabilities.

2023-09-19 Thread Chenghui Pan
LoongArch failed to pass gcc.dg/pr104992.c with -mlsx and -mlasx. This test uses different dg-final directives depending on the vect_int_mod result, LoongArch SX/ASX supports this operations but corresponding description is not defined in target-supports.exp. This patch solves the problem above

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

2023-08-31 Thread Chenghui Pan
+0800, Xi Ruoyao wrote: > On Thu, 2023-08-31 at 17:08 +0800, Chenghui Pan wrote: > > This is an update of: > > https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628303.html > > > > Changes since last version of patch set: > > - "dg-skip-if"-

[PATCH v6 0/4] Add Loongson SX/ASX instruction support to LoongArch target.

2023-08-31 Thread Chenghui Pan
This is an update of: https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628303.html Changes since last version of patch set: - "dg-skip-if"-related Changes of the g++.dg/torture/vshuf* testcases are reverted. (Replaced by __builtin_shuffle fix) - Add fix of __builtin_shuffle() for Loongson

[PATCH v5 1/6] LoongArch: Add Loongson SX vector directive compilation framework.

2023-08-23 Thread Chenghui Pan
From: Lulu Cheng gcc/ChangeLog: * config/loongarch/genopts/loongarch-strings: Add compilation framework. * config/loongarch/genopts/loongarch.opt.in: Ditto. * config/loongarch/loongarch-c.cc (loongarch_cpu_cpp_builtins): Ditto. * config/loongarch/loongarch-def.c:

[PATCH v5 4/6] LoongArch: Add Loongson ASX vector directive compilation framework.

2023-08-23 Thread Chenghui Pan
From: Lulu Cheng gcc/ChangeLog: * config/loongarch/genopts/loongarch-strings: Add compilation framework. * config/loongarch/genopts/loongarch.opt.in: Ditto. * config/loongarch/loongarch-c.cc (loongarch_cpu_cpp_builtins): Ditto. * config/loongarch/loongarch-def.c:

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

2023-08-23 Thread Chenghui Pan
This is an update of: https://gcc.gnu.org/pipermail/gcc-patches/2023-August/627413.html Changes since last version of patch set: - Fix regression test fail of pr54346.c with RUNTESTFLAGS="--target_board=unix/-mlsx". This is caused by the code simplification of

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

2023-08-17 Thread Chenghui Pan
life use() can be in another > translation > unit (or even a shared library) compiled with -mno-lsx.  So it seems > we > need to tell the compiler "a function call may clobber the high bits > of > a vector register even if the corresponding floating-point register > is > saved&

[PATCH v4 1/6] LoongArch: Add Loongson SX vector directive compilation framework.

2023-08-14 Thread Chenghui Pan
From: Lulu Cheng gcc/ChangeLog: * config/loongarch/genopts/loongarch-strings: Add compilation framework. * config/loongarch/genopts/loongarch.opt.in: Ditto. * config/loongarch/loongarch-c.cc (loongarch_cpu_cpp_builtins): Ditto. * config/loongarch/loongarch-def.c:

[PATCH v4 4/6] LoongArch: Add Loongson ASX vector directive compilation framework.

2023-08-14 Thread Chenghui Pan
From: Lulu Cheng gcc/ChangeLog: * config/loongarch/genopts/loongarch-strings: Add compilation framework. * config/loongarch/genopts/loongarch.opt.in: Ditto. * config/loongarch/loongarch-c.cc (loongarch_cpu_cpp_builtins): Ditto. * config/loongarch/loongarch-def.c:

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

2023-08-14 Thread Chenghui Pan
This is an update of: https://gcc.gnu.org/pipermail/gcc-patches/2023-August/626194.html This version of patch set only introduces some small simplications of implementation. Because I missed the size limitation of mail size, the huge testsuite patches of v2 and v3 are not shown in the mail list.

[PATCH v3 4/8] LoongArch: Add Loongson ASX vector directive compilation framework.

2023-08-03 Thread Chenghui Pan
From: Lulu Cheng gcc/ChangeLog: * config/loongarch/genopts/loongarch-strings: Add compilation framework. * config/loongarch/genopts/loongarch.opt.in: Ditto. * config/loongarch/loongarch-c.cc (loongarch_cpu_cpp_builtins): Ditto. * config/loongarch/loongarch-def.c:

[PATCH v3 1/8] LoongArch: Add Loongson SX vector directive compilation framework.

2023-08-03 Thread Chenghui Pan
From: Lulu Cheng gcc/ChangeLog: * config/loongarch/genopts/loongarch-strings: Add compilation framework. * config/loongarch/genopts/loongarch.opt.in: Ditto. * config/loongarch/loongarch-c.cc (loongarch_cpu_cpp_builtins): Ditto. * config/loongarch/loongarch-def.c:

[PATCH v3 0/8] Add Loongson SX/ASX instruction support to LoongArch target.

2023-08-03 Thread Chenghui Pan
This is an update of : https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624770.html Changes since last version: - Revert vabsd/xvabsd RTL templates to unspec impl, because arithmetic RTL expression cannot cover the edge case of the instruction output. v2 impl of vabsd/xvabsd template

[PATCH v2 0/8] Add Loongson SX/ASX instruction support to LoongArch target.

2023-07-18 Thread Chenghui Pan
This is an update of https://gcc.gnu.org/pipermail/gcc-patches/2023-June/623262.html In addition, LSX/LASX instructions support is added in the master branch of binutils-gdb, and these GCC patches can be used with future releases of binutils-gdb. Changes since v1: - Some usages of "unspec" in

[PATCH v2 4/8] LoongArch: Added Loongson ASX vector directive compilation framework.

2023-07-18 Thread Chenghui Pan
From: Lulu Cheng gcc/ChangeLog: * config/loongarch/genopts/loongarch-strings: Added compilation framework. * config/loongarch/genopts/loongarch.opt.in: Ditto. * config/loongarch/loongarch-c.cc (loongarch_cpu_cpp_builtins): Ditto. *

[PATCH v2 1/8] LoongArch: Added Loongson SX vector directive compilation framework.

2023-07-18 Thread Chenghui Pan
From: Lulu Cheng gcc/ChangeLog: * config/loongarch/genopts/loongarch-strings: Added compilation framework. * config/loongarch/genopts/loongarch.opt.in: Ditto. * config/loongarch/loongarch-c.cc (loongarch_cpu_cpp_builtins): Ditto. *

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

2023-07-06 Thread Chenghui Pan
load and store. See https://gcc.gnu.org/bugzilla/PR104688 for the background, and some people really hate using a lock for atomics. On Fri, 2023-06-30 at 10:16 +0800, Chenghui Pan wrote: These patches add the Loongson SX/ASX instruction support to the LoongArch target, and can be utilized

[PATCH v1 4/6] LoongArch: Added Loongson ASX vector directive compilation framework.

2023-06-29 Thread Chenghui Pan
From: Lulu Cheng gcc/ChangeLog: * config/loongarch/genopts/loongarch-strings: Added compilation framework. * config/loongarch/genopts/loongarch.opt.in: Ditto. * config/loongarch/loongarch-c.cc (loongarch_cpu_cpp_builtins): Ditto. *

[PATCH v1 1/6] LoongArch: Added Loongson SX vector directive compilation framework.

2023-06-29 Thread Chenghui Pan
From: Lulu Cheng gcc/ChangeLog: * config/loongarch/genopts/loongarch-strings: Added compilation framework. * config/loongarch/genopts/loongarch.opt.in: Ditto. * config/loongarch/loongarch-c.cc (loongarch_cpu_cpp_builtins): Ditto. *

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

2023-06-29 Thread Chenghui Pan
These patches add the Loongson SX/ASX instruction support to the LoongArch target, and can be utilized by using the new "-mlsx" and "-mlasx" option. Patches are bootstrapped and tested on loongarch64-linux-gnu target. Lulu Cheng (6): LoongArch: Added Loongson SX vector directive compilation