aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@orcam.me.uk>2025-03-30 15:24:50 +0100
committerMaciej W. Rozycki <macro@orcam.me.uk>2025-03-30 15:24:50 +0100
commit47a48c7f42b5ad908f087bf612615632319cf445 (patch)
treeed011441c41c37fb21ecb6baa7f1c3901459df62
parente0886d8ad4c51919c349d0b31f2bec3acbc79e14 (diff)
downloadgcc-47a48c7f42b5ad908f087bf612615632319cf445.zip
gcc-47a48c7f42b5ad908f087bf612615632319cf445.tar.gz
gcc-47a48c7f42b5ad908f087bf612615632319cf445.tar.bz2
Alpha: Export `emit_unlikely_jump' for a subsequent change to use
Rename `emit_unlikely_jump' function to `alpha_emit_unlikely_jump', so as to avoid namespace pollution, updating callers accordingly and export it for use in the machine description. Make it return the insn emitted. gcc/ * config/alpha/alpha-protos.h (alpha_emit_unlikely_jump): New prototype. * config/alpha/alpha.cc (emit_unlikely_jump): Rename to... (alpha_emit_unlikely_jump): ... this. Return the insn emitted. (alpha_split_atomic_op, alpha_split_compare_and_swap) (alpha_split_compare_and_swap_12, alpha_split_atomic_exchange) (alpha_split_atomic_exchange_12): Update call sites accordingly.
-rw-r--r--gcc/config/alpha/alpha-protos.h1
-rw-r--r--gcc/config/alpha/alpha.cc19
2 files changed, 11 insertions, 9 deletions
diff --git a/gcc/config/alpha/alpha-protos.h b/gcc/config/alpha/alpha-protos.h
index 1bc5520..6d28fa8 100644
--- a/gcc/config/alpha/alpha-protos.h
+++ b/gcc/config/alpha/alpha-protos.h
@@ -59,6 +59,7 @@ extern rtx alpha_expand_zap_mask (HOST_WIDE_INT);
extern void alpha_expand_builtin_vector_binop (rtx (*)(rtx, rtx, rtx),
machine_mode,
rtx, rtx, rtx);
+extern rtx alpha_emit_unlikely_jump (rtx, rtx);
extern void alpha_expand_builtin_establish_vms_condition_handler (rtx, rtx);
extern void alpha_expand_builtin_revert_vms_condition_handler (rtx);
diff --git a/gcc/config/alpha/alpha.cc b/gcc/config/alpha/alpha.cc
index 6965ece..d3e8a3a 100644
--- a/gcc/config/alpha/alpha.cc
+++ b/gcc/config/alpha/alpha.cc
@@ -4421,12 +4421,13 @@ alpha_expand_builtin_vector_binop (rtx (*gen) (rtx, rtx, rtx),
/* A subroutine of the atomic operation splitters. Jump to LABEL if
COND is true. Mark the jump as unlikely to be taken. */
-static void
-emit_unlikely_jump (rtx cond, rtx label)
+rtx
+alpha_emit_unlikely_jump (rtx cond, rtx label)
{
rtx x = gen_rtx_IF_THEN_ELSE (VOIDmode, cond, label, pc_rtx);
rtx_insn *insn = emit_jump_insn (gen_rtx_SET (pc_rtx, x));
add_reg_br_prob_note (insn, profile_probability::very_unlikely ());
+ return insn;
}
/* Subroutines of the atomic operation splitters. Emit barriers
@@ -4518,7 +4519,7 @@ alpha_split_atomic_op (enum rtx_code code, rtx mem, rtx val, rtx before,
emit_insn (gen_store_conditional (mode, cond, mem, scratch));
x = gen_rtx_EQ (DImode, cond, const0_rtx);
- emit_unlikely_jump (x, label);
+ alpha_emit_unlikely_jump (x, label);
alpha_post_atomic_barrier (model);
}
@@ -4568,7 +4569,7 @@ alpha_split_compare_and_swap (rtx operands[])
emit_insn (gen_rtx_SET (cond, x));
x = gen_rtx_EQ (DImode, cond, const0_rtx);
}
- emit_unlikely_jump (x, label2);
+ alpha_emit_unlikely_jump (x, label2);
emit_move_insn (cond, newval);
emit_insn (gen_store_conditional
@@ -4577,7 +4578,7 @@ alpha_split_compare_and_swap (rtx operands[])
if (!is_weak)
{
x = gen_rtx_EQ (DImode, cond, const0_rtx);
- emit_unlikely_jump (x, label1);
+ alpha_emit_unlikely_jump (x, label1);
}
if (!is_mm_relaxed (mod_f))
@@ -4680,7 +4681,7 @@ alpha_split_compare_and_swap_12 (rtx operands[])
emit_insn (gen_rtx_SET (cond, x));
x = gen_rtx_EQ (DImode, cond, const0_rtx);
}
- emit_unlikely_jump (x, label2);
+ alpha_emit_unlikely_jump (x, label2);
emit_insn (gen_mskxl (cond, scratch, mask, addr));
@@ -4692,7 +4693,7 @@ alpha_split_compare_and_swap_12 (rtx operands[])
if (!is_weak)
{
x = gen_rtx_EQ (DImode, cond, const0_rtx);
- emit_unlikely_jump (x, label1);
+ alpha_emit_unlikely_jump (x, label1);
}
if (!is_mm_relaxed (mod_f))
@@ -4732,7 +4733,7 @@ alpha_split_atomic_exchange (rtx operands[])
emit_insn (gen_store_conditional (mode, cond, mem, scratch));
x = gen_rtx_EQ (DImode, cond, const0_rtx);
- emit_unlikely_jump (x, label);
+ alpha_emit_unlikely_jump (x, label);
alpha_post_atomic_barrier (model);
}
@@ -4806,7 +4807,7 @@ alpha_split_atomic_exchange_12 (rtx operands[])
emit_insn (gen_store_conditional (DImode, scratch, mem, scratch));
x = gen_rtx_EQ (DImode, scratch, const0_rtx);
- emit_unlikely_jump (x, label);
+ alpha_emit_unlikely_jump (x, label);
alpha_post_atomic_barrier (model);
}