1 /* score7.h for Sunplus S+CORE processor
2 Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc.
3 Contributed by Sunnorth
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published
9 by the Free Software Foundation; either version 3, or (at your
10 option) any later version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
24 enum score7_address_type
31 struct score7_frame_info
33 HOST_WIDE_INT total_size
; /* bytes that the entire frame takes up */
34 HOST_WIDE_INT var_size
; /* bytes that variables take up */
35 HOST_WIDE_INT args_size
; /* bytes that outgoing arguments take up */
36 HOST_WIDE_INT gp_reg_size
; /* bytes needed to store gp regs */
37 HOST_WIDE_INT gp_sp_offset
; /* offset from new sp to store gp registers */
38 HOST_WIDE_INT cprestore_size
; /* # bytes that the .cprestore slot takes up */
39 unsigned int mask
; /* mask of saved gp registers */
40 int num_gp
; /* number of gp registers saved */
43 struct score7_arg_info
45 unsigned int num_bytes
; /* The argument's size in bytes */
46 unsigned int reg_words
; /* The number of words passed in registers */
47 unsigned int reg_offset
; /* The offset of the first register from */
48 /* GP_ARG_FIRST or FP_ARG_FIRST etc */
49 unsigned int stack_words
; /* The number of words that must be passed */
51 unsigned int stack_offset
; /* The offset from the start of the stack */
56 struct score7_address_info
58 enum score7_address_type type
;
62 enum score_symbol_type symbol_type
;
66 #define SCORE7_SDATA_MAX score7_sdata_max
67 #define SCORE7_STACK_ALIGN(LOC) (((LOC) + 3) & ~3)
68 #define SCORE7_PROLOGUE_TEMP_REGNUM (GP_REG_FIRST + 8)
69 #define SCORE7_EPILOGUE_TEMP_REGNUM (GP_REG_FIRST + 8)
70 #define SCORE7_DEFAULT_SDATA_MAX 8
72 extern int score7_symbolic_constant_p (rtx x
,
73 enum score_symbol_type
*symbol_type
);
74 extern bool score7_return_in_memory (tree type
,
75 tree fndecl ATTRIBUTE_UNUSED
);
76 extern void score7_output_mi_thunk (FILE *file
,
77 tree thunk_fndecl ATTRIBUTE_UNUSED
,
79 HOST_WIDE_INT vcall_offset
,
81 extern rtx
score7_legitimize_address (rtx x
);
83 score7_function_prologue (FILE *file
,
84 HOST_WIDE_INT size ATTRIBUTE_UNUSED
);
86 score7_function_epilogue (FILE *file
,
87 HOST_WIDE_INT size ATTRIBUTE_UNUSED
);
88 extern section
*score7_select_rtx_section (enum machine_mode mode
, rtx x
,
89 unsigned HOST_WIDE_INT align
);
90 extern bool score7_in_small_data_p (tree decl
);
91 extern void score7_asm_file_start (void);
92 extern void score7_asm_file_end (void);
93 extern void score7_override_options (void);
94 extern int score7_reg_class (int regno
);
95 extern enum reg_class
score7_preferred_reload_class (rtx x ATTRIBUTE_UNUSED
,
96 enum reg_class rclass
);
98 reg_class
score7_secondary_reload_class (enum reg_class rclass
,
99 enum machine_mode mode ATTRIBUTE_UNUSED
,
101 extern int score7_const_ok_for_letter_p (HOST_WIDE_INT value
, char c
);
102 extern int score7_extra_constraint (rtx op
, char c
);
103 extern int score7_hard_regno_mode_ok (unsigned int regno
,
104 enum machine_mode mode
);
106 score7_initial_elimination_offset (int from
,
107 int to ATTRIBUTE_UNUSED
);
108 extern void score7_function_arg_advance (CUMULATIVE_ARGS
*cum
,
109 enum machine_mode mode
,
112 extern int score7_arg_partial_bytes (CUMULATIVE_ARGS
*cum
,
113 enum machine_mode mode
,
116 extern rtx
score7_function_arg (const CUMULATIVE_ARGS
*cum
,
117 enum machine_mode mode
,
120 extern rtx
score7_function_value (tree valtype
,
121 tree func ATTRIBUTE_UNUSED
,
122 enum machine_mode mode
);
123 extern void score7_initialize_trampoline (rtx ADDR
, rtx FUNC
, rtx CHAIN
);
124 extern int score7_regno_mode_ok_for_base_p (int regno
, int strict
);
125 extern int score7_address_p (enum machine_mode mode
, rtx x
, int strict
);
126 extern int score7_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED
,
129 extern bool score7_rtx_costs (rtx x
, int code
, int outer_code
, int *total
, bool speed
);
130 extern int score7_address_cost (rtx addr
);
131 extern int score7_output_external (FILE *file ATTRIBUTE_UNUSED
,
134 extern rtx
score7_return_addr (int count
, rtx frame ATTRIBUTE_UNUSED
);
135 extern void score7_print_operand (FILE *file
, rtx op
, int c
);
136 extern void score7_print_operand_address (FILE *file
, rtx x
);
137 extern enum machine_mode
score7_select_cc_mode (enum rtx_code op
,
140 extern void score7_prologue (void);
141 extern void score7_epilogue (int sibcall_p
);
142 extern void score7_gen_cmp (enum machine_mode mode
);
143 extern void score7_call (rtx
*ops
, bool sib
);
144 extern void score7_call_value (rtx
*ops
, bool sib
);
145 extern void score7_movsicc (rtx
*ops
);
146 extern void score7_movdi (rtx
*ops
);
147 extern void score7_zero_extract_andi (rtx
*ops
);
148 extern const char * score7_select_add_imm (rtx
*ops
, bool set_cc
);
149 extern const char * score7_select (rtx
*ops
, const char *inst_pre
, bool commu
,
150 const char *letter
, bool set_cc
);
151 extern const char * score7_move (rtx
*ops
);
152 extern const char * score7_limm (rtx
*ops
);
154 score7_linsn (rtx
*ops
, enum score_mem_unit unit
, bool sign
);
156 score7_sinsn (rtx
*ops
, enum score_mem_unit unit
);