Thanks for your suggestion!
Indeed, there are still some scenarios that can be optimized and
improved next.
在 2024/12/30 下午12:06, Xi Ruoyao 写道:
On Mon, 2024-12-30 at 10:39 +0800, Guo Jie wrote:
+ /* Make sure that imm is a positive integer power of
2. */
Maybe we should also
gcc/ChangeLog:
* config/loongarch/lasx.md (lasx_xvabsd_s_): Remove.
(abd3): New insn pattern.
(lasx_xvabsd_u_): Remove.
* config/loongarch/loongarch-builtins.cc (CODE_FOR_lsx_vabsd_b):
Rename.
(CODE_FOR_lsx_vabsd_h): Ditto.
(CODE_FOR_lsx_vabs
Thank you. I will fix it in patch v2.
在 2024/12/30 上午11:55, Xi Ruoyao 写道:
On Mon, 2024-12-30 at 10:38 +0800, Guo Jie wrote:
diff --git a/gcc/config/loongarch/loongarch.md
b/gcc/config/loongarch/loongarch.md
index 7a110ca9de6..d4287012b3c 100644
--- a/gcc/config/loongarch/loongarch.md
+++ b/gcc
The optimization example is as follows.
From:
if (condition)
dest += 1 << 16;
To:
dest += (condition ? 1 : 0) << 16;
It does not use maskeqz and masknez, thus reducing the number of
instructions.
gcc/ChangeLog:
* config/loongarch/loongarch.cc
(loongarch_expand_conditiona
For some instruction patterns with commutative operands,
the order of operands needs to be adjusted to match the rules.
gcc/ChangeLog:
* config/loongarch/loongarch.md
(bytepick_d__rev): New combiner.
(bstrpick_alsl_paired): Reorder input operands.
gcc/testsuite/ChangeLog:
gcc/ChangeLog:
* config/loongarch/lasx.md (vec_unpacks_lo_): Redefine.
(vec_unpacku_lo_): Ditto.
(lasx_vext2xv_h_b): Replaced by vec_unpack_lo_v32qi.
(vec_unpack_lo_v32qi): New insn.
(lasx_vext2xv_w_h): Replaced by vec_unpack_lo_v16hi.
(vec_unpack_lo
gcc/ChangeLog:
* config/loongarch/lasx.md (lasx_xvabsd_s_): Remove.
(abd3): New insn pattern.
(lasx_xvabsd_u_): Remove.
* config/loongarch/loongarch-builtins.cc (CODE_FOR_lsx_vabsd_b):
Rename.
(CODE_FOR_lsx_vabsd_h): Ditto.
(CODE_FOR_lsx_vabs
The xvexth related instructions operate SEPARATELY according to
the high and low 128 bits, and sign/zero extend the upper half
of every 128 bits in src to the corresponding 128 bits in dest.
For xvexth.d.w, the rule for the first element of dest should be:
dest.D[0] = sign_extend (src.W[2] ,64
There are two aspects that affect the matching of instruction templates:
1. vec_duplicate is redundant in the following operations.
set (match_operand:V4DI ...)
(vec_duplicate:V4DI (vec_select:V4DI ...))
2. The range of values for testing predicate const_8_to_15_operand and
const_16_t
gcc/ChangeLog:
* config/loongarch/lasx.md: Remove useless code.
* config/loongarch/lsx.md: Ditto.
---
gcc/config/loongarch/lasx.md | 66
gcc/config/loongarch/lsx.md | 35 ---
2 files changed, 101 deletions(-)
diff --git a/gcc
The constraint of op[1] is inconsistent with the output template.
gcc/ChangeLog:
* config/loongarch/loongarch.md
(define_insn "*sge_"): Fix inconsistency
error.
---
Update in v2:
Remove useless support for op[1] is const_imm12_operand.
---
gcc/config/loongarch/loong
Thanks for the feedback.
The comparison between a const_imm12_operand and (const_int 1) does indeed
perform a universal process of constant folding before any tree based
optimization.
I will fix it in patch v2.
在 2024/3/4 下午5:18, Xi Ruoyao 写道:
On Mon, 2024-03-04 at 11:03 +0800, Guo Jie
The constraint of op[1] is inconsistent with the output template.
gcc/ChangeLog:
* config/loongarch/loongarch.md
(define_insn "*sge_"): Fix inconsistency
error.
---
gcc/config/loongarch/loongarch.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/
gcc/ChangeLog:
* config/loongarch/loongarch.cc (loongarch_split_plus_constant):
avoid left shift of negative value -0x8000.
---
gcc/config/loongarch/loongarch.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/config/loongarch/loongarch.cc
b/gcc/config/lo
For the following immediate load operation in
gcc/testsuite/gcc.target/loongarch/imm-load1.c:
long long r = 0x0101010101010101;
Before this patch:
lu12i.w $r15,16842752>>12
ori $r15,$r15,257
lu32i.d $r15,0x10101>>32
lu52i.d $r1
Thanks for your advice! I will fix it in patch v2.
在 2023/11/18 下午5:09, Xi Ruoyao 写道:
On Sat, 2023-11-18 at 14:59 +0800, Guo Jie wrote:
For the following immediate load operation in
gcc/testsuite/gcc.target/loongarch/imm-load1.c:
long long r = 0x0101010101010101;
Before this patch
For the following immediate load operation in
gcc/testsuite/gcc.target/loongarch/imm-load1.c:
long long r = 0x0101010101010101;
Before this patch:
lu12i.w $r15,16842752>>12
ori $r15,$r15,257
lu32i.d $r15,0x10101>>32
lu52i.d $r1
gcc/ChangeLog:
* config/loongarch/lasx.md (lasx_vecinit_merge_): New
pattern for vector construction.
(vec_set_internal): Ditto.
(lasx_xvinsgr2vr__internal): Ditto.
(lasx_xvilvl__internal): Ditto.
* config/loongarch/loongarch.cc (loongarch_expand_vec
Change-Id: I327f68ab482b94073974e672c71d25c98b35a080
gcc/ChangeLog:
* config/loongarch/lasx.md (lasx_vecinit_merge_): New
pattern for vector construction.
(vec_set_internal): Ditto.
(lasx_xvinsgr2vr__internal): Ditto.
(lasx_xvilvl__internal): Ditto.
Hi,
What I wanna change is "gcc/common/config/loongarch/loongarch-common.cc",
and the patch is automatically generated by "git gcc-commit-mklog".
Is it necessary to to remove "common/" ?
Thanks for the review.
在 2023/9/8 下午4:06, Xi Ruoyao 写道:
On Fri, 2023
gcc/ChangeLog:
* common/config/loongarch/loongarch-common.cc:
(default_options loongarch_option_optimization_table):
Default to -fsched-pressure.
---
gcc/common/config/loongarch/loongarch-common.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/gcc/common/config/loon
v2: Modify commit message.
gcc/ChangeLog:
* config/loongarch/loongarch.md: Support 'G' -> 'k' in
movsf_hardfloat and movdf_hardfloat.
gcc/testsuite/ChangeLog:
* gcc.target/loongarch/const-double-zero-stx.c: New test.
---
gcc/config/loongarch/loongarch.md |
gcc/ChangeLog:
* config/loongarch/loongarch.md: Support 'G' -> 'k' in
movsf_hardfloat and movdf_hardfloat.
gcc/testsuite/ChangeLog:
* gcc.target/loongarch/const-double-zero-stx.c: New test.
---
gcc/config/loongarch/loongarch.md | 12 ++--
.../loonga
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 changed, 4 insertions(+)
diff --git a/gcc/con
From: Sun Haiyong
gcc/ChangeLog:
* config.gcc: Add some include file in tm_file.
---
gcc/config.gcc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 51ca5311fa4..b901aa8e5dc 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -24
/* snip */
diff --git a/gcc/testsuite/gcc.target/loongarch/shrink-wrap.c
b/gcc/testsuite/gcc.target/loongarch/shrink-wrap.c
new file mode 100644
index 000..f2c867a2769
--- /dev/null
+++ b/gcc/testsuite/gcc.target/loongarch/shrink-wrap.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* {
26 matches
Mail list logo