libFirm
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
be.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5 
11 #ifndef FIRM_BE_H
12 #define FIRM_BE_H
13 
14 #include <stdio.h>
15 #include "irarch.h"
16 #include "iroptimize.h"
17 #include "irmode.h"
18 #include "begin.h"
19 
30 typedef enum asm_constraint_flags_t {
54 ENUM_BITSET(asm_constraint_flags_t)
55 
56 
57 typedef enum {
58  DW_LANG_C89 = 0x0001,
59  DW_LANG_C = 0x0002,
60  DW_LANG_Ada83 = 0x0003,
62  DW_LANG_Cobol74 = 0x0005,
63  DW_LANG_Cobol85 = 0x0006,
66  DW_LANG_Pascal83 = 0x0009,
67  DW_LANG_Modula2 = 0x000a,
68  DW_LANG_Java = 0x000b,
69  DW_LANG_C99 = 0x000c,
70  DW_LANG_Ada95 = 0x000d,
72  DW_LANG_PLI = 0x000f,
73  DW_LANG_ObjC = 0x0010,
75  DW_LANG_UPC = 0x0012,
76  DW_LANG_D = 0x0013,
77  DW_LANG_Python = 0x0014,
78  DW_LANG_Go = 0x0016,
80 
81 typedef void(*lower_func)(ir_node*);
82 
87 typedef struct vararg_params {
94 
99 typedef struct backend_params {
103  unsigned pic_supported:1;
107 
114  unsigned modulo_shift;
115 
118 
121 
124  unsigned machine_size;
125 
131 
136 
141 
146 
149 
152 
156 
163 FIRM_API int be_parse_arg(const char *arg);
164 
169 FIRM_API int be_is_big_endian(void);
170 
175 FIRM_API unsigned be_get_machine_size(void);
176 
183 FIRM_API ir_mode *be_get_mode_float_arithmetic(void);
184 
186 FIRM_API ir_type *be_get_type_long_long(void);
187 
190 
192 FIRM_API ir_type *be_get_type_long_double(void);
193 
196 
203 FIRM_API const backend_params *be_get_backend_param(void);
204 
214 FIRM_API void be_lower_for_target(void);
215 
216 typedef void (*after_transform_func)(ir_graph *irg, const char *name);
217 
224 
228 FIRM_API void be_main(FILE *output, const char *compilation_unit_name);
229 
234 FIRM_API asm_constraint_flags_t be_parse_asm_constraints(const char *constraints);
235 
239 FIRM_API int be_is_valid_clobber(const char *clobber);
240 
245 
250 FIRM_API void be_dwarf_set_compilation_directory(const char *directory);
251 
254 #include "end.h"
255 
256 #endif
ir_type * va_list_type
Which type is to be used for va_list.
Definition: be.h:90
struct ir_type ir_type
Type.
Definition: firm_types.h:71
ir_type * be_get_type_long_double(void)
Returns type used for long double or NULL if none available.
int be_parse_arg(const char *arg)
Parse one backend argument.
void be_dwarf_set_compilation_directory(const char *directory)
Sets working directory of the compiler (or directory where the compiler searched for sources) for dwa...
const ir_settings_arch_dep_t * dep_param
Settings for architecture dependent optimizations.
Definition: be.h:117
int be_is_big_endian(void)
Returns 1 if the backend uses big-endian byte ordering and 0 for little-endian.
ir_type * type_long_double
type used for long double or NULL if none available.
Definition: be.h:145
struct ir_graph ir_graph
Procedure Graph.
Definition: firm_types.h:74
asm_constraint_flags_t be_parse_asm_constraints(const char *constraints)
parse assembler constraint strings and returns flags (so the frontend knows which operands are inputs...
void be_set_after_transform_func(after_transform_func func)
Sets a callback that is called after each transformation step in be_lower_for_target().
unsigned modulo_shift
Shifts on this architecture only read some bits of the shift value.
Definition: be.h:114
unsigned stack_param_align
Alignment of stack parameters.
Definition: be.h:148
invalid constraint (due to parse error)
Definition: be.h:52
input can be encoded as an immediate number
Definition: be.h:37
ir_mode * be_get_mode_float_arithmetic(void)
Returns supported float arithmetic mode or NULL if mode_D and mode_F are supported natively...
Definition: be.h:69
Definition: be.h:75
Definition: be.h:72
ir_type * be_get_type_long_long(void)
Returns type used for long long or NULL if none available.
float_int_conversion_overflow_style_t be_get_float_int_overflow(void)
Returns the backend behaviour on float to integer conversion overflow.
void be_dwarf_set_source_language(dwarf_source_language language)
Sets source language for dwarf debug information.
unsigned pic_supported
1 if backend supports generation of position independent code (PIC)
Definition: be.h:103
float_int_conversion_overflow_style_t
Specifies what happens when a float value is converted to an integer and overflow happens...
Definition: irmode.h:53
unsigned unaligned_memaccess_supported
unaligned memory accesses are not supported natively (but the backend may break the access up into se...
Definition: be.h:106
asm_constraint_flags_t
flags categorizing assembler constraint specifications
Definition: be.h:30
input/output can be in a register, in memory or an immediate
Definition: be.h:39
void(* lower_func)(ir_node *)
Definition: be.h:81
dwarf_source_language
Dwarf source language codes.
Definition: be.h:57
vararg_params vararg
How this backend implements variadic functions.
Definition: be.h:154
ir_mode * mode_float_arithmetic
some backends like x87 can only do arithmetic in a specific float mode (load/store are still done in ...
Definition: be.h:130
void be_lower_for_target(void)
Lowers current program for the target architecture.
the input is read
Definition: be.h:45
input/output can be in a register
Definition: be.h:33
unsigned be_get_machine_size(void)
Returns size of machine words.
int be_is_valid_clobber(const char *clobber)
tests whether a string is a valid clobber in an ASM instruction
The input is also written to.
Definition: be.h:43
input/output can be read/written to/from a memory address
Definition: be.h:35
This operand and the following operand are commutative.
Definition: be.h:50
void(* after_transform_func)(ir_graph *irg, const char *name)
Definition: be.h:216
int(* arch_allow_ifconv_func)(ir_node *sel, ir_node *mux_false, ir_node *mux_true)
This function is called to evaluate, if a mux(sel, mux_false, mux_true) should be built for the curre...
Definition: iroptimize.h:108
no constraints
Definition: be.h:31
lower_func lower_va_arg
The function to lower a call to the va_arg macro.
Definition: be.h:92
unsigned machine_size
size of machine word in bits.
Definition: be.h:124
void be_main(FILE *output, const char *compilation_unit_name)
Main interface to the frontend.
ir_type * type_long_long
type used for long long or NULL if none available.
Definition: be.h:135
unsigned byte_order_big_endian
the backend uses big-endian byte ordering if set, else little endian
Definition: be.h:101
the value is modified before all inputs to the asm block are handled.
Definition: be.h:48
ir_type * be_get_type_unsigned_long_long(void)
Returns type used for unsigned long long or NULL if none available.
ir_type * type_unsigned_long_long
type used for unsigned long long or NULL if none available
Definition: be.h:140
Definition: be.h:76
Definition: be.h:78
struct ir_mode ir_mode
SSA Value mode.
Definition: firm_types.h:59
struct ir_node ir_node
Procedure Graph Node.
Definition: firm_types.h:53
arch_allow_ifconv_func allow_ifconv
Backend settings for if-conversion.
Definition: be.h:120
the constraint is not supported yet by libFirm (but valid in gcc)
Definition: be.h:41
float_int_conversion_overflow_style_t float_int_overflow
Semantic on float->int conversion overflow.
Definition: be.h:151
This structure holds the information on how the backend implements variadic functions.
Definition: be.h:87
This structure contains parameters that should be propagated to the libFirm parameter set...
Definition: be.h:99
const backend_params * be_get_backend_param(void)
Returns the backend configuration parameter.
Definition: be.h:59
Definition: be.h:58
struct ir_settings_arch_dep_t ir_settings_arch_dep_t
Definition: irarch.h:34