fixed MLA creation
[libfirm] / ir / be / arm / arm_new_nodes.h
1 /*
2  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief   Function prototypes for the assembler ir node constructors.
23  * @author  Oliver Richter, Tobias Gneist
24  * @version $Id$
25  */
26 #ifndef FIRM_BE_ARM_ARM_NEW_NODES_H
27 #define FIRM_BE_ARM_ARM_NEW_NODES_H
28
29 #include "arm_nodes_attr.h"
30 #include "bearch_arm_t.h"
31
32 /***************************************************************************************************
33  *        _   _                   _       __        _                    _   _               _
34  *       | | | |                 | |     / /       | |                  | | | |             | |
35  *   __ _| |_| |_ _ __   ___  ___| |_   / /_ _  ___| |_   _ __ ___   ___| |_| |__   ___   __| |___
36  *  / _` | __| __| '__| / __|/ _ \ __| / / _` |/ _ \ __| | '_ ` _ \ / _ \ __| '_ \ / _ \ / _` / __|
37  * | (_| | |_| |_| |    \__ \  __/ |_ / / (_| |  __/ |_  | | | | | |  __/ |_| | | | (_) | (_| \__ \
38  *  \__,_|\__|\__|_|    |___/\___|\__/_/ \__, |\___|\__| |_| |_| |_|\___|\__|_| |_|\___/ \__,_|___/
39  *                                        __/ |
40  *                                       |___/
41  ***************************************************************************************************/
42
43 /**
44  * Returns the attributes of a generic Arm node.
45  */
46 arm_attr_t *get_arm_attr(ir_node *node);
47 const arm_attr_t *get_arm_attr_const(const ir_node *node);
48
49 /**
50  * Returns the attributes of an ARM SymConst node.
51  */
52 arm_SymConst_attr_t *get_arm_SymConst_attr(ir_node *node);
53 const arm_SymConst_attr_t *get_arm_SymConst_attr_const(const ir_node *node);
54
55 /**
56  * Returns the attributes of an ARM CondJmp node.
57  */
58 arm_CondJmp_attr_t *get_arm_CondJmp_attr(ir_node *node);
59 const arm_CondJmp_attr_t *get_arm_CondJmp_attr_const(const ir_node *node);
60
61 /**
62  * Returns the attributes of an ARM SwitchJmp node.
63  */
64 arm_SwitchJmp_attr_t *get_arm_SwitchJmp_attr(ir_node *node);
65 const arm_SwitchJmp_attr_t *get_arm_SwitchJmp_attr_const(const ir_node *node);
66
67 /**
68  * Returns the argument register requirements of an arm node.
69  */
70 const arch_register_req_t **get_arm_in_req_all(const ir_node *node);
71
72 /**
73  * Returns the result register requirements of an arm node.
74  */
75 const arch_register_req_t **get_arm_out_req_all(const ir_node *node);
76
77 /**
78  * Returns the argument register requirements of an arm node.
79  */
80 const arch_register_req_t *get_arm_in_req(const ir_node *node, int pos);
81
82 /**
83  * Returns the result register requirements of an arm node.
84  */
85 const arch_register_req_t *get_arm_out_req(const ir_node *node, int pos);
86
87 /**
88  * Sets the OUT register requirements at position pos.
89  */
90 void set_arm_req_out(ir_node *node, const arch_register_req_t *req, int pos);
91
92 /**
93  * Sets the complete OUT requirements of node.
94  */
95 void set_arm_req_out_all(ir_node *node, const arch_register_req_t **reqs);
96
97 /**
98  * Sets the IN register requirements at position pos.
99  */
100 void set_arm_req_in(ir_node *node, const arch_register_req_t *req, int pos);
101
102 /**
103  * Returns the register flag of an arm node.
104  */
105 arch_irn_flags_t get_arm_flags(const ir_node *node);
106
107 /**
108  * Sets the register flag of an arm node.
109  */
110 void set_arm_flags(ir_node *node, arch_irn_flags_t flags);
111
112 /**
113  * Returns the result register slots of an arm node.
114  */
115 const arch_register_t **get_arm_slots(const ir_node *node);
116
117 /**
118  * Returns the name of the OUT register at position pos.
119  */
120 const char *get_arm_out_reg_name(const ir_node *node, int pos);
121
122 /**
123  * Returns the index of the OUT register at position pos within its register class.
124  */
125 int get_arm_out_regnr(const ir_node *node, int pos);
126
127 /**
128  * Returns the OUT register at position pos.
129  */
130 const arch_register_t *get_arm_out_reg(const ir_node *node, int pos);
131
132 /**
133  * Returns the number of results.
134  */
135 int get_arm_n_res(const ir_node *node);
136
137 /**
138  * Set the ARM machine node attributes to default values.
139  */
140 void init_arm_attributes(ir_node *node, int flags, const arch_register_req_t ** in_reqs,
141                          const arch_register_req_t ** out_reqs, const be_execution_unit_t ***execution_units, int n_res, unsigned latency);
142
143 /**
144  * Sets the flags for the n'th out.
145  */
146 void set_arm_out_flags(ir_node *node, arch_irn_flags_t flags, int pos);
147
148 /**
149  * Gets the flags for the n'th out.
150  */
151 arch_irn_flags_t get_arm_out_flags(const ir_node *node, int pos);
152
153 /**
154  * Returns the tarval
155  */
156 tarval *get_arm_value(const ir_node *node);
157
158 /**
159  * Sets the tarval
160  */
161 void set_arm_value(ir_node *node, tarval *tv);
162
163 /**
164  * Returns the proj num
165  */
166 int get_arm_CondJmp_proj_num(const ir_node *node);
167
168 /**
169  * Sets the proj num
170  */
171 void set_arm_CondJmp_proj_num(ir_node *node, int proj_num);
172
173 ident *get_arm_symconst_id(const ir_node *node);
174 void set_arm_symconst_id(ir_node *node, ident *symconst_id);
175
176 ir_node *new_r_arm_StoreStackMInc(ir_graph *irg, ir_node *block, ir_node *mem, ir_node *sp,
177                                                               int n_regs, ir_node **regs, ir_mode *mode);
178
179 /**
180  * Returns the number of projs of a SwitchJmp.
181  */
182 int get_arm_SwitchJmp_n_projs(const ir_node *node);
183
184 /**
185  * Sets the number of projs of a SwitchJmp.
186  */
187 void set_arm_SwitchJmp_n_projs(ir_node *node, int n_projs);
188
189 /**
190  * Returns the default_proj_num.
191  */
192 long get_arm_SwitchJmp_default_proj_num(const ir_node *node);
193
194 /**
195  * Sets the default_proj_num.
196  */
197 void set_arm_SwitchJmp_default_proj_num(ir_node *node, long default_proj_num);
198
199 /**
200  * Gets the shift modifier attribute.
201  */
202 arm_shift_modifier get_arm_shift_modifier(const ir_node *node);
203
204 /**
205  * Decode an immediate with shifter operand
206  */
207 unsigned int arm_decode_imm_w_shift(tarval *tv);
208
209 /**
210  * Registers the arm_copy_attr function for all ARM opcodes.
211  */
212 void arm_register_copy_attr_func(void);
213
214 /* Include the generated headers */
215 #include "gen_arm_new_nodes.h"
216
217 #endif