2008-01-10 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / config / score / score-mdaux.h
blob99a40601305196d2bc5bae3a2fb404d2d0104d0e
1 /* score-mdaux.h for Sunplus S+CORE processor
2 Copyright (C) 2005, 2007 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/>. */
21 #ifndef SCORE_MDAUX_0621
22 #define SCORE_MDAUX_0621
24 /* Machine Auxiliary Functions. */
25 enum score_address_type
27 ADD_REG,
28 ADD_CONST_INT,
29 ADD_SYMBOLIC
31 #ifdef RTX_CODE
32 struct score_address_info
34 enum score_address_type type;
35 rtx reg;
36 rtx offset;
37 enum rtx_code code;
38 enum score_symbol_type symbol_type;
40 #endif
42 struct score_frame_info
44 HOST_WIDE_INT total_size; /* bytes that the entire frame takes up */
45 HOST_WIDE_INT var_size; /* bytes that variables take up */
46 HOST_WIDE_INT args_size; /* bytes that outgoing arguments take up */
47 HOST_WIDE_INT gp_reg_size; /* bytes needed to store gp regs */
48 HOST_WIDE_INT gp_sp_offset; /* offset from new sp to store gp registers */
49 HOST_WIDE_INT cprestore_size; /* # bytes that the .cprestore slot takes up */
50 unsigned int mask; /* mask of saved gp registers */
51 int num_gp; /* number of gp registers saved */
54 typedef void (*score_save_restore_fn) (rtx, rtx);
56 int mda_valid_base_register_p (rtx x, int strict);
58 #ifdef RTX_CODE
59 int mda_classify_address (struct score_address_info *info,
60 enum machine_mode mode, rtx x, int strict);
62 struct score_frame_info *mda_compute_frame_size (HOST_WIDE_INT size);
64 struct score_frame_info *mda_cached_frame (void);
66 void mda_gen_cmp (enum machine_mode mode);
67 #endif
69 int mda_symbolic_constant_p (rtx x, enum score_symbol_type *symbol_type);
71 int mda_bp (void);
73 /* Machine Expand. */
74 void mdx_prologue (void);
76 void mdx_epilogue (int sibcall_p);
78 void mdx_movsicc (rtx *ops);
80 void mdx_call (rtx *ops, bool sibcall);
82 void mdx_call_value (rtx *ops, bool sibcall);
84 /* Machine Split. */
85 void mds_movdi (rtx *ops);
87 void mds_zero_extract_andi (rtx *ops);
89 /* Machine Print. */
90 enum mda_mem_unit {MDA_BYTE = 0, MDA_HWORD = 1, MDA_WORD = 2};
92 #define MDA_ALIGN_UNIT(V, UNIT) !(V & ((1 << UNIT) - 1))
94 const char * mdp_linsn (rtx *ops, enum mda_mem_unit unit, bool sign);
96 const char * mdp_sinsn (rtx *ops, enum mda_mem_unit unit);
98 const char * mdp_select_add_imm (rtx *ops, bool set_cc);
100 const char * mdp_select (rtx *ops, const char *inst_pre,
101 bool commu, const char *letter, bool set_cc);
103 const char * mdp_limm (rtx *ops);
105 const char * mdp_move (rtx *ops);
107 /* Machine unaligned memory load/store. */
108 bool mdx_unaligned_load (rtx* ops);
110 bool mdx_unaligned_store (rtx* ops);
112 bool mdx_block_move (rtx* ops);
114 #endif