aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/sparc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-08-20 08:52:17 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-08-20 08:52:17 +0000
commita7c81bc1fb43366ca1b4332d8a6042b648a84cdc (patch)
tree789c552939f2fbd5585369d30b3beb3dde5a2a72 /gcc/config/sparc
parent4f53599cb5b822cd7f95997861c2e064977ecb6a (diff)
downloadgcc-a7c81bc1fb43366ca1b4332d8a6042b648a84cdc.zip
gcc-a7c81bc1fb43366ca1b4332d8a6042b648a84cdc.tar.gz
gcc-a7c81bc1fb43366ca1b4332d8a6042b648a84cdc.tar.bz2
Use function_arg_info for TARGET_ARG_PARTIAL_BYTES
This patch adds the function_arg_info class and uses it for TARGET_ARG_PARTIAL_BYTES. The hook is passed the promoted mode instead of the original type mode. The arguments aren't mentioned in the documentation, which is why the target.def change is so small. The patch changes "true" to "arg.named" in: gcc_assert (!epiphany_pass_by_reference (cum, mode, type, /* named */ true)); but epiphany_pass_by_reference doesn't care about the named flag. 2019-08-20 Richard Sandiford <richard.sandiford@arm.com> gcc/ * target.def (arg_partial_bytes): Take a function_arg_info instead of a mode, type and named flag. * doc/tm.texi: Regenerate. * target.h (function_arg_info): Declare. * calls.h (function_arg_info): New class. * targhooks.h (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Delete. (hook_int_CUMULATIVE_ARGS_arg_info_0): Declare. * targhooks.c (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Delete. (hook_int_CUMULATIVE_ARGS_arg_info_0): New function. * calls.c (initialize_argument_information): Update call to targetm.calls.partial_bytes. (emit_library_call_value_1): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (assign_parm_find_entry_rtl): Likewise. * config/alpha/alpha.c (alpha_arg_partial_bytes): Take a function_arg_info instead of a mode, type and named flag. * config/arc/arc.c (arc_arg_partial_bytes): Likewise. * config/arm/arm.c (arm_arg_partial_bytes): Likewise. (cmse_func_args_or_return_in_stack): Update accordingly. * config/bfin/bfin.c (bfin_arg_partial_bytes): Take a function_arg_info instead of a mode, type and named flag. * config/cris/cris.c (cris_arg_partial_bytes): Likewise. * config/csky/csky.c (csky_arg_partial_bytes): Likewise. * config/epiphany/epiphany.c (epiphany_arg_partial_bytes): Likewise. * config/fr30/fr30.c: Include calls.h. (fr30_arg_partial_bytes): Take a function_arg_info instead of a mode, type and named flag. * config/frv/frv.c: Include calls.h. (frv_arg_partial_bytes): Take a function_arg_info instead of a mode, type and named flag. * config/ft32/ft32.c (ft32_arg_partial_bytes): Likewise. * config/gcn/gcn.c (gcn_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_arg_partial_bytes): Likewise. * config/iq2000/iq2000.c (iq2000_arg_partial_bytes): Likewise. * config/m32r/m32r.c (m32r_arg_partial_bytes): Likewise. * config/mcore/mcore.c (mcore_arg_partial_bytes): Likewise. * config/microblaze/microblaze.c (function_arg_partial_bytes): Likewise. * config/mips/mips.c (mips_arg_partial_bytes): Likewise. * config/mn10300/mn10300.c (mn10300_arg_partial_bytes): Likewise. * config/moxie/moxie.c (moxie_arg_partial_bytes): Likewise. * config/msp430/msp430.c (msp430_arg_partial_bytes): Likewise. * config/nds32/nds32.c (nds32_arg_partial_bytes): Likewise. * config/nios2/nios2.c (nios2_arg_partial_bytes): Likewise. * config/pa/pa.c (pa_arg_partial_bytes): Likewise. * config/pru/pru.c (pru_arg_partial_bytes): Likewise. * config/riscv/riscv.c (riscv_arg_partial_bytes): Likewise. * config/rs6000/rs6000-internal.h (rs6000_arg_partial_bytes): Likewise. * config/rs6000/rs6000-call.c (rs6000_arg_partial_bytes): Likewise. (rs6000_parm_needs_stack): Update call accordingly. * config/sh/sh.c (sh_arg_partial_bytes): Take a function_arg_info instead of a mode, type and named flag. * config/sparc/sparc.c (sparc_arg_partial_bytes): Likewise. * config/v850/v850.c (v850_arg_partial_bytes): Likewise. From-SVN: r274697
Diffstat (limited to 'gcc/config/sparc')
-rw-r--r--gcc/config/sparc/sparc.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index e5cf9a8..6fb6174 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -668,7 +668,7 @@ static pad_direction sparc_function_arg_padding (machine_mode, const_tree);
static unsigned int sparc_function_arg_boundary (machine_mode,
const_tree);
static int sparc_arg_partial_bytes (cumulative_args_t,
- machine_mode, tree, bool);
+ const function_arg_info &);
static bool sparc_return_in_memory (const_tree, const_tree);
static rtx sparc_struct_value_rtx (tree, int);
static rtx sparc_function_value (const_tree, const_tree, bool);
@@ -7533,14 +7533,13 @@ sparc_function_arg_boundary (machine_mode mode, const_tree type)
mode] will be split between that reg and memory. */
static int
-sparc_arg_partial_bytes (cumulative_args_t cum, machine_mode mode,
- tree type, bool named)
+sparc_arg_partial_bytes (cumulative_args_t cum, const function_arg_info &arg)
{
int slotno, regno, padding;
/* We pass false for incoming here, it doesn't matter. */
- slotno = function_arg_slotno (get_cumulative_args (cum), mode, type, named,
- false, &regno, &padding);
+ slotno = function_arg_slotno (get_cumulative_args (cum), arg.mode, arg.type,
+ arg.named, false, &regno, &padding);
if (slotno == -1)
return 0;
@@ -7550,7 +7549,7 @@ sparc_arg_partial_bytes (cumulative_args_t cum, machine_mode mode,
/* We are guaranteed by pass_by_reference that the size of the
argument is not greater than 8 bytes, so we only need to return
one word if the argument is partially passed in registers. */
- const int size = GET_MODE_SIZE (mode);
+ const int size = GET_MODE_SIZE (arg.mode);
if (size > UNITS_PER_WORD && slotno == SPARC_INT_ARG_MAX - 1)
return UNITS_PER_WORD;
@@ -7560,33 +7559,33 @@ sparc_arg_partial_bytes (cumulative_args_t cum, machine_mode mode,
/* We are guaranteed by pass_by_reference that the size of the
argument is not greater than 16 bytes, so we only need to return
one word if the argument is partially passed in registers. */
- if (type && AGGREGATE_TYPE_P (type))
+ if (arg.aggregate_type_p ())
{
- const int size = int_size_in_bytes (type);
+ const int size = int_size_in_bytes (arg.type);
if (size > UNITS_PER_WORD
&& (slotno == SPARC_INT_ARG_MAX - 1
|| slotno == SPARC_FP_ARG_MAX - 1))
return UNITS_PER_WORD;
}
- else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT
- || ((GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
- || (type && VECTOR_TYPE_P (type)))
- && !(TARGET_FPU && named)))
+ else if (GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_INT
+ || ((GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_FLOAT
+ || (arg.type && VECTOR_TYPE_P (arg.type)))
+ && !(TARGET_FPU && arg.named)))
{
- const int size = (type && VECTOR_FLOAT_TYPE_P (type))
- ? int_size_in_bytes (type)
- : GET_MODE_SIZE (mode);
+ const int size = (arg.type && VECTOR_FLOAT_TYPE_P (arg.type))
+ ? int_size_in_bytes (arg.type)
+ : GET_MODE_SIZE (arg.mode);
if (size > UNITS_PER_WORD && slotno == SPARC_INT_ARG_MAX - 1)
return UNITS_PER_WORD;
}
- else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
- || (type && VECTOR_TYPE_P (type)))
+ else if (GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_FLOAT
+ || (arg.type && VECTOR_TYPE_P (arg.type)))
{
- const int size = (type && VECTOR_FLOAT_TYPE_P (type))
- ? int_size_in_bytes (type)
- : GET_MODE_SIZE (mode);
+ const int size = (arg.type && VECTOR_FLOAT_TYPE_P (arg.type))
+ ? int_size_in_bytes (arg.type)
+ : GET_MODE_SIZE (arg.mode);
if (size > UNITS_PER_WORD && slotno == SPARC_FP_ARG_MAX - 1)
return UNITS_PER_WORD;