Fixed register allocation for fp != sp
[libfirm] / ir / be / arm / bearch_arm_t.h
1 #ifndef _BEARCH_ARM_T_H_
2 #define _BEARCH_ARM_T_H_
3
4 #include <stdio.h>
5
6 #include "debug.h"
7 #include "bearch_arm.h"
8 #include "arm_nodes_attr.h"
9 #include "../be.h"
10 #include "set.h"
11
12 typedef struct _arm_isa_t arm_isa_t;
13
14 typedef struct _arm_code_gen_t {
15         const arch_code_generator_if_t *impl;           /**< implementation */
16         ir_graph                       *irg;            /**< current irg */
17         const arch_env_t               *arch_env;       /**< the arch env */
18         set                            *reg_set;        /**< set to memorize registers for FIRM nodes (e.g. phi) */
19         int                             emit_decls;     /**< flag indicating if decls were already emitted */
20         arm_isa_t                      *isa;            /**< the isa instance */
21         const be_irg_t                 *birg;           /**< The be-irg (contains additional information about the irg) */
22         ir_type                        *int_tp;         /**< the int type, needed for Call conversion */
23         int                             have_fp;        /**< non-zero, if fp hardware instructions are emitted */
24         DEBUG_ONLY(firm_dbg_module_t   *mod;)            /**< debugging module */
25 } arm_code_gen_t;
26
27
28 struct _arm_isa_t {
29         const arch_isa_if_t   *impl;
30         const arch_register_t *sp;            /**< The stack pointer register. */
31         const arch_register_t *bp;            /**< The base pointer register. */
32         const int              stack_dir;     /**< -1 for decreasing, 1 for increasing. */
33         int                    num_codegens;
34         int                    gen_reg_names; /**< use generic register names instead of SP, LR, PC */
35         arm_code_gen_t        *cg;            /**< current code generator */
36         FILE                  *out;           /**< output file */
37 };
38
39
40 typedef struct _arm_irn_ops_t {
41         const arch_irn_ops_if_t *impl;
42         arm_code_gen_t     *cg;
43 } arm_irn_ops_t;
44
45
46 /* this is a struct to minimize the number of parameters
47    for transformation walker */
48 typedef struct _arm_transform_env_t {
49         arm_code_gen_t    *cg;       /**< current code generator */
50         dbg_info          *dbg;      /**< The node debug info */
51         ir_graph          *irg;      /**< The irg, the node should be created in */
52         ir_node           *block;    /**< The block, the node should belong to */
53         ir_node           *irn;      /**< The irn, to be transformed */
54         ir_mode           *mode;     /**< The mode of the irn */
55         DEBUG_ONLY(firm_dbg_module_t *mod;)      /**< The firm debugger */
56 } arm_transform_env_t;
57
58
59 #endif /* _BEARCH_ARM_T_H_ */