This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Formatting tidy up of arm.c
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: 16 Jan 2002 12:23:28 +0000
- Subject: Formatting tidy up of arm.c
Hi Guys,
I am applying the patch below as a general tidy up of the formatting
in gcc/config/arm/arm.c. It does not add any new code, it just
makes things neater.
Cheers
Nick
2002-01-16 Nick Clifton <nickc@cambridge.redhat.com>
* config/arm/arm.c: General formatting tidy up.
Index: config/arm/arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.184
diff -c -3 -p -w -r1.184 arm.c
*** arm.c 2002/01/11 16:15:36 1.184
--- arm.c 2002/01/16 12:22:47
***************
*** 1,5 ****
/* Output routines for GCC for ARM.
! Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
and Martin Simmons (@harleqn.co.uk).
--- 1,5 ----
/* Output routines for GCC for ARM.
! Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
and Martin Simmons (@harleqn.co.uk).
*************** typedef struct minipool_fixup Mfix;
*** 60,65 ****
--- 60,67 ----
#define Ulong unsigned long
#define Ccstar const char *
+ const struct attribute_spec arm_attribute_table[];
+
/* Forward function declarations. */
static void arm_add_gc_roots PARAMS ((void));
static int arm_gen_constant PARAMS ((enum rtx_code, Mmode, Hint, rtx, rtx, int, int));
*************** static int eliminate_lr2ip PARAMS
*** 69,76 ****
static rtx emit_multi_reg_push PARAMS ((int));
static rtx emit_sfm PARAMS ((int, int));
#ifndef AOF_ASSEMBLER
! static bool arm_assemble_integer PARAMS ((rtx, unsigned int,
! int));
#endif
static Ccstar fp_const_from_val PARAMS ((REAL_VALUE_TYPE *));
static arm_cc get_arm_condition_code PARAMS ((rtx));
--- 71,77 ----
static rtx emit_multi_reg_push PARAMS ((int));
static rtx emit_sfm PARAMS ((int, int));
#ifndef AOF_ASSEMBLER
! static bool arm_assemble_integer PARAMS ((rtx, unsigned int, int));
#endif
static Ccstar fp_const_from_val PARAMS ((REAL_VALUE_TYPE *));
static arm_cc get_arm_condition_code PARAMS ((rtx));
*************** static Ulong arm_isr_value PARAMS
*** 110,129 ****
static Ulong arm_compute_func_type PARAMS ((void));
static tree arm_handle_fndecl_attribute PARAMS ((tree *, tree, tree, int, bool *));
static tree arm_handle_isr_attribute PARAMS ((tree *, tree, tree, int, bool *));
! const struct attribute_spec arm_attribute_table[];
! static void arm_output_function_epilogue PARAMS ((FILE *,
! HOST_WIDE_INT));
! static void arm_output_function_prologue PARAMS ((FILE *,
! HOST_WIDE_INT));
! static void thumb_output_function_prologue PARAMS ((FILE *,
! HOST_WIDE_INT));
static int arm_comp_type_attributes PARAMS ((tree, tree));
static void arm_set_default_type_attributes PARAMS ((tree));
#ifdef OBJECT_FORMAT_ELF
! static void arm_elf_asm_named_section PARAMS ((const char *,
! unsigned int));
#endif
- static int arm_adjust_cost PARAMS ((rtx, rtx, rtx, int));
#undef Hint
#undef Mmode
--- 111,125 ----
static Ulong arm_compute_func_type PARAMS ((void));
static tree arm_handle_fndecl_attribute PARAMS ((tree *, tree, tree, int, bool *));
static tree arm_handle_isr_attribute PARAMS ((tree *, tree, tree, int, bool *));
! static void arm_output_function_epilogue PARAMS ((FILE *, Hint));
! static void arm_output_function_prologue PARAMS ((FILE *, Hint));
! static void thumb_output_function_prologue PARAMS ((FILE *, Hint));
static int arm_comp_type_attributes PARAMS ((tree, tree));
static void arm_set_default_type_attributes PARAMS ((tree));
+ static int arm_adjust_cost PARAMS ((rtx, rtx, rtx, int));
#ifdef OBJECT_FORMAT_ELF
! static void arm_elf_asm_named_section PARAMS ((const char *, unsigned int));
#endif
#undef Hint
#undef Mmode
*************** static char *minipool_startobj;
*** 183,190 ****
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
! /* The maximum number of insns skipped which will be conditionalised if
! possible. */
static int max_insns_skipped = 5;
extern FILE * asm_out_file;
--- 179,186 ----
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
! /* The maximum number of insns skipped which
! will be conditionalised if possible. */
static int max_insns_skipped = 5;
extern FILE * asm_out_file;
*************** int arm_structure_size_boundary = DEF
*** 225,232 ****
#define FL_ARCH5E (1 << 9) /* DSP extenstions to v5 */
#define FL_XSCALE (1 << 10) /* XScale */
! /* The bits in this mask specify which instructions we are
! allowed to generate. */
static int insn_flags = 0;
/* The bits in this mask specify which instruction scheduling options should
--- 221,228 ----
#define FL_ARCH5E (1 << 9) /* DSP extenstions to v5 */
#define FL_XSCALE (1 << 10) /* XScale */
! /* The bits in this mask specify which
! instructions we are allowed to generate. */
static int insn_flags = 0;
/* The bits in this mask specify which instruction scheduling options should
*************** arm_isr_value (argument)
*** 826,832 ****
/* Check it against the list of known arguments. */
for (ptr = isr_attribute_args; ptr->arg != NULL; ptr ++)
! if (strcmp (arg, ptr->arg) == 0)
return ptr->return_value;
/* An unrecognised interrupt type. */
--- 822,828 ----
/* Check it against the list of known arguments. */
for (ptr = isr_attribute_args; ptr->arg != NULL; ptr ++)
! if (streq (arg, ptr->arg))
return ptr->return_value;
/* An unrecognised interrupt type. */
*************** count_insns_for_constant (HOST_WIDE_INT
*** 1101,1106 ****
--- 1097,1103 ----
/* As above, but extra parameter GENERATE which, if clear, suppresses
RTL generation. */
+
static int
arm_gen_constant (code, mode, val, target, source, subtargets, generate)
enum rtx_code code;
*************** arm_gen_constant (code, mode, val, targe
*** 1672,1685 ****
i -= 6;
}
i -= 2;
- } while (remainder);
}
return insns;
}
/* Canonicalize a comparison so that we are more likely to recognize it.
This can be done for a few constant compares, where we can make the
immediate value easier to load. */
enum rtx_code
arm_canonicalize_comparison (code, op1)
enum rtx_code code;
--- 1669,1685 ----
i -= 6;
}
i -= 2;
}
+ while (remainder);
+ }
+
return insns;
}
/* Canonicalize a comparison so that we are more likely to recognize it.
This can be done for a few constant compares, where we can make the
immediate value easier to load. */
+
enum rtx_code
arm_canonicalize_comparison (code, op1)
enum rtx_code code;
*************** arm_canonicalize_comparison (code, op1)
*** 1743,1748 ****
--- 1743,1749 ----
/* Decide whether a type should be returned in memory (true)
or in a register (false). This is called by the macro
RETURN_IN_MEMORY. */
+
int
arm_return_in_memory (type)
tree type;
*************** arm_init_cumulative_args (pcum, fntype,
*** 1877,1882 ****
--- 1878,1884 ----
the preceding args and about the function being called.
NAMED is nonzero if this argument is a named parameter
(otherwise it is an extra parameter matching an ellipsis). */
+
rtx
arm_function_arg (pcum, mode, type, named)
CUMULATIVE_ARGS * pcum;
*************** arm_pr_long_calls_off (pfile)
*** 1925,1931 ****
arm_pragma_long_calls = OFF;
}
-
/* Table of machine attributes. */
const struct attribute_spec arm_attribute_table[] =
{
--- 1927,1932 ----
*************** const struct attribute_spec arm_attribut
*** 1960,1965 ****
--- 1961,1967 ----
/* Handle an attribute requiring a FUNCTION_DECL;
arguments as in struct attribute_spec.handler. */
+
static tree
arm_handle_fndecl_attribute (node, name, args, flags, no_add_attrs)
tree * node;
*************** arm_handle_fndecl_attribute (node, name,
*** 1980,1985 ****
--- 1982,1988 ----
/* Handle an "interrupt" or "isr" attribute;
arguments as in struct attribute_spec.handler. */
+
static tree
arm_handle_isr_attribute (node, name, args, flags, no_add_attrs)
tree * node;
*************** arm_handle_isr_attribute (node, name, ar
*** 2016,2025 ****
&& arm_isr_value (args) != ARM_FT_UNKNOWN)
{
*node = build_type_copy (*node);
! TREE_TYPE (*node) = build_type_attribute_variant (TREE_TYPE (*node),
! tree_cons (name,
! args,
! TYPE_ATTRIBUTES (TREE_TYPE (*node))));
*no_add_attrs = true;
}
else
--- 2019,2027 ----
&& arm_isr_value (args) != ARM_FT_UNKNOWN)
{
*node = build_type_copy (*node);
! TREE_TYPE (*node) = build_type_attribute_variant
! (TREE_TYPE (*node),
! tree_cons (name, args, TYPE_ATTRIBUTES (TREE_TYPE (*node))));
*no_add_attrs = true;
}
else
*************** arm_handle_isr_attribute (node, name, ar
*** 2045,2050 ****
--- 2047,2053 ----
/* Return 0 if the attributes for two types are incompatible, 1 if they
are compatible, and 2 if they are nearly compatible (which causes a
warning to be generated). */
+
static int
arm_comp_type_attributes (type1, type2)
tree type1;
*************** arm_comp_type_attributes (type1, type2)
*** 2089,2094 ****
--- 2092,2098 ----
/* Encode long_call or short_call attribute by prefixing
symbol name in DECL with a special character FLAG. */
+
void
arm_encode_call_attribute (decl, flag)
tree decl;
*************** arm_encode_call_attribute (decl, flag)
*** 2116,2121 ****
--- 2120,2126 ----
/* Assigns default attributes to newly defined type. This is used to
set short_call/long_call attributes for function types of
functions defined inside corresponding #pragma scopes. */
+
static void
arm_set_default_type_attributes (type)
tree type;
*************** arm_set_default_type_attributes (type)
*** 2143,2148 ****
--- 2148,2154 ----
/* Return 1 if the operand is a SYMBOL_REF for a function known to be
defined within the current compilation unit. If this caanot be
determined, then 0 is returned. */
+
static int
current_file_function_operand (sym_ref)
rtx sym_ref;
*************** current_file_function_operand (sym_ref)
*** 2185,2190 ****
--- 2191,2197 ----
"call_symbol" and "call_symbol_value" patterns and to 0 in the "call"
and "call_value" patterns. This is because of the difference in the
SYM_REFs passed by these patterns. */
+
int
arm_is_longcall_p (sym_ref, call_cookie, call_symbol)
rtx sym_ref;
*************** arm_is_longcall_p (sym_ref, call_cookie,
*** 2217,2222 ****
--- 2224,2230 ----
}
/* Return non-zero if it is ok to make a tail-call to DECL. */
+
int
arm_function_ok_for_sibcall (decl)
tree decl;
*************** neg_const_double_rtx_ok_for_fpu (x)
*** 3004,3010 ****
int
s_register_operand (op, mode)
! register rtx op;
enum machine_mode mode;
{
if (GET_MODE (op) != mode && mode != VOIDmode)
--- 3012,3018 ----
int
s_register_operand (op, mode)
! rtx op;
enum machine_mode mode;
{
if (GET_MODE (op) != mode && mode != VOIDmode)
*************** s_register_operand (op, mode)
*** 3022,3030 ****
}
/* A hard register operand (even before reload. */
int
arm_hard_register_operand (op, mode)
! register rtx op;
enum machine_mode mode;
{
if (GET_MODE (op) != mode && mode != VOIDmode)
--- 3030,3039 ----
}
/* A hard register operand (even before reload. */
+
int
arm_hard_register_operand (op, mode)
! rtx op;
enum machine_mode mode;
{
if (GET_MODE (op) != mode && mode != VOIDmode)
*************** arm_hard_register_operand (op, mode)
*** 3038,3044 ****
int
reg_or_int_operand (op, mode)
! register rtx op;
enum machine_mode mode;
{
if (GET_CODE (op) == CONST_INT)
--- 3047,3053 ----
int
reg_or_int_operand (op, mode)
! rtx op;
enum machine_mode mode;
{
if (GET_CODE (op) == CONST_INT)
*************** arm_reload_memory_operand (op, mode)
*** 3078,3083 ****
--- 3087,3093 ----
emitting patterns. In this latter case we cannot use memory_operand()
because it will fail on badly formed MEMs, which is precisly what we are
trying to catch. */
+
int
bad_signed_byte_operand (op, mode)
rtx op;
*************** arm_rhs_operand (op, mode)
*** 3120,3127 ****
|| (GET_CODE (op) == CONST_INT && const_ok_for_arm (INTVAL (op))));
}
! /* Return TRUE for valid operands for the rhs of an ARM instruction, or a load.
! */
int
arm_rhsm_operand (op, mode)
--- 3130,3137 ----
|| (GET_CODE (op) == CONST_INT && const_ok_for_arm (INTVAL (op))));
}
! /* Return TRUE for valid operands for the
! rhs of an ARM instruction, or a load. */
int
arm_rhsm_operand (op, mode)
*************** arm_not_operand (op, mode)
*** 3163,3171 ****
/* Return TRUE if the operand is a memory reference which contains an
offsettable address. */
int
offsettable_memory_operand (op, mode)
! register rtx op;
enum machine_mode mode;
{
if (mode == VOIDmode)
--- 3173,3182 ----
/* Return TRUE if the operand is a memory reference which contains an
offsettable address. */
+
int
offsettable_memory_operand (op, mode)
! rtx op;
enum machine_mode mode;
{
if (mode == VOIDmode)
*************** offsettable_memory_operand (op, mode)
*** 3179,3187 ****
/* Return TRUE if the operand is a memory reference which is, or can be
made word aligned by adjusting the offset. */
int
alignable_memory_operand (op, mode)
! register rtx op;
enum machine_mode mode;
{
rtx reg;
--- 3190,3199 ----
/* Return TRUE if the operand is a memory reference which is, or can be
made word aligned by adjusting the offset. */
+
int
alignable_memory_operand (op, mode)
! rtx op;
enum machine_mode mode;
{
rtx reg;
*************** alignable_memory_operand (op, mode)
*** 3207,3215 ****
/* Similar to s_register_operand, but does not allow hard integer
registers. */
int
f_register_operand (op, mode)
! register rtx op;
enum machine_mode mode;
{
if (GET_MODE (op) != mode && mode != VOIDmode)
--- 3219,3228 ----
/* Similar to s_register_operand, but does not allow hard integer
registers. */
+
int
f_register_operand (op, mode)
! rtx op;
enum machine_mode mode;
{
if (GET_MODE (op) != mode && mode != VOIDmode)
*************** power_of_two_operand (op, mode)
*** 3272,3279 ****
--- 3285,3294 ----
if (GET_CODE (op) == CONST_INT)
{
HOST_WIDE_INT value = INTVAL (op);
+
return value != 0 && (value & (value - 1)) == 0;
}
+
return FALSE;
}
*************** di_operand (op, mode)
*** 3311,3316 ****
--- 3326,3332 ----
}
/* Like di_operand, but don't accept constants. */
+
int
nonimmediate_di_operand (op, mode)
rtx op;
*************** soft_df_operand (op, mode)
*** 3342,3348 ****
--- 3358,3371 ----
enum machine_mode mode;
{
if (s_register_operand (op, mode))
+ {
+ if (GET_CODE (op) == SUBREG)
+ op = SUBREG_REG (op);
+
+ if (REGNO (op) == IP_REGNUM)
+ return FALSE;
return TRUE;
+ }
if (mode != VOIDmode && GET_MODE (op) != mode)
return FALSE;
*************** soft_df_operand (op, mode)
*** 3367,3379 ****
--- 3390,3410 ----
}
/* Like soft_df_operand, but don't accept constants. */
+
int
nonimmediate_soft_df_operand (op, mode)
rtx op;
enum machine_mode mode;
{
if (s_register_operand (op, mode))
+ {
+ if (GET_CODE (op) == SUBREG)
+ op = SUBREG_REG (op);
+
+ if (REGNO (op) == IP_REGNUM)
+ return FALSE;
return TRUE;
+ }
if (mode != VOIDmode && GET_MODE (op) != mode)
return FALSE;
*************** nonimmediate_soft_df_operand (op, mode)
*** 3387,3392 ****
--- 3418,3424 ----
}
/* Return TRUE for valid index operands. */
+
int
index_operand (op, mode)
rtx op;
*************** shiftable_operator (x, mode)
*** 3421,3436 ****
rtx x;
enum machine_mode mode;
{
if (GET_MODE (x) != mode)
return FALSE;
- else
- {
- enum rtx_code code = GET_CODE (x);
return (code == PLUS || code == MINUS
|| code == IOR || code == XOR || code == AND);
}
- }
/* Return TRUE for binary logical operators. */
--- 3453,3468 ----
rtx x;
enum machine_mode mode;
{
+ enum rtx_code code;
+
if (GET_MODE (x) != mode)
return FALSE;
+ code = GET_CODE (x);
+
return (code == PLUS || code == MINUS
|| code == IOR || code == XOR || code == AND);
}
/* Return TRUE for binary logical operators. */
*************** logical_binary_operator (x, mode)
*** 3439,3453 ****
rtx x;
enum machine_mode mode;
{
if (GET_MODE (x) != mode)
return FALSE;
! else
! {
! enum rtx_code code = GET_CODE (x);
return (code == IOR || code == XOR || code == AND);
}
- }
/* Return TRUE for shift operators. */
--- 3471,3485 ----
rtx x;
enum machine_mode mode;
{
+ enum rtx_code code;
+
if (GET_MODE (x) != mode)
return FALSE;
!
! code = GET_CODE (x);
return (code == IOR || code == XOR || code == AND);
}
/* Return TRUE for shift operators. */
*************** shift_operator (x, mode)
*** 3456,3466 ****
rtx x;
enum machine_mode mode;
{
if (GET_MODE (x) != mode)
return FALSE;
! else
! {
! enum rtx_code code = GET_CODE (x);
if (code == MULT)
return power_of_two_operand (XEXP (x, 1), mode);
--- 3488,3499 ----
rtx x;
enum machine_mode mode;
{
+ enum rtx_code code;
+
if (GET_MODE (x) != mode)
return FALSE;
!
! code = GET_CODE (x);
if (code == MULT)
return power_of_two_operand (XEXP (x, 1), mode);
*************** shift_operator (x, mode)
*** 3468,3476 ****
return (code == ASHIFT || code == ASHIFTRT || code == LSHIFTRT
|| code == ROTATERT);
}
- }
/* Return TRUE if x is EQ or NE. */
int
equality_operator (x, mode)
rtx x;
--- 3501,3509 ----
return (code == ASHIFT || code == ASHIFTRT || code == LSHIFTRT
|| code == ROTATERT);
}
/* Return TRUE if x is EQ or NE. */
+
int
equality_operator (x, mode)
rtx x;
*************** equality_operator (x, mode)
*** 3480,3485 ****
--- 3513,3519 ----
}
/* Return TRUE if x is a comparison operator other than LTGT or UNEQ. */
+
int
arm_comparison_operator (x, mode)
rtx x;
*************** arm_comparison_operator (x, mode)
*** 3491,3496 ****
--- 3525,3531 ----
}
/* Return TRUE for SMIN SMAX UMIN UMAX operators. */
+
int
minmax_operator (x, mode)
rtx x;
*************** minmax_operator (x, mode)
*** 3506,3511 ****
--- 3541,3547 ----
/* Return TRUE if this is the condition code register, if we aren't given
a mode, accept any class CCmode register. */
+
int
cc_register (x, mode)
rtx x;
*************** cc_register (x, mode)
*** 3530,3535 ****
--- 3566,3572 ----
/* Return TRUE if this is the condition code register, if we aren't given
a mode, accept any class CCmode register which indicates a dominance
expression. */
+
int
dominant_cc_register (x, mode)
rtx x;
*************** dominant_cc_register (x, mode)
*** 3554,3565 ****
}
/* Return TRUE if X references a SYMBOL_REF. */
int
symbol_mentioned_p (x)
rtx x;
{
! register const char * fmt;
! register int i;
if (GET_CODE (x) == SYMBOL_REF)
return 1;
--- 3591,3603 ----
}
/* Return TRUE if X references a SYMBOL_REF. */
+
int
symbol_mentioned_p (x)
rtx x;
{
! const char * fmt;
! int i;
if (GET_CODE (x) == SYMBOL_REF)
return 1;
*************** symbol_mentioned_p (x)
*** 3570,3576 ****
{
if (fmt[i] == 'E')
{
! register int j;
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
if (symbol_mentioned_p (XVECEXP (x, i, j)))
--- 3608,3614 ----
{
if (fmt[i] == 'E')
{
! int j;
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
if (symbol_mentioned_p (XVECEXP (x, i, j)))
*************** symbol_mentioned_p (x)
*** 3584,3595 ****
}
/* Return TRUE if X references a LABEL_REF. */
int
label_mentioned_p (x)
rtx x;
{
! register const char * fmt;
! register int i;
if (GET_CODE (x) == LABEL_REF)
return 1;
--- 3622,3634 ----
}
/* Return TRUE if X references a LABEL_REF. */
+
int
label_mentioned_p (x)
rtx x;
{
! const char * fmt;
! int i;
if (GET_CODE (x) == LABEL_REF)
return 1;
*************** label_mentioned_p (x)
*** 3599,3605 ****
{
if (fmt[i] == 'E')
{
! register int j;
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
if (label_mentioned_p (XVECEXP (x, i, j)))
--- 3638,3644 ----
{
if (fmt[i] == 'E')
{
! int j;
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
if (label_mentioned_p (XVECEXP (x, i, j)))
*************** minmax_code (x)
*** 3631,3643 ****
}
/* Return 1 if memory locations are adjacent. */
int
adjacent_mem_locations (a, b)
rtx a, b;
{
- int val0 = 0, val1 = 0;
- int reg0, reg1;
-
if ((GET_CODE (XEXP (a, 0)) == REG
|| (GET_CODE (XEXP (a, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (a, 0), 1)) == CONST_INT))
--- 3670,3680 ----
}
/* Return 1 if memory locations are adjacent. */
+
int
adjacent_mem_locations (a, b)
rtx a, b;
{
if ((GET_CODE (XEXP (a, 0)) == REG
|| (GET_CODE (XEXP (a, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (a, 0), 1)) == CONST_INT))
*************** adjacent_mem_locations (a, b)
*** 3645,3650 ****
--- 3682,3690 ----
|| (GET_CODE (XEXP (b, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (b, 0), 1)) == CONST_INT)))
{
+ int val0 = 0, val1 = 0;
+ int reg0, reg1;
+
if (GET_CODE (XEXP (a, 0)) == PLUS)
{
reg0 = REGNO (XEXP (XEXP (a, 0), 0));
*************** adjacent_mem_locations (a, b)
*** 3652,3657 ****
--- 3692,3698 ----
}
else
reg0 = REGNO (XEXP (a, 0));
+
if (GET_CODE (XEXP (b, 0)) == PLUS)
{
reg1 = REGNO (XEXP (XEXP (b, 0), 0));
*************** adjacent_mem_locations (a, b)
*** 3659,3664 ****
--- 3700,3706 ----
}
else
reg1 = REGNO (XEXP (b, 0));
+
return (reg0 == reg1) && ((val1 - val0) == 4 || (val0 - val1) == 4);
}
return 0;
*************** adjacent_mem_locations (a, b)
*** 3666,3671 ****
--- 3708,3714 ----
/* Return 1 if OP is a load multiple operation. It is known to be
parallel and the first section will be tested. */
+
int
load_multiple_operation (op, mode)
rtx op;
*************** load_multiple_operation (op, mode)
*** 3728,3733 ****
--- 3771,3777 ----
/* Return 1 if OP is a store multiple operation. It is known to be
parallel and the first section will be tested. */
+
int
store_multiple_operation (op, mode)
rtx op;
*************** load_multiple_sequence (operands, nops,
*** 3802,3809 ****
int base_reg = -1;
int i;
! /* Can only handle 2, 3, or 4 insns at present, though could be easily
! extended if required. */
if (nops < 2 || nops > 4)
abort ();
--- 3846,3853 ----
int base_reg = -1;
int i;
! /* Can only handle 2, 3, or 4 insns at present,
! though could be easily extended if required. */
if (nops < 2 || nops > 4)
abort ();
*************** multi_register_push (op, mode)
*** 4221,4226 ****
--- 4265,4271 ----
}
/* Routines for use in generating RTL. */
+
rtx
arm_gen_load_multiple (base_regno, count, from, up, write_back, unchanging_p,
in_struct_p, scalar_p)
*************** arm_gen_movstrqi (operands)
*** 4565,4570 ****
--- 4610,4616 ----
/* Generate a memory reference for a half word, such that it will be loaded
into the top 16 bits of the word. We can assume that the address is
known to be alignable and of the form reg, or plus (reg, const). */
+
rtx
arm_gen_rotated_half_load (memref)
rtx memref;
*************** arm_reload_in_hi (operands)
*** 4952,4957 ****
--- 4998,5004 ----
scratch in operands[2] overlaps either the input value or output address
in some way, then that value must die in this insn (we absolutely need
two scratch registers for some corner cases). */
+
void
arm_reload_out_hi (operands)
rtx * operands;
*************** arm_reload_out_hi (operands)
*** 4967,4973 ****
ref = SUBREG_REG (ref);
}
-
if (GET_CODE (ref) == REG)
{
/* We have a pseudo which has been spilt onto the stack; there
--- 5014,5019 ----
*************** arm_reload_out_hi (operands)
*** 5113,5118 ****
--- 5159,5165 ----
}
/* Print a symbolic form of X to the debug file, F. */
+
static void
arm_print_value (f, x)
FILE * f;
*************** Mfix * minipool_barrier;
*** 5281,5286 ****
--- 5328,5334 ----
/* Determines if INSN is the start of a jump table. Returns the end
of the TABLE or NULL_RTX. */
+
static rtx
is_jump_table (insn)
rtx insn;
*************** get_jump_table_size (insn)
*** 5313,5318 ****
--- 5361,5367 ----
/* Move a minipool fix MP from its current location to before MAX_MP.
If MAX_MP is NULL, then MP doesn't need moving, but the addressing
contrains may need updating. */
+
static Mnode *
move_minipool_fix_forward_ref (mp, max_mp, max_address)
Mnode * mp;
*************** move_minipool_fix_forward_ref (mp, max_m
*** 5372,5377 ****
--- 5421,5427 ----
/* Add a constant to the minipool for a forward reference. Returns the
node added or NULL if the constant will not fit in this pool. */
+
static Mnode *
add_minipool_forward_ref (fix)
Mfix * fix;
*************** move_minipool_fix_backward_ref (mp, min_
*** 5540,5545 ****
--- 5590,5596 ----
somewhat confusing because the calculated offsets for each fix do
not take into account the size of the pool (which is still under
construction. */
+
static Mnode *
add_minipool_backward_ref (fix)
Mfix * fix;
*************** dump_minipool (scan)
*** 5756,5761 ****
--- 5807,5813 ----
}
/* Return the cost of forcibly inserting a barrier after INSN. */
+
static int
arm_barrier_cost (insn)
rtx insn;
*************** arm_barrier_cost (insn)
*** 5792,5797 ****
--- 5844,5850 ----
(FIX->address,MAX_ADDRESS) to forcibly insert a minipool barrier.
Create the barrier by inserting a jump and add a new fix entry for
it. */
+
static Mfix *
create_fix_barrier (fix, max_address)
Mfix * fix;
*************** push_minipool_fix (insn, address, loc, m
*** 5957,5962 ****
--- 6010,6016 ----
}
/* Scan INSN and note any of its operands that need fixing. */
+
static void
note_invalid_constants (insn, address)
rtx insn;
*************** arm_reorg (first)
*** 6170,6175 ****
--- 6224,6230 ----
/* If the rtx is the correct value then return the string of the number.
In this way we can ensure that valid double constants are generated even
when cross compiling. */
+
const char *
fp_immediate_constant (x)
rtx x;
*************** fp_immediate_constant (x)
*** 6189,6194 ****
--- 6244,6250 ----
}
/* As for fp_immediate_constant, but value is passed directly, not in rtx. */
+
static const char *
fp_const_from_val (r)
REAL_VALUE_TYPE * r;
*************** eliminate_lr2ip (x)
*** 6268,6275 ****
int something_changed = 0;
rtx x0 = * x;
int code = GET_CODE (x0);
! register int i, j;
! register const char * fmt;
switch (code)
{
--- 6324,6331 ----
int something_changed = 0;
rtx x0 = * x;
int code = GET_CODE (x0);
! int i, j;
! const char * fmt;
switch (code)
{
*************** output_mov_long_double_arm_from_fpu (ope
*** 6372,6377 ****
--- 6428,6434 ----
/* Output a move from arm registers to arm registers of a long double
OPERANDS[0] is the destination.
OPERANDS[1] is the source. */
+
const char *
output_mov_long_double_arm_from_arm (operands)
rtx * operands;
*************** output_move_double (operands)
*** 6493,6505 ****
abort ();
else if (WORDS_BIG_ENDIAN)
{
-
otherops[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
operands[1] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
}
else
{
-
otherops[1] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
}
--- 6550,6560 ----
*************** output_move_double (operands)
*** 6573,6578 ****
--- 6628,6634 ----
otherops[0] = operands[0];
otherops[1] = XEXP (XEXP (operands[1], 0), 0);
otherops[2] = XEXP (XEXP (operands[1], 0), 1);
+
if (GET_CODE (XEXP (operands[1], 0)) == PLUS)
{
if (GET_CODE (otherops[2]) == CONST_INT)
*************** output_move_double (operands)
*** 6589,6594 ****
--- 6645,6651 ----
output_asm_insn ("ldm%?ib\t%1, %M0", otherops);
return "";
}
+
if (!(const_ok_for_arm (INTVAL (otherops[2]))))
output_asm_insn ("sub%?\t%0, %1, #%n2", otherops);
else
*************** output_move_double (operands)
*** 6677,6683 ****
}
}
else
! abort (); /* Constraints should prevent this */
return "";
}
--- 6734,6741 ----
}
}
else
! /* Constraints should prevent this. */
! abort ();
return "";
}
*************** output_mov_immediate (operands)
*** 6691,6716 ****
rtx * operands;
{
HOST_WIDE_INT n = INTVAL (operands[1]);
- int n_ones = 0;
- int i;
! /* Try to use one MOV */
if (const_ok_for_arm (n))
- {
output_asm_insn ("mov%?\t%0, %1", operands);
- return "";
- }
! /* Try to use one MVN */
! if (const_ok_for_arm (~n))
{
operands[1] = GEN_INT (~n);
output_asm_insn ("mvn%?\t%0, %1", operands);
- return "";
}
/* If all else fails, make it out of ORRs or BICs as appropriate. */
-
for (i=0; i < 32; i++)
if (n & 1 << i)
n_ones++;
--- 6749,6771 ----
rtx * operands;
{
HOST_WIDE_INT n = INTVAL (operands[1]);
! /* Try to use one MOV. */
if (const_ok_for_arm (n))
output_asm_insn ("mov%?\t%0, %1", operands);
! /* Try to use one MVN. */
! else if (const_ok_for_arm (~n))
{
operands[1] = GEN_INT (~n);
output_asm_insn ("mvn%?\t%0, %1", operands);
}
+ else
+ {
+ int n_ones = 0;
+ int i;
/* If all else fails, make it out of ORRs or BICs as appropriate. */
for (i = 0; i < 32; i ++)
if (n & 1 << i)
n_ones ++;
*************** output_mov_immediate (operands)
*** 6719,6731 ****
output_multi_immediate (operands, "mvn%?\t%0, %1", "bic%?\t%0, %0, %1", 1, ~n);
else
output_multi_immediate (operands, "mov%?\t%0, %1", "orr%?\t%0, %0, %1", 1, n);
return "";
}
-
! /* Output an ADD r, s, #n where n may be too big for one instruction. If
! adding zero to one register, output nothing. */
const char *
output_add_immediate (operands)
--- 6774,6786 ----
output_multi_immediate (operands, "mvn%?\t%0, %1", "bic%?\t%0, %0, %1", 1, ~ n);
else
output_multi_immediate (operands, "mov%?\t%0, %1", "orr%?\t%0, %0, %1", 1, n);
+ }
return "";
}
! /* Output an ADD r, s, #n where n may be too big for one instruction.
! If adding zero to one register, output nothing. */
const char *
output_add_immediate (operands)
*************** output_multi_immediate (operands, instr1
*** 6769,6776 ****
if (n == 0)
{
operands[immed_op] = const0_rtx;
! output_asm_insn (instr1, operands); /* Quick and easy output. */
}
else
{
--- 6824,6832 ----
if (n == 0)
{
+ /* Quick and easy output. */
operands[immed_op] = const0_rtx;
! output_asm_insn (instr1, operands);
}
else
{
*************** output_multi_immediate (operands, instr1
*** 6793,6799 ****
return "";
}
-
/* Return the appropriate ARM instruction for the operation code.
The returned result should not be overwritten. OP is the rtx of the
operation. SHIFT_FIRST_ARG is TRUE if the first argument of the operator
--- 6849,6854 ----
*************** arithmetic_instr (op, shift_first_arg)
*** 6826,6832 ****
}
}
-
/* Ensure valid constant shifts and return the appropriate shift mnemonic
for the operation code. The returned result should not be overwritten.
OP is the rtx code of the shift.
--- 6881,6886 ----
*************** shift_op (op, amountp)
*** 6889,6895 ****
is not set correctly if we set the flags; but we never use the
carry bit from such an operation, so we can ignore that. */
if (code == ROTATERT)
! *amountp &= 31; /* Rotate is just modulo 32 */
else if (*amountp != (*amountp & 31))
{
if (code == ASHIFT)
--- 6943,6950 ----
is not set correctly if we set the flags; but we never use the
carry bit from such an operation, so we can ignore that. */
if (code == ROTATERT)
! /* Rotate is just modulo 32. */
! *amountp &= 31;
else if (*amountp != (*amountp & 31))
{
if (code == ASHIFT)
*************** shift_op (op, amountp)
*** 6905,6912 ****
return mnem;
}
-
/* Obtain the shift from the POWER of two. */
static HOST_WIDE_INT
int_log2 (power)
HOST_WIDE_INT power;
--- 6960,6967 ----
return mnem;
}
/* Obtain the shift from the POWER of two. */
+
static HOST_WIDE_INT
int_log2 (power)
HOST_WIDE_INT power;
*************** output_ascii_pseudo_op (stream, p, len)
*** 6940,6946 ****
for (i = 0; i < len; i++)
{
! register int c = p[i];
if (len_so_far >= MAX_ASCII_LEN)
{
--- 6995,7001 ----
for (i = 0; i < len; i++)
{
! int c = p[i];
if (len_so_far >= MAX_ASCII_LEN)
{
*************** arm_compute_initial_elimination_offset (
*** 7967,7980 ****
unsigned int reg_mask;
unsigned int reg;
! /* Makre sure that we compute which registers will be saved
on the stack using the same algorithm that is used by
arm_compute_save_reg_mask(). */
reg_mask = arm_compute_save_reg0_reg12_mask ();
/* Now count the number of bits set in save_reg_mask.
For each set bit we need 4 bytes of stack space. */
-
while (reg_mask)
{
call_saved_registers += 4;
--- 8022,8034 ----
unsigned int reg_mask;
unsigned int reg;
! /* Make sure that we compute which registers will be saved
on the stack using the same algorithm that is used by
arm_compute_save_reg_mask(). */
reg_mask = arm_compute_save_reg0_reg12_mask ();
/* Now count the number of bits set in save_reg_mask.
For each set bit we need 4 bytes of stack space. */
while (reg_mask)
{
call_saved_registers += 4;
*************** arm_expand_prologue ()
*** 8282,8301 ****
/* Recover the static chain register. */
if (regs_ever_live [3] == 0
|| saved_pretend_args)
- {
insn = gen_rtx_REG (SImode, 3);
- insn = gen_rtx_SET (SImode, ip_rtx, insn);
- (void) emit_insn (insn);
- }
else /* if (current_function_pretend_args_size == 0) */
{
insn = gen_rtx_PLUS (SImode, hard_frame_pointer_rtx, GEN_INT (4));
insn = gen_rtx_MEM (SImode, insn);
insn = gen_rtx_SET (SImode, ip_rtx, insn);
(void) emit_insn (insn);
}
}
- }
amount = GEN_INT (-(get_frame_size ()
+ current_function_outgoing_args_size));
--- 8336,8352 ----
/* Recover the static chain register. */
if (regs_ever_live [3] == 0
|| saved_pretend_args)
insn = gen_rtx_REG (SImode, 3);
else /* if (current_function_pretend_args_size == 0) */
{
insn = gen_rtx_PLUS (SImode, hard_frame_pointer_rtx, GEN_INT (4));
insn = gen_rtx_MEM (SImode, insn);
+ }
+
insn = gen_rtx_SET (SImode, ip_rtx, insn);
(void) emit_insn (insn);
}
}
amount = GEN_INT (-(get_frame_size ()
+ current_function_outgoing_args_size));
*************** arm_assemble_integer (x, size, aligned_p
*** 8581,8586 ****
--- 8632,8638 ----
fputc ('\n', asm_out_file);
return true;
}
+
return default_assemble_integer (x, size, aligned_p);
}
#endif
*************** get_arm_condition_code (comparison)
*** 8625,8632 ****
rtx comparison;
{
enum machine_mode mode = GET_MODE (XEXP (comparison, 0));
! register int code;
! register enum rtx_code comp_code = GET_CODE (comparison);
if (GET_MODE_CLASS (mode) != MODE_CC)
mode = SELECT_CC_MODE (comp_code, XEXP (comparison, 0),
--- 8677,8684 ----
rtx comparison;
{
enum machine_mode mode = GET_MODE (XEXP (comparison, 0));
! int code;
! enum rtx_code comp_code = GET_CODE (comparison);
if (GET_MODE_CLASS (mode) != MODE_CC)
mode = SELECT_CC_MODE (comp_code, XEXP (comparison, 0),
*************** arm_final_prescan_insn (insn)
*** 8748,8754 ****
rtx insn;
{
/* BODY will hold the body of INSN. */
! register rtx body = PATTERN (insn);
/* This will be 1 if trying to repeat the trick, and things need to be
reversed if it appears to fail. */
--- 8800,8806 ----
rtx insn;
{
/* BODY will hold the body of INSN. */
! rtx body = PATTERN (insn);
/* This will be 1 if trying to repeat the trick, and things need to be
reversed if it appears to fail. */
*************** arm_regno_class (regno)
*** 9108,9113 ****
--- 9160,9166 ----
/* Handle a special case when computing the offset
of an argument from the frame pointer. */
+
int
arm_debugger_arg_offset (value, addr)
int value;
*************** replace_symbols_in_block (block, orig, n
*** 9302,9310 ****
replace_symbols_in_block (BLOCK_SUBBLOCKS (block), orig, new);
}
}
- /* Return the number (counting from 0) of the least significant set
- bit in MASK. */
#ifdef __GNUC__
inline
#endif
--- 9355,9364 ----
replace_symbols_in_block (BLOCK_SUBBLOCKS (block), orig, new);
}
}
+
+ /* Return the number (counting from 0) of
+ the least significant set bit in MASK. */
#ifdef __GNUC__
inline
#endif
*************** thumb_exit (f, reg_containing_return_add
*** 9616,9621 ****
--- 9670,9676 ----
}
/* Emit code to push or pop registers to or from the stack. */
+
static void
thumb_pushpop (f, mask, push)
FILE * f;
*************** thumb_shiftable_const (val)
*** 9708,9713 ****
--- 9763,9769 ----
/* Returns non-zero if the current function contains,
or might contain a far jump. */
+
int
thumb_far_jump_used_p (int in_prologue)
{
*************** thumb_far_jump_used_p (int in_prologue)
*** 9775,9780 ****
--- 9831,9837 ----
}
/* Return non-zero if FUNC must be entered in ARM mode. */
+
int
is_called_in_ARM_mode (func)
tree func;
*************** arm_free_machine_status (p)
*** 10005,10010 ****
--- 10062,10068 ----
/* Return an RTX indicating where the return address to the
calling function can be found. */
+
rtx
arm_return_addr (count, frame)
int count;
*************** arm_return_addr (count, frame)
*** 10024,10029 ****
--- 10082,10088 ----
}
/* Do anything needed before RTL is emitted for each function. */
+
void
arm_init_expanders ()
{
*************** arm_init_expanders ()
*** 10034,10039 ****
--- 10093,10099 ----
}
/* Generate the rest of a function's prologue. */
+
void
thumb_expand_prologue ()
{
*************** thumb_expand_prologue ()
*** 10093,10104 ****
if (regno > LAST_LO_REGNUM) /* Very unlikely */
{
rtx spare = gen_rtx (REG, SImode, IP_REGNUM);
/* Choose an arbitary, non-argument low register. */
reg = gen_rtx (REG, SImode, LAST_LO_REGNUM);
/* Save it by copying it into a high, scratch register. */
! emit_insn (gen_movsi (spare, reg));
/* Decrement the stack. */
emit_insn (gen_movsi (reg, GEN_INT (-amount)));
--- 10153,10168 ----
if (regno > LAST_LO_REGNUM) /* Very unlikely */
{
rtx spare = gen_rtx (REG, SImode, IP_REGNUM);
+ rtx insn;
/* Choose an arbitary, non-argument low register. */
reg = gen_rtx (REG, SImode, LAST_LO_REGNUM);
/* Save it by copying it into a high, scratch register. */
! insn = emit_insn (gen_movsi (spare, reg));
! /* Add a reg note to stop propogate_one_insn() from barfing. */
! REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, spare,
! REG_NOTES (insn));
/* Decrement the stack. */
emit_insn (gen_movsi (reg, GEN_INT (- amount)));
*************** thumb_output_move_mem_multiple (n, opera
*** 10586,10592 ****
return "";
}
! /* Routines for generating rtl */
void
thumb_expand_movstrqi (operands)
--- 10650,10656 ----
return "";
}
! /* Routines for generating rtl. */
void
thumb_expand_movstrqi (operands)
*************** thumb_condition_code (x, invert)
*** 10681,10686 ****
--- 10745,10751 ----
}
/* Handle storing a half-word to memory during reload. */
+
void
thumb_reload_out_hi (operands)
rtx * operands;
*************** thumb_reload_out_hi (operands)
*** 10689,10694 ****
--- 10754,10760 ----
}
/* Handle storing a half-word to memory during reload. */
+
void
thumb_reload_in_hi (operands)
rtx * operands ATTRIBUTE_UNUSED;
*************** thumb_reload_in_hi (operands)
*** 10698,10703 ****
--- 10764,10770 ----
/* Return the length of a function name prefix
that starts with the character 'c'. */
+
static int
arm_get_strip_length (char c)
{
*************** arm_get_strip_length (char c)
*** 10710,10715 ****
--- 10777,10783 ----
/* Return a pointer to a function's name with any
and all prefix encodings stripped from it. */
+
const char *
arm_strip_name_encoding (const char * name)
{