From patchwork Tue Jun 30 20:57:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 489813 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 01C511402A1 for ; Wed, 1 Jul 2015 06:57:48 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=cPRrW44k; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=KOmUvBvelmF+FyFz h0ERvbPREZ52NfHVZscUfB18oiUd+/+tePn/6GhCkvjmjgYYuQ/gkIjMHlvs9FH6 dx3ND3kBmndu6nZA59rWoqbgLjPduux58UdRFOqzj/AcndB1qh3GFvENeSB1DThK w1/PKtc1X1ltgFHgg4GvLe3rseQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=4TRGJJihwXn6ep4u8krdZV wXxt4=; b=cPRrW44kpf1TfjqfE9cD7PR74rV6XJJsmSOsNM8bvBcoTirt7Fhz6e YcMZtErHFA4MqHreiU/W7ElYKUDqOX4ePFuYXmX7EoLRkFUNGKh7e6ziYqxzlcOI E7BKTu82YxviZsDOu6GtEcWXv/LeSI5mr307zFRnGeAzY8wmHVtB8= Received: (qmail 75650 invoked by alias); 30 Jun 2015 20:57:41 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 75641 invoked by uid 89); 30 Jun 2015 20:57:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL, BAYES_50, KAM_ASCII_DIVIDERS, SPF_PASS autolearn=no version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (207.82.80.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 Jun 2015 20:57:39 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-30-la4iEhJFQLWNju6GJ1KSvw-1 Received: from localhost ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 30 Jun 2015 21:57:34 +0100 From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [committed] Use target-insns.def for jump Date: Tue, 30 Jun 2015 21:57:34 +0100 Message-ID: <87mvzgoqwx.fsf@e105548-lin.cambridge.arm.com> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-MC-Unique: la4iEhJFQLWNju6GJ1KSvw-1 Bootstrapped & regression-tested on x86_64-linux-gnu and aarch64-linux-gnu. Also tested via config-list.mk. Committed as preapproved. Thanks, Richard 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. Index: gcc/target-insns.def =================================================================== --- gcc/target-insns.def 2015-06-30 21:56:48.294898184 +0100 +++ gcc/target-insns.def 2015-06-30 21:56:48.278898365 +0100 @@ -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)) Index: gcc/bb-reorder.c =================================================================== --- gcc/bb-reorder.c 2015-06-30 21:56:48.294898184 +0100 +++ gcc/bb-reorder.c 2015-06-30 21:56:48.290898228 +0100 @@ -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_ 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 /* 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; Index: gcc/cfgrtl.c =================================================================== --- gcc/cfgrtl.c 2015-06-30 21:56:48.294898184 +0100 +++ gcc/cfgrtl.c 2015-06-30 21:56:48.290898228 +0100 @@ -1117,7 +1117,7 @@ try_redirect_by_replacing_jump (edge e, 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, 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: gcc/cse.c =================================================================== --- gcc/cse.c 2015-06-30 21:56:48.294898184 +0100 +++ gcc/cse.c 2015-06-30 21:56:48.278898365 +0100 @@ -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: gcc/expmed.c =================================================================== --- gcc/expmed.c 2015-06-30 21:56:48.294898184 +0100 +++ gcc/expmed.c 2015-06-30 21:56:48.278898365 +0100 @@ -4539,11 +4539,11 @@ expand_divmod (int rem_flag, enum tree_c 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_c 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_c 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_c 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_c 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: gcc/expr.c =================================================================== --- gcc/expr.c 2015-06-30 21:56:48.294898184 +0100 +++ gcc/expr.c 2015-06-30 21:56:48.286898272 +0100 @@ -5268,7 +5268,7 @@ store_expr_with_bounds (tree exp, rtx ta 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 @@ #define REDUCE_BIT_FIELD(expr) (reduce_b 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: gcc/haifa-sched.c =================================================================== --- gcc/haifa-sched.c 2015-06-30 21:56:48.294898184 +0100 +++ gcc/haifa-sched.c 2015-06-30 21:56:48.290898228 +0100 @@ -8120,7 +8120,7 @@ init_before_recovery (basic_block *befor 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 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: gcc/ifcvt.c =================================================================== --- gcc/ifcvt.c 2015-06-30 21:56:48.294898184 +0100 +++ gcc/ifcvt.c 2015-06-30 21:56:48.278898365 +0100 @@ -3824,10 +3824,9 @@ find_cond_trap (basic_block test_bb, edg 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: gcc/optabs.c =================================================================== --- gcc/optabs.c 2015-06-30 21:56:48.294898184 +0100 +++ gcc/optabs.c 2015-06-30 21:56:48.290898228 +0100 @@ -1110,7 +1110,7 @@ expand_doubleword_shift (machine_mode op 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 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 unsi /* 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 unsign /* 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: gcc/stmt.c =================================================================== --- gcc/stmt.c 2015-06-30 21:56:48.294898184 +0100 +++ gcc/stmt.c 2015-06-30 21:56:48.278898365 +0100 @@ -172,7 +172,7 @@ jump_target_rtx (tree label) emit_jump (rtx label) { do_pending_stack_adjust (); - emit_jump_insn (gen_jump (label)); + emit_jump_insn (targetm.gen_jump (label)); emit_barrier (); }