a1ef249bad9f5faf8c0aad7e96312b79a9fe0fb1
[libfirm] / ir / be / arm / arm_new_nodes.h
1 #ifndef _ARM_NEW_NODES_H_
2 #define _ARM_NEW_NODES_H_
3
4 /**
5  * Function prototypes for the assembler ir node constructors.
6  * $Id$
7  */
8
9 #include "arm_nodes_attr.h"
10 #include "bearch_arm_t.h"
11
12 /***************************************************************************************************
13  *        _   _                   _       __        _                    _   _               _
14  *       | | | |                 | |     / /       | |                  | | | |             | |
15  *   __ _| |_| |_ _ __   ___  ___| |_   / /_ _  ___| |_   _ __ ___   ___| |_| |__   ___   __| |___
16  *  / _` | __| __| '__| / __|/ _ \ __| / / _` |/ _ \ __| | '_ ` _ \ / _ \ __| '_ \ / _ \ / _` / __|
17  * | (_| | |_| |_| |    \__ \  __/ |_ / / (_| |  __/ |_  | | | | | |  __/ |_| | | | (_) | (_| \__ \
18  *  \__,_|\__|\__|_|    |___/\___|\__/_/ \__, |\___|\__| |_| |_| |_|\___|\__|_| |_|\___/ \__,_|___/
19  *                                        __/ |
20  *                                       |___/
21  ***************************************************************************************************/
22
23 /**
24  * Returns the attributes of an arm node.
25  */
26 arm_attr_t *get_arm_attr(const ir_node *node);
27
28 /**
29  * Returns the argument register requirements of an arm node.
30  */
31 const arm_register_req_t **get_arm_in_req_all(const ir_node *node);
32
33 /**
34  * Returns the result register requirements of an arm node.
35  */
36 const arm_register_req_t **get_arm_out_req_all(const ir_node *node);
37
38 /**
39  * Returns the argument register requirements of an arm node.
40  */
41 const arm_register_req_t *get_arm_in_req(const ir_node *node, int pos);
42
43 /**
44  * Returns the result register requirements of an arm node.
45  */
46 const arm_register_req_t *get_arm_out_req(const ir_node *node, int pos);
47
48 /**
49  * Sets the OUT register requirements at position pos.
50  */
51 void set_arm_req_out(ir_node *node, const arm_register_req_t *req, int pos);
52
53 /**
54  * Sets the complete OUT requirements of node.
55  */
56 void set_arm_req_out_all(ir_node *node, const arm_register_req_t **reqs);
57
58 /**
59  * Sets the IN register requirements at position pos.
60  */
61 void set_arm_req_in(ir_node *node, const arm_register_req_t *req, int pos);
62
63 /**
64  * Returns the register flag of an arm node.
65  */
66 arch_irn_flags_t get_arm_flags(const ir_node *node);
67
68 /**
69  * Sets the register flag of an arm node.
70  */
71 void set_arm_flags(const ir_node *node, arch_irn_flags_t flags);
72
73 /**
74  * Returns the result register slots of an arm node.
75  */
76 const arch_register_t **get_arm_slots(const ir_node *node);
77
78 /**
79  * Returns the name of the OUT register at position pos.
80  */
81 const char *get_arm_out_reg_name(const ir_node *node, int pos);
82
83 /**
84  * Returns the index of the OUT register at position pos within its register class.
85  */
86 int get_arm_out_regnr(const ir_node *node, int pos);
87
88 /**
89  * Returns the OUT register at position pos.
90  */
91 const arch_register_t *get_arm_out_reg(const ir_node *node, int pos);
92
93 /**
94  * Sets the number of results.
95  */
96 void set_arm_n_res(ir_node *node, int n_res);
97
98 /**
99  * Returns the number of results.
100  */
101 int get_arm_n_res(const ir_node *node);
102
103 /**
104  * Set the ARM machine node attributes to default values.
105  */
106 void init_arm_attributes(ir_node *node, int flags, const arm_register_req_t ** in_reqs,
107                          const arm_register_req_t ** out_reqs, int n_res);
108
109 ir_node *arm_new_NoReg_gp(arm_code_gen_t *cg);
110 ir_node *arm_new_NoReg_fp(arm_code_gen_t *cg);
111
112 /**
113  * Returns the tarval
114  */
115 tarval *get_arm_value(const ir_node *node);
116
117 /**
118  * Sets the tarval
119  */
120 void set_arm_value(ir_node *node, tarval *tv);
121
122 /**
123  * Returns the proj num
124  */
125 int get_arm_proj_num(const ir_node *node);
126
127 /**
128  * Sets the proj num
129  */
130 void set_arm_proj_num(ir_node *node, int proj_num);
131
132 const char *get_arm_symconst_label(ir_node *node);
133 void set_arm_symconst_label(ir_node *node, const char *symconst_label);
134
135 ir_node *new_r_arm_StoreStackMInc(ir_graph *irg, ir_node *block, ir_node *mem, ir_node *sp,
136                                                               int n_regs, ir_node **regs, ir_mode *mode);
137
138 /**
139  * Returns the number of projs.
140  */
141 int get_arm_n_projs(ir_node *node);
142
143 /**
144  * Sets the number of projs.
145  */
146 void set_arm_n_projs(ir_node *node, int n_projs);
147
148 /**
149  * Returns the default_proj_num.
150  */
151 long get_arm_default_proj_num(ir_node *node);
152
153 /**
154  * Sets the default_proj_num.
155  */
156 void set_arm_default_proj_num(ir_node *node, long default_proj_num);
157
158 /**
159  * Gets the shift modifier attribute.
160  */
161 arm_shift_modifier get_arm_shift_modifier(ir_node *node);
162
163 /**
164  * Decode an immediate with shifter operand
165  */
166 unsigned int arm_decode_imm_w_shift(tarval *tv);
167
168 /* Include the generated headers */
169 #include "gen_arm_new_nodes.h"
170
171 #endif /* _ARM_NEW_NODES_H_ */