sparc: implement all floating point operations in single, double and quad mode
[libfirm] / ir / be / sparc / bearch_sparc_t.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   declarations for SPARC backend -- private header
23  * @version $Id$
24  */
25 #ifndef FIRM_BE_SPARC_BEARCH_SPARC_T_H
26 #define FIRM_BE_SPARC_BEARCH_SPARC_T_H
27
28 #include <stdbool.h>
29 #include "sparc_nodes_attr.h"
30 #include "be.h"
31
32 typedef struct sparc_transform_env_t  sparc_transform_env_t;
33 typedef struct sparc_isa_t            sparc_isa_t;
34
35 typedef struct sparc_code_gen_t {
36         const arch_code_generator_if_t *impl;    /**< implementation */
37         ir_graph                       *irg;     /**< current irg */
38         sparc_isa_t                    *isa;     /**< the isa instance */
39         bool                            dump;    /**< set to 1 if graphs should
40                                                       be dumped */
41     pmap                           *constants;
42 } sparc_code_gen_t;
43
44 struct sparc_isa_t {
45         arch_env_t        base;      /**< must be derived from arch_env_t */
46         sparc_code_gen_t *cg;        /**< current code generator */
47 };
48
49 /**
50  * this is a struct to minimize the number of parameters
51  * for transformation walker
52  */
53 struct sparc_transform_env_t {
54         dbg_info *dbg;      /**< The node debug info */
55         ir_graph *irg;      /**< The irg, the node should be created in */
56         ir_node  *block;    /**< The block, the node should belong to */
57         ir_node  *irn;      /**< The irn, to be transformed */
58         ir_mode  *mode;     /**< The mode of the irn */
59 };
60
61 void sparc_finish_irg(sparc_code_gen_t *cg);
62
63 /**
64  * Sparc ABI requires some space which is always available at the top of
65  * the stack. It contains:
66  * 16*4 bytes space for spilling the register window
67  * 1*4 byte   holding a pointer to space for agregate returns (the space is
68  *            always reserved, regardless wether we have an agregate return
69  *            or not)
70  * 6*4 bytes  Space for spilling parameters 0-5. For the cases when someone
71  *            takes the adress of a parameter. I guess this is also there so
72  *            the implementation of va_args gets easier -> We can simply store
73  *            param 0-5 in this spaces and then handle va_next by simply
74  *            incrementing the stack pointer
75  */
76 #define SPARC_MIN_STACKSIZE 92
77
78 #endif