diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-20 02:38:56 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-20 02:38:56 +0000 |
commit | 032caa7bca273e2232eebbb6be45bd9f871ec61b (patch) | |
tree | 752fb067b665acf9c4d281f624aeb5714431f180 /gcc/config/alpha/sync.md | |
parent | 9e7b62cab8e5262fbd50f92a9d7a9d9a86100b02 (diff) | |
download | gcc-032caa7bca273e2232eebbb6be45bd9f871ec61b.tar.gz |
* config/alpha/alpha.c (emit_unlikely_jump, emit_load_locked,
emit_store_conditional): Split out from ...
(alpha_split_atomic_op): ... here.
(alpha_split_compare_and_swap): New; extract from .md file.
(alpha_split_lock_test_and_set): Likewise.
* config/alpha/alpha-protos.h: Update.
* config/alpha/sync.md (sync_compare_and_swap<I48MODE>): Move
split code into alpha.c.
(sync_lock_test_and_set<I48MODE>): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100005 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/alpha/sync.md')
-rw-r--r-- | gcc/config/alpha/sync.md | 73 |
1 files changed, 4 insertions, 69 deletions
diff --git a/gcc/config/alpha/sync.md b/gcc/config/alpha/sync.md index 8f67a4e255d..2cba9e372f2 100644 --- a/gcc/config/alpha/sync.md +++ b/gcc/config/alpha/sync.md @@ -221,49 +221,8 @@ "reload_completed" [(const_int 0)] { - rtx retval, mem, oldval, newval, scratch; - rtx cond, label1, label2, x; - rtx very_unlikely = GEN_INT (REG_BR_PROB_BASE / 100 - 1); - - retval = operands[0]; - mem = operands[1]; - oldval = operands[2]; - newval = operands[3]; - scratch = operands[4]; - cond = gen_lowpart (DImode, scratch); - - emit_insn (gen_memory_barrier ()); - - label1 = gen_rtx_LABEL_REF (DImode, gen_label_rtx ()); - label2 = gen_rtx_LABEL_REF (DImode, gen_label_rtx ()); - emit_label (XEXP (label1, 0)); - - emit_insn (gen_load_locked_<mode> (retval, mem)); - - x = gen_lowpart (DImode, retval); - if (oldval == const0_rtx) - x = gen_rtx_NE (DImode, x, const0_rtx); - else - { - x = gen_rtx_EQ (DImode, x, oldval); - emit_insn (gen_rtx_SET (VOIDmode, cond, x)); - x = gen_rtx_EQ (DImode, cond, const0_rtx); - } - x = gen_rtx_IF_THEN_ELSE (VOIDmode, x, label2, pc_rtx); - x = emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, x)); - REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_BR_PROB, very_unlikely, NULL_RTX); - - emit_move_insn (scratch, newval); - - emit_insn (gen_store_conditional_<mode> (cond, mem, scratch)); - - x = gen_rtx_EQ (DImode, cond, const0_rtx); - x = gen_rtx_IF_THEN_ELSE (VOIDmode, x, label1, pc_rtx); - x = emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, x)); - REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_BR_PROB, very_unlikely, NULL_RTX); - - emit_insn (gen_memory_barrier ()); - emit_label (XEXP (label2, 0)); + alpha_split_compare_and_swap (operands[0], operands[1], operands[2], + operands[3], operands[4]); DONE; } [(set_attr "type" "multi")]) @@ -281,32 +240,8 @@ "reload_completed" [(const_int 0)] { - rtx retval, mem, val, scratch; - rtx cond, label1, x; - rtx very_unlikely = GEN_INT (REG_BR_PROB_BASE / 100 - 1); - - retval = operands[0]; - mem = operands[1]; - val = operands[2]; - scratch = operands[3]; - cond = gen_lowpart (DImode, scratch); - - emit_insn (gen_memory_barrier ()); - - label1 = gen_rtx_LABEL_REF (DImode, gen_label_rtx ()); - emit_label (XEXP (label1, 0)); - - emit_insn (gen_load_locked_<mode> (retval, mem)); - - emit_move_insn (scratch, val); - - emit_insn (gen_store_conditional_<mode> (cond, mem, scratch)); - - x = gen_rtx_EQ (DImode, cond, const0_rtx); - x = gen_rtx_IF_THEN_ELSE (VOIDmode, x, label1, pc_rtx); - x = emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, x)); - REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_BR_PROB, very_unlikely, NULL_RTX); - + alpha_split_lock_test_and_set (operands[0], operands[1], + operands[2], operands[3]); DONE; } [(set_attr "type" "multi")]) |