diff options
author | Lulu Cheng <chenglulu@loongson.cn> | 2023-12-08 10:16:48 +0800 |
---|---|---|
committer | Lulu Cheng <chenglulu@loongson.cn> | 2024-01-11 09:36:07 +0800 |
commit | b4deb244dd2f4639b6f1c80d711215ca37e621df (patch) | |
tree | 7246ec7cd4ff9c46622e604506bf2be633b47ac3 /gcc/c | |
parent | 6686e16fda419067b91614835dd743ebb82717ea (diff) | |
download | gcc-b4deb244dd2f4639b6f1c80d711215ca37e621df.zip gcc-b4deb244dd2f4639b6f1c80d711215ca37e621df.tar.gz gcc-b4deb244dd2f4639b6f1c80d711215ca37e621df.tar.bz2 |
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.
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions