Hi Richard, +++ b/gcc/config/aarch64/aarch64.md @@ -876,10 +876,16 @@ (clobber (reg:CC CC_REGNUM))] "TARGET_CMPBR && aarch64_cb_rhs (<INT_CMP:CODE>, operands[1])" { - return (get_attr_far_branch (insn) == FAR_BRANCH_NO) - ? "cb<INT_CMP:cmp_op>\\t%<w>0, %<w>1, %l2" - : aarch64_gen_far_branch (operands, 2, - "cb<INT_CMP:inv_cmp_op>\\t%<w>0, %<w>1, "); + if (get_attr_length (insn) == 4) + return "cb<INT_CMP:cmp_op>\t%<w>0, %<w>1, %l2"; + if (get_attr_far_branch (insn) == FAR_BRANCH_YES) + return aarch64_gen_far_branch (operands, 2, + "cb<INT_CMP:inv_cmp_op>\t%<w>0, %<w>1, ");
If you force everything as far branches, I still get assembler errors of the form: Error: immediate value out of range -1 to 62 at operand 2 -- `cbls w21,63,.L1255' The reason is that not all immediate forms support reversing of the condition, so using a far branch using a cb<cc> instruction is not possible in all cases. We need to use a 12-byte far branch sequence here. I don't believe this should block committing of this series, but it shows we need to generalize these patterns even further... Cheers, Wilco