ca40638ee43fde4c02fa3beced15f17519b59833
[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
43 /**
44  * attribute for FP immediate instruction
45  */
46 typedef struct sparc_fp_attr_t sparc_fp_attr_t;
47 struct sparc_fp_attr_t {
48         sparc_attr_t    base;         /**< generic attribute */
49         double          fp_immediate; /* the FP immediate value */
50 };
51
52 /**
53  * attribute for save instruction
54  */
55 typedef struct sparc_save_attr_t sparc_save_attr_t;
56 struct sparc_save_attr_t {
57         sparc_attr_t  base;              /**< generic attribute */
58         int           initial_stacksize; /* the min. stack size required by the sparc ABI */
59 };
60
61 /**
62  * attributes for load/store adressing modes
63  */
64 typedef struct sparc_load_store_attr_t sparc_load_store_attr_t;
65 struct sparc_load_store_attr_t {
66         sparc_attr_t  base;    /**< generic attribute */
67         ir_mode      *load_store_mode;
68         ir_entity    *entity;
69         int           entity_sign;
70         long          offset;
71         bool          is_frame_entity;
72 };
73
74 /**
75  * attributes for SymConsts
76  */
77 typedef struct sparc_symconst_attr_t sparc_symconst_attr_t;
78 struct sparc_symconst_attr_t {
79         sparc_attr_t  base;    /**< generic attribute */
80         ir_entity    *entity;
81         int           fp_offset;
82 };
83
84 /**
85  * attributes for conditional jumps
86  */
87 typedef struct sparc_jmp_cond_attr_t sparc_jmp_cond_attr_t;
88 struct sparc_jmp_cond_attr_t {
89         sparc_attr_t base;    /**< generic attribute */
90         int          proj_num;
91         bool         is_unsigned : 1;
92 };
93
94 /**
95  * attributes for switch jumps
96  */
97 typedef struct sparc_jmp_switch_attr_t sparc_jmp_switch_attr_t;
98 struct sparc_jmp_switch_attr_t {
99         sparc_attr_t  base;    /**< generic attribute */
100         int           n_projs;
101         long          default_proj_num;
102 };
103
104 #endif