diff gcc/config/rs6000/rs6000.md @ 27:f9b1a53df341

implemented indirect sibcall for ppc.
author kent@teto.cr.ie.u-ryukyu.ac.jp
date Tue, 10 Nov 2009 16:34:29 +0900
parents a06113de4d67
children f2ea7e07d030
line wrap: on
line diff
--- a/gcc/config/rs6000/rs6000.md	Thu Oct 29 18:19:02 2009 +0900
+++ b/gcc/config/rs6000/rs6000.md	Tue Nov 10 16:34:29 2009 +0900
@@ -11681,6 +11681,35 @@
   [(set_attr "type" "branch,branch")
    (set_attr "length" "4,8")])
 
+
+;; added by kent.
+;; for indirect sibcalls of Continuation based C.
+;; this is based on call_indirect_nonlocal_sysv<mode>"
+(define_insn "*sibcall_indirect_nonlocal_sysv<mode>"
+  [(call (mem:SI (match_operand:P 0 "register_operand" "c,*l,c,*l"))
+	 (match_operand 1 "" "g,g,g,g"))
+   (use (match_operand:SI 2 "immediate_operand" "O,O,n,n"))
+   (use (reg:SI LR_REGNO))
+   (return)]
+  "DEFAULT_ABI == ABI_V4
+   || DEFAULT_ABI == ABI_DARWIN"
+{
+  /*
+  if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
+    output_asm_insn ("crxor 6,6,6", operands);
+
+  else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
+    output_asm_insn ("creqv 6,6,6", operands);
+  */
+
+  return "b%T0";
+}
+  [(set_attr "type" "branch,branch")
+   (set_attr "length" "4,8")])
+
+
+
+
 (define_expand "sibcall_value"
   [(parallel [(set (match_operand 0 "register_operand" "")
 		(call (mem:SI (match_operand 1 "address_operand" ""))