]> git.ipfire.org Git - thirdparty/gcc.git/commit
MIPS: Support more cases with alien mode of SHF.DF
authorYunQiang Su <syq@gcc.gnu.org>
Thu, 27 Jun 2024 10:28:27 +0000 (18:28 +0800)
committerYunQiang Su <syq@gcc.gnu.org>
Fri, 5 Jul 2024 08:12:30 +0000 (16:12 +0800)
commit320c2ed4d2b4b007bab5ebf0078e6c730ad25d3e
tree70bd342613675489fe53a05762284df3240e5583
parent33dfd6798aa3e5f8be58c8810f9814d57485fe12
MIPS: Support more cases with alien mode of SHF.DF

Currently, we support the cases that strictly fit for the instructions.
For example, for V16QImode, we only support shuffle like
(0<=N0, N1, N2, N3<=3 here)
N0, N1, N2, N3
N0+4 N1+4 N2+4, N3+4
N0+8 N1+8 N2+8, N3+8
N0+12 N1+12 N2+12, N3+12

While in fact we can support more cases to try use other SHF.DF
instructions not strictly fitting the mode.

1) We can use SHF.H to support more cases for V16QImode:
(M0/M1/M2/M3 are 0 or 2 or 4 or 6)
M0 M0+1, M1, M1+1
M2 M2+1, M3, M3+1
M0+8 M0+9, M1+8, M1+9
M2+8 M2+9, M3+8, M3+9

2) We can use SHF.W to support some cases for V16QImode:
(M0/M1/M2/M3 are 0 or 4 or 8 or 12)
M0, M0+1, M0+2, M0+3
M1, M1+1, M1+2, M1+3
M2, M2+1, M2+2, M2+3
M3, M3+1, M3+2, M3+3

3) We can use SHF.W to support some cases for V8HImode:
(M0/M1/M2/M3 are 0 or 2 or 4 or 6)
M0, M0+1
M1, M1+1
M2, M2+1
M3, M3+1

4) We can also use SHF.W to swap the 2 parts of V2DF or V2DI.

gcc
* config/mips/mips-protos.h: New function mips_msa_shf_i8.
* config/mips/mips-msa.md(MSA_WHB_W): Not used anymore;
(msa_shf_<msafmt_f>): Use mips_msa_shf_i8.
* config/mips/mips.cc(mips_const_vector_shuffle_set_p):
Support more cases try to use alien mode instruction;
(mips_msa_shf_i8): New function to get the correct MSA SHF
instruction and IMM.
gcc/config/mips/mips-msa.md
gcc/config/mips/mips-protos.h
gcc/config/mips/mips.cc