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