]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/config/mips/mips-protos.h
mips: msa: truncate immediate shift amount [PR101922]
authorXi Ruoyao <xry111@mengyan1223.wang>
Fri, 20 Aug 2021 14:52:57 +0000 (22:52 +0800)
committerXi Ruoyao <xry111@mengyan1223.wang>
Mon, 23 Aug 2021 05:24:50 +0000 (13:24 +0800)
commitf93f0868919ab32bfbc24adb40158298031a4d58
tree4986ce90586c766deb6d15c092e3c6532d47e289
parent4a4616e53f440e15d0f3e91e23b67a3b5c84dddf
mips: msa: truncate immediate shift amount [PR101922]

When -mloongson-mmi is enabled, SHIFT_COUNT_TRUNCATED is turned off.
This causes untruncated immediate shift amount outputed into the asm,
and the GNU assembler refuses to assemble it.

Truncate immediate shift amount when outputing the asm instruction to
make GAS happy again.

gcc/

PR target/101922
* config/mips/mips-protos.h (mips_msa_output_shift_immediate):
  Declare.
* config/mips/mips.c (mips_msa_output_shift_immediate): New
  function.
* config/mips/mips-msa.md (vashl<mode>3, vashr<mode>3,
  vlshr<mode>3): Call it.

gcc/testsuite/

PR target/101922
* gcc.target/mips/pr101922.c: New test.
gcc/config/mips/mips-msa.md
gcc/config/mips/mips-protos.h
gcc/config/mips/mips.c
gcc/testsuite/gcc.target/mips/pr101922.c [new file with mode: 0644]