-
- Downloads
LoongArch: Optimized some of the symbolic expansion instructions generated...
LoongArch: Optimized some of the symbolic expansion instructions generated during bitwise operations. There are two mode iterators defined in the loongarch.md: (define_mode_iterator GPR [SI (DI "TARGET_64BIT")]) and (define_mode_iterator X [(SI "!TARGET_64BIT") (DI "TARGET_64BIT")]) Replace the mode in the bit arithmetic from GPR to X. Since the bitwise operation instruction does not distinguish between 64-bit, 32-bit, etc., it is necessary to perform symbolic expansion if the bitwise operation is less than 64 bits. The original definition would have generated a lot of redundant symbolic extension instructions. This problem is optimized with reference to the implementation of RISCV. Add this patch spec2017 500.perlbench performance improvement by 1.8% gcc/ChangeLog: * config/loongarch/loongarch.md (one_cmpl<mode>2): Replace GPR with X. (*nor<mode>3): Likewise. (nor<mode>3): Likewise. (*negsi2_extended): New template. (*<optab>si3_internal): Likewise. (*one_cmplsi2_internal): Likewise. (*norsi3_internal): Likewise. (*<optab>nsi_internal): Likewise. (bytepick_w_<bytepick_imm>_extend): Modify this template according to the modified bit operation to make the optimization work. gcc/testsuite/ChangeLog: * gcc.target/loongarch/sign-extend-bitwise.c: New test.
Loading
Please register or sign in to comment