(call+1...
authorJim Wilson <wilson@gcc.gnu.org>
Sat, 28 Aug 1993 19:04:13 +0000 (12:04 -0700)
committerJim Wilson <wilson@gcc.gnu.org>
Sat, 28 Aug 1993 19:04:13 +0000 (12:04 -0700)
(call+1, call+2, call_value+1, untyped_call+1): Split
into two patterns, one using address_operand and 'p', the other
immediate_operand and 'i'.

From-SVN: r5223

gcc/config/sparc/sparc.md

index c0c1bca58cfd2dbcfdb7d2f05bbd4acaf304d749..9c48d2fd07216bda3d858adc5483516ef49a170a 100644 (file)
   DONE;
 }")
 
+;; We can't use the same pattern for these two insns, because then registers
+;; in the address may not be properly reloaded.
+
+(define_insn ""
+  [(call (mem:SI (match_operand:SI 0 "address_operand" "p"))
+        (match_operand 1 "" ""))
+   (clobber (reg:SI 15))]
+  ;;- Do not use operand 1 for most machines.
+  ""
+  "*
+{
+  return \"call %a0,%1%#\";
+}"
+  [(set_attr "type" "call")])
+
 (define_insn ""
-  [(call (mem:SI (match_operand:SI 0 "call_operand_address" "S,r"))
+  [(call (mem:SI (match_operand:SI 0 "immediate_operand" "i"))
         (match_operand 1 "" ""))
    (clobber (reg:SI 15))]
   ;;- Do not use operand 1 for most machines.
 
 ;; This is a call that wants a structure value.
 (define_insn ""
-  [(call (mem:SI (match_operand:SI 0 "call_operand_address" "S,r"))
+  [(call (mem:SI (match_operand:SI 0 "address_operand" "p"))
+        (match_operand 1 "" ""))
+   (match_operand 2 "immediate_operand" "")
+   (clobber (reg:SI 15))]
+  ;;- Do not use operand 1 for most machines.
+  "GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) > 0"
+  "*
+{
+  return \"call %a0,%1\;nop\;unimp %2\";
+}"
+  [(set_attr "type" "call_no_delay_slot")])
+
+;; This is a call that wants a structure value.
+(define_insn ""
+  [(call (mem:SI (match_operand:SI 0 "immediate_operand" "i"))
         (match_operand 1 "" ""))
    (match_operand 2 "immediate_operand" "")
    (clobber (reg:SI 15))]
 
 (define_insn ""
   [(set (match_operand 0 "" "=rf")
-       (call (mem:SI (match_operand:SI 1 "call_operand_address" "rS"))
+       (call (mem:SI (match_operand:SI 1 "address_operand" "p"))
+             (match_operand 2 "" "")))
+   (clobber (reg:SI 15))]
+  ;;- Do not use operand 2 for most machines.
+  ""
+  "*
+{
+  return \"call %a1,%2%#\";
+}"
+  [(set_attr "type" "call")])
+
+(define_insn ""
+  [(set (match_operand 0 "" "=rf")
+       (call (mem:SI (match_operand:SI 1 "immediate_operand" "i"))
              (match_operand 2 "" "")))
    (clobber (reg:SI 15))]
   ;;- Do not use operand 2 for most machines.
 ;; returns a structure value and expects to skip an unimp instruction.
 
 (define_insn ""
-  [(call (mem:SI (match_operand:SI 0 "call_operand_address" "rS"))
+  [(call (mem:SI (match_operand:SI 0 "address_operand" "p"))
+        (const_int 0))
+   (match_operand:DI 1 "memory_operand" "o")
+   (match_operand 2 "" "")
+   (clobber (reg:SI 15))]
+  ""
+  "*
+{
+  operands[2] = adj_offsettable_operand (operands[1], 8);
+  return \"call %a0,0\;nop\;nop\;std %%o0,%1\;st %%f0,%2\";
+}"
+  [(set_attr "type" "multi")])
+
+;; Make a call followed by two nops in case the function being called
+;; returns a structure value and expects to skip an unimp instruction.
+
+(define_insn ""
+  [(call (mem:SI (match_operand:SI 0 "immediate_operand" "i"))
         (const_int 0))
    (match_operand:DI 1 "memory_operand" "o")
    (match_operand 2 "" "")
 
 (define_peephole
   [(parallel [(set (match_operand 0 "" "")
-                  (call (mem:SI (match_operand:SI 1 "call_operand_address" "S,r"))
+                  (call (mem:SI (match_operand:SI 1 "call_operand_address" "pi"))
                         (match_operand 2 "" "")))
              (clobber (reg:SI 15))])
    (set (pc) (label_ref (match_operand 3 "" "")))]
 }")
 
 (define_peephole
-  [(parallel [(call (mem:SI (match_operand:SI 0 "call_operand_address" "S,r"))
+  [(parallel [(call (mem:SI (match_operand:SI 0 "call_operand_address" "pi"))
                    (match_operand 1 "" ""))
              (clobber (reg:SI 15))])
    (set (pc) (label_ref (match_operand 2 "" "")))]