The first patch fixes a wrong-code caused by <optab>_alsl_reversesi_extended which mistakenly accepted the same hard register for the destination and the addend.
The second patch partially fixes the performance regression caused by failing to combine the instructions in some cases and failing to utilize the uarch macro-fused operation. The fix is partial because TARGET_SCHED_MACRO_FUSION_PAIR_P will be needed to guarantee the bstrpick.d and alsl instructions are not separated. Bootstrapped and regtested on loongarch64-linux-gnu. Ok for trunk? Xi Ruoyao (2): LoongArch: Fix wrong code with <optab>_alsl_reversesi_extended LoongArch: Partially fix code regression from r15-7062 gcc/config/loongarch/loongarch.md | 61 ++++++++++++++++--- .../loongarch/bitwise-shift-reassoc-clobber.c | 21 +++++++ .../loongarch/bitwise-shift-reassoc-dual.c | 18 ++++++ .../loongarch/bitwise-shift-reassoc-fuse.c | 16 +++++ .../loongarch/bitwise-shift-reassoc.c | 2 +- .../loongarch/bstrpick_alsl_paired.c | 2 +- 6 files changed, 109 insertions(+), 11 deletions(-) create mode 100644 gcc/testsuite/gcc.target/loongarch/bitwise-shift-reassoc-clobber.c create mode 100644 gcc/testsuite/gcc.target/loongarch/bitwise-shift-reassoc-dual.c create mode 100644 gcc/testsuite/gcc.target/loongarch/bitwise-shift-reassoc-fuse.c -- 2.48.1