From: Richard Sandiford Date: Tue, 30 Jun 2015 20:57:21 +0000 (+0000) Subject: target-insns.def (jump): New targetm instruction pattern. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec4a505ff54c848fd4d71c7d121482c65e7b5ce7;p=gcc.git target-insns.def (jump): New targetm instruction pattern. gcc/ * target-insns.def (jump): New targetm instruction pattern. * bb-reorder.c (get_uncond_jump_length): Use targetm.gen_jump instead of gen_jump. (fix_up_crossing_landing_pad): Likewise. (add_labels_and_missing_jumps): Likewise. (fix_crossing_conditional_branches): Likewise. * cfgrtl.c (try_redirect_by_replacing_jump): Likewise. (force_nonfallthru_and_redirect): Likewise. * cse.c (cse_insn): Likewise. * expmed.c (expand_divmod): Likewise. * expr.c (store_expr_with_bounds, expand_expr_real_2): Likewise. * haifa-sched.c (init_before_recovery): Likewise. (sched_create_recovery_edges): Likewise. * ifcvt.c (find_cond_trap): Likewise. * optabs.c (expand_doubleword_shift, expand_doubleword_clz): Likewise. (expand_float, expand_fix): Likewise. * stmt.c (emit_jump): Likewise. From-SVN: r225211 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 88614cfdab6..91e7e4a51af 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,23 @@ +2015-06-30 Richard Sandiford + + * target-insns.def (jump): New targetm instruction pattern. + * bb-reorder.c (get_uncond_jump_length): Use targetm.gen_jump + instead of gen_jump. + (fix_up_crossing_landing_pad): Likewise. + (add_labels_and_missing_jumps): Likewise. + (fix_crossing_conditional_branches): Likewise. + * cfgrtl.c (try_redirect_by_replacing_jump): Likewise. + (force_nonfallthru_and_redirect): Likewise. + * cse.c (cse_insn): Likewise. + * expmed.c (expand_divmod): Likewise. + * expr.c (store_expr_with_bounds, expand_expr_real_2): Likewise. + * haifa-sched.c (init_before_recovery): Likewise. + (sched_create_recovery_edges): Likewise. + * ifcvt.c (find_cond_trap): Likewise. + * optabs.c (expand_doubleword_shift, expand_doubleword_clz): Likewise. + (expand_float, expand_fix): Likewise. + * stmt.c (emit_jump): Likewise. + 2015-06-30 Richard Sandiford * defaults.h (HAVE_load_multiple, gen_load_multiple) diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index dd98527b572..84c91524755 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -1385,7 +1385,7 @@ get_uncond_jump_length (void) start_sequence (); rtx_code_label *label = emit_label (gen_label_rtx ()); - rtx_insn *jump = emit_jump_insn (gen_jump (label)); + rtx_insn *jump = emit_jump_insn (targetm.gen_jump (label)); length = get_attr_min_length (jump); end_sequence (); @@ -1420,7 +1420,7 @@ fix_up_crossing_landing_pad (eh_landing_pad old_lp, basic_block old_bb) post_bb = BLOCK_FOR_INSN (old_lp->landing_pad); post_bb = single_succ (post_bb); rtx_code_label *post_label = block_label (post_bb); - jump = emit_jump_insn (gen_jump (post_label)); + jump = emit_jump_insn (targetm.gen_jump (post_label)); JUMP_LABEL (jump) = post_label; /* Create new basic block to be dest for lp. */ @@ -1766,7 +1766,7 @@ add_labels_and_missing_jumps (vec crossing_edges) /* Make sure there's only one successor. */ gcc_assert (single_succ_p (src)); - new_jump = emit_jump_insn_after (gen_jump (label), BB_END (src)); + new_jump = emit_jump_insn_after (targetm.gen_jump (label), BB_END (src)); BB_END (src) = new_jump; JUMP_LABEL (new_jump) = label; LABEL_NUSES (label) += 1; @@ -2082,7 +2082,7 @@ fix_crossing_conditional_branches (void) gcc_assert (GET_CODE (old_label) == LABEL_REF); old_jump_target = old_jump_insn->jump_target (); new_jump = as_a - (emit_jump_insn (gen_jump (old_jump_target))); + (emit_jump_insn (targetm.gen_jump (old_jump_target))); new_jump->set_jump_target (old_jump_target); last_bb = EXIT_BLOCK_PTR_FOR_FN (cfun)->prev_bb; diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 5ac3a20d0b5..4a711b3aa4f 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -1117,7 +1117,7 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) rtx label; rtx_jump_table_data *table; - emit_jump_insn_after_noloc (gen_jump (target_label), insn); + emit_jump_insn_after_noloc (targetm.gen_jump (target_label), insn); JUMP_LABEL (BB_END (src)) = target_label; LABEL_NUSES (target_label)++; if (dump_file) @@ -1708,7 +1708,8 @@ force_nonfallthru_and_redirect (edge e, basic_block target, rtx jump_label) else { rtx_code_label *label = block_label (target); - emit_jump_insn_after_setloc (gen_jump (label), BB_END (jump_block), loc); + emit_jump_insn_after_setloc (targetm.gen_jump (label), + BB_END (jump_block), loc); JUMP_LABEL (BB_END (jump_block)) = label; LABEL_NUSES (label)++; } diff --git a/gcc/cse.c b/gcc/cse.c index 100c9c83e76..e01240cd2e6 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -5483,7 +5483,8 @@ cse_insn (rtx_insn *insn) rtx_jump_insn *new_rtx; rtx note; - new_rtx = emit_jump_insn_before (gen_jump (XEXP (src, 0)), insn); + rtx_insn *seq = targetm.gen_jump (XEXP (src, 0)); + new_rtx = emit_jump_insn_before (seq, insn); JUMP_LABEL (new_rtx) = XEXP (src, 0); LABEL_NUSES (XEXP (src, 0))++; diff --git a/gcc/expmed.c b/gcc/expmed.c index 3f7490899cb..69c48a6b8b4 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -4539,11 +4539,11 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode, quotient, 0, OPTAB_LIB_WIDEN); if (tem != quotient) emit_move_insn (quotient, tem); - emit_jump_insn (gen_jump (label5)); + emit_jump_insn (targetm.gen_jump (label5)); emit_barrier (); emit_label (label1); expand_inc (adjusted_op0, const1_rtx); - emit_jump_insn (gen_jump (label4)); + emit_jump_insn (targetm.gen_jump (label4)); emit_barrier (); emit_label (label2); do_cmp_and_jump (adjusted_op0, const0_rtx, GT, compute_mode, label3); @@ -4551,7 +4551,7 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode, quotient, 0, OPTAB_LIB_WIDEN); if (tem != quotient) emit_move_insn (quotient, tem); - emit_jump_insn (gen_jump (label5)); + emit_jump_insn (targetm.gen_jump (label5)); emit_barrier (); emit_label (label3); expand_dec (adjusted_op0, const1_rtx); @@ -4645,7 +4645,7 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode, do_cmp_and_jump (adjusted_op0, const0_rtx, NE, compute_mode, label1); emit_move_insn (quotient, const0_rtx); - emit_jump_insn (gen_jump (label2)); + emit_jump_insn (targetm.gen_jump (label2)); emit_barrier (); emit_label (label1); expand_dec (adjusted_op0, const1_rtx); @@ -4753,11 +4753,11 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode, quotient, 0, OPTAB_LIB_WIDEN); if (tem != quotient) emit_move_insn (quotient, tem); - emit_jump_insn (gen_jump (label5)); + emit_jump_insn (targetm.gen_jump (label5)); emit_barrier (); emit_label (label1); expand_dec (adjusted_op0, const1_rtx); - emit_jump_insn (gen_jump (label4)); + emit_jump_insn (targetm.gen_jump (label4)); emit_barrier (); emit_label (label2); do_cmp_and_jump (adjusted_op0, const0_rtx, LT, @@ -4766,7 +4766,7 @@ expand_divmod (int rem_flag, enum tree_code code, machine_mode mode, quotient, 0, OPTAB_LIB_WIDEN); if (tem != quotient) emit_move_insn (quotient, tem); - emit_jump_insn (gen_jump (label5)); + emit_jump_insn (targetm.gen_jump (label5)); emit_barrier (); emit_label (label3); expand_inc (adjusted_op0, const1_rtx); diff --git a/gcc/expr.c b/gcc/expr.c index 6690574009f..5c0df44248d 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -5268,7 +5268,7 @@ store_expr_with_bounds (tree exp, rtx target, int call_param_p, jumpifnot (TREE_OPERAND (exp, 0), lab1, -1); store_expr_with_bounds (TREE_OPERAND (exp, 1), target, call_param_p, nontemporal, btarget); - emit_jump_insn (gen_jump (lab2)); + emit_jump_insn (targetm.gen_jump (lab2)); emit_barrier (); emit_label (lab1); store_expr_with_bounds (TREE_OPERAND (exp, 2), target, call_param_p, @@ -9200,7 +9200,7 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode, modifier == EXPAND_STACK_PARM, false); - emit_jump_insn (gen_jump (lab1)); + emit_jump_insn (targetm.gen_jump (lab1)); emit_barrier (); emit_label (lab0); store_expr (treeop2, temp, diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index fd6e3e929e6..e685cc8a1af 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -8120,7 +8120,7 @@ init_before_recovery (basic_block *before_recovery_ptr) EDGE_FALLTHRU); rtx_code_label *label = block_label (empty); - rtx_jump_insn *x = emit_jump_insn_after (gen_jump (label), + rtx_jump_insn *x = emit_jump_insn_after (targetm.gen_jump (label), BB_END (single)); JUMP_LABEL (x) = label; LABEL_NUSES (label)++; @@ -8198,7 +8198,8 @@ sched_create_recovery_edges (basic_block first_bb, basic_block rec, make_edge (first_bb, rec, edge_flags); rtx_code_label *label = block_label (second_bb); - rtx_jump_insn *jump = emit_jump_insn_after (gen_jump (label), BB_END (rec)); + rtx_jump_insn *jump = emit_jump_insn_after (targetm.gen_jump (label), + BB_END (rec)); JUMP_LABEL (jump) = label; LABEL_NUSES (label)++; diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 7d4ad934003..6e20557d52b 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -3824,10 +3824,9 @@ find_cond_trap (basic_block test_bb, edge then_edge, edge else_edge) single_succ_edge (test_bb)->flags |= EDGE_FALLTHRU; else if (trap_bb == then_bb) { - rtx lab; - - lab = JUMP_LABEL (jump); - rtx_jump_insn *newjump = emit_jump_insn_after (gen_jump (lab), jump); + rtx lab = JUMP_LABEL (jump); + rtx_insn *seq = targetm.gen_jump (lab); + rtx_jump_insn *newjump = emit_jump_insn_after (seq, jump); LABEL_NUSES (lab) += 1; JUMP_LABEL (newjump) = lab; emit_barrier_after (newjump); diff --git a/gcc/optabs.c b/gcc/optabs.c index 163d57dae3d..5c761457fe9 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -1110,7 +1110,7 @@ expand_doubleword_shift (machine_mode op1_mode, optab binoptab, unsignedp, methods)) return false; - emit_jump_insn (gen_jump (done_label)); + emit_jump_insn (targetm.gen_jump (done_label)); emit_barrier (); emit_label (subword_label); @@ -2589,7 +2589,7 @@ expand_doubleword_clz (machine_mode mode, rtx op0, rtx target) if (temp != result) convert_move (result, temp, true); - emit_jump_insn (gen_jump (after_label)); + emit_jump_insn (targetm.gen_jump (after_label)); emit_barrier (); /* Else clz of the full value is clz of the low word plus the number @@ -5088,7 +5088,7 @@ expand_float (rtx to, rtx from, int unsignedp) /* The sign bit is not set. Convert as signed. */ expand_float (target, from, 0); - emit_jump_insn (gen_jump (label)); + emit_jump_insn (targetm.gen_jump (label)); emit_barrier (); /* The sign bit is set. @@ -5293,7 +5293,7 @@ expand_fix (rtx to, rtx from, int unsignedp) /* If not, do the signed "fix" and branch around fixup code. */ expand_fix (to, from, 0); - emit_jump_insn (gen_jump (lab2)); + emit_jump_insn (targetm.gen_jump (lab2)); emit_barrier (); /* Otherwise, subtract 2**(N-1), convert to signed number, diff --git a/gcc/stmt.c b/gcc/stmt.c index 7c40e124334..426e3056d08 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -172,7 +172,7 @@ void emit_jump (rtx label) { do_pending_stack_adjust (); - emit_jump_insn (gen_jump (label)); + emit_jump_insn (targetm.gen_jump (label)); emit_barrier (); } diff --git a/gcc/target-insns.def b/gcc/target-insns.def index 47451f065f5..0d8f5014928 100644 --- a/gcc/target-insns.def +++ b/gcc/target-insns.def @@ -32,6 +32,7 @@ Instructions should be documented in md.texi rather than here. */ DEF_TARGET_INSN (canonicalize_funcptr_for_compare, (rtx x0, rtx x1)) DEF_TARGET_INSN (epilogue, (void)) +DEF_TARGET_INSN (jump, (rtx x0)) DEF_TARGET_INSN (load_multiple, (rtx x0, rtx x1, rtx x2)) DEF_TARGET_INSN (mem_signal_fence, (rtx x0)) DEF_TARGET_INSN (mem_thread_fence, (rtx x0))