diff options
author | Richard Henderson <rth@redhat.com> | 2012-08-09 19:12:56 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2012-08-09 19:12:56 -0700 |
commit | 4e1ffb63c7db2b9e0a623528405cca46ea34fd28 (patch) | |
tree | fe94d0e62ecab05dc8dbd941eb245f83dc850bcc /gcc | |
parent | 1c6b1021266dc25184a1bcb381a255debe57dd68 (diff) | |
download | gcc-4e1ffb63c7db2b9e0a623528405cca46ea34fd28.zip gcc-4e1ffb63c7db2b9e0a623528405cca46ea34fd28.tar.gz gcc-4e1ffb63c7db2b9e0a623528405cca46ea34fd28.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 16 |
2 files changed, 15 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e978842..9e4e872 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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> * config/rl78/rl78.c (rl78_alloc_physical_registers): Check for diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 5297ff3..0ae77a2 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -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) { 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 csloop = NULL, csend = NULL; @@ -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))); else { + rtx tmp; + /* Jump to end if we're done (likely?). */ s390_emit_jump (csend, cc); - /* Check for changes outside mode, and loop internal if so. */ - resv = expand_simple_binop (SImode, AND, res, ac.modemaski, - NULL_RTX, 1, OPTAB_DIRECT); - cc = s390_emit_compare (NE, resv, val); - emit_move_insn (val, resv); + /* Check for changes outside mode, and loop internal if so. + Arrange the moves so that the compare is adjacent to the + branch so that we can generate CRJ. */ + tmp = copy_to_reg (val); + 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); /* Failed. */ |