]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Further improvements to H8 variable shift patterns
authorJeff Law <jeffreyalaw@gmail.com>
Thu, 8 Jul 2021 21:09:36 +0000 (17:09 -0400)
committerJeff Law <jeffreyalaw@gmail.com>
Thu, 8 Jul 2021 21:09:36 +0000 (17:09 -0400)
gcc/

* config/h8300/shiftrotate.md (variable shifts): Expose condition
code handling for the test before the loop.

gcc/config/h8300/shiftrotate.md

index 485303cb906daf721a54ea0ce414723393838be2..d3aa6bea064d54f6fa9b4c2a017fb2f325a0909e 100644 (file)
    (clobber (reg:CC CC_REG))]
   "epilogue_completed
    && find_regno_note (insn, REG_DEAD, REGNO (operands[1]))"
-  [(set (pc)
-        (if_then_else (le (match_dup 1) (const_int 0))
+  [(set (reg:CCZN CC_REG)
+        (compare:CCZN (match_dup 1) (const_int 0)))
+   (set (pc)
+        (if_then_else (le (reg:CCZN CC_REG)  (const_int 0))
                      (label_ref (match_dup 5))
                      (pc)))
    (match_dup 4)
    (clobber (reg:CC CC_REG))]
   "epilogue_completed
    && !find_regno_note (insn, REG_DEAD, REGNO (operands[1]))"
-  [(set (match_dup 3)
-       (match_dup 1))
+  [(parallel
+     [(set (reg:CCZN CC_REG)
+          (compare:CCZN (match_dup 1) (const_int 0)))
+      (set (match_dup 3) (match_dup 1))])
    (set (pc)
-        (if_then_else (le (match_dup 3) (const_int 0))
+        (if_then_else (le (reg:CCZN CC_REG) (const_int 0))
                      (label_ref (match_dup 5))
                      (pc)))
    (match_dup 4)