@@ -598,13 +598,39 @@ arc64_layout_arg (cumulative_args_t pcum_v, machine_mode mode,
598
598
599
599
static void
600
600
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 )
604
604
{
605
605
arc64_layout_arg (pcum_v , mode , type );
606
606
}
607
607
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
+
608
634
/* This function is used to control a function argument is passed in a
609
635
register, and which register.
610
636
@@ -1719,6 +1745,9 @@ arc64_limm_addr_p (rtx op)
1719
1745
#undef TARGET_FUNCTION_ARG_ADVANCE
1720
1746
#define TARGET_FUNCTION_ARG_ADVANCE arc64_function_arg_advance
1721
1747
1748
+ #undef TARGET_ARG_PARTIAL_BYTES
1749
+ #define TARGET_ARG_PARTIAL_BYTES arc64_arg_partial_bytes
1750
+
1722
1751
#undef TARGET_COMPUTE_FRAME_LAYOUT
1723
1752
#define TARGET_COMPUTE_FRAME_LAYOUT arc64_compute_frame_info
1724
1753
0 commit comments