Commit 4e1ffb63 by Richard Henderson Committed by Richard Henderson

s390: Rearrange temporary moves for use of CRJ

	* config/s390/s390.c (s390_expand_cs_hqi): Copy val to a temp before
	performing the compare for the restart loop.

From-SVN: r190280
parent 1c6b1021
2012-08-09 Richard Henderson <rth@redhat.com>
* config/s390/s390.c (s390_expand_cs_hqi): Copy val to a temp before
performing the compare for the restart loop.
2012-08-09 DJ Delorie <dj@redhat.com> 2012-08-09 DJ Delorie <dj@redhat.com>
* config/rl78/rl78.c (rl78_alloc_physical_registers): Check for * config/rl78/rl78.c (rl78_alloc_physical_registers): Check for
......
...@@ -4821,7 +4821,7 @@ s390_expand_cs_hqi (enum machine_mode mode, rtx btarget, rtx vtarget, rtx mem, ...@@ -4821,7 +4821,7 @@ s390_expand_cs_hqi (enum machine_mode mode, rtx btarget, rtx vtarget, rtx mem,
rtx cmp, rtx new_rtx, bool is_weak) rtx cmp, rtx new_rtx, bool is_weak)
{ {
struct alignment_context ac; struct alignment_context ac;
rtx cmpv, newv, val, resv, cc, seq0, seq1, seq2, seq3; rtx cmpv, newv, val, cc, seq0, seq1, seq2, seq3;
rtx res = gen_reg_rtx (SImode); rtx res = gen_reg_rtx (SImode);
rtx csloop = NULL, csend = NULL; rtx csloop = NULL, csend = NULL;
...@@ -4868,14 +4868,18 @@ s390_expand_cs_hqi (enum machine_mode mode, rtx btarget, rtx vtarget, rtx mem, ...@@ -4868,14 +4868,18 @@ s390_expand_cs_hqi (enum machine_mode mode, rtx btarget, rtx vtarget, rtx mem,
emit_insn (gen_cstorecc4 (btarget, cc, XEXP (cc, 0), XEXP (cc, 1))); emit_insn (gen_cstorecc4 (btarget, cc, XEXP (cc, 0), XEXP (cc, 1)));
else else
{ {
rtx tmp;
/* Jump to end if we're done (likely?). */ /* Jump to end if we're done (likely?). */
s390_emit_jump (csend, cc); s390_emit_jump (csend, cc);
/* Check for changes outside mode, and loop internal if so. */ /* Check for changes outside mode, and loop internal if so.
resv = expand_simple_binop (SImode, AND, res, ac.modemaski, Arrange the moves so that the compare is adjacent to the
NULL_RTX, 1, OPTAB_DIRECT); branch so that we can generate CRJ. */
cc = s390_emit_compare (NE, resv, val); tmp = copy_to_reg (val);
emit_move_insn (val, resv); force_expand_binop (SImode, and_optab, res, ac.modemaski, val,
1, OPTAB_DIRECT);
cc = s390_emit_compare (NE, val, tmp);
s390_emit_jump (csloop, cc); s390_emit_jump (csloop, cc);
/* Failed. */ /* Failed. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment