diff options
author | Jeff Law <jeffreyalaw@gmail.com> | 2021-07-05 17:23:43 -0400 |
---|---|---|
committer | Jeff Law <jeffreyalaw@gmail.com> | 2021-07-05 17:25:39 -0400 |
commit | 1562c7987be115311a75b1074c3768a1b006adb6 (patch) | |
tree | 38c22c67c06f6c7599142b94d866c2af7dba732e | |
parent | 7d6979197274a662da7bdc564314afe8415865c1 (diff) | |
download | gcc-1562c7987be115311a75b1074c3768a1b006adb6.zip gcc-1562c7987be115311a75b1074c3768a1b006adb6.tar.gz gcc-1562c7987be115311a75b1074c3768a1b006adb6.tar.bz2 |
Remove redundant compare in shift loop on H8
gcc/ChangeLog
* config/h8300/shiftrotate.md (shift-by-variable patterns): Update to
generate condition code aware RTL directly.
-rw-r--r-- | gcc/config/h8300/shiftrotate.md | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/config/h8300/shiftrotate.md b/gcc/config/h8300/shiftrotate.md index 0476324..485303c 100644 --- a/gcc/config/h8300/shiftrotate.md +++ b/gcc/config/h8300/shiftrotate.md @@ -385,10 +385,15 @@ (parallel [(set (match_dup 0) (match_op_dup 2 [(match_dup 0) (const_int 1)])) - (clobber (scratch:QI))]) - (set (match_dup 1) (plus:QI (match_dup 1) (const_int -1))) + (clobber (reg:CC CC_REG))]) + (parallel + [(set (reg:CCZN CC_REG) + (compare:CCZN + (plus:QI (match_dup 1) (const_int -1)) + (const_int 0))) + (set (match_dup 1) (plus:QI (match_dup 1) (const_int -1)))]) (set (pc) - (if_then_else (ne (match_dup 1) (const_int 0)) + (if_then_else (ne (reg:CCZN CC_REG) (const_int 0)) (label_ref (match_dup 4)) (pc))) (match_dup 5)] @@ -416,10 +421,15 @@ (parallel [(set (match_dup 0) (match_op_dup 2 [(match_dup 0) (const_int 1)])) - (clobber (scratch:QI))]) - (set (match_dup 3) (plus:QI (match_dup 3) (const_int -1))) + (clobber (reg:CC CC_REG))]) + (parallel + [(set (reg:CCZN CC_REG) + (compare:CCZN + (plus:QI (match_dup 3) (const_int -1)) + (const_int 0))) + (set (match_dup 3) (plus:QI (match_dup 3) (const_int -1)))]) (set (pc) - (if_then_else (ne (match_dup 3) (const_int 0)) + (if_then_else (ne (reg:CCZN CC_REG) (const_int 0)) (label_ref (match_dup 4)) (pc))) (match_dup 5)] |