Commit ebb1b59a by Bernd Schmidt Committed by Bernd Schmidt

Bring back equal forms for libcalls

From-SVN: r36469
parent e85427f9
2000-09-17 Bernd Schmidt <bernds@redhat.co.uk>
* expr.h (emit_library_call, emit_library_call_value): Delete
declarations.
* rtl.h (enum libcall_type): New.
(emit_library_call, emit_library_call_value): Change fn_type arg to
be of type enum libcall_type.
* calls.c: Likewise for the function definitions. Several callers
throughout changed to use the new enumeration appropriately.
(emit_library_call_value_1): Likewise. Put back code to make libcall
blocks of equal form, but only use it for the two new higher
enumeration values.
2000-09-16 Mark Mitchell <mark@codesourcery.com> 2000-09-16 Mark Mitchell <mark@codesourcery.com>
Convert the C front-end to use function-at-a-time mode. Convert the C front-end to use function-at-a-time mode.
......
...@@ -1388,8 +1388,8 @@ expand_builtin_strlen (exp, target, mode) ...@@ -1388,8 +1388,8 @@ expand_builtin_strlen (exp, target, mode)
/* Check the string is readable and has an end. */ /* Check the string is readable and has an end. */
if (current_function_check_memory_usage) if (current_function_check_memory_usage)
emit_library_call (chkr_check_str_libfunc, 1, VOIDmode, 2, emit_library_call (chkr_check_str_libfunc, LCT_CONST_MAKE_BLOCK,
src_reg, Pmode, VOIDmode, 2, src_reg, Pmode,
GEN_INT (MEMORY_USE_RO), GEN_INT (MEMORY_USE_RO),
TYPE_MODE (integer_type_node)); TYPE_MODE (integer_type_node));
...@@ -1468,8 +1468,8 @@ expand_builtin_memcpy (arglist) ...@@ -1468,8 +1468,8 @@ expand_builtin_memcpy (arglist)
/* Just copy the rights of SRC to the rights of DEST. */ /* Just copy the rights of SRC to the rights of DEST. */
if (current_function_check_memory_usage) if (current_function_check_memory_usage)
emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_copy_bitmap_libfunc, LCT_CONST_MAKE_BLOCK,
XEXP (dest_mem, 0), Pmode, VOIDmode, 3, XEXP (dest_mem, 0), Pmode,
XEXP (src_mem, 0), Pmode, XEXP (src_mem, 0), Pmode,
len_rtx, TYPE_MODE (sizetype)); len_rtx, TYPE_MODE (sizetype));
...@@ -1574,8 +1574,8 @@ expand_builtin_memset (exp) ...@@ -1574,8 +1574,8 @@ expand_builtin_memset (exp)
/* Just check DST is writable and mark it as readable. */ /* Just check DST is writable and mark it as readable. */
if (current_function_check_memory_usage) if (current_function_check_memory_usage)
emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_check_addr_libfunc, LCT_CONST_MAKE_BLOCK,
XEXP (dest_mem, 0), Pmode, VOIDmode, 3, XEXP (dest_mem, 0), Pmode,
len_rtx, TYPE_MODE (sizetype), len_rtx, TYPE_MODE (sizetype),
GEN_INT (MEMORY_USE_WO), GEN_INT (MEMORY_USE_WO),
TYPE_MODE (integer_type_node)); TYPE_MODE (integer_type_node));
...@@ -1687,7 +1687,7 @@ expand_builtin_memcmp (exp, arglist, target) ...@@ -1687,7 +1687,7 @@ expand_builtin_memcmp (exp, arglist, target)
if (insn) if (insn)
emit_insn (insn); emit_insn (insn);
else else
emit_library_call_value (memcmp_libfunc, result, 2, emit_library_call_value (memcmp_libfunc, result, LCT_PURE_MAKE_BLOCK,
TYPE_MODE (integer_type_node), 3, TYPE_MODE (integer_type_node), 3,
XEXP (arg1_rtx, 0), Pmode, XEXP (arg1_rtx, 0), Pmode,
XEXP (arg2_rtx, 0), Pmode, XEXP (arg2_rtx, 0), Pmode,
......
...@@ -219,7 +219,8 @@ static rtx rtx_for_function_call PARAMS ((tree, tree)); ...@@ -219,7 +219,8 @@ static rtx rtx_for_function_call PARAMS ((tree, tree));
static void load_register_parameters PARAMS ((struct arg_data *, static void load_register_parameters PARAMS ((struct arg_data *,
int, rtx *, int)); int, rtx *, int));
static int libfunc_nothrow PARAMS ((rtx)); static int libfunc_nothrow PARAMS ((rtx));
static rtx emit_library_call_value_1 PARAMS ((int, rtx, rtx, int, static rtx emit_library_call_value_1 PARAMS ((int, rtx, rtx,
enum libcall_type,
enum machine_mode, enum machine_mode,
int, va_list)); int, va_list));
static int special_function_p PARAMS ((tree, int)); static int special_function_p PARAMS ((tree, int));
...@@ -1678,9 +1679,8 @@ rtx_for_function_call (fndecl, exp) ...@@ -1678,9 +1679,8 @@ rtx_for_function_call (fndecl, exp)
that this seems safer. */ that this seems safer. */
funaddr = convert_memory_address (Pmode, funexp); funaddr = convert_memory_address (Pmode, funexp);
#endif #endif
emit_library_call (chkr_check_exec_libfunc, 1, emit_library_call (chkr_check_exec_libfunc, LCT_CONST_MAKE_BLOCK,
VOIDmode, 1, VOIDmode, 1, funaddr, Pmode);
funaddr, Pmode);
} }
emit_queue (); emit_queue ();
} }
...@@ -3026,7 +3026,7 @@ expand_call (exp, target, ignore) ...@@ -3026,7 +3026,7 @@ expand_call (exp, target, ignore)
/* Mark the memory for the aggregate as write-only. */ /* Mark the memory for the aggregate as write-only. */
if (current_function_check_memory_usage) if (current_function_check_memory_usage)
emit_library_call (chkr_set_right_libfunc, 1, emit_library_call (chkr_set_right_libfunc, LCT_CONST_MAKE_BLOCK,
VOIDmode, 3, VOIDmode, 3,
structure_value_addr, ptr_mode, structure_value_addr, ptr_mode,
GEN_INT (struct_value_size), GEN_INT (struct_value_size),
...@@ -3465,7 +3465,7 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p) ...@@ -3465,7 +3465,7 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
int retval; int retval;
rtx orgfun; rtx orgfun;
rtx value; rtx value;
int fn_type; enum libcall_type fn_type;
enum machine_mode outmode; enum machine_mode outmode;
int nargs; int nargs;
va_list p; va_list p;
...@@ -3521,9 +3521,9 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p) ...@@ -3521,9 +3521,9 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
#endif #endif
#endif #endif
if (fn_type == 1) if (fn_type == LCT_CONST_MAKE_BLOCK)
flags |= ECF_CONST; flags |= ECF_CONST;
else if (fn_type == 2) else if (fn_type == LCT_PURE_MAKE_BLOCK)
flags |= ECF_PURE; flags |= ECF_PURE;
fun = orgfun; fun = orgfun;
...@@ -3580,6 +3580,11 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p) ...@@ -3580,6 +3580,11 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
count = 0; count = 0;
/* Now we are about to start emitting insns that can be deleted
if a libcall is deleted. */
if (flags & (ECF_CONST | ECF_PURE))
start_sequence ();
push_temp_slots (); push_temp_slots ();
/* If there's a structure value address to be passed, /* If there's a structure value address to be passed,
...@@ -4017,6 +4022,45 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p) ...@@ -4017,6 +4022,45 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
/* Now restore inhibit_defer_pop to its actual original value. */ /* Now restore inhibit_defer_pop to its actual original value. */
OK_DEFER_POP; OK_DEFER_POP;
/* If call is cse'able, make appropriate pair of reg-notes around it.
Test valreg so we don't crash; may safely ignore `const'
if return type is void. Disable for PARALLEL return values, because
we have no way to move such values into a pseudo register. */
if ((flags & (ECF_CONST | ECF_PURE))
&& valreg != 0 && GET_CODE (valreg) != PARALLEL)
{
rtx note = 0;
rtx temp = gen_reg_rtx (GET_MODE (valreg));
rtx insns;
int i;
/* Construct an "equal form" for the value which mentions all the
arguments in order as well as the function name. */
for (i = 0; i < nargs; i++)
note = gen_rtx_EXPR_LIST (VOIDmode, argvec[i].value, note);
note = gen_rtx_EXPR_LIST (VOIDmode, fun, note);
insns = get_insns ();
end_sequence ();
if (flags & ECF_PURE)
note = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_USE (VOIDmode,
gen_rtx_MEM (BLKmode,
gen_rtx_SCRATCH (VOIDmode))), note);
emit_libcall_block (insns, temp, valreg, note);
valreg = temp;
}
else if (flags & (ECF_CONST | ECF_PURE))
{
/* Otherwise, just write out the sequence without a note. */
rtx insns = get_insns ();
end_sequence ();
emit_insns (insns);
}
pop_temp_slots (); pop_temp_slots ();
/* Copy the value to the right place. */ /* Copy the value to the right place. */
...@@ -4098,8 +4142,8 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p) ...@@ -4098,8 +4142,8 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
(use (memory (scratch)). */ (use (memory (scratch)). */
void void
emit_library_call VPARAMS((rtx orgfun, int fn_type, enum machine_mode outmode, emit_library_call VPARAMS((rtx orgfun, enum libcall_type fn_type,
int nargs, ...)) enum machine_mode outmode, int nargs, ...))
{ {
#ifndef ANSI_PROTOTYPES #ifndef ANSI_PROTOTYPES
rtx orgfun; rtx orgfun;
...@@ -4132,7 +4176,8 @@ emit_library_call VPARAMS((rtx orgfun, int fn_type, enum machine_mode outmode, ...@@ -4132,7 +4176,8 @@ emit_library_call VPARAMS((rtx orgfun, int fn_type, enum machine_mode outmode,
If VALUE is nonzero, VALUE is returned. */ If VALUE is nonzero, VALUE is returned. */
rtx rtx
emit_library_call_value VPARAMS((rtx orgfun, rtx value, int fn_type, emit_library_call_value VPARAMS((rtx orgfun, rtx value,
enum libcall_type fn_type,
enum machine_mode outmode, int nargs, ...)) enum machine_mode outmode, int nargs, ...))
{ {
#ifndef ANSI_PROTOTYPES #ifndef ANSI_PROTOTYPES
...@@ -4376,8 +4421,8 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space) ...@@ -4376,8 +4421,8 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
/* If the value is already in the stack slot, we are done. */ /* If the value is already in the stack slot, we are done. */
if (current_function_check_memory_usage && GET_CODE (arg->stack) == MEM) if (current_function_check_memory_usage && GET_CODE (arg->stack) == MEM)
{ {
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_set_right_libfunc, LCT_CONST_MAKE_BLOCK,
XEXP (arg->stack, 0), Pmode, VOIDmode, 3, XEXP (arg->stack, 0), Pmode,
ARGS_SIZE_RTX (arg->size), ARGS_SIZE_RTX (arg->size),
TYPE_MODE (sizetype), TYPE_MODE (sizetype),
GEN_INT (MEMORY_USE_RW), GEN_INT (MEMORY_USE_RW),
......
...@@ -1363,7 +1363,7 @@ start_dynamic_handler () ...@@ -1363,7 +1363,7 @@ start_dynamic_handler ()
buf = plus_constant (XEXP (arg, 0), GET_MODE_SIZE (Pmode)*2); buf = plus_constant (XEXP (arg, 0), GET_MODE_SIZE (Pmode)*2);
#ifdef DONT_USE_BUILTIN_SETJMP #ifdef DONT_USE_BUILTIN_SETJMP
x = emit_library_call_value (setjmp_libfunc, NULL_RTX, 1, x = emit_library_call_value (setjmp_libfunc, NULL_RTX, LCT_CONST,
TYPE_MODE (integer_type_node), 1, TYPE_MODE (integer_type_node), 1,
buf, Pmode); buf, Pmode);
/* If we come back here for a catch, transfer control to the handler. */ /* If we come back here for a catch, transfer control to the handler. */
...@@ -1761,7 +1761,8 @@ start_catch_handler (rtime) ...@@ -1761,7 +1761,8 @@ start_catch_handler (rtime)
/* Now issue the call, and branch around handler if needed */ /* Now issue the call, and branch around handler if needed */
call_rtx = emit_library_call_value (eh_rtime_match_libfunc, NULL_RTX, call_rtx = emit_library_call_value (eh_rtime_match_libfunc, NULL_RTX,
0, TYPE_MODE (integer_type_node), LCT_NORMAL,
TYPE_MODE (integer_type_node),
1, rtime_address, Pmode); 1, rtime_address, Pmode);
/* Did the function return true? */ /* Did the function return true? */
......
...@@ -812,7 +812,7 @@ convert_move (to, from, unsignedp) ...@@ -812,7 +812,7 @@ convert_move (to, from, unsignedp)
abort (); abort ();
start_sequence (); start_sequence ();
value = emit_library_call_value (libcall, NULL_RTX, 1, to_mode, value = emit_library_call_value (libcall, NULL_RTX, LCT_CONST, to_mode,
1, from, from_mode); 1, from, from_mode);
insns = get_insns (); insns = get_insns ();
end_sequence (); end_sequence ();
...@@ -1785,7 +1785,7 @@ emit_block_move (x, y, size, align) ...@@ -1785,7 +1785,7 @@ emit_block_move (x, y, size, align)
retval = expand_expr (call_expr, NULL_RTX, VOIDmode, 0); retval = expand_expr (call_expr, NULL_RTX, VOIDmode, 0);
#else #else
emit_library_call (bcopy_libfunc, 0, emit_library_call (bcopy_libfunc, LCT_NORMAL,
VOIDmode, 3, y, Pmode, x, Pmode, VOIDmode, 3, y, Pmode, x, Pmode,
convert_to_mode (TYPE_MODE (integer_type_node), size, convert_to_mode (TYPE_MODE (integer_type_node), size,
TREE_UNSIGNED (integer_type_node)), TREE_UNSIGNED (integer_type_node)),
...@@ -2556,7 +2556,7 @@ clear_storage (object, size, align) ...@@ -2556,7 +2556,7 @@ clear_storage (object, size, align)
retval = expand_expr (call_expr, NULL_RTX, VOIDmode, 0); retval = expand_expr (call_expr, NULL_RTX, VOIDmode, 0);
#else #else
emit_library_call (bzero_libfunc, 0, emit_library_call (bzero_libfunc, LCT_NORMAL,
VOIDmode, 2, object, Pmode, size, VOIDmode, 2, object, Pmode, size,
TYPE_MODE (integer_type_node)); TYPE_MODE (integer_type_node));
#endif #endif
...@@ -3060,15 +3060,15 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, ...@@ -3060,15 +3060,15 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra,
in_check_memory_usage = 1; in_check_memory_usage = 1;
temp = get_push_address (INTVAL (size) - used); temp = get_push_address (INTVAL (size) - used);
if (GET_CODE (x) == MEM && type && AGGREGATE_TYPE_P (type)) if (GET_CODE (x) == MEM && type && AGGREGATE_TYPE_P (type))
emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_copy_bitmap_libfunc,
temp, Pmode, LCT_CONST_MAKE_BLOCK, VOIDmode, 3, temp,
XEXP (xinner, 0), Pmode, Pmode, XEXP (xinner, 0), Pmode,
GEN_INT (INTVAL (size) - used), GEN_INT (INTVAL (size) - used),
TYPE_MODE (sizetype)); TYPE_MODE (sizetype));
else else
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_set_right_libfunc,
temp, Pmode, LCT_CONST_MAKE_BLOCK, VOIDmode, 3, temp,
GEN_INT (INTVAL (size) - used), Pmode, GEN_INT (INTVAL (size) - used),
TYPE_MODE (sizetype), TYPE_MODE (sizetype),
GEN_INT (MEMORY_USE_RW), GEN_INT (MEMORY_USE_RW),
TYPE_MODE (integer_type_node)); TYPE_MODE (integer_type_node));
...@@ -3117,12 +3117,14 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, ...@@ -3117,12 +3117,14 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra,
in_check_memory_usage = 1; in_check_memory_usage = 1;
target = copy_to_reg (temp); target = copy_to_reg (temp);
if (GET_CODE (x) == MEM && type && AGGREGATE_TYPE_P (type)) if (GET_CODE (x) == MEM && type && AGGREGATE_TYPE_P (type))
emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_copy_bitmap_libfunc,
LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
target, Pmode, target, Pmode,
XEXP (xinner, 0), Pmode, XEXP (xinner, 0), Pmode,
size, TYPE_MODE (sizetype)); size, TYPE_MODE (sizetype));
else else
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_set_right_libfunc,
LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
target, Pmode, target, Pmode,
size, TYPE_MODE (sizetype), size, TYPE_MODE (sizetype),
GEN_INT (MEMORY_USE_RW), GEN_INT (MEMORY_USE_RW),
...@@ -3209,13 +3211,13 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, ...@@ -3209,13 +3211,13 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra,
to force it to pop the bcopy-arguments right away. */ to force it to pop the bcopy-arguments right away. */
NO_DEFER_POP; NO_DEFER_POP;
#ifdef TARGET_MEM_FUNCTIONS #ifdef TARGET_MEM_FUNCTIONS
emit_library_call (memcpy_libfunc, 0, emit_library_call (memcpy_libfunc, LCT_NORMAL,
VOIDmode, 3, temp, Pmode, XEXP (xinner, 0), Pmode, VOIDmode, 3, temp, Pmode, XEXP (xinner, 0), Pmode,
convert_to_mode (TYPE_MODE (sizetype), convert_to_mode (TYPE_MODE (sizetype),
size, TREE_UNSIGNED (sizetype)), size, TREE_UNSIGNED (sizetype)),
TYPE_MODE (sizetype)); TYPE_MODE (sizetype));
#else #else
emit_library_call (bcopy_libfunc, 0, emit_library_call (bcopy_libfunc, LCT_NORMAL,
VOIDmode, 3, XEXP (xinner, 0), Pmode, temp, Pmode, VOIDmode, 3, XEXP (xinner, 0), Pmode, temp, Pmode,
convert_to_mode (TYPE_MODE (integer_type_node), convert_to_mode (TYPE_MODE (integer_type_node),
size, size,
...@@ -3339,15 +3341,15 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, ...@@ -3339,15 +3341,15 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra,
target = get_push_address (GET_MODE_SIZE (mode)); target = get_push_address (GET_MODE_SIZE (mode));
if (GET_CODE (x) == MEM && type && AGGREGATE_TYPE_P (type)) if (GET_CODE (x) == MEM && type && AGGREGATE_TYPE_P (type))
emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_copy_bitmap_libfunc,
target, Pmode, LCT_CONST_MAKE_BLOCK, VOIDmode, 3, target,
XEXP (x, 0), Pmode, Pmode, XEXP (x, 0), Pmode,
GEN_INT (GET_MODE_SIZE (mode)), GEN_INT (GET_MODE_SIZE (mode)),
TYPE_MODE (sizetype)); TYPE_MODE (sizetype));
else else
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_set_right_libfunc,
target, Pmode, LCT_CONST_MAKE_BLOCK, VOIDmode, 3, target,
GEN_INT (GET_MODE_SIZE (mode)), Pmode, GEN_INT (GET_MODE_SIZE (mode)),
TYPE_MODE (sizetype), TYPE_MODE (sizetype),
GEN_INT (MEMORY_USE_RW), GEN_INT (MEMORY_USE_RW),
TYPE_MODE (integer_type_node)); TYPE_MODE (integer_type_node));
...@@ -3548,8 +3550,8 @@ expand_assignment (to, from, want_value, suggest_reg) ...@@ -3548,8 +3550,8 @@ expand_assignment (to, from, want_value, suggest_reg)
/* Check the access right of the pointer. */ /* Check the access right of the pointer. */
in_check_memory_usage = 1; in_check_memory_usage = 1;
if (size) if (size)
emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_check_addr_libfunc, LCT_CONST_MAKE_BLOCK,
to_addr, Pmode, VOIDmode, 3, to_addr, Pmode,
GEN_INT (size), TYPE_MODE (sizetype), GEN_INT (size), TYPE_MODE (sizetype),
GEN_INT (MEMORY_USE_WO), GEN_INT (MEMORY_USE_WO),
TYPE_MODE (integer_type_node)); TYPE_MODE (integer_type_node));
...@@ -3692,22 +3694,22 @@ expand_assignment (to, from, want_value, suggest_reg) ...@@ -3692,22 +3694,22 @@ expand_assignment (to, from, want_value, suggest_reg)
/* Copy the rights of the bitmap. */ /* Copy the rights of the bitmap. */
if (current_function_check_memory_usage) if (current_function_check_memory_usage)
emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_copy_bitmap_libfunc, LCT_CONST_MAKE_BLOCK,
XEXP (to_rtx, 0), Pmode, VOIDmode, 3, XEXP (to_rtx, 0), Pmode,
XEXP (from_rtx, 0), Pmode, XEXP (from_rtx, 0), Pmode,
convert_to_mode (TYPE_MODE (sizetype), convert_to_mode (TYPE_MODE (sizetype),
size, TREE_UNSIGNED (sizetype)), size, TREE_UNSIGNED (sizetype)),
TYPE_MODE (sizetype)); TYPE_MODE (sizetype));
#ifdef TARGET_MEM_FUNCTIONS #ifdef TARGET_MEM_FUNCTIONS
emit_library_call (memcpy_libfunc, 0, emit_library_call (memcpy_libfunc, LCT_NORMAL,
VOIDmode, 3, XEXP (to_rtx, 0), Pmode, VOIDmode, 3, XEXP (to_rtx, 0), Pmode,
XEXP (from_rtx, 0), Pmode, XEXP (from_rtx, 0), Pmode,
convert_to_mode (TYPE_MODE (sizetype), convert_to_mode (TYPE_MODE (sizetype),
size, TREE_UNSIGNED (sizetype)), size, TREE_UNSIGNED (sizetype)),
TYPE_MODE (sizetype)); TYPE_MODE (sizetype));
#else #else
emit_library_call (bcopy_libfunc, 0, emit_library_call (bcopy_libfunc, LCT_NORMAL,
VOIDmode, 3, XEXP (from_rtx, 0), Pmode, VOIDmode, 3, XEXP (from_rtx, 0), Pmode,
XEXP (to_rtx, 0), Pmode, XEXP (to_rtx, 0), Pmode,
convert_to_mode (TYPE_MODE (integer_type_node), convert_to_mode (TYPE_MODE (integer_type_node),
...@@ -3932,13 +3934,13 @@ store_expr (exp, target, want_value) ...@@ -3932,13 +3934,13 @@ store_expr (exp, target, want_value)
{ {
in_check_memory_usage = 1; in_check_memory_usage = 1;
if (GET_CODE (temp) == MEM) if (GET_CODE (temp) == MEM)
emit_library_call (chkr_copy_bitmap_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_copy_bitmap_libfunc, LCT_CONST_MAKE_BLOCK,
XEXP (target, 0), Pmode, VOIDmode, 3, XEXP (target, 0), Pmode,
XEXP (temp, 0), Pmode, XEXP (temp, 0), Pmode,
expr_size (exp), TYPE_MODE (sizetype)); expr_size (exp), TYPE_MODE (sizetype));
else else
emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_check_addr_libfunc, LCT_CONST_MAKE_BLOCK,
XEXP (target, 0), Pmode, VOIDmode, 3, XEXP (target, 0), Pmode,
expr_size (exp), TYPE_MODE (sizetype), expr_size (exp), TYPE_MODE (sizetype),
GEN_INT (MEMORY_USE_WO), GEN_INT (MEMORY_USE_WO),
TYPE_MODE (integer_type_node)); TYPE_MODE (integer_type_node));
...@@ -4052,7 +4054,8 @@ store_expr (exp, target, want_value) ...@@ -4052,7 +4054,8 @@ store_expr (exp, target, want_value)
/* Be sure we can write on ADDR. */ /* Be sure we can write on ADDR. */
in_check_memory_usage = 1; in_check_memory_usage = 1;
if (current_function_check_memory_usage) if (current_function_check_memory_usage)
emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_check_addr_libfunc,
LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
addr, Pmode, addr, Pmode,
size, TYPE_MODE (sizetype), size, TYPE_MODE (sizetype),
GEN_INT (MEMORY_USE_WO), GEN_INT (MEMORY_USE_WO),
...@@ -4795,7 +4798,7 @@ store_constructor (exp, target, align, cleared, size) ...@@ -4795,7 +4798,7 @@ store_constructor (exp, target, align, cleared, size)
&& (startb = TREE_INT_CST_LOW (startbit)) % BITS_PER_UNIT == 0 && (startb = TREE_INT_CST_LOW (startbit)) % BITS_PER_UNIT == 0
&& (endb = TREE_INT_CST_LOW (endbit) + 1) % BITS_PER_UNIT == 0) && (endb = TREE_INT_CST_LOW (endbit) + 1) % BITS_PER_UNIT == 0)
{ {
emit_library_call (memset_libfunc, 0, emit_library_call (memset_libfunc, LCT_NORMAL,
VOIDmode, 3, VOIDmode, 3,
plus_constant (XEXP (targetx, 0), plus_constant (XEXP (targetx, 0),
startb / BITS_PER_UNIT), startb / BITS_PER_UNIT),
...@@ -4807,8 +4810,8 @@ store_constructor (exp, target, align, cleared, size) ...@@ -4807,8 +4810,8 @@ store_constructor (exp, target, align, cleared, size)
else else
#endif #endif
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__setbits"), emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__setbits"),
0, VOIDmode, 4, XEXP (targetx, 0), Pmode, LCT_NORMAL, VOIDmode, 4, XEXP (targetx, 0),
bitlength_rtx, TYPE_MODE (sizetype), Pmode, bitlength_rtx, TYPE_MODE (sizetype),
startbit_rtx, TYPE_MODE (sizetype), startbit_rtx, TYPE_MODE (sizetype),
endbit_rtx, TYPE_MODE (sizetype)); endbit_rtx, TYPE_MODE (sizetype));
...@@ -6006,7 +6009,8 @@ expand_expr (exp, target, tmode, modifier) ...@@ -6006,7 +6009,8 @@ expand_expr (exp, target, tmode, modifier)
in_check_memory_usage = 1; in_check_memory_usage = 1;
if (memory_usage != MEMORY_USE_DONT) if (memory_usage != MEMORY_USE_DONT)
emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_check_addr_libfunc,
LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
XEXP (DECL_RTL (exp), 0), Pmode, XEXP (DECL_RTL (exp), 0), Pmode,
GEN_INT (int_size_in_bytes (type)), GEN_INT (int_size_in_bytes (type)),
TYPE_MODE (sizetype), TYPE_MODE (sizetype),
...@@ -6524,9 +6528,9 @@ expand_expr (exp, target, tmode, modifier) ...@@ -6524,9 +6528,9 @@ expand_expr (exp, target, tmode, modifier)
if (memory_usage != MEMORY_USE_DONT) if (memory_usage != MEMORY_USE_DONT)
{ {
in_check_memory_usage = 1; in_check_memory_usage = 1;
emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_check_addr_libfunc,
op0, Pmode, LCT_CONST_MAKE_BLOCK, VOIDmode, 3, op0,
GEN_INT (int_size_in_bytes (type)), Pmode, GEN_INT (int_size_in_bytes (type)),
TYPE_MODE (sizetype), TYPE_MODE (sizetype),
GEN_INT (memory_usage), GEN_INT (memory_usage),
TYPE_MODE (integer_type_node)); TYPE_MODE (integer_type_node));
...@@ -6837,9 +6841,9 @@ expand_expr (exp, target, tmode, modifier) ...@@ -6837,9 +6841,9 @@ expand_expr (exp, target, tmode, modifier)
/* Check the access right of the pointer. */ /* Check the access right of the pointer. */
in_check_memory_usage = 1; in_check_memory_usage = 1;
if (size > BITS_PER_UNIT) if (size > BITS_PER_UNIT)
emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_check_addr_libfunc,
to, Pmode, LCT_CONST_MAKE_BLOCK, VOIDmode, 3, to,
GEN_INT (size / BITS_PER_UNIT), Pmode, GEN_INT (size / BITS_PER_UNIT),
TYPE_MODE (sizetype), TYPE_MODE (sizetype),
GEN_INT (memory_usage), GEN_INT (memory_usage),
TYPE_MODE (integer_type_node)); TYPE_MODE (integer_type_node));
...@@ -8805,7 +8809,8 @@ expand_expr_unaligned (exp, palign) ...@@ -8805,7 +8809,8 @@ expand_expr_unaligned (exp, palign)
/* Check the access right of the pointer. */ /* Check the access right of the pointer. */
in_check_memory_usage = 1; in_check_memory_usage = 1;
if (size > BITS_PER_UNIT) if (size > BITS_PER_UNIT)
emit_library_call (chkr_check_addr_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_check_addr_libfunc,
LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
to, ptr_mode, GEN_INT (size / BITS_PER_UNIT), to, ptr_mode, GEN_INT (size / BITS_PER_UNIT),
TYPE_MODE (sizetype), TYPE_MODE (sizetype),
GEN_INT (MEMORY_USE_RO), GEN_INT (MEMORY_USE_RO),
......
...@@ -1017,11 +1017,6 @@ extern void emit_push_insn PARAMS ((rtx, enum machine_mode, tree, rtx, ...@@ -1017,11 +1017,6 @@ extern void emit_push_insn PARAMS ((rtx, enum machine_mode, tree, rtx,
unsigned int, int, rtx, int, rtx, rtx, unsigned int, int, rtx, int, rtx, rtx,
int, rtx)); int, rtx));
/* Emit library call. */
extern void emit_library_call PARAMS ((rtx, int, enum machine_mode, int, ...));
extern rtx emit_library_call_value PARAMS ((rtx, rtx, int, enum machine_mode,
int, ...));
/* Expand an assignment that stores the value of FROM into TO. */ /* Expand an assignment that stores the value of FROM into TO. */
extern rtx expand_assignment PARAMS ((tree, tree, int, int)); extern rtx expand_assignment PARAMS ((tree, tree, int, int));
......
...@@ -1453,8 +1453,8 @@ put_var_into_stack (decl) ...@@ -1453,8 +1453,8 @@ put_var_into_stack (decl)
return; return;
if (current_function_check_memory_usage) if (current_function_check_memory_usage)
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_set_right_libfunc, LCT_CONST_MAKE_BLOCK, VOIDmode,
XEXP (reg, 0), Pmode, 3, XEXP (reg, 0), Pmode,
GEN_INT (GET_MODE_SIZE (GET_MODE (reg))), GEN_INT (GET_MODE_SIZE (GET_MODE (reg))),
TYPE_MODE (sizetype), TYPE_MODE (sizetype),
GEN_INT (MEMORY_USE_RW), GEN_INT (MEMORY_USE_RW),
...@@ -4684,7 +4684,8 @@ assign_parms (fndecl) ...@@ -4684,7 +4684,8 @@ assign_parms (fndecl)
store_expr (parm, copy, 0); store_expr (parm, copy, 0);
emit_move_insn (parmreg, XEXP (copy, 0)); emit_move_insn (parmreg, XEXP (copy, 0));
if (current_function_check_memory_usage) if (current_function_check_memory_usage)
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_set_right_libfunc,
LCT_CONST_MAKE_BLOCK, VOIDmode, 3,
XEXP (copy, 0), Pmode, XEXP (copy, 0), Pmode,
GEN_INT (int_size_in_bytes (type)), GEN_INT (int_size_in_bytes (type)),
TYPE_MODE (sizetype), TYPE_MODE (sizetype),
...@@ -4848,8 +4849,8 @@ assign_parms (fndecl) ...@@ -4848,8 +4849,8 @@ assign_parms (fndecl)
if (current_function_check_memory_usage) if (current_function_check_memory_usage)
{ {
push_to_sequence (conversion_insns); push_to_sequence (conversion_insns);
emit_library_call (chkr_set_right_libfunc, 1, VOIDmode, 3, emit_library_call (chkr_set_right_libfunc, LCT_CONST_MAKE_BLOCK,
XEXP (stack_parm, 0), Pmode, VOIDmode, 3, XEXP (stack_parm, 0), Pmode,
GEN_INT (GET_MODE_SIZE (GET_MODE GEN_INT (GET_MODE_SIZE (GET_MODE
(entry_parm))), (entry_parm))),
TYPE_MODE (sizetype), TYPE_MODE (sizetype),
......
...@@ -1692,7 +1692,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) ...@@ -1692,7 +1692,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
/* Pass 1 for NO_QUEUE so we don't lose any increments /* Pass 1 for NO_QUEUE so we don't lose any increments
if the libcall is cse'd or moved. */ if the libcall is cse'd or moved. */
value = emit_library_call_value (binoptab->handlers[(int) mode].libfunc, value = emit_library_call_value (binoptab->handlers[(int) mode].libfunc,
NULL_RTX, 1, mode, 2, NULL_RTX, LCT_CONST, mode, 2,
op0, mode, op1x, op1_mode); op0, mode, op1x, op1_mode);
insns = get_insns (); insns = get_insns ();
...@@ -2175,7 +2175,7 @@ expand_unop (mode, unoptab, op0, target, unsignedp) ...@@ -2175,7 +2175,7 @@ expand_unop (mode, unoptab, op0, target, unsignedp)
/* Pass 1 for NO_QUEUE so we don't lose any increments /* Pass 1 for NO_QUEUE so we don't lose any increments
if the libcall is cse'd or moved. */ if the libcall is cse'd or moved. */
value = emit_library_call_value (unoptab->handlers[(int) mode].libfunc, value = emit_library_call_value (unoptab->handlers[(int) mode].libfunc,
NULL_RTX, 1, mode, 1, op0, mode); NULL_RTX, LCT_CONST, mode, 1, op0, mode);
insns = get_insns (); insns = get_insns ();
end_sequence (); end_sequence ();
...@@ -2493,7 +2493,7 @@ expand_complex_abs (mode, op0, target, unsignedp) ...@@ -2493,7 +2493,7 @@ expand_complex_abs (mode, op0, target, unsignedp)
/* Pass 1 for NO_QUEUE so we don't lose any increments /* Pass 1 for NO_QUEUE so we don't lose any increments
if the libcall is cse'd or moved. */ if the libcall is cse'd or moved. */
value = emit_library_call_value (abs_optab->handlers[(int) mode].libfunc, value = emit_library_call_value (abs_optab->handlers[(int) mode].libfunc,
NULL_RTX, 1, submode, 1, op0, mode); NULL_RTX, LCT_CONST, submode, 1, op0, mode);
insns = get_insns (); insns = get_insns ();
end_sequence (); end_sequence ();
...@@ -3033,14 +3033,14 @@ prepare_cmp_insn (px, py, pcomparison, size, pmode, punsignedp, align, ...@@ -3033,14 +3033,14 @@ prepare_cmp_insn (px, py, pcomparison, size, pmode, punsignedp, align,
#endif #endif
{ {
#ifdef TARGET_MEM_FUNCTIONS #ifdef TARGET_MEM_FUNCTIONS
emit_library_call (memcmp_libfunc, 2, emit_library_call (memcmp_libfunc, LCT_PURE_MAKE_BLOCK,
TYPE_MODE (integer_type_node), 3, TYPE_MODE (integer_type_node), 3,
XEXP (x, 0), Pmode, XEXP (y, 0), Pmode, XEXP (x, 0), Pmode, XEXP (y, 0), Pmode,
convert_to_mode (TYPE_MODE (sizetype), size, convert_to_mode (TYPE_MODE (sizetype), size,
TREE_UNSIGNED (sizetype)), TREE_UNSIGNED (sizetype)),
TYPE_MODE (sizetype)); TYPE_MODE (sizetype));
#else #else
emit_library_call (bcmp_libfunc, 2, emit_library_call (bcmp_libfunc, LCT_PURE_MAKE_BLOCK,
TYPE_MODE (integer_type_node), 3, TYPE_MODE (integer_type_node), 3,
XEXP (x, 0), Pmode, XEXP (y, 0), Pmode, XEXP (x, 0), Pmode, XEXP (y, 0), Pmode,
convert_to_mode (TYPE_MODE (integer_type_node), convert_to_mode (TYPE_MODE (integer_type_node),
...@@ -3487,7 +3487,8 @@ prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp) ...@@ -3487,7 +3487,8 @@ prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp)
if (libfunc == 0) if (libfunc == 0)
abort (); abort ();
emit_library_call (libfunc, 1, word_mode, 2, x, mode, y, mode); emit_library_call (libfunc, LCT_CONST_MAKE_BLOCK, word_mode, 2, x, mode, y,
mode);
/* Immediately move the result of the libcall into a pseudo /* Immediately move the result of the libcall into a pseudo
register so reload doesn't clobber the value if it needs register so reload doesn't clobber the value if it needs
...@@ -4111,9 +4112,9 @@ expand_float (to, from, unsignedp) ...@@ -4111,9 +4112,9 @@ expand_float (to, from, unsignedp)
start_sequence (); start_sequence ();
value = emit_library_call_value (libfcn, NULL_RTX, 1, value = emit_library_call_value (libfcn, NULL_RTX, LCT_CONST,
GET_MODE (to), GET_MODE (to), 1, from,
1, from, GET_MODE (from)); GET_MODE (from));
insns = get_insns (); insns = get_insns ();
end_sequence (); end_sequence ();
...@@ -4345,9 +4346,9 @@ expand_fix (to, from, unsignedp) ...@@ -4345,9 +4346,9 @@ expand_fix (to, from, unsignedp)
start_sequence (); start_sequence ();
value = emit_library_call_value (libfcn, NULL_RTX, 1, GET_MODE (to), value = emit_library_call_value (libfcn, NULL_RTX, LCT_CONST,
GET_MODE (to), 1, from,
1, from, GET_MODE (from)); GET_MODE (from));
insns = get_insns (); insns = get_insns ();
end_sequence (); end_sequence ();
......
...@@ -1913,11 +1913,21 @@ extern void rrotate_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT, ...@@ -1913,11 +1913,21 @@ extern void rrotate_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
HOST_WIDE_INT *)); HOST_WIDE_INT *));
/* In calls.c */ /* In calls.c */
extern void emit_library_call PARAMS ((rtx, int, enum machine_mode, enum libcall_type
int, ...)); {
extern rtx emit_library_call_value PARAMS ((rtx, rtx, int, LCT_NORMAL = 0,
enum machine_mode, LCT_CONST = 1,
int, ...)); LCT_PURE = 2,
LCT_CONST_MAKE_BLOCK = 3,
LCT_PURE_MAKE_BLOCK = 4
};
extern void emit_library_call PARAMS ((rtx, enum libcall_type,
enum machine_mode, int,
...));
extern rtx emit_library_call_value PARAMS ((rtx, rtx, enum libcall_type,
enum machine_mode, int,
...));
/* In unroll.c */ /* In unroll.c */
extern int set_dominates_use PARAMS ((int, int, int, rtx, rtx)); extern int set_dominates_use PARAMS ((int, int, int, rtx, rtx));
......
...@@ -713,7 +713,7 @@ expand_computed_goto (exp) ...@@ -713,7 +713,7 @@ expand_computed_goto (exp)
emit_queue (); emit_queue ();
/* Be sure the function is executable. */ /* Be sure the function is executable. */
if (current_function_check_memory_usage) if (current_function_check_memory_usage)
emit_library_call (chkr_check_exec_libfunc, 1, emit_library_call (chkr_check_exec_libfunc, LCT_CONST_MAKE_BLOCK,
VOIDmode, 1, x, ptr_mode); VOIDmode, 1, x, ptr_mode);
do_pending_stack_adjust (); do_pending_stack_adjust ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment