target-insns.def (jump): New targetm instruction pattern.
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 30 Jun 2015 20:57:21 +0000 (20:57 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 30 Jun 2015 20:57:21 +0000 (20:57 +0000)
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

gcc/ChangeLog
gcc/bb-reorder.c
gcc/cfgrtl.c
gcc/cse.c
gcc/expmed.c
gcc/expr.c
gcc/haifa-sched.c
gcc/ifcvt.c
gcc/optabs.c
gcc/stmt.c
gcc/target-insns.def

index 88614cfdab66803b1f19ded0c0c6af83dfc6c5cf..91e7e4a51af47ecf769afa899e379b666ca1115f 100644 (file)
@@ -1,3 +1,23 @@
+2015-06-30  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * 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  <richard.sandiford@arm.com>
 
        * defaults.h (HAVE_load_multiple, gen_load_multiple)
index dd98527b572b38e6cd92f5a5c54dfe3478a1a583..84c915247553c058c9ae19fdaa0a519aca24c3e9 100644 (file)
@@ -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<edge> 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 <rtx_jump_insn *>
-                               (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;
index 5ac3a20d0b5df9e91732f919b1d1d68d542c75a9..4a711b3aa4f715a20356264aeef379c1cedeabe6 100644 (file)
@@ -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)++;
     }
index 100c9c83e769faf920d15c98bb614c35b80e8b5d..e01240cd2e6b8ba3e2119195cfb838f4e8006585 100644 (file)
--- 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))++;
 
index 3f7490899cbcdf940661ed95e75aa72029c3b0bc..69c48a6b8b4a4a8b499594452aca81a0c12b130a 100644 (file)
@@ -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);
index 6690574009f1a28a2f3a651e2b91bbea69a1c0d5..5c0df44248db9032d7371a5e7750b657c60bc89c 100644 (file)
@@ -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,
index fd6e3e929e65a6c0a5bafa369f1362abe3758950..e685cc8a1af86fba5f81ed523ca7dd928fb89bfb 100644 (file)
@@ -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)++;
 
index 7d4ad934003165a4d8ad672aa379563ba65b9f33..6e20557d52b5821317d25a3fdaa933af2e961925 100644 (file)
@@ -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);
index 163d57dae3dba6cc398b7f5fdc139fae2a828f5d..5c761457fe934dcd31a76b6f873ffa39338377b5 100644 (file)
@@ -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,
index 7c40e124334de5965b4fbfcf1d1a403f45fa5f28..426e3056d083f44b1284b8671251819e02b9105d 100644 (file)
@@ -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 ();
 }
 \f
index 47451f065f54225012298c08eefd3acf09455a24..0d8f5014928e3ddbfdff126fe27c2c71e30a61e1 100644 (file)
@@ -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))