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