]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Implement vector reduction from 256-bit to 128-bit
authorJiahao Xu <xujiahao@loongson.cn>
Thu, 23 Oct 2025 06:29:06 +0000 (14:29 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Sat, 25 Oct 2025 07:51:59 +0000 (15:51 +0800)
commitffdee87ac4cf576c59825a0a7a615ff212e51d96
tree49d0916e43214babc62906f7a49d52f0a292bf3b
parentf0717d13402d8a057ce0516dcfb3cedbf635c1ed
LoongArch: Implement vector reduction from 256-bit to 128-bit

gcc/ChangeLog:

* config/loongarch/lasx.md (vec_extract<mode><lasxhalf>): New define_expand.
(vec_extract_lo_<mode>): New define_insn_and_split.
(vec_extract_hi_<mode>): New define_insn.
* config/loongarch/loongarch-protos.h (loongarch_check_vect_par_cnst_half)
New function prototype.
* config/loongarch/loongarch.cc (loongarch_split_reduction):
Implement TARGET_VECTORIZE_SPLIT_REDUCTION.
(loongarch_check_vect_par_cnst_half): New function.
* config/loongarch/predicates.md
(vect_par_cnst_low_half): New predicate.
(vect_par_cnst_high_half): New predicate.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/lasx-reduc-1.c: New test.
gcc/config/loongarch/lasx.md
gcc/config/loongarch/loongarch-protos.h
gcc/config/loongarch/loongarch.cc
gcc/config/loongarch/predicates.md
gcc/testsuite/gcc.target/loongarch/lasx-reduc-1.c [new file with mode: 0644]