* c-decl.c (duplicate_decls): Conditionalize DECL_SAVED_TREE copy.
[official-gcc.git] / gcc / machmode.def
blob580f6ff61c616da8722ee151454bf63a7a76ffac
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 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA. */
23 /* This file defines all the MACHINE MODES used by GCC.
25 A machine mode specifies a size and format of data
26 at the machine level.
28 Each RTL expression has a machine mode.
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. */
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".
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.
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
51 Fourth argument is the relative size of the object, in bits,
52 so we can have modes smaller than 1 byte.
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.
58 Sixth arg is the relative size of subunits of the object.
59 It is same as the fifth argument except for complexes and vectors,
60 since they are really made of many equal size subunits.
62 Seventh arg is next wider natural mode of the same class. 0 if
63 there is none. Vector modes use this field to point to the next
64 vector size, so we can iterate through the different vectors modes.
65 The ordering is by increasing byte size, with QI coming before HI,
66 HI before SI, etc. */
68 /* VOIDmode is used when no mode needs to be specified,
69 as for example on CONST_INT RTL expressions. */
70 DEF_MACHMODE (VOIDmode, "VOID", MODE_RANDOM, 0, 0, 0, VOIDmode)
72 DEF_MACHMODE (BImode, "BI", MODE_INT, 1, 1, 1, QImode)
73 DEF_MACHMODE (QImode, "QI", MODE_INT, BITS_PER_UNIT, 1, 1, HImode)
74 DEF_MACHMODE (HImode, "HI", MODE_INT, BITS_PER_UNIT*2, 2, 2, SImode)
75 DEF_MACHMODE (SImode, "SI", MODE_INT, BITS_PER_UNIT*4, 4, 4, DImode)
76 DEF_MACHMODE (DImode, "DI", MODE_INT, BITS_PER_UNIT*8, 8, 8, TImode)
77 DEF_MACHMODE (TImode, "TI", MODE_INT, BITS_PER_UNIT*16, 16, 16, OImode)
78 DEF_MACHMODE (OImode, "OI", MODE_INT, BITS_PER_UNIT*32, 32, 32, VOIDmode)
80 /* Pointers on some machines use these types to distinguish them from
81 ints. Useful if a pointer is 4 bytes but has some bits that are
82 not significant, so it is really not quite as wide as an integer. */
83 DEF_MACHMODE (PQImode, "PQI", MODE_PARTIAL_INT, BITS_PER_UNIT, 1, 1, PHImode)
84 DEF_MACHMODE (PHImode, "PHI", MODE_PARTIAL_INT, BITS_PER_UNIT*2, 2, 2, PSImode)
85 DEF_MACHMODE (PSImode, "PSI", MODE_PARTIAL_INT, BITS_PER_UNIT*4, 4, 4, PDImode)
86 DEF_MACHMODE (PDImode, "PDI", MODE_PARTIAL_INT, BITS_PER_UNIT*8, 8, 8, VOIDmode)
88 DEF_MACHMODE (QFmode, "QF", MODE_FLOAT, BITS_PER_UNIT, 1, 1, HFmode)
89 DEF_MACHMODE (HFmode, "HF", MODE_FLOAT, BITS_PER_UNIT*2, 2, 2, TQFmode)
90 DEF_MACHMODE (TQFmode, "TQF", MODE_FLOAT, BITS_PER_UNIT*3, 3, 3, SFmode) /* MIL-STD-1750A */
91 DEF_MACHMODE (SFmode, "SF", MODE_FLOAT, BITS_PER_UNIT*4, 4, 4, DFmode)
92 DEF_MACHMODE (DFmode, "DF", MODE_FLOAT, BITS_PER_UNIT*8, 8, 8, XFmode)
93 DEF_MACHMODE (XFmode, "XF", MODE_FLOAT, BITS_PER_UNIT*12, 12, 12, TFmode) /* IEEE extended */
94 DEF_MACHMODE (TFmode, "TF", MODE_FLOAT, BITS_PER_UNIT*16, 16, 16, VOIDmode)
96 /* Complex modes. */
97 DEF_MACHMODE (QCmode, "QC", MODE_COMPLEX_FLOAT, BITS_PER_UNIT*2, 2, 1, HCmode)
98 DEF_MACHMODE (HCmode, "HC", MODE_COMPLEX_FLOAT, BITS_PER_UNIT*4, 4, 2, SCmode)
99 DEF_MACHMODE (SCmode, "SC", MODE_COMPLEX_FLOAT, BITS_PER_UNIT*8, 8, 4, DCmode)
100 DEF_MACHMODE (DCmode, "DC", MODE_COMPLEX_FLOAT, BITS_PER_UNIT*16, 16, 8, XCmode)
101 DEF_MACHMODE (XCmode, "XC", MODE_COMPLEX_FLOAT, BITS_PER_UNIT*24, 24, 12, TCmode)
102 DEF_MACHMODE (TCmode, "TC", MODE_COMPLEX_FLOAT, BITS_PER_UNIT*32, 32, 16, VOIDmode)
104 DEF_MACHMODE (CQImode, "CQI", MODE_COMPLEX_INT, BITS_PER_UNIT*2, 2, 1, CHImode)
105 DEF_MACHMODE (CHImode, "CHI", MODE_COMPLEX_INT, BITS_PER_UNIT*4, 4, 2, CSImode)
106 DEF_MACHMODE (CSImode, "CSI", MODE_COMPLEX_INT, BITS_PER_UNIT*8, 8, 4, CDImode)
107 DEF_MACHMODE (CDImode, "CDI", MODE_COMPLEX_INT, BITS_PER_UNIT*16, 16, 8, CTImode)
108 DEF_MACHMODE (CTImode, "CTI", MODE_COMPLEX_INT, BITS_PER_UNIT*32, 32, 16, COImode)
109 DEF_MACHMODE (COImode, "COI", MODE_COMPLEX_INT, BITS_PER_UNIT*64, 64, 32, VOIDmode)
111 /* Vector modes. */
112 /* There are no V1xx vector modes. These are equivalent to normal
113 scalar modes. */
114 /* The wider mode field for vectors follows in order of increasing bit
115 size with QI coming before HI, HI before SI, and SI before DI
116 within same bit sizes. */
117 DEF_MACHMODE (V2QImode, "V2QI", MODE_VECTOR_INT, BITS_PER_UNIT*2, 2, 1, V4QImode)
118 DEF_MACHMODE (V2HImode, "V2HI", MODE_VECTOR_INT, BITS_PER_UNIT*4, 4, 2, V8QImode)
119 DEF_MACHMODE (V2SImode, "V2SI", MODE_VECTOR_INT, BITS_PER_UNIT*8, 8, 4, V16QImode)
120 DEF_MACHMODE (V2DImode, "V2DI", MODE_VECTOR_INT, BITS_PER_UNIT*16, 16, 8, V8SImode)
122 DEF_MACHMODE (V4QImode, "V4QI", MODE_VECTOR_INT, BITS_PER_UNIT*4, 4, 1, V2HImode)
123 DEF_MACHMODE (V4HImode, "V4HI", MODE_VECTOR_INT, BITS_PER_UNIT*8, 8, 2, V2SImode)
124 DEF_MACHMODE (V4SImode, "V4SI", MODE_VECTOR_INT, BITS_PER_UNIT*16, 16, 4, V2DImode)
125 DEF_MACHMODE (V4DImode, "V4DI", MODE_VECTOR_INT, BITS_PER_UNIT*32, 32, 8, V8DImode)
127 DEF_MACHMODE (V8QImode, "V8QI", MODE_VECTOR_INT, BITS_PER_UNIT*8, 8, 1, V4HImode)
128 DEF_MACHMODE (V8HImode, "V8HI", MODE_VECTOR_INT, BITS_PER_UNIT*16, 16, 2, V4SImode)
129 DEF_MACHMODE (V8SImode, "V8SI", MODE_VECTOR_INT, BITS_PER_UNIT*32, 32, 4, V4DImode)
130 DEF_MACHMODE (V8DImode, "V8DI", MODE_VECTOR_INT, BITS_PER_UNIT*64, 64, 8, VOIDmode)
132 DEF_MACHMODE (V16QImode, "V16QI", MODE_VECTOR_INT, BITS_PER_UNIT*16, 16, 1, V8HImode)
134 DEF_MACHMODE (V2SFmode, "V2SF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*8, 8, 4, V4SFmode)
135 DEF_MACHMODE (V2DFmode, "V2DF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*16, 16, 8, V8SFmode)
137 DEF_MACHMODE (V4SFmode, "V4SF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*16, 16, 4, V2DFmode)
138 DEF_MACHMODE (V4DFmode, "V4DF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*32, 32, 8, V8DFmode)
140 DEF_MACHMODE (V8SFmode, "V8SF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*32, 32, 4,V4DFmode)
141 DEF_MACHMODE (V8DFmode, "V8DF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*64, 64, 8, VOIDmode)
143 /* BLKmode is used for structures, arrays, etc.
144 that fit no more specific mode. */
145 DEF_MACHMODE (BLKmode, "BLK", MODE_RANDOM, 0, 0, 0, VOIDmode)
147 /* The modes for representing the condition codes come last. CCmode
148 is always defined. Additional modes for the condition code can be
149 specified in the EXTRA_CC_MODES macro. All MODE_CC modes are the
150 same width as SImode and have VOIDmode as their next wider mode. */
152 #define CC(E, M) DEF_MACHMODE (E, M, MODE_CC, BITS_PER_UNIT*4, 4, 4, VOIDmode)
154 CC (CCmode, "CC")
156 #ifdef EXTRA_CC_MODES
157 EXTRA_CC_MODES
158 #endif
160 #undef CC
162 /* The symbol Pmode stands for one of the above machine modes (usually SImode).
163 The tm file specifies which one. It is not a distinct mode. Nevertheless,
164 while processing the md file, we wish to treat as a distinct mode so that
165 it is preserved intact through to the insn-foo.c files. This eliminates a
166 lot of redundancy in ports that support both 32-bit and 64-bit targets. */
167 #ifdef GENERATOR_FILE
168 #undef Pmode
169 DEF_MACHMODE (Pmode, "P", MODE_RANDOM, 0, 0, 0, VOIDmode)
170 #endif
173 Local variables:
174 mode:c
175 version-control: t
176 End: