diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1993-08-28 12:04:13 -0700 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1993-08-28 12:04:13 -0700 |
commit | bf97b9672d4a6081f1d78850b506abe02a4850c7 (patch) | |
tree | 08a8b86f5a7c38d2b2c95fa73238ab182b05ac26 | |
parent | e228410eeb2c812c49d0b4534c4d7dd56352391e (diff) | |
download | gcc-bf97b9672d4a6081f1d78850b506abe02a4850c7.zip gcc-bf97b9672d4a6081f1d78850b506abe02a4850c7.tar.gz gcc-bf97b9672d4a6081f1d78850b506abe02a4850c7.tar.bz2 |
(call+1...
(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
-rw-r--r-- | gcc/config/sparc/sparc.md | 71 |
1 files changed, 65 insertions, 6 deletions
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md index c0c1bca..9c48d2f 100644 --- a/gcc/config/sparc/sparc.md +++ b/gcc/config/sparc/sparc.md @@ -2675,8 +2675,23 @@ 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. @@ -2689,7 +2704,21 @@ ;; 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))] @@ -2735,7 +2764,20 @@ (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. @@ -2762,7 +2804,24 @@ ;; 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 "" "") @@ -3376,7 +3435,7 @@ (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 "" "")))] @@ -3387,7 +3446,7 @@ }") (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 "" "")))] |