re PR target/64180 (PowerPC carry bit improvements)
authorSegher Boessenkool <segher@kernel.crashing.org>
Wed, 10 Dec 2014 18:31:15 +0000 (19:31 +0100)
committerSegher Boessenkool <segher@gcc.gnu.org>
Wed, 10 Dec 2014 18:31:15 +0000 (19:31 +0100)
PR target/64180
* config/rs6000/rs6000.md (*ctr<mode>_internal1, *ctr<mode>_internal2,
*ctr<mode>_internal5, *ctr<mode>_internal6): Change "r" alternatives
to "b".  Increase length.
(splitters for these): Split to cmp+addi instead of addic.

From-SVN: r218591

gcc/ChangeLog
gcc/config/rs6000/rs6000.md

index ad0ff1ec30c32bf77578649b6893ff23cd26db6f..63479fb6adf0826ddd4c3dbf10efea93cea7a56d 100644 (file)
@@ -1,3 +1,11 @@
+2014-12-10  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       PR target/64180
+       * config/rs6000/rs6000.md (*ctr<mode>_internal1, *ctr<mode>_internal2,
+       *ctr<mode>_internal5, *ctr<mode>_internal6): Change "r" alternatives
+       to "b".  Increase length.
+       (splitters for these): Split to cmp+addi instead of addic.
+
 2014-12-10  Segher Boessenkool  <segher@kernel.crashing.org>
 
        PR target/64180
index 989a296eb335c6f28f317caaee67c2bdfd327438..c11c31a2f2da42482cf50b69c5ea7f1c71352707 100644 (file)
 
 (define_insn "*ctr<mode>_internal1"
   [(set (pc)
-       (if_then_else (ne (match_operand:P 1 "register_operand" "c,*r,*r,*r")
+       (if_then_else (ne (match_operand:P 1 "register_operand" "c,*b,*b,*b")
                          (const_int 1))
                      (label_ref (match_operand 0 "" ""))
                      (pc)))
     return \"bdz $+8\;b %l0\";
 }"
   [(set_attr "type" "branch")
-   (set_attr "length" "*,12,16,16")])
+   (set_attr "length" "*,16,20,20")])
 
 (define_insn "*ctr<mode>_internal2"
   [(set (pc)
-       (if_then_else (ne (match_operand:P 1 "register_operand" "c,*r,*r,*r")
+       (if_then_else (ne (match_operand:P 1 "register_operand" "c,*b,*b,*b")
                          (const_int 1))
                      (pc)
                      (label_ref (match_operand 0 "" ""))))
     return \"bdnz $+8\;b %l0\";
 }"
   [(set_attr "type" "branch")
-   (set_attr "length" "*,12,16,16")])
+   (set_attr "length" "*,16,20,20")])
 
 ;; Similar but use EQ
 
 (define_insn "*ctr<mode>_internal5"
   [(set (pc)
-       (if_then_else (eq (match_operand:P 1 "register_operand" "c,*r,*r,*r")
+       (if_then_else (eq (match_operand:P 1 "register_operand" "c,*b,*b,*b")
                          (const_int 1))
                      (label_ref (match_operand 0 "" ""))
                      (pc)))
     return \"bdnz $+8\;b %l0\";
 }"
   [(set_attr "type" "branch")
-   (set_attr "length" "*,12,16,16")])
+   (set_attr "length" "*,16,20,20")])
 
 (define_insn "*ctr<mode>_internal6"
   [(set (pc)
-       (if_then_else (eq (match_operand:P 1 "register_operand" "c,*r,*r,*r")
+       (if_then_else (eq (match_operand:P 1 "register_operand" "c,*b,*b,*b")
                          (const_int 1))
                      (pc)
                      (label_ref (match_operand 0 "" ""))))
     return \"bdz $+8\;b %l0\";
 }"
   [(set_attr "type" "branch")
-   (set_attr "length" "*,12,16,16")])
+   (set_attr "length" "*,16,20,20")])
 
 ;; Now the splitters if we could not allocate the CTR register
 
    (clobber (match_scratch:CC 3 ""))
    (clobber (match_scratch:P 4 ""))]
   "reload_completed"
-  [(parallel [(set (match_dup 3)
-                  (compare:CC (plus:P (match_dup 1)
-                                       (const_int -1))
-                              (const_int 0)))
-             (set (match_dup 0)
-                  (plus:P (match_dup 1)
-                           (const_int -1)))])
+  [(set (match_dup 3)
+       (compare:CC (match_dup 1)
+                   (const_int 1)))
+   (set (match_dup 0)
+       (plus:P (match_dup 1)
+               (const_int -1)))
    (set (pc) (if_then_else (match_dup 7)
                           (match_dup 5)
                           (match_dup 6)))]
    (clobber (match_scratch:CC 3 ""))
    (clobber (match_scratch:P 4 ""))]
   "reload_completed && ! gpc_reg_operand (operands[0], SImode)"
-  [(parallel [(set (match_dup 3)
-                  (compare:CC (plus:P (match_dup 1)
-                                       (const_int -1))
-                              (const_int 0)))
-             (set (match_dup 4)
-                  (plus:P (match_dup 1)
-                           (const_int -1)))])
+  [(set (match_dup 3)
+       (compare:CC (match_dup 1)
+                   (const_int 1)))
+   (set (match_dup 4)
+       (plus:P (match_dup 1)
+               (const_int -1)))
    (set (match_dup 0)
        (match_dup 4))
    (set (pc) (if_then_else (match_dup 7)