1 #ifndef _BEARCH_IA32_T_H_
2 #define _BEARCH_IA32_T_H_
5 #include "bearch_ia32.h"
6 #include "ia32_nodes_attr.h"
11 typedef struct _ia32_optimize_t {
12 unsigned incdec : 1; /**< optimize add/sub 1/-1 to inc/dec */
13 unsigned doam : 1; /**< do address mode optimizations */
14 unsigned placecnst : 1; /**< place constants in the blocks where they are used */
15 unsigned immops : 1; /**< create operations with immediates */
18 typedef struct _ia32_code_gen_t {
19 const arch_code_generator_if_t *impl; /**< implementation */
20 ir_graph *irg; /**< current irg */
21 FILE *out; /**< output file */
22 const arch_env_t *arch_env; /**< the arch env */
23 set *reg_set; /**< set to memorize registers for non-ia32 nodes (e.g. phi nodes) */
24 firm_dbg_module_t *mod; /**< debugging module */
25 int emit_decls; /**< flag indicating if decls were already emitted */
26 pmap *types; /**< A map of modes to primitive types */
27 pmap *tv_ent; /**< A map of entities that store tarvals */
28 const be_irg_t *birg; /**< The be-irg (contains additional information about the irg) */
29 ia32_optimize_t opt; /**< contains optimization information */
32 typedef struct _ia32_isa_t {
33 const arch_isa_if_t *impl;
34 const arch_register_t *sp; /** The stack pointer register. */
35 const arch_register_t *bp; /** The base pointer register. */
36 const int stack_dir; /** -1 for decreasing, 1 for increasing. */
40 typedef struct _ia32_irn_ops_t {
41 const arch_irn_ops_if_t *impl;
45 /* this is a struct to minimize the number of parameters
46 for transformation walker */
47 typedef struct _ia32_transform_env_t {
48 firm_dbg_module_t *mod; /**< The firm debugger */
49 dbg_info *dbg; /**< The node debug info */
50 ir_graph *irg; /**< The irg, the node should be created in */
51 ir_node *block; /**< The block, the node should belong to */
52 ir_node *irn; /**< The irn, to be transformed */
53 ir_mode *mode; /**< The mode of the irn */
54 ia32_code_gen_t *cg; /**< The code generator */
55 } ia32_transform_env_t;
58 * Creates the unique per irg GP NoReg node.
60 ir_node *ia32_new_NoReg_gp(ia32_code_gen_t *cg);
63 * Creates the unique per irg FP NoReg node.
65 ir_node *ia32_new_NoReg_fp(ia32_code_gen_t *cg);
67 #endif /* _BEARCH_IA32_T_H_ */