OSDN Git Service

Merge cond-optab branch.
[pf3gnuchains/gcc-fork.git] / gcc / config / score / score7.h
1 /* score7.h for Sunplus S+CORE processor
2    Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc.
3    Contributed by Sunnorth
4
5    This file is part of GCC.
6
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.
11
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.
16
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/>.  */
20
21 #ifndef GCC_SCORE7_H
22 #define GCC_SCORE7_H
23
24 enum score7_address_type
25 {
26   SCORE7_ADD_REG,
27   SCORE7_ADD_CONST_INT,
28   SCORE7_ADD_SYMBOLIC
29 };
30
31 struct score7_frame_info
32 {
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  */
41 };
42
43 struct score7_arg_info
44 {
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  */
50                               /* on the stack  */
51   unsigned int stack_offset;  /* The offset from the start of the stack  */
52                               /* overflow area  */
53 };
54
55 #ifdef RTX_CODE
56 struct score7_address_info
57 {
58   enum score7_address_type type;
59   rtx reg;
60   rtx offset;
61   enum rtx_code code;
62   enum score_symbol_type symbol_type;
63 };
64 #endif
65
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
71
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,
78                                     HOST_WIDE_INT delta,
79                                     HOST_WIDE_INT vcall_offset,
80                                     tree function);
81 extern rtx score7_legitimize_address (rtx x);
82 extern void
83 score7_function_prologue (FILE *file,
84                           HOST_WIDE_INT size ATTRIBUTE_UNUSED);
85 extern void
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);
97 extern enum
98 reg_class score7_secondary_reload_class (enum reg_class rclass,
99                                          enum machine_mode mode ATTRIBUTE_UNUSED,
100                                          rtx x);
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);
105 extern HOST_WIDE_INT
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,
110                                          tree type,
111                                          int named);
112 extern int score7_arg_partial_bytes (CUMULATIVE_ARGS *cum,
113                                      enum machine_mode mode,
114                                      tree type,
115                                      bool named);
116 extern rtx score7_function_arg (const CUMULATIVE_ARGS *cum,
117                                 enum machine_mode mode,
118                                 tree type,
119                                 int named);
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,
127                                       enum reg_class from,
128                                       enum reg_class to);
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,
132                                    tree decl,
133                                    const char *name);
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,
138                                                 rtx x,
139                                                 rtx y);
140 extern void score7_prologue (void);
141 extern void score7_epilogue (int sibcall_p);
142 extern void score7_call (rtx *ops, bool sib);
143 extern void score7_call_value (rtx *ops, bool sib);
144 extern void score7_movsicc (rtx *ops);
145 extern void score7_movdi (rtx *ops);
146 extern void score7_zero_extract_andi (rtx *ops);
147 extern const char * score7_select_add_imm (rtx *ops, bool set_cc);
148 extern const char * score7_select (rtx *ops, const char *inst_pre, bool commu,
149                                    const char *letter, bool set_cc);
150 extern const char * score7_move (rtx *ops);
151 extern const char * score7_limm (rtx *ops);
152 extern const char *
153 score7_linsn (rtx *ops, enum score_mem_unit unit, bool sign);
154 extern const char *
155 score7_sinsn (rtx *ops, enum score_mem_unit unit);
156 #endif