aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.cc
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2023-11-14 00:17:19 +0800
committerXi Ruoyao <xry111@xry111.site>2023-11-17 19:21:11 +0800
commitbdf20fdfc342746d1e1785f5aaa36e33897b1574 (patch)
treebd147f723562223035e0ce07617b4e248b54450b /gcc/tree-vect-loop.cc
parent10615c8a10d6b61e813254924d76be728dbd4688 (diff)
downloadgcc-bdf20fdfc342746d1e1785f5aaa36e33897b1574.zip
gcc-bdf20fdfc342746d1e1785f5aaa36e33897b1574.tar.gz
gcc-bdf20fdfc342746d1e1785f5aaa36e33897b1574.tar.bz2
LoongArch: Handle vectorized copysign (x, -1) expansion efficiently
With LSX or LASX, copysign (x[i], -1) (or any negative constant) can be vectorized using [x]vbitseti.{w/d} instructions to directly set the signbits. Inspired by Tamar Christina's "AArch64: Handle copysign (x, -1) expansion efficiently" (r14-5289). gcc/ChangeLog: * config/loongarch/lsx.md (copysign<mode>3): Allow operand[2] to be an reg_or_vector_same_val_operand. If it's a const vector with same negative elements, expand the copysign with a bitset instruction. Otherwise, force it into an register. * config/loongarch/lasx.md (copysign<mode>3): Likewise. gcc/testsuite/ChangeLog: * g++.target/loongarch/vect-copysign-negconst.C: New test. * g++.target/loongarch/vect-copysign-negconst-run.C: New test.
Diffstat (limited to 'gcc/tree-vect-loop.cc')
0 files changed, 0 insertions, 0 deletions