aboutsummaryrefslogtreecommitdiff
path: root/config/bitfields.m4
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2024-09-05 17:53:41 +0800
committerXi Ruoyao <xry111@xry111.site>2025-01-20 21:27:52 +0800
commitf3bedc9a3b8b7dd3911272731a1ea595621e13cd (patch)
treef3a956db1e876ead7471772654de605f61e4accd /config/bitfields.m4
parent67b10ee872197ba53524db4f0ca777899e27b151 (diff)
downloadgcc-f3bedc9a3b8b7dd3911272731a1ea595621e13cd.zip
gcc-f3bedc9a3b8b7dd3911272731a1ea595621e13cd.tar.gz
gcc-f3bedc9a3b8b7dd3911272731a1ea595621e13cd.tar.bz2
LoongArch: Simplify using bstr{ins,pick} instructions for and
For bstrins, we can merge it into and<mode>3 instead of having a separate define_insn. For bstrpick, we can use the constraints to ensure the first source register and the destination register are the same hardware register, instead of emitting a move manually. This will simplify the next commit where we'll reassociate bitwise and left shift for better code generation. gcc/ChangeLog: * config/loongarch/constraints.md (Yy): New define_constriant. * config/loongarch/loongarch.cc (loongarch_print_operand): For "%M", output the index of bits to be used with bstrins/bstrpick. * config/loongarch/predicates.md (ins_zero_bitmask_operand): Exclude low_bitmask_operand as for low_bitmask_operand it's always better to use bstrpick instead of bstrins. (and_operand): New define_predicate. * config/loongarch/loongarch.md (any_or): New define_code_iterator. (bitwise_operand): New define_code_attr. (*<optab:any_or><mode:GPR>3): New define_insn. (*and<mode:GPR>3): New define_insn. (<optab:any_bitwise><mode:X>3): New define_expand. (and<mode>3_extended): Remove, replaced by the 3rd alternative of *and<mode:GPR>3. (bstrins_<mode>_for_mask): Remove, replaced by the 4th alternative of *and<mode:GPR>3. (*<optab:any_bitwise>si3_internal): Remove, already covered by the *<optab:any_or><mode:GPR>3 and *and<mode:GPR>3 templates.
Diffstat (limited to 'config/bitfields.m4')
0 files changed, 0 insertions, 0 deletions