PR82045 is about a bootstrap failure on sparc-sun-solaris2.11.
The problem was that we were passing the new machine_mode wrapper
classes through "..." to emit_library_call(_value), which then
read them back as ints instead.
The simplest fix seemed to be replace "..." with an array of
rtx_mode_ts, then provide wrappers for the common cases. This
bulks out rtl.h a bit, but it does make things a bit more typesafe.
2017-09-04 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
PR bootstrap/82045
* rtl.h (emit_library_call_value_1): Declare.
(emit_library_call): Replace declaration with a series of overloads.
Remove the parameter count argument.
(emit_library_call_value): Likewise.
* calls.c (emit_library_call_value_1): Make global. Replace varargs
with an "rtx_mode_t *".
(emit_library_call_value): Delete.
(emit_library_call): Likewise.
* asan.c (asan_emit_stack_protection): Update calls accordingly.
(asan_emit_allocas_unpoison): Likewise.
* builtins.c (expand_builtin_powi): Likewise.
(expand_asan_emit_allocas_unpoison): Likewise.
* cfgexpand.c (expand_main_function): Likewise.
* config/aarch64/aarch64.c (aarch64_trampoline_init): Likewise.
* config/aarch64/aarch64.h (PROFILE_HOOK): Likewise.
* config/alpha/alpha.c (alpha_trampoline_init): Likewise.
* config/arm/arm.c (arm_trampoline_init): Likewise.
(arm_call_tls_get_addr): Likewise.
(arm_expand_divmod_libfunc): Likewise.
* config/bfin/bfin.md (umulsi3_highpart): Likewise.
(smulsi3_highpart): Likewise.
* config/c6x/c6x.c (c6x_initialize_trampoline): Likewise.
(c6x_expand_compare): Likewise.
(c6x_expand_movmem): Likewise.
* config/frv/frv.c (frv_trampoline_init): Likewise.
* config/i386/i386.c (ix86_trampoline_init): Likewise.
(ix86_expand_divmod_libfunc): Likewise.
* config/ia64/ia64.c (ia64_expand_tls_address): Likewise.
(ia64_expand_compare): Likewise.
(ia64_profile_hook): Likewise.
* config/ia64/ia64.md (save_stack_nonlocal): Likewise.
(nonlocal_goto): Likewise.
(restore_stack_nonlocal): Likewise.
* config/m32r/m32r.c (block_move_call): Likewise.
(m32r_trampoline_init): Likewise.
* config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise.
* config/m68k/m68k.c (m68k_call_tls_get_addr): Likewise.
(m68k_call_m68k_read_tp): Likewise.
* config/microblaze/microblaze.c (microblaze_call_tls_get_addr)
(microblaze_expand_divide): Likewise.
* config/mips/mips.h (mips_args): Likewise.
* config/mips/sdemtk.h (mips_sync_icache): Likewise.
(MIPS_ICACHE_SYNC): Likewise.
* config/nios2/nios2.c (nios2_emit_expensive_div): Likewise.
(nios2_trampoline_init): Likewise.
* config/pa/pa.c (hppa_tls_call): Likewise.
(pa_trampoline_init): Likewise.
* config/pa/pa.md (canonicalize_funcptr_for_compare): Likewise.
* config/powerpcspe/powerpcspe.c (rs6000_legitimize_tls_address)
(expand_strn_compare): Likewise.
(rs6000_generate_compare): Likewise.
(rs6000_expand_float128_convert): Likewise.
(output_profile_hook): Likewise.
(rs6000_trampoline_init): Likewise.
* config/powerpcspe/powerpcspe.md (neg<mode>2): Likewise.
* config/riscv/riscv.h (PROFILE_HOOK): Likewise.
* config/rs6000/rs6000-string.c (expand_strn_compare): Likewise.
* config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Likewise.
(rs6000_generate_compare): Likewise.
(rs6000_expand_float128_convert): Likewise.
(output_profile_hook): Likewise.
(rs6000_trampoline_init): Likewise.
* config/rs6000/rs6000.md (neg<mode>2): Likewise.
* config/sh/sh.c (sh_trampoline_init): Likewise.
* config/sparc/sparc.c (emit_soft_tfmode_libcall): Likewise.
(sparc_emit_float_lib_cmp): Likewise.
(sparc32_initialize_trampoline): Likewise.
(sparc64_initialize_trampoline): Likewise.
(sparc_profile_hook): Likewise.
* config/spu/spu.c (ea_load_store): Likewise.
* config/spu/spu.md (floatunssidf2): Likewise.
* config/tilegx/tilegx.c (tilegx_trampoline_init): Likewise.
* config/tilepro/tilepro.c (tilepro_trampoline_init): Likewise.
* config/visium/visium.c (expand_block_move_4): Likewise.
(expand_block_move_2): Likewise.
(expand_block_move_1): Likewise.
(expand_block_set_4): Likewise.
(expand_block_set_2): Likewise.
(expand_block_set_1): Likewise.
(visium_trampoline_init): Likewise.
(visium_profile_hook): Likewise.
* config/xtensa/xtensa.c (xtensa_expand_nonlocal_goto): Likewise.
(xtensa_setup_frame_addresses): Likewise.
(xtensa_trampoline_init): Likewise.
* except.c (sjlj_emit_function_enter): Likewise.
(sjlj_emit_function_exit): Likewise.
* explow.c (allocate_dynamic_stack_space): Likewise.
(probe_stack_range): Likewise.
* expr.c (convert_mode_scalar): Likewise.
* optabs.c (expand_binop): Likewise.
(expand_twoval_binop_libfunc): Likewise.
(expand_unop): Likewise.
(prepare_cmp_insn): Likewise.
(prepare_float_lib_cmp): Likewise.
(expand_float): Likewise.
(expand_fix): Likewise.
(expand_fixed_convert): Likewise.
(maybe_emit_sync_lock_test_and_set): Likewise.
(expand_atomic_compare_and_swap): Likewise.
(expand_mem_thread_fence): Likewise.
(expand_atomic_fetch_op): Likewise.
From-SVN: r251637
+2017-09-04 Richard Sandiford <richard.sandiford@linaro.org>
+
+ PR bootstrap/82045
+ * rtl.h (emit_library_call_value_1): Declare.
+ (emit_library_call): Replace declaration with a series of overloads.
+ Remove the parameter count argument.
+ (emit_library_call_value): Likewise.
+ * calls.c (emit_library_call_value_1): Make global. Replace varargs
+ with an "rtx_mode_t *".
+ (emit_library_call_value): Delete.
+ (emit_library_call): Likewise.
+ * asan.c (asan_emit_stack_protection): Update calls accordingly.
+ (asan_emit_allocas_unpoison): Likewise.
+ * builtins.c (expand_builtin_powi): Likewise.
+ (expand_asan_emit_allocas_unpoison): Likewise.
+ * cfgexpand.c (expand_main_function): Likewise.
+ * config/aarch64/aarch64.c (aarch64_trampoline_init): Likewise.
+ * config/aarch64/aarch64.h (PROFILE_HOOK): Likewise.
+ * config/alpha/alpha.c (alpha_trampoline_init): Likewise.
+ * config/arm/arm.c (arm_trampoline_init): Likewise.
+ (arm_call_tls_get_addr): Likewise.
+ (arm_expand_divmod_libfunc): Likewise.
+ * config/bfin/bfin.md (umulsi3_highpart): Likewise.
+ (smulsi3_highpart): Likewise.
+ * config/c6x/c6x.c (c6x_initialize_trampoline): Likewise.
+ (c6x_expand_compare): Likewise.
+ (c6x_expand_movmem): Likewise.
+ * config/frv/frv.c (frv_trampoline_init): Likewise.
+ * config/i386/i386.c (ix86_trampoline_init): Likewise.
+ (ix86_expand_divmod_libfunc): Likewise.
+ * config/ia64/ia64.c (ia64_expand_tls_address): Likewise.
+ (ia64_expand_compare): Likewise.
+ (ia64_profile_hook): Likewise.
+ * config/ia64/ia64.md (save_stack_nonlocal): Likewise.
+ (nonlocal_goto): Likewise.
+ (restore_stack_nonlocal): Likewise.
+ * config/m32r/m32r.c (block_move_call): Likewise.
+ (m32r_trampoline_init): Likewise.
+ * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise.
+ * config/m68k/m68k.c (m68k_call_tls_get_addr): Likewise.
+ (m68k_call_m68k_read_tp): Likewise.
+ * config/microblaze/microblaze.c (microblaze_call_tls_get_addr)
+ (microblaze_expand_divide): Likewise.
+ * config/mips/mips.h (mips_args): Likewise.
+ * config/mips/sdemtk.h (mips_sync_icache): Likewise.
+ (MIPS_ICACHE_SYNC): Likewise.
+ * config/nios2/nios2.c (nios2_emit_expensive_div): Likewise.
+ (nios2_trampoline_init): Likewise.
+ * config/pa/pa.c (hppa_tls_call): Likewise.
+ (pa_trampoline_init): Likewise.
+ * config/pa/pa.md (canonicalize_funcptr_for_compare): Likewise.
+ * config/powerpcspe/powerpcspe.c (rs6000_legitimize_tls_address)
+ (expand_strn_compare): Likewise.
+ (rs6000_generate_compare): Likewise.
+ (rs6000_expand_float128_convert): Likewise.
+ (output_profile_hook): Likewise.
+ (rs6000_trampoline_init): Likewise.
+ * config/powerpcspe/powerpcspe.md (neg<mode>2): Likewise.
+ * config/riscv/riscv.h (PROFILE_HOOK): Likewise.
+ * config/rs6000/rs6000-string.c (expand_strn_compare): Likewise.
+ * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Likewise.
+ (rs6000_generate_compare): Likewise.
+ (rs6000_expand_float128_convert): Likewise.
+ (output_profile_hook): Likewise.
+ (rs6000_trampoline_init): Likewise.
+ * config/rs6000/rs6000.md (neg<mode>2): Likewise.
+ * config/sh/sh.c (sh_trampoline_init): Likewise.
+ * config/sparc/sparc.c (emit_soft_tfmode_libcall): Likewise.
+ (sparc_emit_float_lib_cmp): Likewise.
+ (sparc32_initialize_trampoline): Likewise.
+ (sparc64_initialize_trampoline): Likewise.
+ (sparc_profile_hook): Likewise.
+ * config/spu/spu.c (ea_load_store): Likewise.
+ * config/spu/spu.md (floatunssidf2): Likewise.
+ * config/tilegx/tilegx.c (tilegx_trampoline_init): Likewise.
+ * config/tilepro/tilepro.c (tilepro_trampoline_init): Likewise.
+ * config/visium/visium.c (expand_block_move_4): Likewise.
+ (expand_block_move_2): Likewise.
+ (expand_block_move_1): Likewise.
+ (expand_block_set_4): Likewise.
+ (expand_block_set_2): Likewise.
+ (expand_block_set_1): Likewise.
+ (visium_trampoline_init): Likewise.
+ (visium_profile_hook): Likewise.
+ * config/xtensa/xtensa.c (xtensa_expand_nonlocal_goto): Likewise.
+ (xtensa_setup_frame_addresses): Likewise.
+ (xtensa_trampoline_init): Likewise.
+ * except.c (sjlj_emit_function_enter): Likewise.
+ (sjlj_emit_function_exit): Likewise.
+ * explow.c (allocate_dynamic_stack_space): Likewise.
+ (probe_stack_range): Likewise.
+ * expr.c (convert_mode_scalar): Likewise.
+ * optabs.c (expand_binop): Likewise.
+ (expand_twoval_binop_libfunc): Likewise.
+ (expand_unop): Likewise.
+ (prepare_cmp_insn): Likewise.
+ (prepare_float_lib_cmp): Likewise.
+ (expand_float): Likewise.
+ (expand_fix): Likewise.
+ (expand_fixed_convert): Likewise.
+ (maybe_emit_sync_lock_test_and_set): Likewise.
+ (expand_atomic_compare_and_swap): Likewise.
+ (expand_mem_thread_fence): Likewise.
+ (expand_atomic_fetch_op): Likewise.
+
2017-09-03 Gerald Pfeifer <gerald@pfeifer.com>
* doc/generic.texi (OpenACC): Adjust URL.
snprintf (buf, sizeof buf, "__asan_stack_malloc_%d",
use_after_return_class);
ret = init_one_libfunc (buf);
- ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode, 1,
+ ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode,
GEN_INT (asan_frame_size
+ base_align_bias),
TYPE_MODE (pointer_sized_int_node));
ret = init_one_libfunc (buf);
rtx addr = convert_memory_address (ptr_mode, base);
rtx orig_addr = convert_memory_address (ptr_mode, orig_base);
- emit_library_call (ret, LCT_NORMAL, ptr_mode, 3, addr, ptr_mode,
+ emit_library_call (ret, LCT_NORMAL, ptr_mode, addr, ptr_mode,
GEN_INT (asan_frame_size + base_align_bias),
TYPE_MODE (pointer_sized_int_node),
orig_addr, ptr_mode);
rtx ret = init_one_libfunc ("__asan_allocas_unpoison");
top = convert_memory_address (ptr_mode, top);
bot = convert_memory_address (ptr_mode, bot);
- ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode, 2, top,
- ptr_mode, bot, ptr_mode);
+ ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode,
+ top, ptr_mode, bot, ptr_mode);
do_pending_stack_adjust ();
rtx_insn *insns = get_insns ();
op1 = convert_to_mode (mode2, op1, 0);
target = emit_library_call_value (optab_libfunc (powi_optab, mode),
- target, LCT_CONST, mode, 2,
+ target, LCT_CONST, mode,
op0, mode, op1, mode2);
return target;
rtx top = expand_expr (arg0, NULL_RTX, ptr_mode, EXPAND_NORMAL);
rtx bot = convert_memory_address (ptr_mode, virtual_stack_dynamic_rtx);
rtx ret = init_one_libfunc ("__asan_allocas_unpoison");
- ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode, 2, top,
- ptr_mode, bot, ptr_mode);
+ ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode,
+ top, ptr_mode, bot, ptr_mode);
return ret;
}
static rtx rtx_for_function_call (tree, tree);
static void load_register_parameters (struct arg_data *, int, rtx *, int,
int, int *);
-static rtx emit_library_call_value_1 (int, rtx, rtx, enum libcall_type,
- machine_mode, int, va_list);
static int special_function_p (const_tree, int);
static int check_sibcall_argument_overlap_1 (rtx);
static int check_sibcall_argument_overlap (rtx_insn *, struct arg_data *, int);
return types;
}
\f
-/* Output a library call to function FUN (a SYMBOL_REF rtx).
- The RETVAL parameter specifies whether return value needs to be saved, other
- parameters are documented in the emit_library_call function below. */
+/* Output a library call to function ORGFUN (a SYMBOL_REF rtx)
+ for a value of mode OUTMODE,
+ with NARGS different arguments, passed as ARGS.
+ Store the return value if RETVAL is nonzero: store it in VALUE if
+ VALUE is nonnull, otherwise pick a convenient location. In either
+ case return the location of the stored value.
-static rtx
+ FN_TYPE should be LCT_NORMAL for `normal' calls, LCT_CONST for
+ `const' calls, LCT_PURE for `pure' calls, or another LCT_ value for
+ other types of library calls. */
+
+rtx
emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
enum libcall_type fn_type,
- machine_mode outmode, int nargs, va_list p)
+ machine_mode outmode, int nargs, rtx_mode_t *args)
{
/* Total size in bytes of all the stack-parms scanned so far. */
struct args_size args_size;
count++;
}
- for (; count < nargs; count++)
+ for (unsigned int i = 0; count < nargs; i++, count++)
{
- rtx val = va_arg (p, rtx);
- machine_mode mode = (machine_mode) va_arg (p, int);
+ rtx val = args[i].first;
+ machine_mode mode = args[i].second;
int unsigned_p = 0;
/* We cannot convert the arg value to the mode the library wants here;
}
\f
-/* Output a library call to function FUN (a SYMBOL_REF rtx)
- (emitting the queue unless NO_QUEUE is nonzero),
- for a value of mode OUTMODE,
- with NARGS different arguments, passed as alternating rtx values
- and machine_modes to convert them to.
-
- FN_TYPE should be LCT_NORMAL for `normal' calls, LCT_CONST for
- `const' calls, LCT_PURE for `pure' calls, or other LCT_ value for
- other types of library calls. */
-
-void
-emit_library_call (rtx orgfun, enum libcall_type fn_type,
- machine_mode outmode, int nargs, ...)
-{
- va_list p;
-
- va_start (p, nargs);
- emit_library_call_value_1 (0, orgfun, NULL_RTX, fn_type, outmode, nargs, p);
- va_end (p);
-}
-\f
-/* Like emit_library_call except that an extra argument, VALUE,
- comes second and says where to store the result.
- (If VALUE is zero, this function chooses a convenient way
- to return the value.
-
- This function returns an rtx for where the value is to be found.
- If VALUE is nonzero, VALUE is returned. */
-
-rtx
-emit_library_call_value (rtx orgfun, rtx value,
- enum libcall_type fn_type,
- machine_mode outmode, int nargs, ...)
-{
- rtx result;
- va_list p;
-
- va_start (p, nargs);
- result = emit_library_call_value_1 (1, orgfun, value, fn_type, outmode,
- nargs, p);
- va_end (p);
-
- return result;
-}
-\f
/* Store pointer bounds argument ARG into Bounds Table entry
associated with PARM. */
|| (!defined(HAS_INIT_SECTION) \
&& !defined(INIT_SECTION_ASM_OP) \
&& !defined(INIT_ARRAY_SECTION_ASM_OP)))
- emit_library_call (init_one_libfunc (NAME__MAIN), LCT_NORMAL, VOIDmode, 0);
+ emit_library_call (init_one_libfunc (NAME__MAIN), LCT_NORMAL, VOIDmode);
#endif
}
\f
gen_clear_cache(). */
a_tramp = XEXP (m_tramp, 0);
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"),
- LCT_NORMAL, VOIDmode, 2, a_tramp, ptr_mode,
+ LCT_NORMAL, VOIDmode, a_tramp, ptr_mode,
plus_constant (ptr_mode, a_tramp, TRAMPOLINE_SIZE),
ptr_mode);
}
rtx fun, lr; \
lr = get_hard_reg_initial_val (Pmode, LR_REGNUM); \
fun = gen_rtx_SYMBOL_REF (Pmode, MCOUNT_NAME); \
- emit_library_call (fun, LCT_NORMAL, VOIDmode, 1, lr, Pmode); \
+ emit_library_call (fun, LCT_NORMAL, VOIDmode, lr, Pmode); \
}
/* All the work done in PROFILE_HOOK, but still required. */
emit_insn (gen_imb ());
#ifdef HAVE_ENABLE_EXECUTE_STACK
emit_library_call (init_one_libfunc ("__enable_execute_stack"),
- LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode);
+ LCT_NORMAL, VOIDmode, XEXP (m_tramp, 0), Pmode);
#endif
}
}
a_tramp = XEXP (m_tramp, 0);
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"),
- LCT_NORMAL, VOIDmode, 2, a_tramp, Pmode,
+ LCT_NORMAL, VOIDmode, a_tramp, Pmode,
plus_constant (Pmode, a_tramp, TRAMPOLINE_SIZE), Pmode);
}
*valuep = emit_library_call_value (get_tls_get_addr (), NULL_RTX,
LCT_PURE, /* LCT_CONST? */
- Pmode, 1, reg, Pmode);
+ Pmode, reg, Pmode);
rtx_insn *insns = get_insns ();
end_sequence ();
= smallest_int_mode_for_size (2 * GET_MODE_BITSIZE (mode));
rtx libval = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
- libval_mode, 2,
+ libval_mode,
op0, GET_MODE (op0),
op1, GET_MODE (op1));
emit_library_call_value (umulsi3_highpart_libfunc,
operands[0], LCT_NORMAL, SImode,
- 2, operands[1], SImode, operands[2], SImode);
+ operands[1], SImode, operands[2], SImode);
}
DONE;
})
emit_library_call_value (smulsi3_highpart_libfunc,
operands[0], LCT_NORMAL, SImode,
- 2, operands[1], SImode, operands[2], SImode);
+ operands[1], SImode, operands[2], SImode);
}
DONE;
})
#ifdef CLEAR_INSN_CACHE
tramp = XEXP (tramp, 0);
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__gnu_clear_cache"),
- LCT_NORMAL, VOIDmode, 2, tramp, Pmode,
- plus_constant (Pmode, tramp, TRAMPOLINE_SIZE),
- Pmode);
+ LCT_NORMAL, VOIDmode, tramp, Pmode,
+ plus_constant (Pmode, tramp, TRAMPOLINE_SIZE), Pmode);
#endif
}
\f
}
start_sequence ();
- cmp = emit_library_call_value (libfunc, 0, LCT_CONST, SImode, 2,
+ cmp = emit_library_call_value (libfunc, 0, LCT_CONST, SImode,
op0, op_mode, op1, op_mode);
insns = get_insns ();
end_sequence ();
mark_addressable (src_expr);
if (dst_expr)
mark_addressable (dst_expr);
- emit_library_call (fn, LCT_NORMAL, VOIDmode, 3,
+ emit_library_call (fn, LCT_NORMAL, VOIDmode,
dstreg, Pmode, srcreg, Pmode, count_exp, SImode);
return true;
}
rtx sc_reg = force_reg (Pmode, static_chain);
emit_library_call (gen_rtx_SYMBOL_REF (SImode, "__trampoline_setup"),
- LCT_NORMAL, VOIDmode, 4,
+ LCT_NORMAL, VOIDmode,
addr, Pmode,
GEN_INT (frv_trampoline_size ()), SImode,
fnaddr, Pmode,
if (CHECK_EXECUTE_STACK_ENABLED)
#endif
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"),
- LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode);
+ LCT_NORMAL, VOIDmode, XEXP (m_tramp, 0), Pmode);
#endif
}
rtx rem = assign_386_stack_local (mode, SLOT_TEMP);
rtx quot = emit_library_call_value (libfunc, NULL_RTX, LCT_NORMAL,
- mode, 3,
- op0, GET_MODE (op0),
- op1, GET_MODE (op1),
- XEXP (rem, 0), Pmode);
+ mode,
+ op0, GET_MODE (op0),
+ op1, GET_MODE (op1),
+ XEXP (rem, 0), Pmode);
*quot_p = quot;
*rem_p = rem;
}
emit_insn (gen_load_dtprel (tga_op2, op1));
tga_ret = emit_library_call_value (gen_tls_get_addr (), NULL_RTX,
- LCT_CONST, Pmode, 2, tga_op1,
- Pmode, tga_op2, Pmode);
+ LCT_CONST, Pmode,
+ tga_op1, Pmode, tga_op2, Pmode);
insns = get_insns ();
end_sequence ();
tga_op2 = const0_rtx;
tga_ret = emit_library_call_value (gen_tls_get_addr (), NULL_RTX,
- LCT_CONST, Pmode, 2, tga_op1,
- Pmode, tga_op2, Pmode);
+ LCT_CONST, Pmode,
+ tga_op1, Pmode, tga_op2, Pmode);
insns = get_insns ();
end_sequence ();
start_sequence ();
- ret = emit_library_call_value (cmptf_libfunc, 0, LCT_CONST, DImode, 3,
+ ret = emit_library_call_value (cmptf_libfunc, 0, LCT_CONST, DImode,
*op0, TFmode, *op1, TFmode,
GEN_INT (magic), DImode);
cmp = gen_reg_rtx (BImode);
ip = gen_reg_rtx (Pmode);
emit_insn (gen_ip_value (ip));
emit_library_call (gen_mcount_func_rtx (), LCT_NORMAL,
- VOIDmode, 3,
+ VOIDmode,
gen_rtx_REG (Pmode, BR_REG (0)), Pmode,
ip, Pmode,
label, Pmode);
{
emit_library_call (gen_rtx_SYMBOL_REF (Pmode,
\"__ia64_save_stack_nonlocal\"),
- LCT_NORMAL, VOIDmode, 2, XEXP (operands[0], 0), Pmode,
+ LCT_NORMAL, VOIDmode, XEXP (operands[0], 0), Pmode,
operands[1], Pmode);
DONE;
})
""
{
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, \"__ia64_nonlocal_goto\"),
- LCT_NORETURN, VOIDmode, 3,
+ LCT_NORETURN, VOIDmode,
operands[1], Pmode,
copy_to_reg (XEXP (operands[2], 0)), Pmode,
operands[3], Pmode);
{
emit_library_call (gen_rtx_SYMBOL_REF (Pmode,
"__ia64_restore_stack_nonlocal"),
- LCT_NORMAL, VOIDmode, 1,
+ LCT_NORMAL, VOIDmode,
copy_to_reg (XEXP (operands[1], 0)), Pmode);
DONE;
})
bytes_rtx = convert_to_mode (Pmode, bytes_rtx, 1);
emit_library_call (m32r_function_symbol ("memcpy"), LCT_NORMAL,
- VOIDmode, 3, dest_reg, Pmode, src_reg, Pmode,
+ VOIDmode, dest_reg, Pmode, src_reg, Pmode,
convert_to_mode (TYPE_MODE (sizetype), bytes_rtx,
TYPE_UNSIGNED (sizetype)),
TYPE_MODE (sizetype));
gen_int_mode (m32r_cache_flush_trap, SImode)));
else if (m32r_cache_flush_func && m32r_cache_flush_func[0])
emit_library_call (m32r_function_symbol (m32r_cache_flush_func),
- LCT_NORMAL, VOIDmode, 3, XEXP (m_tramp, 0), Pmode,
+ LCT_NORMAL, VOIDmode, XEXP (m_tramp, 0), Pmode,
gen_int_mode (TRAMPOLINE_SIZE, SImode), SImode,
GEN_INT (3), SImode);
}
#undef FINALIZE_TRAMPOLINE
#define FINALIZE_TRAMPOLINE(TRAMP) \
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \
- LCT_NORMAL, VOIDmode, 2, TRAMP, Pmode, \
- plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \
+ LCT_NORMAL, VOIDmode, TRAMP, Pmode, \
+ plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \
Pmode);
/* Clear the instruction cache from `beg' to `end'. This makes an
m68k_libcall_value_in_a0_p = true;
a0 = emit_library_call_value (m68k_get_tls_get_addr (), NULL_RTX, LCT_PURE,
- Pmode, 1, x, Pmode);
+ Pmode, x, Pmode);
m68k_libcall_value_in_a0_p = false;
insns = get_insns ();
/* Emit the call sequence. */
m68k_libcall_value_in_a0_p = true;
a0 = emit_library_call_value (m68k_get_m68k_read_tp (), NULL_RTX, LCT_PURE,
- Pmode, 0);
+ Pmode);
m68k_libcall_value_in_a0_p = false;
insns = get_insns ();
end_sequence ();
*valuep = emit_library_call_value (get_tls_get_addr (), NULL_RTX,
LCT_PURE, /* LCT_CONST? */
- Pmode, 1, reg, Pmode);
+ Pmode, reg, Pmode);
insns = get_insns ();
end_sequence ();
emit_label (div_label);
ret = emit_library_call_value (gen_rtx_SYMBOL_REF (Pmode, "__divsi3"),
- operands[0], LCT_NORMAL,
- GET_MODE (operands[0]), 2, operands[1],
- GET_MODE (operands[1]), operands[2],
- GET_MODE (operands[2]));
+ operands[0], LCT_NORMAL,
+ GET_MODE (operands[0]),
+ operands[1], GET_MODE (operands[1]),
+ operands[2], GET_MODE (operands[2]));
if (ret != operands[0])
emit_move_insn (operands[0], ret);
/* Flush both caches. We need to flush the data cache in case \
the system has a write-back cache. */ \
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mips_cache_flush_func), \
- LCT_NORMAL, VOIDmode, 3, ADDR, Pmode, SIZE, Pmode, \
+ LCT_NORMAL, VOIDmode, ADDR, Pmode, SIZE, Pmode, \
GEN_INT (3), TYPE_MODE (integer_type_node))
\f
#undef MIPS_ICACHE_SYNC
#define MIPS_ICACHE_SYNC(ADDR, SIZE) \
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mips_cache_flush_func), \
- LCT_NORMAL, VOIDmode, 2, ADDR, Pmode, \
+ LCT_NORMAL, VOIDmode, ADDR, Pmode, \
SIZE, TYPE_MODE (sizetype))
/* This version of _mcount does not pop 2 words from the stack. */
start_sequence ();
final_result = emit_library_call_value (libfunc, NULL_RTX,
- LCT_CONST, SImode, 2,
+ LCT_CONST, SImode,
operands[1], SImode,
operands[2], SImode);
rtx addr = force_reg (Pmode, XEXP (m_tramp, 0));
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__trampoline_setup"),
- LCT_NORMAL, VOIDmode, 3, addr, Pmode, fnaddr, Pmode,
+ LCT_NORMAL, VOIDmode, addr, Pmode, fnaddr, Pmode,
ctx_reg, Pmode);
}
ret = gen_reg_rtx (Pmode);
emit_library_call_value (gen_tls_get_addr (), ret,
- LCT_CONST, Pmode, 1, arg, Pmode);
+ LCT_CONST, Pmode, arg, Pmode);
return ret;
}
#ifdef HAVE_ENABLE_EXECUTE_STACK
 emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"),
- Â Â Â Â LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode);
+ LCT_NORMAL, VOIDmode, XEXP (m_tramp, 0), Pmode);
#endif
}
emit_library_call_value (canonicalize_funcptr_for_compare_libfunc,
operands[0], LCT_NORMAL, Pmode,
- 1, operands[1], Pmode);
+ operands[1], Pmode);
DONE;
}
{
tga = rs6000_tls_get_addr ();
emit_library_call_value (tga, dest, LCT_CONST, Pmode,
- 1, const0_rtx, Pmode);
+ const0_rtx, Pmode);
r3 = gen_rtx_REG (Pmode, 3);
if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2)
tga = rs6000_tls_get_addr ();
tmp1 = gen_reg_rtx (Pmode);
emit_library_call_value (tga, tmp1, LCT_CONST, Pmode,
- 1, const0_rtx, Pmode);
+ const0_rtx, Pmode);
r3 = gen_rtx_REG (Pmode, 3);
if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2)
{
tree fun = builtin_decl_explicit (BUILT_IN_STRCMP);
emit_library_call_value (XEXP (DECL_RTL (fun), 0),
- target, LCT_NORMAL, GET_MODE (target), 2,
+ target, LCT_NORMAL, GET_MODE (target),
force_reg (Pmode, XEXP (src1, 0)), Pmode,
force_reg (Pmode, XEXP (src2, 0)), Pmode);
}
tree fun = builtin_decl_explicit (BUILT_IN_STRNCMP);
emit_library_call_value (XEXP (DECL_RTL (fun), 0),
- target, LCT_NORMAL, GET_MODE (target), 3,
+ target, LCT_NORMAL, GET_MODE (target),
force_reg (Pmode, XEXP (src1, 0)), Pmode,
force_reg (Pmode, XEXP (src2, 0)), Pmode,
len_rtx, GET_MODE (len_rtx));
{
tree fun = builtin_decl_explicit (BUILT_IN_STRCMP);
emit_library_call_value (XEXP (DECL_RTL (fun), 0),
- target, LCT_NORMAL, GET_MODE (target), 2,
+ target, LCT_NORMAL, GET_MODE (target),
force_reg (Pmode, XEXP (src1, 0)), Pmode,
force_reg (Pmode, XEXP (src2, 0)), Pmode);
}
emit_move_insn (len_rtx, GEN_INT (bytes - compare_length));
tree fun = builtin_decl_explicit (BUILT_IN_STRNCMP);
emit_library_call_value (XEXP (DECL_RTL (fun), 0),
- target, LCT_NORMAL, GET_MODE (target), 3,
+ target, LCT_NORMAL, GET_MODE (target),
force_reg (Pmode, XEXP (src1, 0)), Pmode,
force_reg (Pmode, XEXP (src2, 0)), Pmode,
len_rtx, GET_MODE (len_rtx));
if (!check_nan)
dest = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
- SImode, 2, op0, mode, op1, mode);
+ SImode, op0, mode, op1, mode);
/* The library signals an exception for signalling NaNs, so we need to
handle isgreater, etc. by first checking isordered. */
/* Test for either value being a NaN. */
gcc_assert (unord_func);
unord_dest = emit_library_call_value (unord_func, NULL_RTX, LCT_CONST,
- SImode, 2, op0, mode, op1,
- mode);
+ SImode, op0, mode, op1, mode);
/* Set value (0) if either value is a NaN, and jump to the join
label. */
/* Do the normal comparison, knowing that the values are not
NaNs. */
normal_dest = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
- SImode, 2, op0, mode, op1,
- mode);
+ SImode, op0, mode, op1, mode);
emit_insn (gen_cstoresi4 (dest,
gen_rtx_fmt_ee (code, SImode, normal_dest,
libfunc = convert_optab_libfunc (cvt, dest_mode, src_mode);
gcc_assert (libfunc != NULL_RTX);
- dest2 = emit_library_call_value (libfunc, dest, LCT_CONST, dest_mode, 1, src,
- src_mode);
+ dest2 = emit_library_call_value (libfunc, dest, LCT_CONST, dest_mode,
+ src, src_mode);
gcc_assert (dest2 != NULL_RTX);
if (!rtx_equal_p (dest, dest2))
#endif
if (NO_PROFILE_COUNTERS)
emit_library_call (init_one_libfunc (RS6000_MCOUNT),
- LCT_NORMAL, VOIDmode, 0);
+ LCT_NORMAL, VOIDmode);
else
{
char buf[30];
fun = gen_rtx_SYMBOL_REF (Pmode, label_name);
emit_library_call (init_one_libfunc (RS6000_MCOUNT),
- LCT_NORMAL, VOIDmode, 1, fun, Pmode);
+ LCT_NORMAL, VOIDmode, fun, Pmode);
}
}
else if (DEFAULT_ABI == ABI_DARWIN)
caller_addr_regno = 0;
#endif
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mcount_name),
- LCT_NORMAL, VOIDmode, 1,
+ LCT_NORMAL, VOIDmode,
gen_rtx_REG (Pmode, caller_addr_regno), Pmode);
}
}
case ABI_DARWIN:
case ABI_V4:
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__trampoline_setup"),
- LCT_NORMAL, VOIDmode, 4,
+ LCT_NORMAL, VOIDmode,
addr, Pmode,
GEN_INT (rs6000_trampoline_size ()), SImode,
fnaddr, Pmode,
{
rtx libfunc = optab_libfunc (neg_optab, <MODE>mode);
rtx target = emit_library_call_value (libfunc, operands[0], LCT_CONST,
- <MODE>mode, 1,
+ <MODE>mode,
operands[1], <MODE>mode);
if (target && !rtx_equal_p (target, operands[0]))
rtx fun, ra; \
ra = get_hard_reg_initial_val (Pmode, RETURN_ADDR_REGNUM); \
fun = gen_rtx_SYMBOL_REF (Pmode, MCOUNT_NAME); \
- emit_library_call (fun, LCT_NORMAL, VOIDmode, 1, ra, Pmode); \
+ emit_library_call (fun, LCT_NORMAL, VOIDmode, ra, Pmode); \
}
/* All the work done in PROFILE_HOOK, but still required. */
{
tree fun = builtin_decl_explicit (BUILT_IN_STRCMP);
emit_library_call_value (XEXP (DECL_RTL (fun), 0),
- target, LCT_NORMAL, GET_MODE (target), 2,
+ target, LCT_NORMAL, GET_MODE (target),
force_reg (Pmode, XEXP (src1, 0)), Pmode,
force_reg (Pmode, XEXP (src2, 0)), Pmode);
}
tree fun = builtin_decl_explicit (BUILT_IN_STRNCMP);
emit_library_call_value (XEXP (DECL_RTL (fun), 0),
- target, LCT_NORMAL, GET_MODE (target), 3,
+ target, LCT_NORMAL, GET_MODE (target),
force_reg (Pmode, XEXP (src1, 0)), Pmode,
force_reg (Pmode, XEXP (src2, 0)), Pmode,
len_rtx, GET_MODE (len_rtx));
{
tree fun = builtin_decl_explicit (BUILT_IN_STRCMP);
emit_library_call_value (XEXP (DECL_RTL (fun), 0),
- target, LCT_NORMAL, GET_MODE (target), 2,
+ target, LCT_NORMAL, GET_MODE (target),
force_reg (Pmode, XEXP (src1, 0)), Pmode,
force_reg (Pmode, XEXP (src2, 0)), Pmode);
}
emit_move_insn (len_rtx, GEN_INT (bytes - compare_length));
tree fun = builtin_decl_explicit (BUILT_IN_STRNCMP);
emit_library_call_value (XEXP (DECL_RTL (fun), 0),
- target, LCT_NORMAL, GET_MODE (target), 3,
+ target, LCT_NORMAL, GET_MODE (target),
force_reg (Pmode, XEXP (src1, 0)), Pmode,
force_reg (Pmode, XEXP (src2, 0)), Pmode,
len_rtx, GET_MODE (len_rtx));
{
tga = rs6000_tls_get_addr ();
emit_library_call_value (tga, dest, LCT_CONST, Pmode,
- 1, const0_rtx, Pmode);
+ const0_rtx, Pmode);
r3 = gen_rtx_REG (Pmode, 3);
if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2)
tga = rs6000_tls_get_addr ();
tmp1 = gen_reg_rtx (Pmode);
emit_library_call_value (tga, tmp1, LCT_CONST, Pmode,
- 1, const0_rtx, Pmode);
+ const0_rtx, Pmode);
r3 = gen_rtx_REG (Pmode, 3);
if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2)
if (!check_nan)
dest = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
- SImode, 2, op0, mode, op1, mode);
+ SImode, op0, mode, op1, mode);
/* The library signals an exception for signalling NaNs, so we need to
handle isgreater, etc. by first checking isordered. */
/* Test for either value being a NaN. */
gcc_assert (unord_func);
unord_dest = emit_library_call_value (unord_func, NULL_RTX, LCT_CONST,
- SImode, 2, op0, mode, op1,
- mode);
+ SImode, op0, mode, op1, mode);
/* Set value (0) if either value is a NaN, and jump to the join
label. */
/* Do the normal comparison, knowing that the values are not
NaNs. */
normal_dest = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
- SImode, 2, op0, mode, op1,
- mode);
+ SImode, op0, mode, op1, mode);
emit_insn (gen_cstoresi4 (dest,
gen_rtx_fmt_ee (code, SImode, normal_dest,
libfunc = convert_optab_libfunc (cvt, dest_mode, src_mode);
gcc_assert (libfunc != NULL_RTX);
- dest2 = emit_library_call_value (libfunc, dest, LCT_CONST, dest_mode, 1, src,
- src_mode);
+ dest2 = emit_library_call_value (libfunc, dest, LCT_CONST, dest_mode,
+ src, src_mode);
gcc_assert (dest2 != NULL_RTX);
if (!rtx_equal_p (dest, dest2))
#endif
if (NO_PROFILE_COUNTERS)
emit_library_call (init_one_libfunc (RS6000_MCOUNT),
- LCT_NORMAL, VOIDmode, 0);
+ LCT_NORMAL, VOIDmode);
else
{
char buf[30];
fun = gen_rtx_SYMBOL_REF (Pmode, label_name);
emit_library_call (init_one_libfunc (RS6000_MCOUNT),
- LCT_NORMAL, VOIDmode, 1, fun, Pmode);
+ LCT_NORMAL, VOIDmode, fun, Pmode);
}
}
else if (DEFAULT_ABI == ABI_DARWIN)
caller_addr_regno = 0;
#endif
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mcount_name),
- LCT_NORMAL, VOIDmode, 1,
+ LCT_NORMAL, VOIDmode,
gen_rtx_REG (Pmode, caller_addr_regno), Pmode);
}
}
case ABI_DARWIN:
case ABI_V4:
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__trampoline_setup"),
- LCT_NORMAL, VOIDmode, 4,
+ LCT_NORMAL, VOIDmode,
addr, Pmode,
GEN_INT (rs6000_trampoline_size ()), SImode,
fnaddr, Pmode,
{
rtx libfunc = optab_libfunc (neg_optab, <MODE>mode);
rtx target = emit_library_call_value (libfunc, operands[0], LCT_CONST,
- <MODE>mode, 1,
+ <MODE>mode,
operands[1], <MODE>mode);
if (target && !rtx_equal_p (target, operands[0]))
|| (!(TARGET_SH4A || TARGET_SH4_300) && TARGET_USERMODE))
emit_library_call (function_symbol (NULL, "__ic_invalidate",
FUNCTION_ORDINARY).sym,
- LCT_NORMAL, VOIDmode, 1, tramp, SImode);
+ LCT_NORMAL, VOIDmode, tramp, SImode);
else
emit_insn (gen_ic_invalidate_line (tramp));
}
if (GET_MODE (operands[0]) == TFmode)
{
if (nargs == 2)
- emit_library_call (func_sym, LCT_NORMAL, VOIDmode, 2,
+ emit_library_call (func_sym, LCT_NORMAL, VOIDmode,
arg[0], GET_MODE (arg[0]),
arg[1], GET_MODE (arg[1]));
else
- emit_library_call (func_sym, LCT_NORMAL, VOIDmode, 3,
+ emit_library_call (func_sym, LCT_NORMAL, VOIDmode,
arg[0], GET_MODE (arg[0]),
arg[1], GET_MODE (arg[1]),
arg[2], GET_MODE (arg[2]));
gcc_assert (nargs == 2);
ret = emit_library_call_value (func_sym, operands[0], LCT_NORMAL,
- GET_MODE (operands[0]), 1,
+ GET_MODE (operands[0]),
arg[1], GET_MODE (arg[1]));
if (ret != operands[0])
libfunc = gen_rtx_SYMBOL_REF (Pmode, qpfunc);
emit_library_call (libfunc, LCT_NORMAL,
- DImode, 2,
+ DImode,
XEXP (slot0, 0), Pmode,
XEXP (slot1, 0), Pmode);
mode = DImode;
{
libfunc = gen_rtx_SYMBOL_REF (Pmode, qpfunc);
emit_library_call (libfunc, LCT_NORMAL,
- SImode, 2,
+ SImode,
x, TFmode, y, TFmode);
mode = SImode;
}
the stack address is accessible. */
#ifdef HAVE_ENABLE_EXECUTE_STACK
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"),
- LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode);
+ LCT_NORMAL, VOIDmode, XEXP (m_tramp, 0), Pmode);
#endif
}
the stack address is accessible. */
#ifdef HAVE_ENABLE_EXECUTE_STACK
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"),
- LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode);
+ LCT_NORMAL, VOIDmode, XEXP (m_tramp, 0), Pmode);
#endif
}
fun = gen_rtx_SYMBOL_REF (Pmode, MCOUNT_FUNCTION);
if (NO_PROFILE_COUNTERS)
{
- emit_library_call (fun, LCT_NORMAL, VOIDmode, 0);
+ emit_library_call (fun, LCT_NORMAL, VOIDmode);
}
else
{
ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
lab = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf));
- emit_library_call (fun, LCT_NORMAL, VOIDmode, 1, lab, Pmode);
+ emit_library_call (fun, LCT_NORMAL, VOIDmode, lab, Pmode);
}
}
\f
if (!cache_fetch_dirty)
cache_fetch_dirty = init_one_libfunc ("__cache_fetch_dirty");
emit_library_call_value (cache_fetch_dirty, data_addr, LCT_NORMAL, Pmode,
- 2, ea_addr, EAmode, ndirty, SImode);
+ ea_addr, EAmode, ndirty, SImode);
}
else
{
if (!cache_fetch)
cache_fetch = init_one_libfunc ("__cache_fetch");
emit_library_call_value (cache_fetch, data_addr, LCT_NORMAL, Pmode,
- 1, ea_addr, EAmode);
+ ea_addr, EAmode);
}
}
{
start_sequence ();
value =
- emit_library_call_value (convert_optab_libfunc (ufloat_optab,
- DFmode, SImode),
- NULL_RTX, LCT_NORMAL, DFmode, 1, operands[1], SImode);
+ emit_library_call_value (convert_optab_libfunc (ufloat_optab,
+ DFmode, SImode),
+ NULL_RTX, LCT_NORMAL, DFmode,
+ operands[1], SImode);
rtx_insn *insns = get_insns ();
end_sequence ();
emit_libcall_block (insns, operands[0], value,
value =
emit_library_call_value (convert_optab_libfunc (ufloat_optab,
DFmode, DImode),
- NULL_RTX, LCT_NORMAL, DFmode, 1, operands[1], DImode);
+ NULL_RTX, LCT_NORMAL, DFmode,
+ operands[1], DImode);
rtx_insn *insns = get_insns ();
end_sequence ();
emit_libcall_block (insns, operands[0], value,
TRAMPOLINE_SIZE));
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"),
- LCT_NORMAL, VOIDmode, 2, begin_addr, Pmode,
+ LCT_NORMAL, VOIDmode, begin_addr, Pmode,
end_addr, Pmode);
}
TRAMPOLINE_SIZE));
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"),
- LCT_NORMAL, VOIDmode, 2, begin_addr, Pmode,
+ LCT_NORMAL, VOIDmode, begin_addr, Pmode,
end_addr, Pmode);
}
emit_insn (insn);
}
else
- emit_library_call (long_int_memcpy_libfunc, LCT_NORMAL, VOIDmode, 3,
+ emit_library_call (long_int_memcpy_libfunc, LCT_NORMAL, VOIDmode,
dst_reg, Pmode,
src_reg, Pmode,
convert_to_mode (TYPE_MODE (sizetype),
unsigned HOST_WIDE_INT bytes = UINTVAL (bytes_rtx);
unsigned int rem = bytes % 2;
- emit_library_call (wrd_memcpy_libfunc, LCT_NORMAL, VOIDmode, 3,
+ emit_library_call (wrd_memcpy_libfunc, LCT_NORMAL, VOIDmode,
dst_reg, Pmode,
src_reg, Pmode,
convert_to_mode (TYPE_MODE (sizetype),
static void
expand_block_move_1 (rtx dst_reg, rtx src_reg, rtx bytes_rtx)
{
- emit_library_call (byt_memcpy_libfunc, LCT_NORMAL, VOIDmode, 3,
+ emit_library_call (byt_memcpy_libfunc, LCT_NORMAL, VOIDmode,
dst_reg, Pmode,
src_reg, Pmode,
convert_to_mode (TYPE_MODE (sizetype),
unsigned int rem = bytes % 4;
value_rtx = convert_to_mode (Pmode, value_rtx, 1);
- emit_library_call (long_int_memset_libfunc, LCT_NORMAL, VOIDmode, 3,
+ emit_library_call (long_int_memset_libfunc, LCT_NORMAL, VOIDmode,
dst_reg, Pmode,
value_rtx, Pmode,
convert_to_mode (TYPE_MODE (sizetype),
unsigned int rem = bytes % 2;
value_rtx = convert_to_mode (Pmode, value_rtx, 1);
- emit_library_call (wrd_memset_libfunc, LCT_NORMAL, VOIDmode, 3,
+ emit_library_call (wrd_memset_libfunc, LCT_NORMAL, VOIDmode,
dst_reg, Pmode,
value_rtx, Pmode,
convert_to_mode (TYPE_MODE (sizetype),
expand_block_set_1 (rtx dst_reg, rtx value_rtx, rtx bytes_rtx)
{
value_rtx = convert_to_mode (Pmode, value_rtx, 1);
- emit_library_call (byt_memset_libfunc, LCT_NORMAL, VOIDmode, 3,
+ emit_library_call (byt_memset_libfunc, LCT_NORMAL, VOIDmode,
dst_reg, Pmode,
value_rtx, Pmode,
convert_to_mode (TYPE_MODE (sizetype),
GEN_INT (0xffff), NULL_RTX),
0x04940000));
- emit_library_call (set_trampoline_parity_libfunc, LCT_NORMAL, VOIDmode, 1,
+ emit_library_call (set_trampoline_parity_libfunc, LCT_NORMAL, VOIDmode,
addr, SImode);
}
{
visium_frame_needed = true;
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "mcount"), LCT_NORMAL,
- VOIDmode, 0);
+ VOIDmode);
}
/* A C expression whose value is RTL representing the address in a stack frame
containing_fp = force_reg (Pmode, containing_fp);
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__xtensa_nonlocal_goto"),
- LCT_NORMAL, VOIDmode, 2,
+ LCT_NORMAL, VOIDmode,
containing_fp, Pmode,
goto_handler, Pmode);
}
if (TARGET_WINDOWED_ABI)
emit_library_call
(gen_rtx_SYMBOL_REF (Pmode, "__xtensa_libgcc_window_spill"),
- LCT_NORMAL, VOIDmode, 0);
+ LCT_NORMAL, VOIDmode);
}
emit_move_insn (adjust_address (m_tramp, SImode, chain_off), chain);
emit_move_insn (adjust_address (m_tramp, SImode, func_off), func);
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__xtensa_sync_caches"),
- LCT_NORMAL, VOIDmode, 1, XEXP (m_tramp, 0), Pmode);
+ LCT_NORMAL, VOIDmode, XEXP (m_tramp, 0), Pmode);
}
/* Implement TARGET_LEGITIMATE_CONSTANT_P. */
}
emit_library_call (unwind_sjlj_register_libfunc, LCT_NORMAL, VOIDmode,
- 1, XEXP (fc, 0), Pmode);
+ XEXP (fc, 0), Pmode);
seq = get_insns ();
end_sequence ();
start_sequence ();
emit_library_call (unwind_sjlj_unregister_libfunc, LCT_NORMAL, VOIDmode,
- 1, XEXP (crtl->eh.sjlj_fc, 0), Pmode);
+ XEXP (crtl->eh.sjlj_fc, 0), Pmode);
seq = get_insns ();
end_sequence ();
func = init_one_libfunc ("__morestack_allocate_stack_space");
space = emit_library_call_value (func, target, LCT_NORMAL, Pmode,
- 1, ask, Pmode);
+ ask, Pmode);
if (available_label == NULL_RTX)
return space;
stack_pointer_rtx,
plus_constant (Pmode,
size, first)));
- emit_library_call (stack_check_libfunc, LCT_THROW, VOIDmode, 1, addr,
- Pmode);
+ emit_library_call (stack_check_libfunc, LCT_THROW, VOIDmode,
+ addr, Pmode);
}
/* Next see if we have an insn to check the stack. */
start_sequence ();
value = emit_library_call_value (libcall, NULL_RTX, LCT_CONST, to_mode,
- 1, from, from_mode);
+ from, from_mode);
insns = get_insns ();
end_sequence ();
emit_libcall_block (insns, to, value,
/* Pass 1 for NO_QUEUE so we don't lose any increments
if the libcall is cse'd or moved. */
value = emit_library_call_value (libfunc,
- NULL_RTX, LCT_CONST, mode, 2,
+ NULL_RTX, LCT_CONST, mode,
op0, mode, op1x, op1_mode);
insns = get_insns ();
libval_mode = smallest_int_mode_for_size (2 * GET_MODE_BITSIZE (mode));
start_sequence ();
libval = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
- libval_mode, 2,
+ libval_mode,
op0, mode,
op1, mode);
/* Get the part of VAL containing the value that we want. */
/* Pass 1 for NO_QUEUE so we don't lose any increments
if the libcall is cse'd or moved. */
value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST, outmode,
- 1, op0, mode);
+ op0, mode);
insns = get_insns ();
end_sequence ();
ret_mode = targetm.libgcc_cmp_return_mode ();
result = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
- ret_mode, 2, x, mode, y, mode);
+ ret_mode, x, mode, y, mode);
/* There are two kinds of comparison routines. Biased routines
return 0/1/2, and unbiased routines return -1/0/1. Other parts
start_sequence ();
value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
- cmp_mode, 2, x, mode, y, mode);
+ cmp_mode, x, mode, y, mode);
insns = get_insns ();
end_sequence ();
start_sequence ();
value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
- GET_MODE (to), 1, from,
- GET_MODE (from));
+ GET_MODE (to), from, GET_MODE (from));
insns = get_insns ();
end_sequence ();
start_sequence ();
value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
- GET_MODE (to), 1, from,
- GET_MODE (from));
+ GET_MODE (to), from, GET_MODE (from));
insns = get_insns ();
end_sequence ();
start_sequence ();
value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST, to_mode,
- 1, from, from_mode);
+ from, from_mode);
insns = get_insns ();
end_sequence ();
addr = convert_memory_address (ptr_mode, XEXP (mem, 0));
return emit_library_call_value (libfunc, NULL_RTX, LCT_NORMAL,
- mode, 2, addr, ptr_mode,
+ mode, addr, ptr_mode,
val, mode);
}
}
{
rtx addr = convert_memory_address (ptr_mode, XEXP (mem, 0));
rtx target = emit_library_call_value (libfunc, NULL_RTX, LCT_NORMAL,
- mode, 3, addr, ptr_mode,
+ mode, addr, ptr_mode,
expected, mode, desired, mode);
emit_move_insn (target_oval, target);
else if (targetm.have_memory_barrier ())
emit_insn (targetm.gen_memory_barrier ());
else if (synchronize_libfunc != NULL_RTX)
- emit_library_call (synchronize_libfunc, LCT_NORMAL, VOIDmode, 0);
+ emit_library_call (synchronize_libfunc, LCT_NORMAL, VOIDmode);
else
expand_asm_memory_barrier ();
}
{
rtx addr = convert_memory_address (ptr_mode, XEXP (mem, 0));
result = emit_library_call_value (libfunc, NULL, LCT_NORMAL, mode,
- 2, addr, ptr_mode, val, mode);
+ addr, ptr_mode, val, mode);
if (!unused_result && fixup)
result = expand_simple_binop (mode, code, result, val, target,
LCT_RETURNS_TWICE = 5
};
-extern void emit_library_call (rtx, enum libcall_type, machine_mode, int,
- ...);
-extern rtx emit_library_call_value (rtx, rtx, enum libcall_type,
- machine_mode, int, ...);
+extern rtx emit_library_call_value_1 (int, rtx, rtx, enum libcall_type,
+ machine_mode, int, rtx_mode_t *);
+
+/* Output a library call and discard the returned value. FUN is the
+ address of the function, as a SYMBOL_REF rtx, and OUTMODE is the mode
+ of the (discarded) return value. FN_TYPE is LCT_NORMAL for `normal'
+ calls, LCT_CONST for `const' calls, LCT_PURE for `pure' calls, or
+ another LCT_ value for other types of library calls.
+
+ There are different overloads of this function for different numbers
+ of arguments. In each case the argument value is followed by its mode. */
+
+inline void
+emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode)
+{
+ emit_library_call_value_1 (0, fun, NULL_RTX, fn_type, outmode, 0, NULL);
+}
+
+inline void
+emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode,
+ rtx arg1, machine_mode arg1_mode)
+{
+ rtx_mode_t args[] = { rtx_mode_t (arg1, arg1_mode) };
+ emit_library_call_value_1 (0, fun, NULL_RTX, fn_type, outmode, 1, args);
+}
+
+inline void
+emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode,
+ rtx arg1, machine_mode arg1_mode,
+ rtx arg2, machine_mode arg2_mode)
+{
+ rtx_mode_t args[] = {
+ rtx_mode_t (arg1, arg1_mode),
+ rtx_mode_t (arg2, arg2_mode)
+ };
+ emit_library_call_value_1 (0, fun, NULL_RTX, fn_type, outmode, 2, args);
+}
+
+inline void
+emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode,
+ rtx arg1, machine_mode arg1_mode,
+ rtx arg2, machine_mode arg2_mode,
+ rtx arg3, machine_mode arg3_mode)
+{
+ rtx_mode_t args[] = {
+ rtx_mode_t (arg1, arg1_mode),
+ rtx_mode_t (arg2, arg2_mode),
+ rtx_mode_t (arg3, arg3_mode)
+ };
+ emit_library_call_value_1 (0, fun, NULL_RTX, fn_type, outmode, 3, args);
+}
+
+inline void
+emit_library_call (rtx fun, libcall_type fn_type, machine_mode outmode,
+ rtx arg1, machine_mode arg1_mode,
+ rtx arg2, machine_mode arg2_mode,
+ rtx arg3, machine_mode arg3_mode,
+ rtx arg4, machine_mode arg4_mode)
+{
+ rtx_mode_t args[] = {
+ rtx_mode_t (arg1, arg1_mode),
+ rtx_mode_t (arg2, arg2_mode),
+ rtx_mode_t (arg3, arg3_mode),
+ rtx_mode_t (arg4, arg4_mode)
+ };
+ emit_library_call_value_1 (0, fun, NULL_RTX, fn_type, outmode, 4, args);
+}
+
+/* Like emit_library_call, but return the value produced by the call.
+ Use VALUE to store the result if it is nonnull, otherwise pick a
+ convenient location. */
+
+inline rtx
+emit_library_call_value (rtx fun, rtx value, libcall_type fn_type,
+ machine_mode outmode)
+{
+ return emit_library_call_value_1 (1, fun, value, fn_type, outmode, 0, NULL);
+}
+
+inline rtx
+emit_library_call_value (rtx fun, rtx value, libcall_type fn_type,
+ machine_mode outmode,
+ rtx arg1, machine_mode arg1_mode)
+{
+ rtx_mode_t args[] = { rtx_mode_t (arg1, arg1_mode) };
+ return emit_library_call_value_1 (1, fun, value, fn_type, outmode, 1, args);
+}
+
+inline rtx
+emit_library_call_value (rtx fun, rtx value, libcall_type fn_type,
+ machine_mode outmode,
+ rtx arg1, machine_mode arg1_mode,
+ rtx arg2, machine_mode arg2_mode)
+{
+ rtx_mode_t args[] = {
+ rtx_mode_t (arg1, arg1_mode),
+ rtx_mode_t (arg2, arg2_mode)
+ };
+ return emit_library_call_value_1 (1, fun, value, fn_type, outmode, 2, args);
+}
+
+inline rtx
+emit_library_call_value (rtx fun, rtx value, libcall_type fn_type,
+ machine_mode outmode,
+ rtx arg1, machine_mode arg1_mode,
+ rtx arg2, machine_mode arg2_mode,
+ rtx arg3, machine_mode arg3_mode)
+{
+ rtx_mode_t args[] = {
+ rtx_mode_t (arg1, arg1_mode),
+ rtx_mode_t (arg2, arg2_mode),
+ rtx_mode_t (arg3, arg3_mode)
+ };
+ return emit_library_call_value_1 (1, fun, value, fn_type, outmode, 3, args);
+}
+
+inline rtx
+emit_library_call_value (rtx fun, rtx value, libcall_type fn_type,
+ machine_mode outmode,
+ rtx arg1, machine_mode arg1_mode,
+ rtx arg2, machine_mode arg2_mode,
+ rtx arg3, machine_mode arg3_mode,
+ rtx arg4, machine_mode arg4_mode)
+{
+ rtx_mode_t args[] = {
+ rtx_mode_t (arg1, arg1_mode),
+ rtx_mode_t (arg2, arg2_mode),
+ rtx_mode_t (arg3, arg3_mode),
+ rtx_mode_t (arg4, arg4_mode)
+ };
+ return emit_library_call_value_1 (1, fun, value, fn_type, outmode, 4, args);
+}
/* In varasm.c */
extern void init_varasm_once (void);