]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Fix incorrect reorder of __lsx_vldx and __lasx_xvldx [PR119084]
authorXi Ruoyao <xry111@xry111.site>
Sun, 2 Mar 2025 11:02:50 +0000 (19:02 +0800)
committerXi Ruoyao <xry111@xry111.site>
Thu, 6 Mar 2025 05:03:43 +0000 (13:03 +0800)
commit43d777078387ab2c4aabe526f6ee0ff13055e0b6
tree33a59282dd2c7b9e576ddce9aced6be2720df90c
parent844f5f1f0e0b7ba4f53c75f7129b9a132d17b81e
LoongArch: Fix incorrect reorder of __lsx_vldx and __lasx_xvldx [PR119084]

They could be incorrectly reordered with store instructions like st.b
because the RTL expression does not have a memory_operand or a (mem)
expression.  The incorrect reorder has been observed in openh264 LTO
build.

Expand them to a (mem) expression instead of unspec to fix the issue.

Closes: https://github.com/cisco/openh264/issues/3857
(cherry picked from commit 4856292f7a680ec478e7607f1b71781996d7d542)

Edited to remove the loongarch.cc change which is not needed for gcc-14
branch.

gcc/ChangeLog:

PR target/119084
* config/loongarch/lasx.md (UNSPEC_LASX_XVLDX): Remove.
(lasx_xvldx): Remove.
* config/loongarch/lsx.md (UNSPEC_LSX_VLDX): Remove.
(lsx_vldx): Remove.
* config/loongarch/simd.md (QIVEC): New define_mode_iterator.
(<simd_isa>_<x>vldx): New define_expand.

gcc/testsuite/ChangeLog:

PR target/119084
* gcc.target/loongarch/pr119084.c: New test.
gcc/config/loongarch/lasx.md
gcc/config/loongarch/lsx.md
gcc/config/loongarch/simd.md
gcc/testsuite/gcc.target/loongarch/pr119084.c [new file with mode: 0644]