OSDN Git Service

PR optimization/12544
[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
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, 59 Temple Place - Suite 330, Boston, MA
21 02111-1307, 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 restructions 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 BITSIZE, BYTESIZE, or COUNT argument must be a positive integer
51    constant.
52
53    Order matters in this file in so far as statements which refer to
54    other modes must appear after the modes they refer to.  However,
55    statements which do not refer to other modes may appear in any
56    order.
57
58      RANDOM_MODE (MODE);
59         declares MODE to be of class RANDOM.
60
61      CC_MODE (MODE);
62         declares MODE to be of class CC.
63
64      INT_MODE (MODE, BYTESIZE);
65         declares MODE to be of class INT and BYTESIZE bytes wide.
66         All of the bits of its representation are significant.
67
68      FRACTIONAL_INT_MODE (MODE, BITSIZE, BYTESIZE);
69         declares MODE to be of class INT, BYTESIZE bytes wide in
70         storage, but with only BITSIZE significant bits.
71
72      FLOAT_MODE (MODE, BYTESIZE);
73         declares MODE to be of class FLOAT and BYTESIZE bytes wide.
74         All of the bits of its representation are significant.
75
76      FRACTIONAL_FLOAT_MODE (MODE, BITSIZE, BYTESIZE);
77         declares MODE to be of class FLOAT, BYTESIZE bytes wide in
78         storage, but with only BITSIZE significant bits.
79
80      PARTIAL_INT_MODE (MODE);
81         declares a mode of class PARTIAL_INT with the same size as
82         MODE (which must be an INT mode).  The name of the new mode
83         is made by prefixing a P to the name MODE.  This statement
84         may grow a BITSIZE argument in the future.
85
86      VECTOR_MODE (CLASS, MODE, COUNT);
87         Declare a vector mode whose component mode is MODE (of class
88         CLASS) with COUNT components.  CLASS must be INT or FLOAT.
89         The name of the vector mode takes the form VnX where n is
90         COUNT in decimal and X is MODE.
91
92      VECTOR_MODES (CLASS, WIDTH);
93         For all modes presently declared in class CLASS, construct
94         corresponding vector modes having width WIDTH.  Modes whose
95         byte sizes do not evenly divide WIDTH are ignored, as are
96         modes that would produce vector modes with only one component,
97         and modes smaller than one byte (if CLASS is INT) or smaller
98         than two bytes (if CLASS is FLOAT).  CLASS must be INT or
99         FLOAT.  The names follow the same rule as VECTOR_MODE uses.
100
101      COMPLEX_MODES (CLASS);
102         For all modes presently declared in class CLASS, construct
103         corresponding complex modes.  Modes smaller than one byte
104         are ignored.  For FLOAT modes, the names are derived by
105         replacing the 'F' in the mode name with a 'C'.  (It is an
106         error if there is no 'F'.  For INT modes, the names are
107         derived by prefixing a C to the name.
108
109      BITS_PER_UNIT (COUNT);
110         Sets the number of bits in a machine byte (least addressable
111         unit).  If this statement does not appear, the default is 8.
112
113    Note: If a mode is ever made which is more than 255 bytes wide,
114    machmode.h and genmodes.c will have to be changed to allocate
115    more space for the mode_size and mode_alignment arrays.  */
116
117 /* VOIDmode is used when no mode needs to be specified,
118    as for example on CONST_INT RTL expressions.  */
119 RANDOM_MODE (VOID);
120
121 /* BLKmode is used for structures, arrays, etc.
122    that fit no more specific mode.  */
123 RANDOM_MODE (BLK);
124
125 /* Single bit mode used for booleans.  */
126 FRACTIONAL_INT_MODE (BI, 1, 1);
127
128 /* Basic integer modes.  */
129 INT_MODE (QI, 1);
130 INT_MODE (HI, 2);
131 INT_MODE (SI, 4);
132 INT_MODE (DI, 8);
133 INT_MODE (TI, 16);
134 INT_MODE (OI, 32);
135
136 /* Pointers on some machines use these types to distinguish them from
137    ints.  Useful if a pointer is 4 bytes but has some bits that are
138    not significant, so it is really not quite as wide as an integer.  */
139 PARTIAL_INT_MODE (QI);
140 PARTIAL_INT_MODE (HI);
141 PARTIAL_INT_MODE (SI);
142 PARTIAL_INT_MODE (DI);
143
144 /* Basic floating point modes.  */
145 FLOAT_MODE (QF, 1);     /* C4x single precision */
146 FLOAT_MODE (HF, 2);     /* C4x double precision */
147 FLOAT_MODE (TQF, 3);    /* MIL-STD-1750a */
148 FLOAT_MODE (SF, 4);
149 FLOAT_MODE (DF, 8);
150 FLOAT_MODE (XF, 12);    /* IEEE extended (80-bit) */
151 FLOAT_MODE (TF, 16);
152
153 /* Basic CC modes.  */
154 CC_MODE (CC);
155
156 /* Allow the target to specify additional modes of various kinds.  */
157 #if HAVE_EXTRA_MODES
158 # define CC(X) CC_MODE(X);  /* backward compatibility, temporary */
159 # include EXTRA_MODES_FILE
160 # undef CC
161 #endif
162
163 /* Complex modes.  */
164 COMPLEX_MODES (INT);
165 COMPLEX_MODES (FLOAT);
166
167 /* Vector modes.  */
168 VECTOR_MODES (INT, 2);        /*                 V2QI */
169 VECTOR_MODES (INT, 4);        /*            V4QI V2HI */
170 VECTOR_MODES (INT, 8);        /*       V8QI V4HI V2SI */
171 VECTOR_MODES (INT, 16);       /* V16QI V8HI V4SI V2DI */
172 /* VECTOR_MODES (INT, 32);             V8SI V4DI      */
173 /* VECTOR_MODES (INT, 64);             V8DI           */
174
175 VECTOR_MODE (INT, SI, 8)
176 VECTOR_MODE (INT, DI, 4);
177 VECTOR_MODE (INT, DI, 8);
178
179 VECTOR_MODE (INT, DI, 1);  /* PPC uses this.  Why not plain DI? */
180
181 VECTOR_MODES (FLOAT, 4);      /*                 V2HF */
182 VECTOR_MODES (FLOAT, 8);      /*            V4HF V2SF */
183 VECTOR_MODES (FLOAT, 16);     /*       V8HF V4SF V2DF */
184 /* VECTOR_MODES (FLOAT, 32);           V8SF V4DF      */
185 /* VECTOR_MODES (FLOAT, 64);     V16SF V8DF           */
186
187 VECTOR_MODE (FLOAT, SF, 8);
188 VECTOR_MODE (FLOAT, SF, 16);
189 VECTOR_MODE (FLOAT, DF, 4);
190 VECTOR_MODE (FLOAT, DF, 8);
191
192 /* The symbol Pmode stands for one of the above machine modes (usually SImode).
193    The tm.h file specifies which one.  It is not a distinct mode.  */
194
195 /*
196 Local variables:
197 mode:c
198 version-control: t
199 End:
200 */