Skip to content

Commit e95e6ed

Browse files
author
Claudiu Zissulescu
committed
HS-ABI: select between keeping the order of the func arguments or the packed version
1 parent c105a4e commit e95e6ed

File tree

4 files changed

+34
-6
lines changed

4 files changed

+34
-6
lines changed

gcc/ChangeLog.ARC

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2013-07-23 Claudiu Zissulescu <[email protected]>
2+
3+
* config/arc/arc-opts.h (arc_abi_type): Define.
4+
* config/arc/arc.opt (-mabi=): New option.
5+
* config/arc/arc.c (arc_setup_incoming_varargs): Clean up.
6+
(arc_function_args_impl): Select ABI std/pack.
7+
18
2013-07-15 Claudiu Zissulescu <[email protected]>
29

310
* config/arc/arc.md (EXPAND mulsidi3): Use separate

gcc/config/arc/arc-opts.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,10 @@ enum processor_type
3838
#define FPU_DD 0x0080 /* Double precision floating point sqrt and div operations. */
3939

4040
#define FPX_DP 0x0100 /* Double precision floating point assist operations. */
41+
42+
enum arc_abi_type
43+
{
44+
ARC_ABI_STD,
45+
ARC_ABI_PACK
46+
};
47+

gcc/config/arc/arc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,7 +1862,6 @@ arc_setup_incoming_varargs (cumulative_args_t args_so_far,
18621862
int first_anon_arg;
18631863
CUMULATIVE_ARGS next_cum;
18641864

1865-
18661865
if (TARGET_HS)
18671866
{
18681867
*pretend_size = 0;
@@ -1872,10 +1871,10 @@ arc_setup_incoming_varargs (cumulative_args_t args_so_far,
18721871
/* We must treat `__builtin_va_alist' as an anonymous arg. */
18731872

18741873
next_cum = *get_cumulative_args (args_so_far);
1875-
arc_function_arg_advance (pack_cumulative_args (&next_cum), mode, type, 1);
1874+
arc_function_arg_advance (pack_cumulative_args (&next_cum), mode, type, true);
18761875
first_anon_arg = next_cum.arg_num;
18771876

1878-
if (first_anon_arg < MAX_ARC_PARM_REGS)
1877+
if (FUNCTION_ARG_REGNO_P (first_anon_arg))
18791878
{
18801879
/* First anonymous (unnamed) argument is in a reg. */
18811880

@@ -5250,10 +5249,10 @@ static rtx
52505249
arc_function_args_impl (CUMULATIVE_ARGS *cum,
52515250
enum machine_mode mode,
52525251
const_tree type,
5253-
int named,
5252+
bool named,
52545253
bool advance)
52555254
{
5256-
int reg_idx = 0;
5255+
int lb, reg_idx = 0;
52575256
int reg_location = 0;
52585257
int nregs;
52595258
bool found = false;
@@ -5297,7 +5296,8 @@ arc_function_args_impl (CUMULATIVE_ARGS *cum,
52975296
if (advance)
52985297
{
52995298
/* Update CUMULATIVE_ARGS if we advance. */
5300-
for (reg_idx = reg_location; (reg_idx < (reg_location + nregs))
5299+
lb = (arc_abi == ARC_ABI_PACK) ? reg_location : 0;
5300+
for (reg_idx = lb; (reg_idx < (reg_location + nregs))
53015301
&& FUNCTION_ARG_REGNO_P (reg_idx); reg_idx++)
53025302
{
53035303
cum->avail[reg_idx] = false;

gcc/config/arc/arc.opt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,3 +515,17 @@ Controls the .di instruction extension of atomic instructions. When enabled, the
515515
mirq-ctrl-saved=
516516
Target RejectNegative Joined Var(arc_deferred_options) Defer
517517
Specifies the registers that the processor saves on an interrupt entry and exit.
518+
519+
mabi=
520+
Target RejectNegative Joined Var(arc_abi) Enum(arc_abi_type) Init(ARC_ABI_STD)
521+
Specify the desired ABI used for ARC HS processors. Variants can be std or pack.
522+
523+
Enum
524+
Name(arc_abi_type) Type(enum arc_abi_type)
525+
526+
EnumValue
527+
Enum(arc_abi_type) String(std) Value(ARC_ABI_STD)
528+
529+
EnumValue
530+
Enum(arc_abi_type) String(pack) Value(ARC_ABI_PACK)
531+

0 commit comments

Comments
 (0)