OSDN Git Service

* gcc.c-torture/execute/multi-ix.c (CHUNK): Be more conservative
[pf3gnuchains/gcc-fork.git] / gcc / machmode.def
1 /* This file contains the definitions and documentation for the
2    machine modes used in the GNU compiler.
3    Copyright (C) 1987, 1992, 1994, 1997, 1998, 2000, 2003, 2004, 2005
4    Free Software Foundation, Inc.
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2, or (at your option) any later
11 version.
12
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING.  If not, write to the Free
20 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
21 02110-1301, USA.  */
22
23
24 /* This file defines all the MACHINE MODES used by GCC.
25
26    A machine mode specifies a size and format of data
27    at the machine level.
28
29    Each RTL expression has a machine mode.
30
31    At the syntax tree level, each ..._TYPE and each ..._DECL node
32    has a machine mode which describes data of that type or the
33    data of the variable declared.  */
34
35 /* This file is included by the genmodes program.  Its text is the
36    body of a function.  Do not rely on this, it will change in the
37    future.
38
39    The following statements can be used in this file -- all have
40    the form of a C macro call.  In their arguments:
41
42    A CLASS argument must be one of the constants defined in
43    mode-classes.def, less the leading MODE_ prefix; some statements
44    that take CLASS arguments have restrictions on which classes are
45    acceptable.  For instance, INT.
46
47    A MODE argument must be the printable name of a machine mode,
48    without quotation marks or trailing "mode".  For instance, SI.
49
50    A PRECISION, BYTESIZE, or COUNT argument must be a positive integer
51    constant.
52
53    A FORMAT argument must be one of the real_mode_format structures
54    declared in real.h, or else a literal 0.  Do not put a leading &
55    on the argument.
56
57    An EXPR argument must be a syntactically valid C expression.
58    If an EXPR contains commas, you may need to write an extra pair of
59    parentheses around it, so it appears to be a single argument to the
60    statement.
61
62    This file defines only those modes which are of use on almost all
63    machines.  Other modes can be defined in the target-specific
64    mode definition file, config/ARCH/ARCH-modes.def.
65
66    Order matters in this file in so far as statements which refer to
67    other modes must appear after the modes they refer to.  However,
68    statements which do not refer to other modes may appear in any
69    order.
70
71      RANDOM_MODE (MODE);
72         declares MODE to be of class RANDOM.
73
74      CC_MODE (MODE);
75         declares MODE to be of class CC.
76
77      INT_MODE (MODE, BYTESIZE);
78         declares MODE to be of class INT and BYTESIZE bytes wide.
79         All of the bits of its representation are significant.
80
81      FRACTIONAL_INT_MODE (MODE, PRECISION, BYTESIZE);
82         declares MODE to be of class INT, BYTESIZE bytes wide in
83         storage, but with only PRECISION significant bits.
84
85      FLOAT_MODE (MODE, BYTESIZE, FORMAT);
86         declares MODE to be of class FLOAT and BYTESIZE bytes wide,
87         using floating point format FORMAT.
88         All of the bits of its representation are significant.
89
90      DECIMAL FLOAT_MODE (MODE, BYTESIZE);
91         declares MODE to be of class DECIMAL_FLOAT and BYTESIZE bytes
92         wide.  All of the bits of its representation are significant.
93
94      FRACTIONAL_FLOAT_MODE (MODE, PRECISION, BYTESIZE, FORMAT);
95         declares MODE to be of class FLOAT, BYTESIZE bytes wide in
96         storage, but with only PRECISION significant bits, using
97         floating point format FORMAT.
98
99      FRACT_MODE (MODE, BYTESIZE, FBIT);
100         declares MODE to be of class FRACT and BYTESIZE bytes wide
101         with FBIT fractional bits.  There may be padding bits.
102
103      UFRACT_MODE (MODE, BYTESIZE, FBIT);
104         declares MODE to be of class UFRACT and BYTESIZE bytes wide
105         with FBIT fractional bits.  There may be padding bits.
106
107      ACCUM_MODE (MODE, BYTESIZE, IBIT, FBIT);
108         declares MODE to be of class ACCUM and BYTESIZE bytes wide
109         with IBIT integral bits and FBIT fractional bits.
110         There may be padding bits.
111
112      UACCUM_MODE (MODE, BYTESIZE, FBIT);
113         declares MODE to be of class UACCUM and BYTESIZE bytes wide
114         with IBIT integral bits and FBIT fractional bits.
115         There may be padding bits.
116
117      RESET_FLOAT_FORMAT (MODE, FORMAT);
118         changes the format of MODE, which must be class FLOAT,
119         to FORMAT.  Use in an ARCH-modes.def to reset the format
120         of one of the float modes defined in this file.
121
122      PARTIAL_INT_MODE (MODE);
123         declares a mode of class PARTIAL_INT with the same size as
124         MODE (which must be an INT mode).  The name of the new mode
125         is made by prefixing a P to the name MODE.  This statement
126         may grow a PRECISION argument in the future.
127
128      VECTOR_MODE (CLASS, MODE, COUNT);
129         Declare a vector mode whose component mode is MODE (of class
130         CLASS) with COUNT components.  CLASS must be INT or FLOAT.
131         The name of the vector mode takes the form VnX where n is
132         COUNT in decimal and X is MODE.
133
134      VECTOR_MODES (CLASS, WIDTH);
135         For all modes presently declared in class CLASS, construct
136         corresponding vector modes having width WIDTH.  Modes whose
137         byte sizes do not evenly divide WIDTH are ignored, as are
138         modes that would produce vector modes with only one component,
139         and modes smaller than one byte (if CLASS is INT) or smaller
140         than two bytes (if CLASS is FLOAT).  CLASS must be INT or
141         FLOAT.  The names follow the same rule as VECTOR_MODE uses.
142
143      COMPLEX_MODES (CLASS);
144         For all modes presently declared in class CLASS, construct
145         corresponding complex modes.  Modes smaller than one byte
146         are ignored.  For FLOAT modes, the names are derived by
147         replacing the 'F' in the mode name with a 'C'.  (It is an
148         error if there is no 'F'.  For INT modes, the names are
149         derived by prefixing a C to the name.
150
151      ADJUST_BYTESIZE (MODE, EXPR);
152      ADJUST_ALIGNMENT (MODE, EXPR);
153      ADJUST_FLOAT_FORMAT (MODE, EXPR);
154      ADJUST_IBIT (MODE, EXPR);
155      ADJUST_FBIT (MODE, EXPR);
156         Arrange for the byte size, alignment, floating point format, ibit,
157         or fbit of MODE to be adjustable at run time.  EXPR will be executed
158         once after processing all command line options, and should
159         evaluate to the desired byte size, alignment, format, ibit or fbit.
160
161         Unlike a FORMAT argument, if you are adjusting a float format
162         you must put an & in front of the name of each format structure.
163
164    Note: If a mode is ever made which is more than 255 bytes wide,
165    machmode.h and genmodes.c will have to be changed to allocate
166    more space for the mode_size and mode_alignment arrays.  */
167
168 /* VOIDmode is used when no mode needs to be specified,
169    as for example on CONST_INT RTL expressions.  */
170 RANDOM_MODE (VOID);
171
172 /* BLKmode is used for structures, arrays, etc.
173    that fit no more specific mode.  */
174 RANDOM_MODE (BLK);
175
176 /* Single bit mode used for booleans.  */
177 FRACTIONAL_INT_MODE (BI, 1, 1);
178
179 /* Basic integer modes.  We go up to TI in generic code (128 bits).
180    The name OI is reserved for a 256-bit type (needed by some back ends).
181    FIXME TI shouldn't be generically available either.  */
182 INT_MODE (QI, 1);
183 INT_MODE (HI, 2);
184 INT_MODE (SI, 4);
185 INT_MODE (DI, 8);
186 INT_MODE (TI, 16);
187
188 /* No partial integer modes are defined by default.  */
189
190 /* Basic floating point modes.  SF and DF are the only modes provided
191    by default.  The names QF, HF, XF, and TF are reserved for targets
192    that need 1-word, 2-word, 80-bit, or 128-bit float types respectively.
193
194    These are the IEEE mappings.  They can be overridden with
195    RESET_FLOAT_FORMAT or at runtime (in OVERRIDE_OPTIONS).  */
196
197 FLOAT_MODE (SF, 4, ieee_single_format);
198 FLOAT_MODE (DF, 8, ieee_double_format);
199
200 /* Basic CC modes.
201    FIXME define this only for targets that need it.  */
202 CC_MODE (CC);
203
204 /* Fixed-point modes.  */
205 FRACT_MODE (QQ, 1, 7); /* s.7 */
206 FRACT_MODE (HQ, 2, 15); /* s.15 */
207 FRACT_MODE (SQ, 4, 31); /* s.31 */
208 FRACT_MODE (DQ, 8, 63); /* s.63 */
209 FRACT_MODE (TQ, 16, 127); /* s.127 */
210
211 UFRACT_MODE (UQQ, 1, 8); /* .8 */
212 UFRACT_MODE (UHQ, 2, 16); /* .16 */
213 UFRACT_MODE (USQ, 4, 32); /* .32 */
214 UFRACT_MODE (UDQ, 8, 64); /* .64 */
215 UFRACT_MODE (UTQ, 16, 128); /* .128 */
216
217 ACCUM_MODE (HA, 2, 8, 7); /* s8.7 */
218 ACCUM_MODE (SA, 4, 16, 15); /* s16.15 */
219 ACCUM_MODE (DA, 8, 32, 31); /* s32.31 */
220 ACCUM_MODE (TA, 16, 64, 63); /* s64.63 */
221
222 UACCUM_MODE (UHA, 2, 8, 8); /* 8.8 */
223 UACCUM_MODE (USA, 4, 16, 16); /* 16.16 */
224 UACCUM_MODE (UDA, 8, 32, 32); /* 32.32 */
225 UACCUM_MODE (UTA, 16, 64, 64); /* 64.64 */
226
227 /* Allow the target to specify additional modes of various kinds.  */
228 #if HAVE_EXTRA_MODES
229 # include EXTRA_MODES_FILE
230 #endif
231
232 /* Complex modes.  */
233 COMPLEX_MODES (INT);
234 COMPLEX_MODES (FLOAT);
235
236 /* Decimal floating point modes.  */
237 DECIMAL_FLOAT_MODE (SD, 4, decimal_single_format);
238 DECIMAL_FLOAT_MODE (DD, 8, decimal_double_format);
239 DECIMAL_FLOAT_MODE (TD, 16, decimal_quad_format);
240
241 /* The symbol Pmode stands for one of the above machine modes (usually SImode).
242    The tm.h file specifies which one.  It is not a distinct mode.  */
243
244 /*
245 Local variables:
246 mode:c
247 version-control: t
248 End:
249 */