aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-05-11 16:50:50 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-05-11 16:50:50 -0400
commitc5bd3be879186eb78b92f12050e928391d8e874d (patch)
tree6a1d58d906b0095506e92ddac9c8f871d1f40fab /gcc
parentf5fa4507849214668430b923a811b6537c4e0272 (diff)
downloadgcc-c5bd3be879186eb78b92f12050e928391d8e874d.zip
gcc-c5bd3be879186eb78b92f12050e928391d8e874d.tar.gz
gcc-c5bd3be879186eb78b92f12050e928391d8e874d.tar.bz2
(clobbers_to): Deleted.
(call_internal, call_value_internal): New patterns. (call, call_value): Just call new patterns and a29k_clobbers_to. From-SVN: r7277
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/a29k/a29k.md61
1 files changed, 30 insertions, 31 deletions
diff --git a/gcc/config/a29k/a29k.md b/gcc/config/a29k/a29k.md
index 11ea210..9c7ca79 100644
--- a/gcc/config/a29k/a29k.md
+++ b/gcc/config/a29k/a29k.md
@@ -111,39 +111,28 @@
;; CALLI
;;
-;; Start with a subroutine to write out CLOBBERs starting at lr2 up to,
-;; but not including, the next parameter register. If operand[0] is null,
-;; it means that all the argument registers have been used.
-(define_expand "clobbers_to"
- [(clobber (match_operand:SI 0 "" ""))]
+;; Each call pattern is duplicated so that we can add CLOBBERs to the
+;; resulting insn.
+;;
+;; We indicate that LR0 is clobbered in the CALL_INSN itself. Otherwise,
+;; reorg will think it is just clobbered by the called function.
+
+(define_expand "call"
+ [(use (match_operand:SI 0 "" ""))
+ (use (match_operand 1 "" ""))
+ (use (match_operand 2 "" ""))]
""
"
-{
- int i;
- int high_regno;
-
- if (operands[0] == 0)
- high_regno = R_LR (18);
- else if (GET_CODE (operands[0]) != REG || REGNO (operands[0]) < R_LR (0)
- || REGNO (operands[0]) > R_LR (18))
- abort ();
- else
- high_regno = REGNO (operands[0]);
-
- for (i = R_LR (2); i < high_regno; i++)
- emit_insn (gen_rtx (CLOBBER, VOIDmode, gen_rtx (REG, SImode, i)));
+{ rtx insn = emit_call_insn (gen_call_internal (operands[0], operands[1]));
+ a29k_clobbers_to (insn, operands[2]);
DONE;
}")
-
-;; We indicate that LR0 is clobbered in the CALL_INSN itself. Otherwise,
-;; reorg will think it is just clobbered by the called function.
-
-(define_expand "call"
+
+(define_expand "call_internal"
[(parallel [(call (match_operand:SI 0 "" "")
(match_operand 1 "" ""))
- (clobber (scratch:SI))])
- (match_operand 2 "" "")]
+ (clobber (scratch:SI))])]
""
"
{
@@ -156,16 +145,27 @@
&& GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
operands[0] = gen_rtx (MEM, SImode,
force_reg (Pmode, XEXP (operands[0], 0)));
-
- operands[2] = gen_clobbers_to (operands[2]);
}")
(define_expand "call_value"
+ [(use (match_operand:SI 0 "gpc_reg_operand" ""))
+ (use (match_operand:SI 1 "" ""))
+ (use (match_operand 2 "" ""))
+ (use (match_operand 3 "" ""))]
+ ""
+ "
+{ rtx insn = emit_call_insn (gen_call_value_internal (operands[0], operands[1],
+ operands[2]));
+
+ a29k_clobbers_to (insn, operands[3]);
+ DONE;
+}")
+
+(define_expand "call_value_internal"
[(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
(call (match_operand:SI 1 "" "")
(match_operand 2 "" "")))
- (clobber (scratch:SI))])
- (match_operand 3 "" "")]
+ (clobber (scratch:SI))])]
""
"
{
@@ -179,7 +179,6 @@
operands[1] = gen_rtx (MEM, SImode,
force_reg (Pmode, XEXP (operands[1], 0)));
- operands[3] = gen_clobbers_to (operands[3]);
}")
(define_insn ""