diff options
author | Guo Jie <guojie@loongson.cn> | 2024-12-30 10:39:13 +0800 |
---|---|---|
committer | Lulu Cheng <chenglulu@loongson.cn> | 2025-01-02 11:24:42 +0800 |
commit | d55d40afd42a280c80729b538e3cce994f20961d (patch) | |
tree | c8c87f15773d2796dec43f6815345b3c22bcc98a /gcc/rust/ast/rust-pattern.h | |
parent | ea7476516dbd600b09ab1f05f4ed977c1cc7bb95 (diff) | |
download | gcc-d55d40afd42a280c80729b538e3cce994f20961d.zip gcc-d55d40afd42a280c80729b538e3cce994f20961d.tar.gz gcc-d55d40afd42a280c80729b538e3cce994f20961d.tar.bz2 |
LoongArch: Optimize for conditional move operations
The optimization example is as follows.
From:
if (condition)
dest += 1 << 16;
To:
dest += (condition ? 1 : 0) << 16;
It does not use maskeqz and masknez, thus reducing the number of
instructions.
gcc/ChangeLog:
* config/loongarch/loongarch.cc
(loongarch_expand_conditional_move): Add some optimization
implementations based on noce_try_cmove_arith.
gcc/testsuite/ChangeLog:
* gcc.target/loongarch/conditional-move-opt-1.c: New test.
* gcc.target/loongarch/conditional-move-opt-2.c: New test.
Diffstat (limited to 'gcc/rust/ast/rust-pattern.h')
0 files changed, 0 insertions, 0 deletions