config.gcc: Add --with-abi=
* config.gcc <arm>: Add --with-abi= * config/arm/arm-protos.h (arm_get_frame_size, thumb_get_frame_size, thumb_far_jump_used): Remove prototypes. (arm_needs_doubleword_align): Add prototype. (thumb_compute_initial_elimination_offset): Ditto. * config/arm/arm.c (arm_get_frame_offsets): New function. (use_return_insn, output_return_instruction, arm_output_epilogue, arm_output_function_epilogue, arm_compute_initial_elimination_offset, arm_expand_prologue, thumb_expand_epilogue): Use it. (arm_abi, target_abi_name, all_arm_abis): New variables. (arm_override_options): Set them. Set structure padding for AAPCS. (arm_return_in_memory): Update ABI check. (arm_init_cumulative_args): Initialize can_split. (arm_needs_doubleword_align): New function. (arm_function_arg): Don't split args after pushing to stack. Handle doubleword/even reg alignment. (arm_va_arg): Handle all doubleword aligned args. (add_minpoolforward ref, dump_minpool, push_minpool_fix): Align based on ABI, not CPU. (arm_compute_save_reg0_reg12_mask): Fix comment. (thumb_get_frame_size, thumb_get_frame_size): Remove. (thumb_jump_far_used_p): Remove superfluous argument. Return save value for alignment. (thumb_unexpanded_epilogue, thumb_output_function_prologue): Change to match. (thumb_compute_initial_elimination_offset): New function. (thumb_expand_prologue): Use arm_get_frame_offsets. Remove unneccessary rounding. * config/arm/arm.h (target_abi_name): Declare. (ARM_DOUBLEWORD_ALIGN, DOUBLEWORD_ALIGNMENT, TARGET_IWMMXT_ABI, arm_abi_type, ARM_DEFAULT_ABI): Define. (ARM_FLAG_ATPCS): Remove. (TARGET_OPTIONS, OPTION_DEFAULT_SPECS): Add -mabi=. (BIGGEST_ALIGNMENT, PREFERRED_STACK_BOUNDARY, STACK_BOUNDARY): Use it. (ADJUST_FIELD_ALIGN, DATA_ALIGNMENT, LOCAL_ALIGNMENT, TYPE_NEEDS_IWMMXT_ALIGNMENT): Remove. (LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P, FUNCTION_ARG_REGNO_P): Contitionalize on ABI, not CPU. (struct arm_stack_offsets): Define. (struct machine_function): Add stack_offsets. Remove frame_size. (FUNCTION_ARG_PARTIAL_NREGS): Don't split if previous args have been pushed. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG_BOUNDARY): Handle general doubleword alignment. (THUMB_INITIAL_ELIMINATION_OFFSET, ARM_INITIAL_ELIMINATION_OFFSET): Remove. (INITIAL_ELIMINATION_OFFSET): Call functions directly. * config/arm/arm.md (align_8): Enable for all targets. * config/arm/netbsd-elf.h (TARGET_DEFAULT): Remove TARGET_ATPCS. (ARM_DEFAULT_ABI): Define. * doc/invoke.texi <ARM>: Document -mabi=. Update documentation for -mstructure-size-boundary. From-SVN: r79921
This commit is contained in:
parent
b4a76c01db
commit
5848830fc3
8 changed files with 554 additions and 465 deletions
|
@ -1,3 +1,58 @@
|
|||
2004-03-24 Paul Brook <paul@nowt.org>
|
||||
|
||||
* config.gcc <arm>: Add --with-abi=
|
||||
* config/arm/arm-protos.h (arm_get_frame_size, thumb_get_frame_size,
|
||||
thumb_far_jump_used): Remove prototypes.
|
||||
(arm_needs_doubleword_align): Add prototype.
|
||||
(thumb_compute_initial_elimination_offset): Ditto.
|
||||
* config/arm/arm.c (arm_get_frame_offsets): New function.
|
||||
(use_return_insn, output_return_instruction, arm_output_epilogue,
|
||||
arm_output_function_epilogue, arm_compute_initial_elimination_offset,
|
||||
arm_expand_prologue, thumb_expand_epilogue): Use it.
|
||||
(arm_abi, target_abi_name, all_arm_abis): New variables.
|
||||
(arm_override_options): Set them. Set structure padding for AAPCS.
|
||||
(arm_return_in_memory): Update ABI check.
|
||||
(arm_init_cumulative_args): Initialize can_split.
|
||||
(arm_needs_doubleword_align): New function.
|
||||
(arm_function_arg): Don't split args after pushing to stack. Handle
|
||||
doubleword/even reg alignment.
|
||||
(arm_va_arg): Handle all doubleword aligned args.
|
||||
(add_minpoolforward ref, dump_minpool, push_minpool_fix): Align based
|
||||
on ABI, not CPU.
|
||||
(arm_compute_save_reg0_reg12_mask): Fix comment.
|
||||
(thumb_get_frame_size, thumb_get_frame_size): Remove.
|
||||
(thumb_jump_far_used_p): Remove superfluous argument. Return save
|
||||
value for alignment.
|
||||
(thumb_unexpanded_epilogue, thumb_output_function_prologue): Change
|
||||
to match.
|
||||
(thumb_compute_initial_elimination_offset): New function.
|
||||
(thumb_expand_prologue): Use arm_get_frame_offsets. Remove
|
||||
unneccessary rounding.
|
||||
* config/arm/arm.h (target_abi_name): Declare.
|
||||
(ARM_DOUBLEWORD_ALIGN, DOUBLEWORD_ALIGNMENT, TARGET_IWMMXT_ABI,
|
||||
arm_abi_type, ARM_DEFAULT_ABI): Define.
|
||||
(ARM_FLAG_ATPCS): Remove.
|
||||
(TARGET_OPTIONS, OPTION_DEFAULT_SPECS): Add -mabi=.
|
||||
(BIGGEST_ALIGNMENT, PREFERRED_STACK_BOUNDARY, STACK_BOUNDARY): Use it.
|
||||
(ADJUST_FIELD_ALIGN, DATA_ALIGNMENT, LOCAL_ALIGNMENT,
|
||||
TYPE_NEEDS_IWMMXT_ALIGNMENT): Remove.
|
||||
(LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P, FUNCTION_ARG_REGNO_P):
|
||||
Contitionalize on ABI, not CPU.
|
||||
(struct arm_stack_offsets): Define.
|
||||
(struct machine_function): Add stack_offsets. Remove frame_size.
|
||||
(FUNCTION_ARG_PARTIAL_NREGS): Don't split if previous args have been
|
||||
pushed.
|
||||
(FUNCTION_ARG_ADVANCE, FUNCTION_ARG_BOUNDARY): Handle general
|
||||
doubleword alignment.
|
||||
(THUMB_INITIAL_ELIMINATION_OFFSET,
|
||||
ARM_INITIAL_ELIMINATION_OFFSET): Remove.
|
||||
(INITIAL_ELIMINATION_OFFSET): Call functions directly.
|
||||
* config/arm/arm.md (align_8): Enable for all targets.
|
||||
* config/arm/netbsd-elf.h (TARGET_DEFAULT): Remove TARGET_ATPCS.
|
||||
(ARM_DEFAULT_ABI): Define.
|
||||
* doc/invoke.texi <ARM>: Document -mabi=. Update documentation for
|
||||
-mstructure-size-boundary.
|
||||
|
||||
2004-03-24 Nathanael Nerode <neroden@gcc.gnu.org>
|
||||
|
||||
* configure.ac: Check for -Wno-variadic-macros; don't use
|
||||
|
|
|
@ -2226,7 +2226,7 @@ fi
|
|||
;;
|
||||
|
||||
arm*-*-*)
|
||||
supported_defaults="arch cpu float tune fpu"
|
||||
supported_defaults="arch cpu float tune fpu abi"
|
||||
for which in cpu tune; do
|
||||
eval "val=\$with_$which"
|
||||
case "$val" in
|
||||
|
@ -2280,13 +2280,24 @@ fi
|
|||
# OK
|
||||
;;
|
||||
*)
|
||||
echo "Unknown fpu used in --with-fpu=$fpu" 2>&1
|
||||
echo "Unknown fpu used in --with-fpu=$with_fpu" 2>&1
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$with_abi" in
|
||||
"" \
|
||||
| apcs-gnu | atpcs | aapcs | iwmmxt )
|
||||
#OK
|
||||
;;
|
||||
*)
|
||||
echo "Unknown ABI used in --with-abi=$with_abi"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "x$with_arch" != x && test "x$with_cpu" != x; then
|
||||
echo "Warning: --with-arch overrides --with-cpu" 1>&2
|
||||
echo "Warning: --with-arch overrides --with-cpu=$with_cpu" 1>&2
|
||||
fi
|
||||
;;
|
||||
|
||||
|
|
|
@ -31,12 +31,13 @@ extern void arm_finalize_pic (int);
|
|||
extern int arm_volatile_func (void);
|
||||
extern const char *arm_output_epilogue (rtx);
|
||||
extern void arm_expand_prologue (void);
|
||||
extern HOST_WIDE_INT arm_get_frame_size (void);
|
||||
extern const char *arm_strip_name_encoding (const char *);
|
||||
extern void arm_asm_output_labelref (FILE *, const char *);
|
||||
extern unsigned long arm_current_func_type (void);
|
||||
extern unsigned int arm_compute_initial_elimination_offset (unsigned int,
|
||||
unsigned int);
|
||||
extern HOST_WIDE_INT thumb_compute_initial_elimination_offset (unsigned int,
|
||||
unsigned int);
|
||||
|
||||
#ifdef TREE_CODE
|
||||
extern int arm_return_in_memory (tree);
|
||||
|
@ -157,6 +158,7 @@ extern void arm_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree);
|
|||
extern rtx arm_va_arg (tree, tree);
|
||||
extern int arm_function_arg_pass_by_reference (CUMULATIVE_ARGS *,
|
||||
enum machine_mode, tree, int);
|
||||
extern bool arm_needs_doubleword_align (enum machine_mode, tree);
|
||||
#endif
|
||||
|
||||
#if defined AOF_ASSEMBLER
|
||||
|
@ -175,9 +177,7 @@ extern int arm_float_words_big_endian (void);
|
|||
|
||||
/* Thumb functions. */
|
||||
extern void arm_init_expanders (void);
|
||||
extern int thumb_far_jump_used_p (int);
|
||||
extern const char *thumb_unexpanded_epilogue (void);
|
||||
extern HOST_WIDE_INT thumb_get_frame_size (void);
|
||||
extern void thumb_expand_prologue (void);
|
||||
extern void thumb_expand_epilogue (void);
|
||||
#ifdef TREE_CODE
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -140,6 +140,8 @@ extern const char *target_fpu_name;
|
|||
extern const char *target_fpe_name;
|
||||
/* Whether to use floating point hardware. */
|
||||
extern const char *target_float_abi_name;
|
||||
/* Which ABI to use. */
|
||||
extern const char *target_abi_name;
|
||||
/* Define the information needed to generate branch insns. This is
|
||||
stored from the compare operation. */
|
||||
extern GTY(()) rtx arm_compare_op0;
|
||||
|
@ -433,11 +435,8 @@ extern GTY(()) rtx aof_pic_label;
|
|||
destination is non-Thumb aware. */
|
||||
#define THUMB_FLAG_CALLER_SUPER_INTERWORKING (1 << 20)
|
||||
|
||||
/* Nonzero means to use ARM/Thumb Procedure Call Standard conventions. */
|
||||
#define ARM_FLAG_ATPCS (1 << 21)
|
||||
|
||||
/* Fix invalid Cirrus instruction combinations by inserting NOPs. */
|
||||
#define CIRRUS_FIX_INVALID_INSNS (1 << 22)
|
||||
#define CIRRUS_FIX_INVALID_INSNS (1 << 21)
|
||||
|
||||
#define TARGET_APCS_FRAME (target_flags & ARM_FLAG_APCS_FRAME)
|
||||
#define TARGET_POKE_FUNCTION_NAME (target_flags & ARM_FLAG_POKE)
|
||||
|
@ -446,7 +445,6 @@ extern GTY(()) rtx aof_pic_label;
|
|||
#define TARGET_APCS_STACK (target_flags & ARM_FLAG_APCS_STACK)
|
||||
#define TARGET_APCS_FLOAT (target_flags & ARM_FLAG_APCS_FLOAT)
|
||||
#define TARGET_APCS_REENT (target_flags & ARM_FLAG_APCS_REENT)
|
||||
#define TARGET_ATPCS (target_flags & ARM_FLAG_ATPCS)
|
||||
#define TARGET_MMU_TRAPS (target_flags & ARM_FLAG_MMU_TRAPS)
|
||||
#define TARGET_SOFT_FLOAT (arm_float_abi == ARM_FLOAT_ABI_SOFT)
|
||||
#define TARGET_SOFT_FLOAT_ABI (arm_float_abi != ARM_FLOAT_ABI_HARD)
|
||||
|
@ -456,6 +454,7 @@ extern GTY(()) rtx aof_pic_label;
|
|||
#define TARGET_VFP (arm_fp_model == ARM_FP_MODEL_VFP)
|
||||
#define TARGET_IWMMXT (arm_arch_iwmmxt)
|
||||
#define TARGET_REALLY_IWMMXT (TARGET_IWMMXT && TARGET_ARM)
|
||||
#define TARGET_IWMMXT_ABI (TARGET_ARM && arm_abi == ARM_ABI_IWMMXT)
|
||||
#define TARGET_BIG_END (target_flags & ARM_FLAG_BIG_END)
|
||||
#define TARGET_INTERWORK (target_flags & ARM_FLAG_INTERWORK)
|
||||
#define TARGET_LITTLE_WORDS (target_flags & ARM_FLAG_LITTLE_WORDS)
|
||||
|
@ -574,7 +573,8 @@ extern GTY(()) rtx aof_pic_label;
|
|||
{"structure-size-boundary=", & structure_size_string, \
|
||||
N_("Specify the minimum bit alignment of structures"), 0}, \
|
||||
{"pic-register=", & arm_pic_register_string, \
|
||||
N_("Specify the register to be used for PIC addressing"), 0} \
|
||||
N_("Specify the register to be used for PIC addressing"), 0}, \
|
||||
{"abi=", &target_abi_name, N_("Specify an ABI"), 0} \
|
||||
}
|
||||
|
||||
/* Support for a compile-time default CPU, et cetera. The rules are:
|
||||
|
@ -585,14 +585,16 @@ extern GTY(()) rtx aof_pic_label;
|
|||
by -march).
|
||||
--with-float is ignored if -mhard-float, -msoft-float or -mfloat-abi are
|
||||
specified.
|
||||
--with-fpu is ignored if -mfpu is specified. */
|
||||
--with-fpu is ignored if -mfpu is specified.
|
||||
--with-abi is ignored is -mabi is specified. */
|
||||
#define OPTION_DEFAULT_SPECS \
|
||||
{"arch", "%{!march=*:%{!mcpu=*:-march=%(VALUE)}}" }, \
|
||||
{"cpu", "%{!march=*:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
|
||||
{"tune", "%{!mcpu=*:%{!mtune=*:-mtune=%(VALUE)}}" }, \
|
||||
{"float", \
|
||||
"%{!msoft-float:%{!mhard-float:%{!mfloat-abi=*:-mfloat-abi=%(VALUE)}}}" }, \
|
||||
{"fpu", "%{!mfpu=*:-mfpu=%(VALUE)}"},
|
||||
{"fpu", "%{!mfpu=*:-mfpu=%(VALUE)}"}, \
|
||||
{"abi", "%{!mabi=*:-mabi=%(VALUE)}"},
|
||||
|
||||
struct arm_cpu_select
|
||||
{
|
||||
|
@ -682,6 +684,21 @@ extern enum float_abi_type arm_float_abi;
|
|||
#define FPUTYPE_DEFAULT FPUTYPE_MAVERICK
|
||||
#endif
|
||||
|
||||
/* Which ABI to use. */
|
||||
enum arm_abi_type
|
||||
{
|
||||
ARM_ABI_APCS,
|
||||
ARM_ABI_ATPCS,
|
||||
ARM_ABI_AAPCS,
|
||||
ARM_ABI_IWMMXT
|
||||
};
|
||||
|
||||
extern enum arm_abi_type arm_abi;
|
||||
|
||||
#ifndef ARM_DEFAULT_ABI
|
||||
#define ARM_DEFAULT_ABI ARM_ABI_APCS
|
||||
#endif
|
||||
|
||||
/* Nonzero if this chip supports the ARM Architecture 3M extensions. */
|
||||
extern int arm_arch3m;
|
||||
|
||||
|
@ -811,13 +828,17 @@ extern int arm_is_6_or_7;
|
|||
|
||||
#define UNITS_PER_WORD 4
|
||||
|
||||
/* True if natural alignment is used for doubleword types. */
|
||||
#define ARM_DOUBLEWORD_ALIGN \
|
||||
(arm_abi == ARM_ABI_AAPCS || arm_abi == ARM_ABI_IWMMXT)
|
||||
#define DOUBLEWORD_ALIGNMENT 64
|
||||
|
||||
#define PARM_BOUNDARY 32
|
||||
|
||||
#define IWMMXT_ALIGNMENT 64
|
||||
#define STACK_BOUNDARY (ARM_DOUBLEWORD_ALIGN ? DOUBLEWORD_ALIGNMENT : 32)
|
||||
|
||||
#define STACK_BOUNDARY 32
|
||||
|
||||
#define PREFERRED_STACK_BOUNDARY (TARGET_ATPCS ? 64 : 32)
|
||||
#define PREFERRED_STACK_BOUNDARY \
|
||||
(arm_abi == ARM_ABI_ATPCS ? 64 : STACK_BOUNDARY)
|
||||
|
||||
#define FUNCTION_BOUNDARY 32
|
||||
|
||||
|
@ -828,62 +849,30 @@ extern int arm_is_6_or_7;
|
|||
|
||||
#define EMPTY_FIELD_BOUNDARY 32
|
||||
|
||||
#define BIGGEST_ALIGNMENT (TARGET_REALLY_IWMMXT ? 64 : 32)
|
||||
|
||||
#define TYPE_NEEDS_IWMMXT_ALIGNMENT(TYPE) \
|
||||
(TARGET_REALLY_IWMMXT \
|
||||
&& ((TREE_CODE (TYPE) == VECTOR_TYPE) || (TYPE_MODE (TYPE) == DImode) || (TYPE_MODE (TYPE) == DFmode)))
|
||||
#define BIGGEST_ALIGNMENT (ARM_DOUBLEWORD_ALIGN ? DOUBLEWORD_ALIGNMENT : 32)
|
||||
|
||||
/* XXX Blah -- this macro is used directly by libobjc. Since it
|
||||
supports no vector modes, cut out the complexity and fall back
|
||||
on BIGGEST_FIELD_ALIGNMENT. */
|
||||
#ifdef IN_TARGET_LIBS
|
||||
#define BIGGEST_FIELD_ALIGNMENT 64
|
||||
#else
|
||||
/* An expression for the alignment of a structure field FIELD if the
|
||||
alignment computed in the usual way is COMPUTED. GCC uses this
|
||||
value instead of the value in `BIGGEST_ALIGNMENT' or
|
||||
`BIGGEST_FIELD_ALIGNMENT', if defined, for structure fields only. */
|
||||
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
|
||||
(TYPE_NEEDS_IWMMXT_ALIGNMENT (TREE_TYPE (FIELD)) \
|
||||
? IWMMXT_ALIGNMENT \
|
||||
: (COMPUTED))
|
||||
#endif
|
||||
|
||||
/* If defined, a C expression to compute the alignment for a static variable.
|
||||
TYPE is the data type, and ALIGN is the alignment that the object
|
||||
would ordinarily have. The value of this macro is used instead of that
|
||||
alignment to align the object.
|
||||
|
||||
If this macro is not defined, then ALIGN is used. */
|
||||
#define DATA_ALIGNMENT(TYPE, ALIGN) \
|
||||
(TYPE_NEEDS_IWMMXT_ALIGNMENT (TYPE) ? IWMMXT_ALIGNMENT : ALIGN)
|
||||
|
||||
/* If defined, a C expression to compute the alignment for a
|
||||
variables in the local store. TYPE is the data type, and
|
||||
BASIC-ALIGN is the alignment that the object would ordinarily
|
||||
have. The value of this macro is used instead of that alignment
|
||||
to align the object.
|
||||
|
||||
If this macro is not defined, then BASIC-ALIGN is used. */
|
||||
#define LOCAL_ALIGNMENT(TYPE, ALIGN) \
|
||||
(TYPE_NEEDS_IWMMXT_ALIGNMENT (TYPE) ? IWMMXT_ALIGNMENT : ALIGN)
|
||||
|
||||
/* Make strings word-aligned so strcpy from constants will be faster. */
|
||||
#define CONSTANT_ALIGNMENT_FACTOR (TARGET_THUMB || ! arm_tune_xscale ? 1 : 2)
|
||||
|
||||
#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
|
||||
((TARGET_REALLY_IWMMXT && TREE_CODE (EXP) == VECTOR_TYPE) ? IWMMXT_ALIGNMENT : \
|
||||
(TREE_CODE (EXP) == STRING_CST \
|
||||
&& (ALIGN) < BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR) \
|
||||
? BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR : (ALIGN))
|
||||
((TREE_CODE (EXP) == STRING_CST \
|
||||
&& (ALIGN) < BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR) \
|
||||
? BITS_PER_WORD * CONSTANT_ALIGNMENT_FACTOR : (ALIGN))
|
||||
|
||||
/* Setting STRUCTURE_SIZE_BOUNDARY to 32 produces more efficient code, but the
|
||||
value set in previous versions of this toolchain was 8, which produces more
|
||||
compact structures. The command line option -mstructure_size_boundary=<n>
|
||||
can be used to change this value. For compatibility with the ARM SDK
|
||||
however the value should be left at 32. ARM SDT Reference Manual (ARM DUI
|
||||
0020D) page 2-20 says "Structures are aligned on word boundaries". */
|
||||
0020D) page 2-20 says "Structures are aligned on word boundaries".
|
||||
The AAPCS specifies a value of 8. */
|
||||
#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary
|
||||
extern int arm_structure_size_boundary;
|
||||
|
||||
|
@ -1728,7 +1717,7 @@ enum reg_class
|
|||
: TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK \
|
||||
&& GET_MODE_CLASS (MODE) == MODE_FLOAT \
|
||||
? gen_rtx_REG (MODE, FIRST_CIRRUS_FP_REGNUM) \
|
||||
: TARGET_REALLY_IWMMXT && VECTOR_MODE_SUPPORTED_P (MODE) \
|
||||
: TARGET_IWMMXT_ABI && VECTOR_MODE_SUPPORTED_P (MODE) \
|
||||
? gen_rtx_REG (MODE, FIRST_IWMMXT_REGNUM) \
|
||||
: gen_rtx_REG (MODE, ARG_REGISTER (1)))
|
||||
|
||||
|
@ -1746,7 +1735,7 @@ enum reg_class
|
|||
((REGNO) == ARG_REGISTER (1) \
|
||||
|| (TARGET_ARM && ((REGNO) == FIRST_CIRRUS_FP_REGNUM) \
|
||||
&& TARGET_HARD_FLOAT && TARGET_MAVERICK) \
|
||||
|| (TARGET_ARM && ((REGNO) == FIRST_IWMMXT_REGNUM) && TARGET_IWMMXT) \
|
||||
|| ((REGNO) == FIRST_IWMMXT_REGNUM && TARGET_IWMMXT_ABI) \
|
||||
|| (TARGET_ARM && ((REGNO) == FIRST_FPA_REGNUM) \
|
||||
&& TARGET_HARD_FLOAT && TARGET_FPA))
|
||||
|
||||
|
@ -1800,6 +1789,22 @@ enum reg_class
|
|||
#define IS_NAKED(t) (t & ARM_FT_NAKED)
|
||||
#define IS_NESTED(t) (t & ARM_FT_NESTED)
|
||||
|
||||
|
||||
/* Structure used to hold the function stack frame layout. Offsets are
|
||||
relative to the stack pointer on function entry. Positive offsets are
|
||||
in the direction of stack growth.
|
||||
Only soft_frame is used in thumb mode. */
|
||||
|
||||
typedef struct arm_stack_offsets GTY(())
|
||||
{
|
||||
int saved_args; /* ARG_POINTER_REGNUM. */
|
||||
int frame; /* ARM_HARD_FRAME_POINTER_REGNUM. */
|
||||
int saved_regs;
|
||||
int soft_frame; /* FRAME_POINTER_REGNUM. */
|
||||
int outgoing_args; /* STACK_POINTER_REGNUM. */
|
||||
}
|
||||
arm_stack_offsets;
|
||||
|
||||
/* A C structure for machine-specific, per-function data.
|
||||
This is added to the cfun structure. */
|
||||
typedef struct machine_function GTY(())
|
||||
|
@ -1813,7 +1818,7 @@ typedef struct machine_function GTY(())
|
|||
/* Records if the save of LR has been eliminated. */
|
||||
int lr_save_eliminated;
|
||||
/* The size of the stack frame. Only valid after reload. */
|
||||
int frame_size;
|
||||
arm_stack_offsets stack_offsets;
|
||||
/* Records the type of the current function. */
|
||||
unsigned long func_type;
|
||||
/* Record if the function has a variable argument list. */
|
||||
|
@ -1837,6 +1842,7 @@ typedef struct
|
|||
int nargs;
|
||||
/* One of CALL_NORMAL, CALL_LONG or CALL_SHORT. */
|
||||
int call_cookie;
|
||||
int can_split;
|
||||
} CUMULATIVE_ARGS;
|
||||
|
||||
/* Define where to put the arguments to a function.
|
||||
|
@ -1866,7 +1872,8 @@ typedef struct
|
|||
#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
|
||||
(VECTOR_MODE_SUPPORTED_P (MODE) ? 0 : \
|
||||
NUM_ARG_REGS > (CUM).nregs \
|
||||
&& (NUM_ARG_REGS < ((CUM).nregs + ARM_NUM_REGS2 (MODE, TYPE))) \
|
||||
&& (NUM_ARG_REGS < ((CUM).nregs + ARM_NUM_REGS2 (MODE, TYPE)) \
|
||||
&& (CUM).can_split) \
|
||||
? NUM_ARG_REGS - (CUM).nregs : 0)
|
||||
|
||||
/* A C expression that indicates when an argument must be passed by
|
||||
|
@ -1889,26 +1896,26 @@ typedef struct
|
|||
(TYPE is null for libcalls where that information may not be available.) */
|
||||
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
|
||||
(CUM).nargs += 1; \
|
||||
if (VECTOR_MODE_SUPPORTED_P (MODE)) \
|
||||
if ((CUM).named_count <= (CUM).nargs) \
|
||||
(CUM).nregs += 2; \
|
||||
else \
|
||||
(CUM).iwmmxt_nregs += 1; \
|
||||
if (VECTOR_MODE_SUPPORTED_P (MODE) \
|
||||
&& (CUM).named_count > (CUM).nargs) \
|
||||
(CUM).iwmmxt_nregs += 1; \
|
||||
else \
|
||||
(CUM).nregs += ARM_NUM_REGS2 (MODE, TYPE)
|
||||
(CUM).nregs += ARM_NUM_REGS2 (MODE, TYPE)
|
||||
|
||||
/* If defined, a C expression that gives the alignment boundary, in bits, of an
|
||||
argument with the specified mode and type. If it is not defined,
|
||||
`PARM_BOUNDARY' is used for all arguments. */
|
||||
#define FUNCTION_ARG_BOUNDARY(MODE,TYPE) \
|
||||
(TARGET_REALLY_IWMMXT && (VALID_IWMMXT_REG_MODE (MODE) || ((MODE) == DFmode)) \
|
||||
? IWMMXT_ALIGNMENT : PARM_BOUNDARY)
|
||||
((ARM_DOUBLEWORD_ALIGN && arm_needs_doubleword_align (MODE, TYPE)) \
|
||||
? DOUBLEWORD_ALIGNMENT \
|
||||
: PARM_BOUNDARY )
|
||||
|
||||
/* 1 if N is a possible register number for function argument passing.
|
||||
On the ARM, r0-r3 are used to pass args. */
|
||||
#define FUNCTION_ARG_REGNO_P(REGNO) \
|
||||
(IN_RANGE ((REGNO), 0, 3) \
|
||||
|| (TARGET_REALLY_IWMMXT && IN_RANGE ((REGNO), FIRST_IWMMXT_REGNUM, FIRST_IWMMXT_REGNUM + 9)))
|
||||
|| (TARGET_IWMMXT_ABI \
|
||||
&& IN_RANGE ((REGNO), FIRST_IWMMXT_REGNUM, FIRST_IWMMXT_REGNUM + 9)))
|
||||
|
||||
/* Implement `va_arg'. */
|
||||
#define EXPAND_BUILTIN_VA_ARG(valist, type) \
|
||||
|
@ -2030,53 +2037,12 @@ typedef struct
|
|||
|
||||
/* Define the offset between two registers, one to be eliminated, and the
|
||||
other its replacement, at the start of a routine. */
|
||||
#define ARM_INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
|
||||
do \
|
||||
{ \
|
||||
(OFFSET) = arm_compute_initial_elimination_offset (FROM, TO); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* Note: This macro must match the code in thumb_function_prologue(). */
|
||||
#define THUMB_INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
|
||||
{ \
|
||||
(OFFSET) = 0; \
|
||||
if ((FROM) == ARG_POINTER_REGNUM) \
|
||||
{ \
|
||||
int count_regs = 0; \
|
||||
int regno; \
|
||||
for (regno = 8; regno < 13; regno ++) \
|
||||
if (THUMB_REG_PUSHED_P (regno)) \
|
||||
count_regs ++; \
|
||||
if (count_regs) \
|
||||
(OFFSET) += 4 * count_regs; \
|
||||
count_regs = 0; \
|
||||
for (regno = 0; regno <= LAST_LO_REGNUM; regno ++) \
|
||||
if (THUMB_REG_PUSHED_P (regno)) \
|
||||
count_regs ++; \
|
||||
if (count_regs || ! leaf_function_p () || thumb_far_jump_used_p (0))\
|
||||
(OFFSET) += 4 * (count_regs + 1); \
|
||||
if (TARGET_BACKTRACE) \
|
||||
{ \
|
||||
if ((count_regs & 0xFF) == 0 && (regs_ever_live[3] != 0)) \
|
||||
(OFFSET) += 20; \
|
||||
else \
|
||||
(OFFSET) += 16; \
|
||||
} \
|
||||
} \
|
||||
if ((TO) == STACK_POINTER_REGNUM) \
|
||||
{ \
|
||||
(OFFSET) += current_function_outgoing_args_size; \
|
||||
(OFFSET) += thumb_get_frame_size (); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
|
||||
if (TARGET_ARM) \
|
||||
ARM_INITIAL_ELIMINATION_OFFSET (FROM, TO, OFFSET); \
|
||||
(OFFSET) = arm_compute_initial_elimination_offset (FROM, TO); \
|
||||
else \
|
||||
THUMB_INITIAL_ELIMINATION_OFFSET (FROM, TO, OFFSET)
|
||||
|
||||
(OFFSET) = thumb_compute_initial_elimination_offset (FROM, TO)
|
||||
|
||||
/* Special case handling of the location of arguments passed on the stack. */
|
||||
#define DEBUGGER_ARG_OFFSET(value, addr) value ? value : arm_debugger_arg_offset (value, addr)
|
||||
|
||||
|
|
|
@ -10102,7 +10102,7 @@
|
|||
|
||||
(define_insn "align_8"
|
||||
[(unspec_volatile [(const_int 0)] VUNSPEC_ALIGN8)]
|
||||
"TARGET_REALLY_IWMMXT"
|
||||
"TARGET_EITHER"
|
||||
"*
|
||||
assemble_align (64);
|
||||
return \"\";
|
||||
|
|
|
@ -38,10 +38,12 @@
|
|||
(ARM_FLAG_APCS_32 \
|
||||
| ARM_FLAG_SOFT_FLOAT \
|
||||
| ARM_FLAG_APCS_FRAME \
|
||||
| ARM_FLAG_ATPCS \
|
||||
| ARM_FLAG_MMU_TRAPS \
|
||||
| TARGET_ENDIAN_DEFAULT)
|
||||
|
||||
#undef ARM_DEFAULT_ABI
|
||||
#define ARM_DEFAULT_ABI ARM_ABI_ATPCS
|
||||
|
||||
#define TARGET_OS_CPP_BUILTINS() \
|
||||
do \
|
||||
{ \
|
||||
|
|
|
@ -368,6 +368,7 @@ in the following sections.
|
|||
|
||||
@emph{ARM Options}
|
||||
@gccoptlist{-mapcs-frame -mno-apcs-frame @gol
|
||||
-mabi=@var{name} @gol
|
||||
-mapcs-26 -mapcs-32 @gol
|
||||
-mapcs-stack-check -mno-apcs-stack-check @gol
|
||||
-mapcs-float -mno-apcs-float @gol
|
||||
|
@ -6413,6 +6414,11 @@ These @samp{-m} options are defined for Advanced RISC Machines (ARM)
|
|||
architectures:
|
||||
|
||||
@table @gcctabopt
|
||||
@item -mabi=@var{name}
|
||||
@opindex mabi
|
||||
Generate code for the specified ABI. Permissible values are: @samp{apcs-gnu},
|
||||
@samp{atpcs}, @samp{aapcs} and @samp{iwmmxt}.
|
||||
|
||||
@item -mapcs-frame
|
||||
@opindex mapcs-frame
|
||||
Generate a stack frame that is compliant with the ARM Procedure Call
|
||||
|
@ -6635,14 +6641,16 @@ floating point values.
|
|||
@item -mstructure-size-boundary=@var{n}
|
||||
@opindex mstructure-size-boundary
|
||||
The size of all structures and unions will be rounded up to a multiple
|
||||
of the number of bits set by this option. Permissible values are 8 and
|
||||
32. The default value varies for different toolchains. For the COFF
|
||||
targeted toolchain the default value is 8. Specifying the larger number
|
||||
can produce faster, more efficient code, but can also increase the size
|
||||
of the program. The two values are potentially incompatible. Code
|
||||
compiled with one value cannot necessarily expect to work with code or
|
||||
libraries compiled with the other value, if they exchange information
|
||||
using structures or unions.
|
||||
of the number of bits set by this option. Permissible values are 8, 32
|
||||
and 64. The default value varies for different toolchains. For the COFF
|
||||
targeted toolchain the default value is 8. A value of 64 is only allowed
|
||||
if the underlying ABI supports it.
|
||||
|
||||
Specifying the larger number can produce faster, more efficient code, but
|
||||
can also increase the size of the program. Different values are potentially
|
||||
incompatible. Code compiled with one value cannot necessarily expect to
|
||||
work with code or libraries compiled with annother value, if they exchange
|
||||
information using structures or unions.
|
||||
|
||||
@item -mabort-on-noreturn
|
||||
@opindex mabort-on-noreturn
|
||||
|
|
Loading…
Add table
Reference in a new issue