OSDN Git Service

Add variants of call and call_value patterns for calls to functions
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Jul 1993 22:10:12 +0000 (22:10 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Jul 1993 22:10:12 +0000 (22:10 +0000)
defined in the same file.  Omit the TOC pointer reload after such
calls.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@4943 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/config/rs6000/rs6000.md

index 45c6a12..d04b249 100644 (file)
     }
 }")
 
+;; Call to function in current module.  No TOC pointer reload needed.
+
+(define_insn ""
+  [(call (mem:SI (match_operand:SI 0 "current_file_function_operand" "s"))
+        (match_operand 1 "" "g"))
+   (clobber (match_scratch:SI 2 "=l"))]
+  ""
+  "bl %z0")
+
+;; Call to function which may be in another module.  Restore the TOC
+;; pointer (r2) after the call.
+
 (define_insn ""
   [(call (mem:SI (match_operand:SI 0 "call_operand" "l,s"))
         (match_operand 1 "" "fg,fg"))
    bl %z0\;cror %.,%.,%.")
 
 (define_insn ""
+  [(set (match_operand 0 "" "=fg")
+       (call (mem:SI (match_operand:SI 1 "current_file_function_operand" "s"))
+             (match_operand 2 "" "g")))
+   (clobber (match_scratch:SI 3 "=l"))]
+  ""
+  "bl %z1")
+
+(define_insn ""
   [(set (match_operand 0 "" "=fg,fg")
        (call (mem:SI (match_operand:SI 1 "call_operand" "l,s"))
              (match_operand 2 "" "fg,fg")))