1 /* score-mdaux.h for Sunplus S+CORE processor
2    Copyright (C) 2005 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 2, 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 COPYING.  If not, write to
19    the Free Software Foundation, 51 Franklin Street, Fifth Floor,
20    Boston, MA 02110-1301, USA.  */
21 
22 #ifndef SCORE_MDAUX_0621
23 #define SCORE_MDAUX_0621
24 
25 /* Machine Auxiliary Functions.  */
26 enum score_address_type
27 {
28   ADD_REG,
29   ADD_CONST_INT,
30   ADD_SYMBOLIC
31 };
32 #ifdef RTX_CODE
33 struct score_address_info
34 {
35   enum score_address_type type;
36   rtx reg;
37   rtx offset;
38   enum rtx_code code;
39   enum score_symbol_type symbol_type;
40 };
41 #endif
42 
43 struct score_frame_info
44 {
45   HOST_WIDE_INT total_size;       /* bytes that the entire frame takes up  */
46   HOST_WIDE_INT var_size;         /* bytes that variables take up  */
47   HOST_WIDE_INT args_size;        /* bytes that outgoing arguments take up  */
48   HOST_WIDE_INT gp_reg_size;      /* bytes needed to store gp regs  */
49   HOST_WIDE_INT gp_sp_offset;     /* offset from new sp to store gp registers  */
50   HOST_WIDE_INT cprestore_size;   /* # bytes that the .cprestore slot takes up  */
51   unsigned int  mask;             /* mask of saved gp registers  */
52   int num_gp;                     /* number of gp registers saved  */
53 };
54 
55 typedef void (*score_save_restore_fn) (rtx, rtx);
56 
57 int mda_valid_base_register_p (rtx x, int strict);
58 
59 #ifdef RTX_CODE
60 int mda_classify_address (struct score_address_info *info,
61                           enum machine_mode mode, rtx x, int strict);
62 
63 struct score_frame_info *mda_compute_frame_size (HOST_WIDE_INT size);
64 
65 struct score_frame_info *mda_cached_frame (void);
66 
67 void mda_gen_cmp (enum machine_mode mode);
68 #endif
69 
70 int mda_symbolic_constant_p (rtx x, enum score_symbol_type *symbol_type);
71 
72 int mda_bp (void);
73 
74 /* Machine Expand.  */
75 void mdx_prologue (void);
76 
77 void mdx_epilogue (int sibcall_p);
78 
79 void mdx_movsicc (rtx *ops);
80 
81 void mdx_call (rtx *ops, bool sibcall);
82 
83 void mdx_call_value (rtx *ops, bool sibcall);
84 
85 /* Machine Split.  */
86 void mds_movdi (rtx *ops);
87 
88 void mds_zero_extract_andi (rtx *ops);
89 
90 /* Machine Print.  */
91 enum mda_mem_unit {MDA_BYTE = 0, MDA_HWORD = 1, MDA_WORD = 2};
92 
93 #define MDA_ALIGN_UNIT(V, UNIT)   !(V & ((1 << UNIT) - 1))
94 
95 const char * mdp_linsn (rtx *ops, enum mda_mem_unit unit, bool sign);
96 
97 const char * mdp_sinsn (rtx *ops, enum mda_mem_unit unit);
98 
99 const char * mdp_select_add_imm (rtx *ops, bool set_cc);
100 
101 const char * mdp_select (rtx *ops, const char *inst_pre,
102                         bool commu, const char *letter, bool set_cc);
103 
104 const char * mdp_limm (rtx *ops);
105 
106 const char * mdp_move (rtx *ops);
107 
108 /* Machine unaligned memory load/store. */
109 bool mdx_unaligned_load (rtx* ops);
110 
111 bool mdx_unaligned_store (rtx* ops);
112 
113 bool mdx_block_move (rtx* ops);
114 
115 #endif
116 
117