13bcea6bd614418d35deab6f1c6dc9048fae6bee
[libfirm] / ir / be / ppc32 / ppc32_nodes_attr.h
1 #ifndef _PPC32_NODES_ATTR_H_
2 #define _PPC32_NODES_ATTR_H_
3
4 #include "../bearch.h"
5
6 typedef struct _ppc32_register_req_t {
7         const arch_register_req_t req;
8         int same_pos;        /**< in case of "should be same" we need to remember the pos to get the irn */
9         int different_pos;   /**< in case of "should be different" we need to remember the pos to get the irn */
10 } ppc32_register_req_t;
11
12 typedef struct
13 {
14         unsigned shift:5;
15         unsigned maskA:5;
16         unsigned maskB:5;
17 } rlwimi_const_t;
18
19
20 typedef enum {
21         ppc32_ac_None,
22         ppc32_ac_Const,
23         ppc32_ac_SymConst,
24         ppc32_ac_FrameEntity,
25         ppc32_ac_RlwimiConst,
26         ppc32_ac_BranchProj,
27         ppc32_ac_Offset
28 } ppc32_attr_content_type;
29
30 typedef enum {
31         ppc32_ao_None, ppc32_ao_Lo16, ppc32_ao_Hi16, ppc32_ao_Ha16, ppc32_ao_Illegal
32 } ppc32_attr_offset_mode;
33
34 typedef struct _ppc32_attr_t {
35         arch_irn_flags_t flags;     /**< indicating if spillable, rematerializeable ... etc. */
36         int              n_res;     /**< number of results for this node */
37
38         const ppc32_register_req_t **in_req;  /**< register requirements for arguments */
39         const ppc32_register_req_t **out_req; /**< register requirements for results */
40
41         ppc32_attr_content_type content_type;
42         ppc32_attr_offset_mode offset_mode;
43         union {
44                 tarval *constant_tarval;
45                 ident *symconst_ident;
46                 ir_entity *frame_entity;
47                 rlwimi_const_t rlwimi_const;
48                 int proj_nr;
49                 int offset;
50                 void* empty;
51         } data;
52
53         /* must be last, dynamically allocated */
54         const arch_register_t *slots[1];       /**< register slots for assigned registers */
55 } ppc32_attr_t;
56
57 #endif /* _PPC32_NODES_ATTR_H_ */