(call): Put USE for r0 in CALL_INSN; call call_internal to emit insn.
(call_internal): New name for anonymous call. (call_value, call_value_internal): Likewise. From-SVN: r9834
This commit is contained in:
parent
57f2483b4b
commit
c07db08e34
|
@ -1,5 +1,5 @@
|
||||||
;;- Machine description for ROMP chip for GNU C compiler
|
;;- Machine description for ROMP chip for GNU C compiler
|
||||||
;; Copyright (C) 1988, 1991, 1993, 1994 Free Software Foundation, Inc.
|
;; Copyright (C) 1988, 1991, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||||
;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
|
;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
|
||||||
|
|
||||||
;; This file is part of GNU CC.
|
;; This file is part of GNU CC.
|
||||||
|
@ -1660,13 +1660,14 @@
|
||||||
;;
|
;;
|
||||||
;; Operand 1 (2 for `call_value') is the number of arguments and is not used.
|
;; Operand 1 (2 for `call_value') is the number of arguments and is not used.
|
||||||
(define_expand "call"
|
(define_expand "call"
|
||||||
[(use (reg:SI 0))
|
[(use (match_operand:SI 0 "address_operand" ""))
|
||||||
(parallel [(call (mem:SI (match_operand:SI 0 "address_operand" ""))
|
(use (match_operand 1 "" ""))]
|
||||||
(match_operand 1 "" ""))
|
|
||||||
(clobber (reg:SI 15))])]
|
|
||||||
""
|
""
|
||||||
"
|
"
|
||||||
{
|
{
|
||||||
|
rtx reg0 = gen_rtx (REG, SImode, 0);
|
||||||
|
rtx call_insn;
|
||||||
|
|
||||||
if (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != CONST_INT)
|
if (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != CONST_INT)
|
||||||
abort();
|
abort();
|
||||||
|
|
||||||
|
@ -1678,8 +1679,7 @@
|
||||||
(char *) alloca (strlen (XSTR (operands[0], 0)) + 2);
|
(char *) alloca (strlen (XSTR (operands[0], 0)) + 2);
|
||||||
|
|
||||||
/* Copy the data area address to r0. */
|
/* Copy the data area address to r0. */
|
||||||
emit_move_insn (gen_rtx (REG, SImode, 0),
|
emit_move_insn (reg0, force_reg (SImode, operands[0]));
|
||||||
force_reg (SImode, operands[0]));
|
|
||||||
strcpy (real_fcnname, \".\");
|
strcpy (real_fcnname, \".\");
|
||||||
strcat (real_fcnname, XSTR (operands[0], 0));
|
strcat (real_fcnname, XSTR (operands[0], 0));
|
||||||
operands[0] = get_symref (real_fcnname);
|
operands[0] = get_symref (real_fcnname);
|
||||||
|
@ -1688,15 +1688,18 @@
|
||||||
{
|
{
|
||||||
rtx data_access;
|
rtx data_access;
|
||||||
|
|
||||||
emit_move_insn (gen_rtx (REG, SImode, 0),
|
emit_move_insn (reg0, force_reg (SImode, operands[0]));
|
||||||
force_reg (SImode, operands[0]));
|
|
||||||
data_access = gen_rtx (MEM, SImode, operands[0]);
|
data_access = gen_rtx (MEM, SImode, operands[0]);
|
||||||
RTX_UNCHANGING_P (data_access) = 1;
|
RTX_UNCHANGING_P (data_access) = 1;
|
||||||
operands[0] = copy_to_reg (data_access);
|
operands[0] = copy_to_reg (data_access);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
call_insn = emit_call_insn (gen_call_internal (operands[0], operands[1]));
|
||||||
|
use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), reg0);
|
||||||
|
DONE;
|
||||||
}")
|
}")
|
||||||
|
|
||||||
(define_insn ""
|
(define_insn "call_internal"
|
||||||
[(call (mem:SI (match_operand:SI 0 "register_operand" "b"))
|
[(call (mem:SI (match_operand:SI 0 "register_operand" "b"))
|
||||||
(match_operand 1 "" "g"))
|
(match_operand 1 "" "g"))
|
||||||
(clobber (reg:SI 15))]
|
(clobber (reg:SI 15))]
|
||||||
|
@ -1715,14 +1718,15 @@
|
||||||
|
|
||||||
;; Call a function and return a value.
|
;; Call a function and return a value.
|
||||||
(define_expand "call_value"
|
(define_expand "call_value"
|
||||||
[(use (reg:SI 0))
|
[(use (match_operand 0 "" ""))
|
||||||
(parallel [(set (match_operand 0 "" "=fg")
|
(use (match_operand:SI 1 "address_operand" ""))
|
||||||
(call (mem:SI (match_operand:SI 1 "address_operand" ""))
|
(use (match_operand 2 "" ""))]
|
||||||
(match_operand 2 "" "")))
|
|
||||||
(clobber (reg:SI 15))])]
|
|
||||||
""
|
""
|
||||||
"
|
"
|
||||||
{
|
{
|
||||||
|
rtx reg0 = gen_rtx (REG, SImode, 0);
|
||||||
|
rtx call_insn;
|
||||||
|
|
||||||
if (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != CONST_INT)
|
if (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != CONST_INT)
|
||||||
abort();
|
abort();
|
||||||
|
|
||||||
|
@ -1734,8 +1738,7 @@
|
||||||
(char *) alloca (strlen (XSTR (operands[1], 0)) + 2);
|
(char *) alloca (strlen (XSTR (operands[1], 0)) + 2);
|
||||||
|
|
||||||
/* Copy the data area address to r0. */
|
/* Copy the data area address to r0. */
|
||||||
emit_move_insn (gen_rtx (REG, SImode, 0),
|
emit_move_insn (reg0,force_reg (SImode, operands[1]));
|
||||||
force_reg (SImode, operands[1]));
|
|
||||||
strcpy (real_fcnname, \".\");
|
strcpy (real_fcnname, \".\");
|
||||||
strcat (real_fcnname, XSTR (operands[1], 0));
|
strcat (real_fcnname, XSTR (operands[1], 0));
|
||||||
operands[1] = get_symref (real_fcnname);
|
operands[1] = get_symref (real_fcnname);
|
||||||
|
@ -1744,15 +1747,20 @@
|
||||||
{
|
{
|
||||||
rtx data_access;
|
rtx data_access;
|
||||||
|
|
||||||
emit_move_insn (gen_rtx (REG, SImode, 0),
|
emit_move_insn (reg0,force_reg (SImode, operands[1]));
|
||||||
force_reg (SImode, operands[1]));
|
|
||||||
data_access = gen_rtx (MEM, SImode, operands[1]);
|
data_access = gen_rtx (MEM, SImode, operands[1]);
|
||||||
RTX_UNCHANGING_P (data_access) = 1;
|
RTX_UNCHANGING_P (data_access) = 1;
|
||||||
operands[1] = copy_to_reg (data_access);
|
operands[1] = copy_to_reg (data_access);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
call_insn = emit_call_insn (gen_call_value_internal (operands[0],
|
||||||
|
operands[1],
|
||||||
|
operands[2]));
|
||||||
|
use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), reg0);
|
||||||
|
DONE;
|
||||||
}")
|
}")
|
||||||
|
|
||||||
(define_insn ""
|
(define_insn "call_value_internal"
|
||||||
[(set (match_operand 0 "" "=fg")
|
[(set (match_operand 0 "" "=fg")
|
||||||
(call (mem:SI (match_operand:SI 1 "register_operand" "b"))
|
(call (mem:SI (match_operand:SI 1 "register_operand" "b"))
|
||||||
(match_operand 2 "" "g")))
|
(match_operand 2 "" "g")))
|
||||||
|
|
Loading…
Reference in New Issue