libFirm
lowering.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1995-2011 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 
25 #ifndef FIRM_LOWERING_H
26 #define FIRM_LOWERING_H
27 
28 #include <stddef.h>
29 
30 #include "firm_types.h"
31 
32 #include "begin.h"
33 
62 FIRM_API void lower_CopyB(ir_graph *irg, unsigned max_small_size,
63  unsigned min_large_size, int allow_misalignments);
64 
75 FIRM_API void lower_switch(ir_graph *irg, unsigned small_switch,
76  unsigned spare_size, ir_mode *selector_mode);
77 
89 
98 
108 FIRM_API void lower_highlevel(void);
109 
113 FIRM_API void lower_const_code(void);
114 
123 
132 typedef int lower_mux_callback(ir_node* mux);
133 
142 FIRM_API void lower_mux(ir_graph *irg, lower_mux_callback *cb_func);
143 
153 FIRM_API ir_graph_pass_t *lower_mux_pass(const char *name,
154  lower_mux_callback *cb_func);
155 
164 typedef int (*i_mapper_func)(ir_node *node, void *ctx);
165 
168 enum ikind {
171 };
172 
176 typedef struct i_call_record {
177  enum ikind kind;
180  void *ctx;
181  void *link;
182 } i_call_record;
183 
187 typedef struct i_instr_record {
188  enum ikind kind;
191  void *ctx;
192  void *link;
194 
198 typedef union i_record {
199  enum ikind kind;
202 } i_record;
203 
218 FIRM_API size_t lower_intrinsics(i_record *list, size_t length,
219  int part_block_used);
220 
229 FIRM_API ir_prog_pass_t *lower_intrinsics_pass(const char *name, i_record *list,
230  size_t length, int part_block_used);
231 
238 FIRM_API int i_mapper_abs(ir_node *call, void *ctx);
239 
246 FIRM_API int i_mapper_bswap(ir_node *call, void *ctx);
247 
253 FIRM_API int i_mapper_sqrt(ir_node *call, void *ctx);
254 
260 FIRM_API int i_mapper_cbrt(ir_node *call, void *ctx);
261 
267 FIRM_API int i_mapper_pow(ir_node *call, void *ctx);
268 
274 FIRM_API int i_mapper_exp(ir_node *call, void *ctx);
275 
281 FIRM_API int i_mapper_exp2(ir_node *call, void *ctx);
282 
288 FIRM_API int i_mapper_exp10(ir_node *call, void *ctx);
289 
295 FIRM_API int i_mapper_log(ir_node *call, void *ctx);
296 
302 FIRM_API int i_mapper_log2(ir_node *call, void *ctx);
303 
309 FIRM_API int i_mapper_log10(ir_node *call, void *ctx);
310 
316 FIRM_API int i_mapper_sin(ir_node *call, void *ctx);
317 
323 FIRM_API int i_mapper_cos(ir_node *call, void *ctx);
324 
330 FIRM_API int i_mapper_tan(ir_node *call, void *ctx);
331 
337 FIRM_API int i_mapper_asin(ir_node *call, void *ctx);
338 
344 FIRM_API int i_mapper_acos(ir_node *call, void *ctx);
345 
351 FIRM_API int i_mapper_atan(ir_node *call, void *ctx);
352 
358 FIRM_API int i_mapper_sinh(ir_node *call, void *ctx);
359 
365 FIRM_API int i_mapper_cosh(ir_node *call, void *ctx);
366 
372 FIRM_API int i_mapper_tanh(ir_node *call, void *ctx);
373 
379 FIRM_API int i_mapper_strcmp(ir_node *call, void *ctx);
380 
386 FIRM_API int i_mapper_strncmp(ir_node *call, void *ctx);
387 
393 FIRM_API int i_mapper_strcpy(ir_node *call, void *ctx);
394 
400 FIRM_API int i_mapper_strlen(ir_node *call, void *ctx);
401 
407 FIRM_API int i_mapper_memcpy(ir_node *call, void *ctx);
408 
414 FIRM_API int i_mapper_mempcpy(ir_node *call, void *ctx);
415 
421 FIRM_API int i_mapper_memmove(ir_node *call, void *ctx);
422 
428 FIRM_API int i_mapper_memset(ir_node *call, void *ctx);
429 
435 FIRM_API int i_mapper_memcmp(ir_node *call, void *ctx);
436 
443 FIRM_API int i_mapper_alloca(ir_node *call, void *ctx);
444 
448 typedef struct runtime_rt {
452  long mem_proj_nr;
454  long exc_proj_nr;
455  long res_proj_nr;
456 } runtime_rt;
457 
518 
521 #include "end.h"
522 
523 #endif