]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Implement sge and sgeu.
authorLulu Cheng <chenglulu@loongson.cn>
Thu, 12 Dec 2024 08:21:38 +0000 (16:21 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Fri, 7 Nov 2025 01:21:37 +0000 (09:21 +0800)
commitcbd06e9f66c2d40ff4af7fa648878eaf32928c18
treee7a59c431716bb2408908692e05ef98793e10539
parent73eb0027ef4c4a85b9233a37a2e281f1222b1f90
LoongArch: Implement sge and sgeu.

The original implementation of the function loongarch_extend_comparands
only prevented op1 from being loaded into the register when op1 was
const0_rtx.  It has now been modified so that op1 is not loaded into
the register as long as op1 is an immediate value.  This allows
slt{u}i to be generated instead of slt{u} if the conditions are met.

gcc/ChangeLog:

* config/loongarch/loongarch.cc
(loongarch_canonicalize_int_order_test): Support GT GTU LT
and LTU.
(loongarch_extend_comparands): Expand the scope of op1 from
0 to all immediate values.
* config/loongarch/loongarch.md
(*sge<u>_<X:mode><GPR:mode>): New template.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/sign-extend-3.c: New test.
gcc/config/loongarch/loongarch.cc
gcc/config/loongarch/loongarch.md
gcc/testsuite/gcc.target/loongarch/sign-extend-3.c [new file with mode: 0644]