OSDN Git Service

4df4da771cc68388c45dfda95c3b84bb08388335
[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 Free Software Foundation, Inc.
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22
23 /* This file defines all the MACHINE MODES used by GNU CC.
24
25    A machine mode specifies a size and format of data
26    at the machine level.
27
28    Each RTL expression has a machine mode.
29
30    At the syntax tree level, each ..._TYPE and each ..._DECL node
31    has a machine mode which describes data of that type or the
32    data of the variable declared.  */
33
34 /* The first argument is the internal name of the machine mode
35    used in the C source.
36    By convention these are in UPPER_CASE, except for the word  "mode".
37
38    The second argument  is the name of the machine mode in the
39    external ASCII format used for reading and printing RTL and trees.
40    By convention these names in UPPER_CASE.
41
42    Third argument states the kind of representation:
43    MODE_INT - integer
44    MODE_FLOAT - floating
45    MODE_PARTIAL_INT - PQImode, PHImode, PSImode and PDImode
46    MODE_CC - modes used for representing the condition code in a register
47    MODE_COMPLEX_INT, MODE_COMPLEX_FLOAT - complex number
48    MODE_VECTOR_INT, MODE_VECTOR_FLOAT - vector
49    MODE_RANDOM - anything else
50
51    Fourth argument is the relative size of the object, in bits,
52    so we can have modes smaller than 1 byte.
53
54    Fifth argument is the relative size of the object, in bytes.
55    It is zero when the size is meaningless or not determined.
56    A byte's size is determined by BITS_PER_UNIT in tm.h. 
57
58    Sixth arg is the relative size of subunits of the object.
59    It is same as the fourth argument except for complexes,
60    since they are really made of two equal size subunits.
61
62    Seventh arg is next wider natural mode of the same class.
63    0 if there is none.  */
64
65 /* VOIDmode is used when no mode needs to be specified,
66    as for example on CONST_INT RTL expressions.  */
67 DEF_MACHMODE (VOIDmode, "VOID", MODE_RANDOM, 0, 0, 0, VOIDmode)
68
69 DEF_MACHMODE (BImode, "BI", MODE_INT, 1, 1, 1, QImode)
70 DEF_MACHMODE (QImode, "QI", MODE_INT, 8, 1, 1, HImode)
71 DEF_MACHMODE (HImode, "HI", MODE_INT, 16, 2, 2, SImode)
72 DEF_MACHMODE (SImode, "SI", MODE_INT, 32, 4, 4, DImode)
73 DEF_MACHMODE (DImode, "DI", MODE_INT, 64, 8, 8, TImode)
74 DEF_MACHMODE (TImode, "TI", MODE_INT, 128, 16, 16, OImode)
75 DEF_MACHMODE (OImode, "OI", MODE_INT, 256, 32, 32, VOIDmode)
76
77 /* Pointers on some machines use these types to distinguish them from
78    ints.  Useful if a pointer is 4 bytes but has some bits that are
79    not significant, so it is really not quite as wide as an integer.  */
80 DEF_MACHMODE (PQImode, "PQI", MODE_PARTIAL_INT, 8, 1, 1, PHImode)
81 DEF_MACHMODE (PHImode, "PHI", MODE_PARTIAL_INT, 16, 2, 2, PSImode)
82 DEF_MACHMODE (PSImode, "PSI", MODE_PARTIAL_INT, 32, 4, 4, PDImode)
83 DEF_MACHMODE (PDImode, "PDI", MODE_PARTIAL_INT, 64, 8, 8, VOIDmode)
84
85 DEF_MACHMODE (QFmode, "QF", MODE_FLOAT, 8, 1, 1, HFmode)
86 DEF_MACHMODE (HFmode, "HF", MODE_FLOAT, 16, 2, 2, TQFmode)
87 DEF_MACHMODE (TQFmode, "TQF", MODE_FLOAT, 24, 3, 3, SFmode) /* MIL-STD-1750A */
88 DEF_MACHMODE (SFmode, "SF", MODE_FLOAT, 32, 4, 4, DFmode)
89 DEF_MACHMODE (DFmode, "DF", MODE_FLOAT, 64, 8, 8, XFmode)
90 DEF_MACHMODE (XFmode, "XF", MODE_FLOAT, 96, 12, 12, TFmode) /* IEEE extended */
91 DEF_MACHMODE (TFmode, "TF", MODE_FLOAT, 128, 16, 16, VOIDmode)
92
93 /* Complex modes.  */
94 DEF_MACHMODE (QCmode, "QC", MODE_COMPLEX_FLOAT, 16, 2, 1, HCmode)
95 DEF_MACHMODE (HCmode, "HC", MODE_COMPLEX_FLOAT, 32, 4, 2, SCmode)
96 DEF_MACHMODE (SCmode, "SC", MODE_COMPLEX_FLOAT, 64, 8, 4, DCmode)
97 DEF_MACHMODE (DCmode, "DC", MODE_COMPLEX_FLOAT, 128, 16, 8, XCmode)
98 DEF_MACHMODE (XCmode, "XC", MODE_COMPLEX_FLOAT, 192, 24, 12, TCmode)
99 DEF_MACHMODE (TCmode, "TC", MODE_COMPLEX_FLOAT, 256, 32, 16, VOIDmode)
100
101 DEF_MACHMODE (CQImode, "CQI", MODE_COMPLEX_INT, 16, 2, 1, CHImode)
102 DEF_MACHMODE (CHImode, "CHI", MODE_COMPLEX_INT, 32, 4, 2, CSImode)
103 DEF_MACHMODE (CSImode, "CSI", MODE_COMPLEX_INT, 64, 8, 4, CDImode)
104 DEF_MACHMODE (CDImode, "CDI", MODE_COMPLEX_INT, 128, 16, 8, CTImode)
105 DEF_MACHMODE (CTImode, "CTI", MODE_COMPLEX_INT, 256, 32, 16, COImode)
106 DEF_MACHMODE (COImode, "COI", MODE_COMPLEX_INT, 512, 64, 32, VOIDmode)
107
108 /* Vector modes.  */
109 /* There are no V1xx vector modes.  These are equivalent to normal
110    scalar modes.  */
111 DEF_MACHMODE (V2QImode, "V2QI", MODE_VECTOR_INT, 16, 2, 1, VOIDmode)
112 DEF_MACHMODE (V2HImode, "V2HI", MODE_VECTOR_INT, 32, 4, 2, VOIDmode)
113 DEF_MACHMODE (V2SImode, "V2SI", MODE_VECTOR_INT, 64, 8, 4, VOIDmode)
114 DEF_MACHMODE (V2DImode, "V2DI", MODE_VECTOR_INT, 128, 16, 8, VOIDmode)
115
116 DEF_MACHMODE (V4QImode, "V4QI", MODE_VECTOR_INT, 32, 4, 1, VOIDmode)
117 DEF_MACHMODE (V4HImode, "V4HI", MODE_VECTOR_INT, 64, 8, 2, VOIDmode)
118 DEF_MACHMODE (V4SImode, "V4SI", MODE_VECTOR_INT, 128, 16, 4, VOIDmode)
119 DEF_MACHMODE (V4DImode, "V4DI", MODE_VECTOR_INT, 256, 32, 8, VOIDmode)
120
121 DEF_MACHMODE (V8QImode, "V8QI", MODE_VECTOR_INT, 64, 8, 1, VOIDmode)
122 DEF_MACHMODE (V8HImode, "V8HI", MODE_VECTOR_INT, 128, 16, 2, VOIDmode)
123 DEF_MACHMODE (V8SImode, "V8SI", MODE_VECTOR_INT, 256, 32, 4, VOIDmode)
124 DEF_MACHMODE (V8DImode, "V8DI", MODE_VECTOR_INT, 512, 64, 8, VOIDmode)
125
126 DEF_MACHMODE (V2SFmode, "V2SF", MODE_VECTOR_FLOAT, 64, 8, 4, VOIDmode)
127 DEF_MACHMODE (V2DFmode, "V2DF", MODE_VECTOR_FLOAT, 128, 16, 8, VOIDmode)
128
129 DEF_MACHMODE (V4SFmode, "V4SF", MODE_VECTOR_FLOAT, 128, 16, 4, VOIDmode)
130 DEF_MACHMODE (V4DFmode, "V4DF", MODE_VECTOR_FLOAT, 256, 32, 8, VOIDmode)
131
132 DEF_MACHMODE (V8SFmode, "V8SF", MODE_VECTOR_FLOAT, 256, 32, 4, VOIDmode)
133 DEF_MACHMODE (V8DFmode, "V8DF", MODE_VECTOR_FLOAT, 512, 64, 8, VOIDmode)
134
135 /* BLKmode is used for structures, arrays, etc.
136    that fit no more specific mode.  */
137 DEF_MACHMODE (BLKmode, "BLK", MODE_RANDOM, 0, 0, 0, VOIDmode)
138
139 /* The modes for representing the condition codes come last.  CCmode
140    is always defined.  Additional modes for the condition code can be
141    specified in the EXTRA_CC_MODES macro.  All MODE_CC modes are the
142    same width as SImode and have VOIDmode as their next wider mode.  */
143
144 #define CC(E, M)  DEF_MACHMODE (E, M, MODE_CC, 32, 4, 4, VOIDmode)
145
146 CC (CCmode, "CC")
147
148 #ifdef EXTRA_CC_MODES
149 EXTRA_CC_MODES
150 #endif
151
152 #undef CC
153
154 /* The symbol Pmode stands for one of the above machine modes (usually SImode).
155    The tm file specifies which one.  It is not a distinct mode.  */
156
157 /*
158 Local variables:
159 mode:c
160 version-control: t
161 End:
162 */