[multiple changes]
authorDavid Edelsohn <dje@gcc.gnu.org>
Mon, 13 Jun 2011 18:24:39 +0000 (14:24 -0400)
committerDavid Edelsohn <dje@gcc.gnu.org>
Mon, 13 Jun 2011 18:24:39 +0000 (14:24 -0400)
2011-06-13  David Edelsohn  <dje.gcc@gmail.com>

        * config/rs6000/rs6000.md (movdi_mfpgpr): Remove POWER mnemonic.
        (movdi_internal64): Same.

2011-06-13  Edmar Wienskoski  <edmar@freescale.com>

        * config/rs6000/rs6000.md (save_gpregs_<mode>): Replaced pattern
        with a set of similar patterns, where the MATCH_OPERAND for the
        function argument is replaced with individual references to hardware
        registers.
        (save_fpregs_<mode>): Ditto
        (restore_gpregs_<mode>): Ditto
        (return_and_restore_gpregs_<mode>): Ditto
        (return_and_restore_fpregs_<mode>): Ditto
        (return_and_restore_fpregs_aix_<mode>): Ditto

From-SVN: r174997

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

index 75954951d6ad54b404149be263f9cd09a101d856..4059d4e73d269cd32e91e16b34a0a547f685b013 100644 (file)
@@ -1,3 +1,20 @@
+2011-06-13  David Edelsohn  <dje.gcc@gmail.com>
+
+       * config/rs6000/rs6000.md (movdi_mfpgpr): Remove POWER mnemonic.
+       (movdi_internal64): Same.
+
+2011-06-13  Edmar Wienskoski  <edmar@freescale.com>
+
+       * config/rs6000/rs6000.md (save_gpregs_<mode>): Replaced pattern
+       with a set of similar patterns, where the MATCH_OPERAND for the
+       function argument is replaced with individual references to hardware
+       registers.
+       (save_fpregs_<mode>): Ditto
+       (restore_gpregs_<mode>): Ditto
+       (return_and_restore_gpregs_<mode>): Ditto
+       (return_and_restore_fpregs_<mode>): Ditto
+       (return_and_restore_fpregs_aix_<mode>): Ditto
+
 2011-06-13  Jan Hubicka  <jh@suse.cz>
 
        * ipa-utils.c (postorder_stack): New structure.
index 586e9e4a83b29d9d67468a43b296d3d0a5fbe3db..61a70eeff338baf1de303481ceaeb994af13fe2e 100644 (file)
    li %0,%1
    lis %0,%v1
    #
-   {cal|la} %0,%a1
+   la %0,%a1
    fmr %0,%1
    lfd%U1%X1 %0,%1
    stfd%U0%X0 %1,%0
    li %0,%1
    lis %0,%v1
    #
-   {cal|la} %0,%a1
+   la %0,%a1
    fmr %0,%1
    lfd%U1%X1 %0,%1
    stfd%U0%X0 %1,%0
   "{stm|stmw} %2,%1"
   [(set_attr "type" "store_ux")])
 
-(define_insn "*save_gpregs_<mode>"
+; The following comment applies to:
+;     save_gpregs_*
+;     save_fpregs_*
+;     restore_gpregs*
+;     return_and_restore_gpregs*
+;     return_and_restore_fpregs*
+;     return_and_restore_fpregs_aix*
+;
+; The out-of-line save / restore functions expects one input argument.
+; Since those are not standard call_insn's, we must avoid using
+; MATCH_OPERAND for that argument. That way the register rename
+; optimization will not try to rename this register.
+; Each pattern is repeated for each possible register number used in 
+; various ABIs (r11, r1, and for some functions r12)
+
+(define_insn "*save_gpregs_<mode>_r11"
+  [(match_parallel 0 "any_parallel_operand"
+                  [(clobber (reg:P 65))
+                   (use (match_operand:P 1 "symbol_ref_operand" "s"))
+                    (use (reg:P 11))
+                   (set (match_operand:P 2 "memory_operand" "=m")
+                        (match_operand:P 3 "gpc_reg_operand" "r"))])]
+  ""
+  "bl %1"
+  [(set_attr "type" "branch")
+   (set_attr "length" "4")])
+
+(define_insn "*save_gpregs_<mode>_r12"
+  [(match_parallel 0 "any_parallel_operand"
+                  [(clobber (reg:P 65))
+                   (use (match_operand:P 1 "symbol_ref_operand" "s"))
+                    (use (reg:P 12))
+                   (set (match_operand:P 2 "memory_operand" "=m")
+                        (match_operand:P 3 "gpc_reg_operand" "r"))])]
+  ""
+  "bl %1"
+  [(set_attr "type" "branch")
+   (set_attr "length" "4")])
+
+(define_insn "*save_gpregs_<mode>_r1"
+  [(match_parallel 0 "any_parallel_operand"
+                  [(clobber (reg:P 65))
+                   (use (match_operand:P 1 "symbol_ref_operand" "s"))
+                    (use (reg:P 1))
+                   (set (match_operand:P 2 "memory_operand" "=m")
+                        (match_operand:P 3 "gpc_reg_operand" "r"))])]
+  ""
+  "bl %1"
+  [(set_attr "type" "branch")
+   (set_attr "length" "4")])
+
+(define_insn "*save_fpregs_<mode>_r11"
+  [(match_parallel 0 "any_parallel_operand"
+                  [(clobber (reg:P 65))
+                   (use (match_operand:P 1 "symbol_ref_operand" "s"))
+                    (use (reg:P 11))
+                   (set (match_operand:DF 2 "memory_operand" "=m")
+                        (match_operand:DF 3 "gpc_reg_operand" "d"))])]
+  ""
+  "bl %1"
+  [(set_attr "type" "branch")
+   (set_attr "length" "4")])
+
+(define_insn "*save_fpregs_<mode>_r12"
   [(match_parallel 0 "any_parallel_operand"
                   [(clobber (reg:P 65))
                    (use (match_operand:P 1 "symbol_ref_operand" "s"))
-                    (use (match_operand:P 2 "gpc_reg_operand" "r"))
-                   (set (match_operand:P 3 "memory_operand" "=m")
-                        (match_operand:P 4 "gpc_reg_operand" "r"))])]
+                    (use (reg:P 12))
+                   (set (match_operand:DF 2 "memory_operand" "=m")
+                        (match_operand:DF 3 "gpc_reg_operand" "d"))])]
   ""
   "bl %1"
   [(set_attr "type" "branch")
    (set_attr "length" "4")])
 
-(define_insn "*save_fpregs_<mode>"
+(define_insn "*save_fpregs_<mode>_r1"
   [(match_parallel 0 "any_parallel_operand"
                   [(clobber (reg:P 65))
                    (use (match_operand:P 1 "symbol_ref_operand" "s"))
-                    (use (match_operand:P 2 "gpc_reg_operand" "r"))
-                   (set (match_operand:DF 3 "memory_operand" "=m")
-                        (match_operand:DF 4 "gpc_reg_operand" "d"))])]
+                    (use (reg:P 1))
+                   (set (match_operand:DF 2 "memory_operand" "=m")
+                        (match_operand:DF 3 "gpc_reg_operand" "d"))])]
   ""
   "bl %1"
   [(set_attr "type" "branch")
 ; FIXME: This would probably be somewhat simpler if the Cygnus sibcall
 ; stuff was in GCC.  Oh, and "any_parallel_operand" is a bit flexible...
 
-(define_insn "*restore_gpregs_<mode>"
+; The following comment applies to:
+;     save_gpregs_*
+;     save_fpregs_*
+;     restore_gpregs*
+;     return_and_restore_gpregs*
+;     return_and_restore_fpregs*
+;     return_and_restore_fpregs_aix*
+;
+; The out-of-line save / restore functions expects one input argument.
+; Since those are not standard call_insn's, we must avoid using
+; MATCH_OPERAND for that argument. That way the register rename
+; optimization will not try to rename this register.
+; Each pattern is repeated for each possible register number used in 
+; various ABIs (r11, r1, and for some functions r12)
+
+(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"))])]
+ ""
+ "bl %2"
+ [(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 (match_operand:P 3 "gpc_reg_operand" "r"))
-                  (set (match_operand:P 4 "gpc_reg_operand" "=r")
-                       (match_operand:P 5 "memory_operand" "m"))])]
+                   (use (reg:P 12))
+                  (set (match_operand:P 3 "gpc_reg_operand" "=r")
+                       (match_operand:P 4 "memory_operand" "m"))])]
  ""
  "bl %2"
  [(set_attr "type" "branch")
   (set_attr "length" "4")])
 
-(define_insn "*return_and_restore_gpregs_<mode>"
+(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"))])]
+ ""
+ "bl %2"
+ [(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"))])]
+ ""
+ "b %2"
+ [(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"))])]
+ ""
+ "b %2"
+ [(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 (match_operand:P 3 "gpc_reg_operand" "r"))
-                  (set (match_operand:P 4 "gpc_reg_operand" "=r")
-                       (match_operand:P 5 "memory_operand" "m"))])]
+                   (use (reg:P 1))
+                  (set (match_operand:P 3 "gpc_reg_operand" "=r")
+                       (match_operand:P 4 "memory_operand" "m"))])]
  ""
  "b %2"
  [(set_attr "type" "branch")
   (set_attr "length" "4")])
 
-(define_insn "*return_and_restore_fpregs_<mode>"
+(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 (match_operand:P 3 "gpc_reg_operand" "r"))
-                  (set (match_operand:DF 4 "gpc_reg_operand" "=d")
-                       (match_operand:DF 5 "memory_operand" "m"))])]
+                   (use (reg:P 11))
+                  (set (match_operand:DF 3 "gpc_reg_operand" "=d")
+                       (match_operand:DF 4 "memory_operand" "m"))])]
+ ""
+ "b %2"
+ [(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"))])]
+ ""
+ "b %2"
+ [(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"))])]
+ ""
+ "b %2"
+ [(set_attr "type" "branch")
+  (set_attr "length" "4")])
+
+(define_insn "*return_and_restore_fpregs_aix_<mode>_r11"
+ [(match_parallel 0 "any_parallel_operand"
+                 [(return)
+                  (use (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"))])]
  ""
  "b %2"
  [(set_attr "type" "branch")
   (set_attr "length" "4")])
 
-(define_insn "*return_and_restore_fpregs_aix_<mode>"
+(define_insn "*return_and_restore_fpregs_aix_<mode>_r1"
  [(match_parallel 0 "any_parallel_operand"
                  [(return)
                   (use (match_operand:P 1 "register_operand" "l"))
                   (use (match_operand:P 2 "symbol_ref_operand" "s"))
-                  (use (match_operand:P 3 "gpc_reg_operand" "r"))
-                  (set (match_operand:DF 4 "gpc_reg_operand" "=d")
-                       (match_operand:DF 5 "memory_operand" "m"))])]
+                  (use (reg:P 1))
+                  (set (match_operand:DF 3 "gpc_reg_operand" "=d")
+                       (match_operand:DF 4 "memory_operand" "m"))])]
  ""
  "b %2"
  [(set_attr "type" "branch")