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 "ia32_nodes_attr.h"
13 * Returns the name of a firm symconst.
15 const char *get_sc_name(ir_node *symc);
19 /***************************************************************************************************
21 * | | | | | | / / | | | | | | | |
22 * __ _| |_| |_ _ __ ___ ___| |_ / /_ _ ___| |_ _ __ ___ ___| |_| |__ ___ __| |___
23 * / _` | __| __| '__| / __|/ _ \ __| / / _` |/ _ \ __| | '_ ` _ \ / _ \ __| '_ \ / _ \ / _` / __|
24 * | (_| | |_| |_| | \__ \ __/ |_ / / (_| | __/ |_ | | | | | | __/ |_| | | | (_) | (_| \__ \
25 * \__,_|\__|\__|_| |___/\___|\__/_/ \__, |\___|\__| |_| |_| |_|\___|\__|_| |_|\___/ \__,_|___/
28 ***************************************************************************************************/
31 * Returns the attributes of an ia32 node.
33 ia32_attr_t *get_ia32_attr(const ir_node *node);
36 * Gets the type of an ia32 node.
38 ia32_op_type_t get_ia32_op_type(const ir_node *node);
41 * Sets the type of an ia32 node.
43 void set_ia32_op_type(ir_node *node, ia32_op_type_t tp);
46 * Gets the supported addrmode of an ia32 node
48 ia32_am_type_t get_ia32_am_support(const ir_node *node);
51 * Sets the supported addrmode of an ia32 node
53 void set_ia32_am_support(ir_node *node, ia32_am_type_t am_tp);
56 * Gets the addrmode flavour of an ia32 node
58 ia32_am_flavour_t get_ia32_am_flavour(const ir_node *node);
61 * Sets the addrmode flavour of an ia32 node
63 void set_ia32_am_flavour(ir_node *node, ia32_am_flavour_t am_flavour);
66 * Gets the joined addrmode offset.
68 char *get_ia32_am_offs(const ir_node *node);
71 * Adds an offset for addrmode.
73 void add_ia32_am_offs(ir_node *node, char *offset);
76 * Subs an offset for addrmode.
78 void sub_ia32_am_offs(ir_node *node, char *offset);
81 * Gets the addr mode const.
83 int get_ia32_am_scale(const ir_node *node);
86 * Sets the const for addr mode.
88 void set_ia32_am_scale(ir_node *node, int scale);
91 * Return the tarval of an immediate operation or NULL in case of SymConst
93 tarval *get_ia32_Immop_tarval(const ir_node *node);
96 * Sets the attributes of an immediate operation to the specified tarval
98 void set_ia32_Immop_tarval(ir_node *node, tarval *tv);
101 * Return the sc attribute.
103 char *get_ia32_sc(const ir_node *node);
106 * Sets the sc attribute.
108 void set_ia32_sc(ir_node *node, char *sc);
111 * Gets the string representation of the internal const (tv or symconst)
113 char *get_ia32_cnst(ir_node *node);
116 * Returns the argument register requirements of an ia32 node.
118 const ia32_register_req_t **get_ia32_in_req_all(const ir_node *node);
121 * Returns the result register requirements of an ia32 node.
123 const ia32_register_req_t **get_ia32_out_req_all(const ir_node *node);
126 * Returns the argument register requirements of an ia32 node.
128 const ia32_register_req_t *get_ia32_in_req(const ir_node *node, int pos);
131 * Returns the result register requirements of an ia32 node.
133 const ia32_register_req_t *get_ia32_out_req(const ir_node *node, int pos);
136 * Sets the OUT register requirements at position pos.
138 void set_ia32_req_out(ir_node *node, const ia32_register_req_t *req, int pos);
141 * Sets the IN register requirements at position pos.
143 void set_ia32_req_in(ir_node *node, const ia32_register_req_t *req, int pos);
146 * Returns the register flag of an ia32 node.
148 arch_irn_flags_t get_ia32_flags(const ir_node *node);
151 * Sets the register flag of an ia32 node.
153 void set_ia32_flags(const ir_node *node, arch_irn_flags_t flags);
156 * Returns the result register slots of an ia32 node.
158 const arch_register_t **get_ia32_slots(const ir_node *node);
161 * Returns the name of the OUT register at position pos.
163 const char *get_ia32_out_reg_name(const ir_node *node, int pos);
166 * Returns the index of the OUT register at position pos within its register class.
168 int get_ia32_out_regnr(const ir_node *node, int pos);
171 * Returns the OUT register at position pos.
173 const arch_register_t *get_ia32_out_reg(const ir_node *node, int pos);
176 * Sets the number of results.
178 void set_ia32_n_res(ir_node *node, int n_res);
181 * Returns the number of results.
183 int get_ia32_n_res(const ir_node *node);
186 * Returns the flavour of an ia32 node,
188 ia32_op_flavour_t get_ia32_flavour(const ir_node *node);
191 * Sets the flavour of an ia32 node to flavour_Div/Mod/DivMod/Mul/Mulh.
193 void set_ia32_flavour(ir_node *node, ia32_op_flavour_t op_flav);
196 * Returns the projnum code.
198 long get_ia32_pncode(const ir_node *node);
201 * Sets the projnum code
203 void set_ia32_pncode(ir_node *node, long code);
207 /******************************************************************************************************
209 * (_) | | | | | | / _| | | (_)
210 * ___ _ __ ___ ___ _ __ _| | __ _| |_| |_ _ __ | |_ _ _ _ __ ___| |_ _ ___ _ __ ___
211 * / __| '_ \ / _ \/ __| |/ _` | | / _` | __| __| '__| | _| | | | '_ \ / __| __| |/ _ \| '_ \ / __|
212 * \__ \ |_) | __/ (__| | (_| | | | (_| | |_| |_| | | | | |_| | | | | (__| |_| | (_) | | | | \__ \
213 * |___/ .__/ \___|\___|_|\__,_|_| \__,_|\__|\__|_| |_| \__,_|_| |_|\___|\__|_|\___/|_| |_| |___/
216 ******************************************************************************************************/
219 * Gets the type of an ia32_Const.
221 unsigned get_ia32_Const_type(ir_node *node);
224 * Sets the type of an ia32_Const.
226 void set_ia32_Const_type(ir_node *node, int type);
229 * Copy the attributes from an ia32_Const to an Immop (Add_i, Sub_i, ...) node
231 void set_ia32_Immop_attr(ir_node *node, ir_node *cnst);
234 * Copy the attributes from a Const to an ia32_Const
236 void set_ia32_Const_attr(ir_node *ia32_cnst, ir_node *cnst);
239 * Sets the AddrMode attribute
240 * @param direction The "direction" of AM ('S' source or 'D' destination)
242 void set_ia32_AddrMode(ir_node *node, char direction);
245 * Returns whether or not the node is an AddrModeS node.
247 int is_ia32_AddrModeS(ir_node *node);
250 * Returns whether or not the node is an AddrModeD node.
252 int is_ia32_AddrModeD(ir_node *node);
254 /* Include the generated headers */
255 #include "gen_ia32_new_nodes.h"
257 #endif /* _IA32_NEW_NODES_H_ */