aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/sparc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-12-29 19:08:18 -0800
committerRichard Henderson <rth@gcc.gnu.org>2004-12-29 19:08:18 -0800
commit78a52f1158e146c6a1e09a6a58a18aedc9ea0fcd (patch)
tree89b8670b5e2c1cd0fc2446517dc71747b11ef273 /gcc/config/sparc
parent86cdac113375a75b96ad79412b667838bf3c00f0 (diff)
downloadgcc-78a52f1158e146c6a1e09a6a58a18aedc9ea0fcd.zip
gcc-78a52f1158e146c6a1e09a6a58a18aedc9ea0fcd.tar.gz
gcc-78a52f1158e146c6a1e09a6a58a18aedc9ea0fcd.tar.bz2
target.h (targetm.calls.arg_partial_bytes): New.
* target.h (targetm.calls.arg_partial_bytes): New. * target-def.h (TARGET_ARG_PARTIAL_BYTES): New. * calls.c (store_unaligned_arguments_into_pseudos): Update for partial in bytes. (load_register_parameters): Likewise. (store_one_arg): Likewise. (initialize_argument_information): Use targetm.calls.arg_partial_bytes. (emit_library_call_value_1): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. (emit_push_insn): Update for partial in bytes. * expr.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * function.c (assign_parm_find_entry_rtl): Use targetm.calls.arg_partial_bytes. Update for result in bytes. (locate_and_pad_parm): Update for partial in bytes. * system.h (FUNCTION_ARG_PARTIAL_NREGS): Poison. * targhooks.c (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): New. * targhooks.h (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Declare. * doc/tm.texi (TARGET_ARG_PARTIAL_BYTES): Rename and update from FUNCTION_ARG_PARTIAL_NREGS. * config/arc/arc.h, config/c4x/c4x.h, config/i386/i386.h, config/i860/i860.h, config/m68hc11/m68hc11.h, config/m68k/m68k.h, config/pdp11/pdp11.h, config/s390/s390.h, config/stormy16/stormy16.h, config/xtensa/xtensa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/alpha/alpha.c (alpha_arg_partial_bytes): New. (TARGET_ARG_PARTIAL_BYTES): New. * config/alpha/alpha.h, config/alpha/unicosmk.h, config/alpha/vms.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/arm/arm.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/arm/arm.c (arm_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/cris/cris.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/cris/cris.c (cris_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/fr30/fr30.c (fr30_arg_partial_bytes): Rename from fr30_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30-protos.h: Update. * config/frv/frv.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/frv/frv.c (frv_arg_partial_bytes): Rename from frv_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/frv/frv-protos.h: Update. * config/ia64/ia64.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/ia64/ia64.c (ia64_arg_partial_bytes): Rename from ia64_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/ia64/ia64-protos.h: Update. * config/iq2000/iq2000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/iq2000/iq2000.c (iq2000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/iq2000/iq2000-protos.h: Update. * config/m32r/m32r.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/m32r/m32r.c (m32r_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/m32r/m32r-protos.h: Update. * config/mcore/mcore.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mcore/mcore.c (mcore_arg_partial_bytes): Rename from mcore_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mcore/mcore-protos.h: Update. * config/mips/mips.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mips/mips.c (mips_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mips/mips-protos.h: Update. * config/mn10300/mn10300.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mn10300/mn10300.c (mn10300_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mn10300/mn10300-protos.h: Update. * config/ns32k/ns32k.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/ns32k/ns32k.c (ns32k_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/pa/pa.c (pa_arg_partial_bytes): Rename from function_arg_partial_nregs. Handle 32-bit. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa-protos.h: Update. * config/rs6000/rs6000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/rs6000/rs6000-protos.h: Update. * config/sh/sh.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/sh/sh.c (sh_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/sparc/sparc.c (sparc_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc-protos.h: Update. * config/v850/v850.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/v850/v850.c (v850_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/v850/v850-protos.h: Update. From-SVN: r92726
Diffstat (limited to 'gcc/config/sparc')
-rw-r--r--gcc/config/sparc/sparc-protos.h2
-rw-r--r--gcc/config/sparc/sparc.c29
-rw-r--r--gcc/config/sparc/sparc.h7
3 files changed, 16 insertions, 22 deletions
diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h
index e181f8f..74fba0c 100644
--- a/gcc/config/sparc/sparc-protos.h
+++ b/gcc/config/sparc/sparc-protos.h
@@ -30,8 +30,6 @@ extern void function_arg_advance (CUMULATIVE_ARGS *,
enum machine_mode, tree, int);
extern struct rtx_def *function_arg (const CUMULATIVE_ARGS *,
enum machine_mode, tree, int, int);
-extern int function_arg_partial_nregs (const CUMULATIVE_ARGS *,
- enum machine_mode, tree, int);
#ifdef RTX_CODE
extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree);
extern void sparc_va_start (tree, rtx);
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index ccc8499..c15a406 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -356,6 +356,8 @@ static tree sparc_gimplify_va_arg (tree, tree, tree *, tree *);
static bool sparc_vector_mode_supported_p (enum machine_mode);
static bool sparc_pass_by_reference (CUMULATIVE_ARGS *,
enum machine_mode, tree, bool);
+static int sparc_arg_partial_bytes (CUMULATIVE_ARGS *,
+ enum machine_mode, tree, bool);
static void sparc_dwarf_handle_frame_unspec (const char *, rtx, int);
#ifdef SUBTARGET_ATTRIBUTE_TABLE
const struct attribute_spec sparc_attribute_table[];
@@ -469,6 +471,8 @@ enum processor_type sparc_cpu;
#define TARGET_MUST_PASS_IN_STACK must_pass_in_stack_var_size
#undef TARGET_PASS_BY_REFERENCE
#define TARGET_PASS_BY_REFERENCE sparc_pass_by_reference
+#undef TARGET_ARG_PARTIAL_BYTES
+#define TARGET_ARG_PARTIAL_BYTES sparc_arg_partial_bytes
#undef TARGET_EXPAND_BUILTIN_SAVEREGS
#define TARGET_EXPAND_BUILTIN_SAVEREGS sparc_builtin_saveregs
@@ -5618,7 +5622,7 @@ function_arg_record_value (tree type, enum machine_mode mode,
/* If at least one field must be passed on the stack, generate
(parallel [(expr_list (nil) ...) ...]) so that all fields will
also be passed on the stack. We can't do much better because the
- semantics of FUNCTION_ARG_PARTIAL_NREGS doesn't handle the case
+ semantics of TARGET_ARG_PARTIAL_BYTES doesn't handle the case
of structures for which the fields passed exclusively in registers
are not at the beginning of the structure. */
if (parms.stack)
@@ -5857,9 +5861,8 @@ function_arg (const struct sparc_args *cum, enum machine_mode mode,
return reg;
}
-/* Handle the FUNCTION_ARG_PARTIAL_NREGS macro.
- For an arg passed partly in registers and partly in memory,
- this is the number of registers used.
+/* For an arg passed partly in registers and partly in memory,
+ this is the number of bytes of registers used.
For args passed entirely in registers or entirely in memory, zero.
Any arg that starts in the first 6 regs but won't entirely fit in them
@@ -5868,9 +5871,9 @@ function_arg (const struct sparc_args *cum, enum machine_mode mode,
values that begin in the last fp reg [where "last fp reg" varies with the
mode] will be split between that reg and memory. */
-int
-function_arg_partial_nregs (const struct sparc_args *cum,
- enum machine_mode mode, tree type, int named)
+static int
+sparc_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, bool named)
{
int slotno, regno, padding;
@@ -5886,13 +5889,13 @@ function_arg_partial_nregs (const struct sparc_args *cum,
? ROUND_ADVANCE (int_size_in_bytes (type))
: ROUND_ADVANCE (GET_MODE_SIZE (mode))))
> SPARC_INT_ARG_MAX)
- return SPARC_INT_ARG_MAX - slotno;
+ return (SPARC_INT_ARG_MAX - slotno) * UNITS_PER_WORD;
}
else
{
/* 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 1 if the argument is partially passed in registers. */
+ 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))
{
@@ -5900,7 +5903,7 @@ function_arg_partial_nregs (const struct sparc_args *cum,
if (size > UNITS_PER_WORD
&& slotno == SPARC_INT_ARG_MAX - 1)
- return 1;
+ return UNITS_PER_WORD;
}
else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT
|| (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
@@ -5909,13 +5912,13 @@ function_arg_partial_nregs (const struct sparc_args *cum,
/* The complex types are passed as packed types. */
if (GET_MODE_SIZE (mode) > UNITS_PER_WORD
&& slotno == SPARC_INT_ARG_MAX - 1)
- return 1;
+ return UNITS_PER_WORD;
}
else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
{
if ((slotno + GET_MODE_SIZE (mode) / UNITS_PER_WORD)
> SPARC_FP_ARG_MAX)
- return 1;
+ return UNITS_PER_WORD;
}
}
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 37f1905..3b6ea6c 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -1737,13 +1737,6 @@ function_arg (& (CUM), (MODE), (TYPE), (NAMED), 0)
#define FUNCTION_INCOMING_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (& (CUM), (MODE), (TYPE), (NAMED), 1)
-/* For an arg passed partly in registers and partly in memory,
- this is the number of registers used.
- For args passed entirely in registers or entirely in memory, zero. */
-
-#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
-function_arg_partial_nregs (& (CUM), (MODE), (TYPE), (NAMED))
-
/* If defined, a C expression which determines whether, and in which direction,
to pad out an argument with extra space. The value should be of type
`enum direction': either `upward' to pad above the argument,