use new double wide register requirements; implement calling convention for sparc...
[libfirm] / ir / be / sparc / sparc_nodes_attr.h
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief   attributes attached to all sparc nodes
23  * @version $Id$
24  */
25 #ifndef FIRM_BE_SPARC_SPARC_NODES_ATTR_H
26 #define FIRM_BE_SPARC_SPARC_NODES_ATTR_H
27
28 #include "../bearch.h"
29
30 typedef struct sparc_attr_t  sparc_attr_t;
31
32 /**
33  * base SPARC attribute
34  */
35 struct sparc_attr_t
36 {
37         except_attr                 exc;                /**< the exception attribute. MUST be the first one. */
38         const arch_register_req_t **in_req;             /**< register requirements for arguments */
39         int                         immediate_value;    /* immediate values */
40         bool                        is_load_store;
41
42         ir_entity                  *immediate_value_entity; /* hack for now */
43 };
44
45 enum sparc_arch_irn_flags_t {
46         sparc_arch_irn_flag_modifies_flags        = arch_irn_flags_backend << 0,
47         sparc_arch_irn_flag_modifies_fp_flags     = arch_irn_flags_backend << 1,
48         sparc_arch_irn_flag_needs_64bit_spillslot = arch_irn_flags_backend << 2,
49 };
50
51 /**
52  * attribute for FP immediate instruction
53  */
54 typedef struct sparc_fp_attr_t sparc_fp_attr_t;
55 struct sparc_fp_attr_t {
56         sparc_attr_t  base;         /**< generic attribute */
57         ir_mode      *fp_mode;
58 };
59
60 typedef struct sparc_fp_conv_attr_t sparc_fp_conv_attr_t;
61 struct sparc_fp_conv_attr_t {
62         sparc_attr_t  base;
63         ir_mode      *src_mode;
64         ir_mode      *dest_mode;
65 };
66
67 /**
68  * attribute for save instruction
69  */
70 typedef struct sparc_save_attr_t sparc_save_attr_t;
71 struct sparc_save_attr_t {
72         sparc_attr_t  base;              /**< generic attribute */
73         int           initial_stacksize; /* the min. stack size required by the sparc ABI */
74 };
75
76 /**
77  * attributes for load/store adressing modes
78  */
79 typedef struct sparc_load_store_attr_t sparc_load_store_attr_t;
80 struct sparc_load_store_attr_t {
81         sparc_attr_t  base;    /**< generic attribute */
82         ir_mode      *load_store_mode;
83         ir_entity    *entity;
84         int           entity_sign;
85         long          offset;
86         bool          is_frame_entity;
87 };
88
89 /**
90  * attributes for SymConsts
91  */
92 typedef struct sparc_symconst_attr_t sparc_symconst_attr_t;
93 struct sparc_symconst_attr_t {
94         sparc_attr_t  base;    /**< generic attribute */
95         ir_entity    *entity;
96         int           fp_offset;
97 };
98
99 /**
100  * attributes for conditional jumps
101  */
102 typedef struct sparc_jmp_cond_attr_t sparc_jmp_cond_attr_t;
103 struct sparc_jmp_cond_attr_t {
104         sparc_attr_t base;    /**< generic attribute */
105         pn_Cmp       pnc;
106         bool         is_unsigned : 1;
107 };
108
109 /**
110  * attributes for switch jumps
111  */
112 typedef struct sparc_jmp_switch_attr_t sparc_jmp_switch_attr_t;
113 struct sparc_jmp_switch_attr_t {
114         sparc_attr_t  base;    /**< generic attribute */
115         int           n_projs;
116         long          default_proj_num;
117 };
118
119 #endif