1 #ifndef _BEARCH_IA32_T_H_
2 #define _BEARCH_IA32_T_H_
4 #include "firm_config.h"
7 #include "bearch_ia32.h"
8 #include "ia32_nodes_attr.h"
13 #define SET_IA32_ORIG_NODE(n, o)
15 #define SET_IA32_ORIG_NODE(n, o) set_ia32_orig_node(n, o);
21 * Bitmask for the backend optimization settings.
23 typedef struct _ia32_optimize_t {
24 unsigned incdec : 1; /**< optimize add/sub 1/-1 to inc/dec */
25 unsigned doam : 1; /**< do address mode optimizations */
26 unsigned placecnst : 1; /**< place constants in the blocks where they are used */
27 unsigned immops : 1; /**< create operations with immediates */
28 unsigned extbb : 1; /**< do extended basic block scheduling */
31 /** floating point support */
32 typedef enum fp_support {
33 fp_x87, /**< use x87 instructions */
34 fp_sse2 /**< use SSE2 instructions */
40 typedef struct _ia32_code_gen_t {
41 const arch_code_generator_if_t *impl; /**< implementation */
42 ir_graph *irg; /**< current irg */
43 FILE *out; /**< output file */
44 const arch_env_t *arch_env; /**< the arch env */
45 set *reg_set; /**< set to memorize registers for non-ia32 nodes (e.g. phi nodes) */
46 firm_dbg_module_t *mod; /**< debugging module */
47 int emit_decls; /**< flag indicating if decls were already emitted */
48 pmap *types; /**< A map of modes to primitive types */
49 pmap *tv_ent; /**< A map of entities that store tarvals */
50 const be_irg_t *birg; /**< The be-irg (contains additional information about the irg) */
51 ir_node **blk_sched; /**< an array containing the scheduled blocks */
52 ia32_optimize_t opt; /**< contains optimization information */
53 char fp_kind; /**< floating point kind */
54 char used_x87; /**< x87 floating point unit used in this graph */
57 typedef struct _ia32_isa_t {
58 const arch_isa_if_t *impl;
59 const arch_register_t *sp; /**< The stack pointer register. */
60 const arch_register_t *bp; /**< The base pointer register. */
61 const int stack_dir; /**< -1 for decreasing, 1 for increasing. */
62 int num_codegens; /**< The number of code generator objects created so far */
63 pmap *regs_16bit; /**< Contains the 16bits names of the gp registers */
64 pmap *regs_8bit; /**< Contains the 8bits names of the gp registers */
65 char fp_kind; /**< floating point kind */
67 struct obstack *name_obst; /**< holds the original node names (for debugging) */
68 unsigned long name_obst_size;
72 typedef struct _ia32_irn_ops_t {
73 const arch_irn_ops_if_t *impl;
77 /* this is a struct to minimize the number of parameters
78 for transformation walker */
79 typedef struct _ia32_transform_env_t {
80 firm_dbg_module_t *mod; /**< The firm debugger */
81 dbg_info *dbg; /**< The node debug info */
82 ir_graph *irg; /**< The irg, the node should be created in */
83 ir_node *block; /**< The block, the node should belong to */
84 ir_node *irn; /**< The irn, to be transformed */
85 ir_mode *mode; /**< The mode of the irn */
86 ia32_code_gen_t *cg; /**< The code generator */
87 } ia32_transform_env_t;
90 * Creates the unique per irg GP NoReg node.
92 ir_node *ia32_new_NoReg_gp(ia32_code_gen_t *cg);
95 * Creates the unique per irg FP NoReg node.
97 ir_node *ia32_new_NoReg_fp(ia32_code_gen_t *cg);
99 #endif /* _BEARCH_IA32_T_H_ */