]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Provide ashr lshr and ashl RTL pattern for vectors.
authorLulu Cheng <chenglulu@loongson.cn>
Thu, 8 Aug 2024 01:59:28 +0000 (09:59 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Mon, 12 Aug 2024 01:33:04 +0000 (09:33 +0800)
commit7bf4cd48d4494ba65680578e9c7ae9a1b809aeaf
tree822358fb63f8565aecd80a5785c3de0e75fff62f
parent0498f8bda1d08b8ed8100d759917792baf2da15f
LoongArch: Provide ashr lshr and ashl RTL pattern for vectors.

We support vashr vlshr and vashl. However, in r15-1638 support optimize
x < 0 ? -1 : 0 into (signed) x >> 31 and x < 0 ? 1 : 0 into (unsigned) x >> 31.
To support this optimization, vector ashr lshr and ashl need to be implemented.

gcc/ChangeLog:

* config/loongarch/loongarch.md (insn): Added rotatert rotr pairs.
* config/loongarch/simd.md (rotr<mode>3): Remove to ...
(<optab><mode>3): This.

gcc/testsuite/ChangeLog:

* g++.target/loongarch/vect-ashr-lshr.C: New test.
gcc/config/loongarch/loongarch.md
gcc/config/loongarch/simd.md
gcc/testsuite/g++.target/loongarch/vect-ashr-lshr.C [new file with mode: 0644]