rs6000: Use LR_REGNO directly in the save/restore patterns
authorSegher Boessenkool <segher@kernel.crashing.org>
Thu, 1 Sep 2016 15:07:54 +0000 (17:07 +0200)
committerSegher Boessenkool <segher@gcc.gnu.org>
Thu, 1 Sep 2016 15:07:54 +0000 (17:07 +0200)
Various patterns use "register_operand" "l" (or "=l") although those
patterns are only created refering to LR_REGNO directly.  This patch
changes those patterns to use the hard regs as well.

* config/rs6000/rs6000.md (*restore_gpregs_<mode>_r11,
*restore_gpregs_<mode>_r12, *restore_gpregs_<mode>_r1,
*return_and_restore_gpregs_<mode>_r11,
*return_and_restore_gpregs_<mode>_r12,
*return_and_restore_gpregs_<mode>_r1,
*return_and_restore_fpregs_<mode>_r11,
*return_and_restore_fpregs_<mode>_r12,
*return_and_restore_fpregs_<mode>_r1): Use the hard register LR_REGNO
directly instead of via the "l" constraint.  Renumber operands.
Fix whitespace.

From-SVN: r239942

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

index 03f96f4d5fb9addce0071acb43289a757f1f70a7..7d80216bc0e6d5a280eae7ac25f4a03b229b8c9c 100644 (file)
@@ -1,3 +1,16 @@
+2016-09-01  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       * config/rs6000/rs6000.md (*restore_gpregs_<mode>_r11,
+       *restore_gpregs_<mode>_r12, *restore_gpregs_<mode>_r1,
+       *return_and_restore_gpregs_<mode>_r11,
+       *return_and_restore_gpregs_<mode>_r12,
+       *return_and_restore_gpregs_<mode>_r1,
+       *return_and_restore_fpregs_<mode>_r11,
+       *return_and_restore_fpregs_<mode>_r12,
+       *return_and_restore_fpregs_<mode>_r1): Use the hard register LR_REGNO
+       directly instead of via the "l" constraint.  Renumber operands.
+       Fix whitespace.
+
 2016-09-01  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * config/rs6000/altivec.md (*save_world, *save_vregs_<mode>_r11,
index 1ecbb9d930c69ddd98d1bf207a9cca45e4fe02be..7da4370242d51fd72bb00cb7f8e1bbcd4cefcab4 100644 (file)
 
 (define_insn "*restore_gpregs_<mode>_r11"
  [(match_parallel 0 "any_parallel_operand"
-                  [(clobber (match_operand:P 1 "register_operand" "=l"))
-                   (use (match_operand:P 2 "symbol_ref_operand" "s"))
-                   (use (reg:P 11))
-                  (set (match_operand:P 3 "gpc_reg_operand" "=r")
-                       (match_operand:P 4 "memory_operand" "m"))])]
+                 [(clobber (reg:P LR_REGNO))
+                  (use (match_operand:P 1 "symbol_ref_operand" "s"))
+                  (use (reg:P 11))
+                  (set (match_operand:P 2 "gpc_reg_operand" "=r")
+                       (match_operand:P 3 "memory_operand" "m"))])]
  ""
- "bl %2"
+ "bl %1"
  [(set_attr "type" "branch")
   (set_attr "length" "4")])
 
 (define_insn "*restore_gpregs_<mode>_r12"
  [(match_parallel 0 "any_parallel_operand"
-                  [(clobber (match_operand:P 1 "register_operand" "=l"))
-                   (use (match_operand:P 2 "symbol_ref_operand" "s"))
-                   (use (reg:P 12))
-                  (set (match_operand:P 3 "gpc_reg_operand" "=r")
-                       (match_operand:P 4 "memory_operand" "m"))])]
+                 [(clobber (reg:P LR_REGNO))
+                  (use (match_operand:P 1 "symbol_ref_operand" "s"))
+                  (use (reg:P 12))
+                  (set (match_operand:P 2 "gpc_reg_operand" "=r")
+                       (match_operand:P 3 "memory_operand" "m"))])]
  ""
- "bl %2"
+ "bl %1"
  [(set_attr "type" "branch")
   (set_attr "length" "4")])
 
 (define_insn "*restore_gpregs_<mode>_r1"
  [(match_parallel 0 "any_parallel_operand"
-                  [(clobber (match_operand:P 1 "register_operand" "=l"))
-                   (use (match_operand:P 2 "symbol_ref_operand" "s"))
-                   (use (reg:P 1))
-                  (set (match_operand:P 3 "gpc_reg_operand" "=r")
-                       (match_operand:P 4 "memory_operand" "m"))])]
+                 [(clobber (reg:P LR_REGNO))
+                  (use (match_operand:P 1 "symbol_ref_operand" "s"))
+                  (use (reg:P 1))
+                  (set (match_operand:P 2 "gpc_reg_operand" "=r")
+                       (match_operand:P 3 "memory_operand" "m"))])]
  ""
- "bl %2"
+ "bl %1"
  [(set_attr "type" "branch")
   (set_attr "length" "4")])
 
 (define_insn "*return_and_restore_gpregs_<mode>_r11"
  [(match_parallel 0 "any_parallel_operand"
-                  [(return)
-                  (clobber (match_operand:P 1 "register_operand" "=l"))
-                  (use (match_operand:P 2 "symbol_ref_operand" "s"))
-                   (use (reg:P 11))
-                  (set (match_operand:P 3 "gpc_reg_operand" "=r")
-                       (match_operand:P 4 "memory_operand" "m"))])]
+                 [(return)
+                  (clobber (reg:P LR_REGNO))
+                  (use (match_operand:P 1 "symbol_ref_operand" "s"))
+                  (use (reg:P 11))
+                  (set (match_operand:P 2 "gpc_reg_operand" "=r")
+                       (match_operand:P 3 "memory_operand" "m"))])]
  ""
- "b %2"
+ "b %1"
  [(set_attr "type" "branch")
   (set_attr "length" "4")])
 
 (define_insn "*return_and_restore_gpregs_<mode>_r12"
  [(match_parallel 0 "any_parallel_operand"
-                  [(return)
-                  (clobber (match_operand:P 1 "register_operand" "=l"))
-                  (use (match_operand:P 2 "symbol_ref_operand" "s"))
-                   (use (reg:P 12))
-                  (set (match_operand:P 3 "gpc_reg_operand" "=r")
-                       (match_operand:P 4 "memory_operand" "m"))])]
+                 [(return)
+                  (clobber (reg:P LR_REGNO))
+                  (use (match_operand:P 1 "symbol_ref_operand" "s"))
+                  (use (reg:P 12))
+                  (set (match_operand:P 2 "gpc_reg_operand" "=r")
+                       (match_operand:P 3 "memory_operand" "m"))])]
  ""
- "b %2"
+ "b %1"
  [(set_attr "type" "branch")
   (set_attr "length" "4")])
 
 (define_insn "*return_and_restore_gpregs_<mode>_r1"
  [(match_parallel 0 "any_parallel_operand"
-                  [(return)
-                  (clobber (match_operand:P 1 "register_operand" "=l"))
-                  (use (match_operand:P 2 "symbol_ref_operand" "s"))
-                   (use (reg:P 1))
-                  (set (match_operand:P 3 "gpc_reg_operand" "=r")
-                       (match_operand:P 4 "memory_operand" "m"))])]
+                 [(return)
+                  (clobber (reg:P LR_REGNO))
+                  (use (match_operand:P 1 "symbol_ref_operand" "s"))
+                  (use (reg:P 1))
+                  (set (match_operand:P 2 "gpc_reg_operand" "=r")
+                       (match_operand:P 3 "memory_operand" "m"))])]
  ""
- "b %2"
+ "b %1"
  [(set_attr "type" "branch")
   (set_attr "length" "4")])
 
 (define_insn "*return_and_restore_fpregs_<mode>_r11"
  [(match_parallel 0 "any_parallel_operand"
-                  [(return)
-                  (clobber (match_operand:P 1 "register_operand" "=l"))
-                  (use (match_operand:P 2 "symbol_ref_operand" "s"))
-                   (use (reg:P 11))
-                  (set (match_operand:DF 3 "gpc_reg_operand" "=d")
-                       (match_operand:DF 4 "memory_operand" "m"))])]
+                 [(return)
+                  (clobber (reg:P LR_REGNO))
+                  (use (match_operand:P 1 "symbol_ref_operand" "s"))
+                  (use (reg:P 11))
+                  (set (match_operand:DF 2 "gpc_reg_operand" "=d")
+                       (match_operand:DF 3 "memory_operand" "m"))])]
  ""
- "b %2"
+ "b %1"
  [(set_attr "type" "branch")
   (set_attr "length" "4")])
 
 (define_insn "*return_and_restore_fpregs_<mode>_r12"
  [(match_parallel 0 "any_parallel_operand"
-                  [(return)
-                  (clobber (match_operand:P 1 "register_operand" "=l"))
-                  (use (match_operand:P 2 "symbol_ref_operand" "s"))
-                   (use (reg:P 12))
-                  (set (match_operand:DF 3 "gpc_reg_operand" "=d")
-                       (match_operand:DF 4 "memory_operand" "m"))])]
+                 [(return)
+                  (clobber (reg:P LR_REGNO))
+                  (use (match_operand:P 1 "symbol_ref_operand" "s"))
+                  (use (reg:P 12))
+                  (set (match_operand:DF 2 "gpc_reg_operand" "=d")
+                       (match_operand:DF 3 "memory_operand" "m"))])]
  ""
- "b %2"
+ "b %1"
  [(set_attr "type" "branch")
   (set_attr "length" "4")])
 
 (define_insn "*return_and_restore_fpregs_<mode>_r1"
  [(match_parallel 0 "any_parallel_operand"
-                  [(return)
-                  (clobber (match_operand:P 1 "register_operand" "=l"))
-                  (use (match_operand:P 2 "symbol_ref_operand" "s"))
-                   (use (reg:P 1))
-                  (set (match_operand:DF 3 "gpc_reg_operand" "=d")
-                       (match_operand:DF 4 "memory_operand" "m"))])]
+                 [(return)
+                  (clobber (reg:P LR_REGNO))
+                  (use (match_operand:P 1 "symbol_ref_operand" "s"))
+                  (use (reg:P 1))
+                  (set (match_operand:DF 2 "gpc_reg_operand" "=d")
+                       (match_operand:DF 3 "memory_operand" "m"))])]
  ""
- "b %2"
+ "b %1"
  [(set_attr "type" "branch")
   (set_attr "length" "4")])