]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Fix incorrect code generation for sad pattern
authorJiahao Xu <xujiahao@loongson.cn>
Thu, 14 Dec 2023 12:49:04 +0000 (20:49 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Thu, 21 Dec 2023 09:21:11 +0000 (17:21 +0800)
commit92045913b23db7fde7b686dac519359b58d35e5a
treea08e29c40eb7061228221e929c29b117d41e7095
parent140aa2cdf93c7729e362b09534535395357183f0
LoongArch: Fix incorrect code generation for sad pattern

When I attempt to enable vect_usad_char effective target for LoongArch, slp-reduc-sad.c
and vect-reduc-sad*.c tests fail. These tests fail because the sad pattern generates bad
code. This patch to fixed them, for sad patterns, use zero expansion instead of sign
expansion for reduction.

Currently, we are fixing failed vectorized tests, and in the future, we will
enable more tests of "vect" for LoongArch.

gcc/ChangeLog:

* config/loongarch/lasx.md: Use zero expansion instruction.
* config/loongarch/lsx.md: Ditto.
gcc/config/loongarch/lasx.md
gcc/config/loongarch/lsx.md