fix warnings because compare_attr gets const nodes now
[libfirm] / ir / be / arm / bearch_arm_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 arm backend -- private header
23  * @author  Oliver Richter, Tobias Gneist
24  * @version $Id$
25  */
26 #ifndef FIRM_BE_ARM_BEARCH_ARM_T_H
27 #define FIRM_BE_ARM_BEARCH_ARM_T_H
28
29 #include <stdio.h>
30
31 #include "arm_nodes_attr.h"
32 #include "be.h"
33
34 typedef struct arm_isa_t arm_isa_t;
35
36 /** The following bitmasks control CPU extensions:  */
37 enum arm_cpu_extensions {
38         ARM_EXT_V1    = 0x00000001,  /**< All processors (core set). */
39         ARM_EXT_V2    = 0x00000002,  /**< Multiply instructions. */
40         ARM_EXT_V2S   = 0x00000004,  /**< SWP instructions. */
41         ARM_EXT_V3    = 0x00000008,  /**< MSR MRS. */
42         ARM_EXT_V3M   = 0x00000010,  /**< Allow long multiplies. */
43         ARM_EXT_V4    = 0x00000020,  /**< Allow half word loads. */
44         ARM_EXT_V4T   = 0x00000040,  /**< Thumb v1. */
45         ARM_EXT_V5    = 0x00000080,  /**< Allow CLZ, etc. */
46         ARM_EXT_V5T   = 0x00000100,  /**< Thumb v2.ยด*/
47         ARM_EXT_V5ExP = 0x00000200,  /**< DSP core set. */
48         ARM_EXT_V5E   = 0x00000400,  /**< DSP Double transfers. */
49         ARM_EXT_V5J   = 0x00000800,  /**< Jazelle extension.   */
50
51         /* Co-processor space extensions.  */
52         ARM_CEXT_XSCALE   = 0x00800000, /**< Allow MIA etc. */
53         ARM_CEXT_MAVERICK = 0x00400000, /**< Use Cirrus/DSP coprocessor. */
54         ARM_CEXT_IWMMXT   = 0x00200000, /**< Intel Wireless MMX technology coprocessor. */
55 };
56
57 /**
58  * Architectures are the sum of the base and extensions.  The ARM ARM (rev E)
59  * defines the following: ARMv3, ARMv3M, ARMv4xM, ARMv4, ARMv4TxM, ARMv4T,
60  * ARMv5xM, ARMv5, ARMv5TxM, ARMv5T, ARMv5TExP, ARMv5TE.  To these we add
61  * three more to cover cores prior to ARM6.  Finally, there are cores which
62  * implement further extensions in the co-processor space.
63  */
64 enum arm_architectures {
65         ARM_ARCH_V1     = ARM_EXT_V1,
66         ARM_ARCH_V2     = ARM_ARCH_V1 | ARM_EXT_V2,
67         ARM_ARCH_V2S    = ARM_ARCH_V2 | ARM_EXT_V2S,
68         ARM_ARCH_V3     = ARM_ARCH_V2S | ARM_EXT_V3,
69         ARM_ARCH_V3M    = ARM_ARCH_V3 | ARM_EXT_V3M,
70         ARM_ARCH_V4xM   = ARM_ARCH_V3 | ARM_EXT_V4,
71         ARM_ARCH_V4     = ARM_ARCH_V3M | ARM_EXT_V4,
72         ARM_ARCH_V4TxM  = ARM_ARCH_V4xM | ARM_EXT_V4T,
73         ARM_ARCH_V4T    = ARM_ARCH_V4 | ARM_EXT_V4T,
74         ARM_ARCH_V5xM   = ARM_ARCH_V4xM| ARM_EXT_V5,
75         ARM_ARCH_V5     = ARM_ARCH_V4 | ARM_EXT_V5,
76         ARM_ARCH_V5TxM  = ARM_ARCH_V5xM | ARM_EXT_V4T | ARM_EXT_V5T,
77         ARM_ARCH_V5T    = ARM_ARCH_V5 | ARM_EXT_V4T | ARM_EXT_V5T,
78         ARM_ARCH_V5TExP = ARM_ARCH_V5T | ARM_EXT_V5ExP,
79         ARM_ARCH_V5TE   = ARM_ARCH_V5TExP | ARM_EXT_V5E,
80         ARM_ARCH_V5TEJ  = ARM_ARCH_V5TE | ARM_EXT_V5J,
81
82         /* Processors with specific extensions in the co-processor space.  */
83         ARM_ARCH_XSCALE = ARM_ARCH_V5TE | ARM_CEXT_XSCALE,
84         ARM_ARCH_IWMMXT = ARM_ARCH_XSCALE | ARM_CEXT_IWMMXT,
85
86         ARM_ARCH_MASK   = 0x00ffffff,
87 };
88
89 /** Floating point instruction set. */
90 enum arm_fp_architectures {
91         ARM_FPU_FPA_EXT_V1     = 0x80000000, /**< Base FPA instruction set. */
92         ARM_FPU_FPA_EXT_V2     = 0x40000000, /**< LFM/SFM. */
93         ARM_FPU_VFP_EXT_NONE   = 0x20000000, /**< Use VFP word-ordering. */
94         ARM_FPU_VFP_EXT_V1xD   = 0x10000000, /**< Base VFP instruction set. */
95         ARM_FPU_VFP_EXT_V1     = 0x08000000, /**< Double-precision insns. */
96         ARM_FPU_VFP_EXT_V2     = 0x04000000, /**< ARM10E VFPr1. */
97
98         ARM_FPU_SOFTFLOAT      = 0x01000000, /**< soft float library */
99         ARM_FPU_NONE           = 0,
100
101         ARM_FPU_ARCH_FPE       = ARM_FPU_FPA_EXT_V1,
102         ARM_FPU_ARCH_FPA       = ARM_FPU_ARCH_FPE | ARM_FPU_FPA_EXT_V2,
103
104         ARM_FPU_ARCH_VFP       = ARM_FPU_VFP_EXT_NONE,
105         ARM_FPU_ARCH_VFP_V1xD  = ARM_FPU_VFP_EXT_V1xD | ARM_FPU_VFP_EXT_NONE,
106         ARM_FPU_ARCH_VFP_V1    = ARM_FPU_ARCH_VFP_V1xD | ARM_FPU_VFP_EXT_V1,
107         ARM_FPU_ARCH_VFP_V2    = ARM_FPU_ARCH_VFP_V1 | ARM_FPU_VFP_EXT_V2,
108
109         ARM_FPU_ARCH_SOFTFLOAT = ARM_FPU_SOFTFLOAT,
110
111         ARM_FPU_MASK           = 0xff000000,
112 };
113
114 /** Returns non-zero if FPA instructions should be issued. */
115 #define USE_FPA(isa)     ((isa)->fpu_arch & ARM_FPU_FPA_EXT_V1)
116
117 /** Returns non-zero if VFP instructions should be issued. */
118 #define USE_VFP(isa)     ((isa)->fpu_arch & ARM_FPU_VFP_EXT_V1xD)
119
120 /** Types of processor to generate code for. */
121 enum arm_processor_types {
122         ARM_1      = ARM_ARCH_V1,
123         ARM_2      = ARM_ARCH_V2,
124         ARM_2a     = ARM_ARCH_V2,
125         ARM_3      = ARM_ARCH_V2S,
126         ARM_3G     = ARM_ARCH_V2S,
127         ARM_250    = ARM_ARCH_V2S,
128         ARM_6      = ARM_ARCH_V3,
129         ARM_7      = ARM_ARCH_V3,
130         ARM_8      = ARM_ARCH_V4,
131         ARM_9      = ARM_ARCH_V4T,
132         ARM_STRONG = ARM_ARCH_V4,
133 };
134
135 struct arm_isa_t {
136         arch_env_t     base;      /**< must be derived from arch_env_t */
137         int            fpu_arch;      /**< FPU architecture */
138 };
139
140 #endif