1 #ifndef _IA32_NEW_NODES_H_
2 #define _IA32_NEW_NODES_H_
5 * Function prototypes for the assembler ir node constructors.
6 * @author Christian Wuerdig
10 #include "firm_config.h"
12 #include "ia32_nodes_attr.h"
15 * Returns the name of a firm symconst.
17 const char *get_sc_name(ir_node *symc);
21 /***************************************************************************************************
23 * | | | | | | / / | | | | | | | |
24 * __ _| |_| |_ _ __ ___ ___| |_ / /_ _ ___| |_ _ __ ___ ___| |_| |__ ___ __| |___
25 * / _` | __| __| '__| / __|/ _ \ __| / / _` |/ _ \ __| | '_ ` _ \ / _ \ __| '_ \ / _ \ / _` / __|
26 * | (_| | |_| |_| | \__ \ __/ |_ / / (_| | __/ |_ | | | | | | __/ |_| | | | (_) | (_| \__ \
27 * \__,_|\__|\__|_| |___/\___|\__/_/ \__, |\___|\__| |_| |_| |_|\___|\__|_| |_|\___/ \__,_|___/
30 ***************************************************************************************************/
33 * Returns the attributes of an ia32 node.
35 ia32_attr_t *get_ia32_attr(const ir_node *node);
38 * Gets the type of an ia32 node.
40 ia32_op_type_t get_ia32_op_type(const ir_node *node);
43 * Sets the type of an ia32 node.
45 void set_ia32_op_type(ir_node *node, ia32_op_type_t tp);
48 * Gets the supported addrmode of an ia32 node
50 ia32_am_type_t get_ia32_am_support(const ir_node *node);
53 * Sets the supported addrmode of an ia32 node
55 void set_ia32_am_support(ir_node *node, ia32_am_type_t am_tp);
58 * Gets the addrmode flavour of an ia32 node
60 ia32_am_flavour_t get_ia32_am_flavour(const ir_node *node);
63 * Sets the addrmode flavour of an ia32 node
65 void set_ia32_am_flavour(ir_node *node, ia32_am_flavour_t am_flavour);
68 * Gets the joined addrmode offset.
70 char *get_ia32_am_offs(const ir_node *node);
73 * Adds an offset for addrmode.
75 void add_ia32_am_offs(ir_node *node, char *offset);
78 * Subs an offset for addrmode.
80 void sub_ia32_am_offs(ir_node *node, char *offset);
83 * Gets the addr mode const.
85 int get_ia32_am_scale(const ir_node *node);
88 * Sets the const for addr mode.
90 void set_ia32_am_scale(ir_node *node, int scale);
93 * Return the tarval of an immediate operation or NULL in case of SymConst
95 tarval *get_ia32_Immop_tarval(const ir_node *node);
98 * Sets the attributes of an immediate operation to the specified tarval
100 void set_ia32_Immop_tarval(ir_node *node, tarval *tv);
103 * Return the sc attribute.
105 char *get_ia32_sc(const ir_node *node);
108 * Sets the sc attribute.
110 void set_ia32_sc(ir_node *node, char *sc);
113 * Gets the string representation of the internal const (tv or symconst)
115 char *get_ia32_cnst(const ir_node *node);
118 * Sets the uses_frame flag.
120 void set_ia32_use_frame(ir_node *node);
123 * Clears the uses_frame flag.
125 void clear_ia32_use_frame(ir_node *node);
128 * Gets the uses_frame flag.
130 int is_ia32_use_frame(const ir_node *node);
133 * Sets node to commutative.
135 void set_ia32_commutative(ir_node *node);
138 * Sets node to non-commutative.
140 void clear_ia32_commutative(ir_node *node);
143 * Checks if node is commutative.
145 int is_ia32_commutative(const ir_node *node);
148 * Gets the mode of the stored/loaded value (only set for Store/Load)
150 ir_mode *get_ia32_ls_mode(const ir_node *node);
153 * Sets the mode of the stored/loaded value (only set for Store/Load)
155 void set_ia32_ls_mode(ir_node *node, ir_mode *mode);
158 * Gets the mode of the result.
160 ir_mode *get_ia32_res_mode(const ir_node *node);
163 * Sets the mode of the result.
165 void set_ia32_res_mode(ir_node *node, ir_mode *mode);
168 * Gets the frame entity assigned to this node;
170 entity *get_ia32_frame_ent(const ir_node *node);
173 * Sets the frame entity for this node;
175 void set_ia32_frame_ent(ir_node *node, entity *ent);
178 * Returns the argument register requirements of an ia32 node.
180 const ia32_register_req_t **get_ia32_in_req_all(const ir_node *node);
183 * Sets the argument register requirements of an ia32 node.
185 void set_ia32_in_req_all(ir_node *node, const ia32_register_req_t **reqs);
188 * Returns the result register requirements of an ia32 node.
190 const ia32_register_req_t **get_ia32_out_req_all(const ir_node *node);
193 * Sets the result register requirements of an ia32 node.
195 void set_ia32_out_req_all(ir_node *node, const ia32_register_req_t **reqs);
198 * Returns the argument register requirements of an ia32 node.
200 const ia32_register_req_t *get_ia32_in_req(const ir_node *node, int pos);
203 * Returns the result register requirements of an ia32 node.
205 const ia32_register_req_t *get_ia32_out_req(const ir_node *node, int pos);
208 * Sets the OUT register requirements at position pos.
210 void set_ia32_req_out(ir_node *node, const ia32_register_req_t *req, int pos);
213 * Sets the IN register requirements at position pos.
215 void set_ia32_req_in(ir_node *node, const ia32_register_req_t *req, int pos);
218 * Returns the register flag of an ia32 node.
220 arch_irn_flags_t get_ia32_flags(const ir_node *node);
223 * Sets the register flag of an ia32 node.
225 void set_ia32_flags(ir_node *node, arch_irn_flags_t flags);
228 * Returns the result register slots of an ia32 node.
230 const arch_register_t **get_ia32_slots(const ir_node *node);
233 * Returns the name of the OUT register at position pos.
235 const char *get_ia32_out_reg_name(const ir_node *node, int pos);
238 * Returns the index of the OUT register at position pos within its register class.
240 int get_ia32_out_regnr(const ir_node *node, int pos);
243 * Returns the OUT register at position pos.
245 const arch_register_t *get_ia32_out_reg(const ir_node *node, int pos);
248 * Sets the number of results.
250 void set_ia32_n_res(ir_node *node, int n_res);
253 * Returns the number of results.
255 int get_ia32_n_res(const ir_node *node);
258 * Returns the flavour of an ia32 node,
260 ia32_op_flavour_t get_ia32_flavour(const ir_node *node);
263 * Sets the flavour of an ia32 node to flavour_Div/Mod/DivMod/Mul/Mulh.
265 void set_ia32_flavour(ir_node *node, ia32_op_flavour_t op_flav);
268 * Returns the projnum code.
270 long get_ia32_pncode(const ir_node *node);
273 * Sets the projnum code
275 void set_ia32_pncode(ir_node *node, long code);
280 * Returns the name of the original ir node.
282 const char *get_ia32_orig_node(const ir_node *node);
285 * Sets the name of the original ir node.
287 void set_ia32_orig_node(ir_node *node, const char *name);
291 /******************************************************************************************************
293 * (_) | | | | | | / _| | | (_)
294 * ___ _ __ ___ ___ _ __ _| | __ _| |_| |_ _ __ | |_ _ _ _ __ ___| |_ _ ___ _ __ ___
295 * / __| '_ \ / _ \/ __| |/ _` | | / _` | __| __| '__| | _| | | | '_ \ / __| __| |/ _ \| '_ \ / __|
296 * \__ \ |_) | __/ (__| | (_| | | | (_| | |_| |_| | | | | |_| | | | | (__| |_| | (_) | | | | \__ \
297 * |___/ .__/ \___|\___|_|\__,_|_| \__,_|\__|\__|_| |_| \__,_|_| |_|\___|\__|_|\___/|_| |_| |___/
300 ******************************************************************************************************/
303 * Gets the type of an ia32_Const.
305 unsigned get_ia32_Const_type(const ir_node *node);
308 * Sets the type of an ia32_Const.
310 void set_ia32_Const_type(ir_node *node, int type);
313 * Copy the attributes from an ia32_Const to an Immop (Add_i, Sub_i, ...) node
315 void set_ia32_Immop_attr(ir_node *node, ir_node *cnst);
318 * Copy the attributes from a Const to an ia32_Const
320 void set_ia32_Const_attr(ir_node *ia32_cnst, ir_node *cnst);
323 * Sets the AddrMode attribute
324 * @param direction The "direction" of AM ('S' source or 'D' destination)
326 void set_ia32_AddrMode(ir_node *node, char direction);
329 * Returns whether or not the node is an AddrModeS node.
331 int is_ia32_AddrModeS(const ir_node *node);
334 * Returns whether or not the node is an AddrModeD node.
336 int is_ia32_AddrModeD(const ir_node *node);
339 * Checks if node is a Load or fLoad.
341 int is_ia32_Ld(const ir_node *node);
344 * Checks if node is a Store or fStore.
346 int is_ia32_St(const ir_node *node);
349 * Checks if node is a Const or fConst.
351 int is_ia32_Cnst(const ir_node *node);
354 * Allocates num register slots for node.
356 void alloc_ia32_reg_slots(ir_node *node, int num);
359 * Initializes the nodes attributes.
361 void init_ia32_attributes(ir_node *node, arch_irn_flags_t flags, const ia32_register_req_t **in_reqs, \
362 const ia32_register_req_t **out_reqs, int n_res);
364 /* Include the generated headers */
365 #include "gen_ia32_new_nodes.h"
367 #endif /* _IA32_NEW_NODES_H_ */