diff options
author | Xi Ruoyao <xry111@xry111.site> | 2023-02-03 17:06:06 +0800 |
---|---|---|
committer | Xi Ruoyao <xry111@xry111.site> | 2023-02-06 21:40:40 +0800 |
commit | 5ebfd7ba2f612283656de4e7b8082bf82ef2b957 (patch) | |
tree | a3f622584cdcdb2025d5d1e924f75cedf0f0daad /gcc/gimple-fold.cc | |
parent | c490c7c0ef34113ee8de7fd4cd4a424498541891 (diff) | |
download | gcc-5ebfd7ba2f612283656de4e7b8082bf82ef2b957.zip gcc-5ebfd7ba2f612283656de4e7b8082bf82ef2b957.tar.gz gcc-5ebfd7ba2f612283656de4e7b8082bf82ef2b957.tar.bz2 |
LoongArch: Generate bytepick.[wd] for suitable bit operation pattern
We can use bytepick.[wd] for
a << (8 * x) | b >> (8 * (sizeof(a) - x))
while a and b are uint32_t or uint64_t. This is useful for some cases,
for example:
https://sourceware.org/pipermail/libc-alpha/2023-February/145203.html
gcc/ChangeLog:
* config/loongarch/loongarch.md (bytepick_w_ashift_amount):
New define_int_iterator.
(bytepick_d_ashift_amount): Likewise.
(bytepick_imm): New define_int_attr.
(bytepick_w_lshiftrt_amount): Likewise.
(bytepick_d_lshiftrt_amount): Likewise.
(bytepick_w_<bytepick_imm>): New define_insn template.
(bytepick_w_<bytepick_imm>_extend): Likewise.
(bytepick_d_<bytepick_imm>): Likewise.
(bytepick_w): Remove unused define_insn.
(bytepick_d): Likewise.
(UNSPEC_BYTEPICK_W): Remove unused unspec.
(UNSPEC_BYTEPICK_D): Likewise.
* config/loongarch/predicates.md (const_0_to_3_operand):
Remove unused define_predicate.
(const_0_to_7_operand): Likewise.
gcc/testsuite/ChangeLog:
* g++.target/loongarch/bytepick.C: New test.
Diffstat (limited to 'gcc/gimple-fold.cc')
0 files changed, 0 insertions, 0 deletions