Skip to content

Commit d7bda7e

Browse files
clazissartemiy-volkov
authored andcommitted
Add partial bytes hook
1 parent bb51df3 commit d7bda7e

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

gcc/config/arc64/arc64.c

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,13 +598,39 @@ arc64_layout_arg (cumulative_args_t pcum_v, machine_mode mode,
598598

599599
static void
600600
arc64_function_arg_advance (cumulative_args_t pcum_v,
601-
machine_mode mode,
602-
const_tree type,
603-
bool named ATTRIBUTE_UNUSED)
601+
machine_mode mode,
602+
const_tree type,
603+
bool named ATTRIBUTE_UNUSED)
604604
{
605605
arc64_layout_arg (pcum_v, mode, type);
606606
}
607607

608+
/* Implement TARGET_ARG_PARTIAL_BYTES. */
609+
610+
static int
611+
arc64_arg_partial_bytes (cumulative_args_t pcum_v,
612+
machine_mode mode,
613+
tree type,
614+
bool named ATTRIBUTE_UNUSED)
615+
{
616+
CUMULATIVE_ARGS *pcum = get_cumulative_args (pcum_v);
617+
int ret = 0;
618+
HOST_WIDE_INT size;
619+
int anum, nregs;
620+
621+
if (type)
622+
size = int_size_in_bytes (type);
623+
else
624+
size = GET_MODE_SIZE (mode);
625+
nregs = (size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
626+
627+
anum = ROUND_ADVANCE_CUM (*pcum, mode, type);
628+
if (anum <= MAX_ARC64_PARM_REGS)
629+
ret = MAX_ARC64_PARM_REGS - anum;
630+
631+
return (ret >= nregs ? 0 : ret * UNITS_PER_WORD);
632+
}
633+
608634
/* This function is used to control a function argument is passed in a
609635
register, and which register.
610636
@@ -1719,6 +1745,9 @@ arc64_limm_addr_p (rtx op)
17191745
#undef TARGET_FUNCTION_ARG_ADVANCE
17201746
#define TARGET_FUNCTION_ARG_ADVANCE arc64_function_arg_advance
17211747

1748+
#undef TARGET_ARG_PARTIAL_BYTES
1749+
#define TARGET_ARG_PARTIAL_BYTES arc64_arg_partial_bytes
1750+
17221751
#undef TARGET_COMPUTE_FRAME_LAYOUT
17231752
#define TARGET_COMPUTE_FRAME_LAYOUT arc64_compute_frame_info
17241753

0 commit comments

Comments
 (0)