]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/machmode.def
Merge basic-improvements-branch to trunk
[thirdparty/gcc.git] / gcc / machmode.def
CommitLineData
95e304f7 1/* This file contains the definitions and documentation for the
38e01259 2 machine modes used in the GNU compiler.
7a099817 3 Copyright (C) 1987, 1992, 1994, 1997, 1998, 2000 Free Software Foundation, Inc.
95e304f7 4
1322177d 5This file is part of GCC.
95e304f7 6
1322177d
LB
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 2, or (at your option) any later
10version.
95e304f7 11
1322177d
LB
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
95e304f7
CH
16
17You should have received a copy of the GNU General Public License
1322177d
LB
18along with GCC; see the file COPYING. If not, write to the Free
19Software Foundation, 59 Temple Place - Suite 330, Boston, MA
2002111-1307, USA. */
95e304f7
CH
21
22
1322177d 23/* This file defines all the MACHINE MODES used by GCC.
95e304f7
CH
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
e5e809f4 45 MODE_PARTIAL_INT - PQImode, PHImode, PSImode and PDImode
95e304f7
CH
46 MODE_CC - modes used for representing the condition code in a register
47 MODE_COMPLEX_INT, MODE_COMPLEX_FLOAT - complex number
f9f27ee5 48 MODE_VECTOR_INT, MODE_VECTOR_FLOAT - vector
95e304f7
CH
49 MODE_RANDOM - anything else
50
a191f0ee
RH
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.
95e304f7
CH
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
a191f0ee 58 Sixth arg is the relative size of subunits of the object.
11f3dc89
TP
59 It is same as the fifth argument except for complexes and vectors,
60 since they are really made of many equal size subunits.
95e304f7 61
7ba2b35c
AH
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,
69ef87e2
AH
66 HI before SI, etc.
67
c6e6f5c1
RH
68 Eigth arg is the mode of the internal elements in a vector or
69 complex, and VOIDmode if not applicable.
69ef87e2 70*/
95e304f7
CH
71
72/* VOIDmode is used when no mode needs to be specified,
73 as for example on CONST_INT RTL expressions. */
69ef87e2 74DEF_MACHMODE (VOIDmode, "VOID", MODE_RANDOM, 0, 0, 0, VOIDmode, VOIDmode)
a191f0ee 75
69ef87e2
AH
76DEF_MACHMODE (BImode, "BI", MODE_INT, 1, 1, 1, QImode, VOIDmode)
77DEF_MACHMODE (QImode, "QI", MODE_INT, BITS_PER_UNIT, 1, 1, HImode, VOIDmode)
78DEF_MACHMODE (HImode, "HI", MODE_INT, BITS_PER_UNIT*2, 2, 2, SImode, VOIDmode)
79DEF_MACHMODE (SImode, "SI", MODE_INT, BITS_PER_UNIT*4, 4, 4, DImode, VOIDmode)
80DEF_MACHMODE (DImode, "DI", MODE_INT, BITS_PER_UNIT*8, 8, 8, TImode, VOIDmode)
81DEF_MACHMODE (TImode, "TI", MODE_INT, BITS_PER_UNIT*16, 16, 16, OImode, VOIDmode)
82DEF_MACHMODE (OImode, "OI", MODE_INT, BITS_PER_UNIT*32, 32, 32, VOIDmode, VOIDmode)
a191f0ee
RH
83
84/* Pointers on some machines use these types to distinguish them from
85 ints. Useful if a pointer is 4 bytes but has some bits that are
86 not significant, so it is really not quite as wide as an integer. */
69ef87e2
AH
87DEF_MACHMODE (PQImode, "PQI", MODE_PARTIAL_INT, BITS_PER_UNIT, 1, 1, PHImode, VOIDmode)
88DEF_MACHMODE (PHImode, "PHI", MODE_PARTIAL_INT, BITS_PER_UNIT*2, 2, 2, PSImode, VOIDmode)
89DEF_MACHMODE (PSImode, "PSI", MODE_PARTIAL_INT, BITS_PER_UNIT*4, 4, 4, PDImode, VOIDmode)
90DEF_MACHMODE (PDImode, "PDI", MODE_PARTIAL_INT, BITS_PER_UNIT*8, 8, 8, VOIDmode, VOIDmode)
91
92DEF_MACHMODE (QFmode, "QF", MODE_FLOAT, BITS_PER_UNIT, 1, 1, HFmode, VOIDmode)
93DEF_MACHMODE (HFmode, "HF", MODE_FLOAT, BITS_PER_UNIT*2, 2, 2, TQFmode, VOIDmode)
94DEF_MACHMODE (TQFmode, "TQF", MODE_FLOAT, BITS_PER_UNIT*3, 3, 3, SFmode, VOIDmode) /* MIL-STD-1750A */
95DEF_MACHMODE (SFmode, "SF", MODE_FLOAT, BITS_PER_UNIT*4, 4, 4, DFmode, VOIDmode)
96DEF_MACHMODE (DFmode, "DF", MODE_FLOAT, BITS_PER_UNIT*8, 8, 8, XFmode, VOIDmode)
97DEF_MACHMODE (XFmode, "XF", MODE_FLOAT, BITS_PER_UNIT*12, 12, 12, TFmode, VOIDmode) /* IEEE extended */
98DEF_MACHMODE (TFmode, "TF", MODE_FLOAT, BITS_PER_UNIT*16, 16, 16, VOIDmode, VOIDmode)
95e304f7 99
c100b4ef 100/* Complex modes. */
c6e6f5c1
RH
101DEF_MACHMODE (QCmode, "QC", MODE_COMPLEX_FLOAT, BITS_PER_UNIT*2, 2, 1, HCmode, QFmode)
102DEF_MACHMODE (HCmode, "HC", MODE_COMPLEX_FLOAT, BITS_PER_UNIT*4, 4, 2, SCmode, HFmode)
103DEF_MACHMODE (SCmode, "SC", MODE_COMPLEX_FLOAT, BITS_PER_UNIT*8, 8, 4, DCmode, SFmode)
104DEF_MACHMODE (DCmode, "DC", MODE_COMPLEX_FLOAT, BITS_PER_UNIT*16, 16, 8, XCmode, DFmode)
105DEF_MACHMODE (XCmode, "XC", MODE_COMPLEX_FLOAT, BITS_PER_UNIT*24, 24, 12, TCmode, XFmode)
106DEF_MACHMODE (TCmode, "TC", MODE_COMPLEX_FLOAT, BITS_PER_UNIT*32, 32, 16, VOIDmode, TFmode)
107
108DEF_MACHMODE (CQImode, "CQI", MODE_COMPLEX_INT, BITS_PER_UNIT*2, 2, 1, CHImode, QImode)
109DEF_MACHMODE (CHImode, "CHI", MODE_COMPLEX_INT, BITS_PER_UNIT*4, 4, 2, CSImode, HImode)
110DEF_MACHMODE (CSImode, "CSI", MODE_COMPLEX_INT, BITS_PER_UNIT*8, 8, 4, CDImode, SImode)
111DEF_MACHMODE (CDImode, "CDI", MODE_COMPLEX_INT, BITS_PER_UNIT*16, 16, 8, CTImode, DImode)
112DEF_MACHMODE (CTImode, "CTI", MODE_COMPLEX_INT, BITS_PER_UNIT*32, 32, 16, COImode, TImode)
113DEF_MACHMODE (COImode, "COI", MODE_COMPLEX_INT, BITS_PER_UNIT*64, 64, 32, VOIDmode, OImode)
c100b4ef 114
f9f27ee5 115/* Vector modes. */
9016e543 116/* The wider mode field for vectors follows in order of increasing bit
7ba2b35c 117 size with QI coming before HI, HI before SI, and SI before DI
9016e543 118 within same bit sizes. */
256e9fd2 119DEF_MACHMODE (V1DImode, "V1DI", MODE_VECTOR_INT, BITS_PER_UNIT*8, 8, 8, V2QImode, DImode)
69ef87e2
AH
120DEF_MACHMODE (V2QImode, "V2QI", MODE_VECTOR_INT, BITS_PER_UNIT*2, 2, 1, V4QImode, QImode)
121DEF_MACHMODE (V2HImode, "V2HI", MODE_VECTOR_INT, BITS_PER_UNIT*4, 4, 2, V8QImode, HImode)
122DEF_MACHMODE (V2SImode, "V2SI", MODE_VECTOR_INT, BITS_PER_UNIT*8, 8, 4, V16QImode, SImode)
123DEF_MACHMODE (V2DImode, "V2DI", MODE_VECTOR_INT, BITS_PER_UNIT*16, 16, 8, V8SImode, DImode)
9016e543 124
69ef87e2
AH
125DEF_MACHMODE (V4QImode, "V4QI", MODE_VECTOR_INT, BITS_PER_UNIT*4, 4, 1, V2HImode, QImode)
126DEF_MACHMODE (V4HImode, "V4HI", MODE_VECTOR_INT, BITS_PER_UNIT*8, 8, 2, V2SImode, HImode)
127DEF_MACHMODE (V4SImode, "V4SI", MODE_VECTOR_INT, BITS_PER_UNIT*16, 16, 4, V2DImode, SImode)
128DEF_MACHMODE (V4DImode, "V4DI", MODE_VECTOR_INT, BITS_PER_UNIT*32, 32, 8, V8DImode, DImode)
9016e543 129
69ef87e2
AH
130DEF_MACHMODE (V8QImode, "V8QI", MODE_VECTOR_INT, BITS_PER_UNIT*8, 8, 1, V4HImode, QImode)
131DEF_MACHMODE (V8HImode, "V8HI", MODE_VECTOR_INT, BITS_PER_UNIT*16, 16, 2, V4SImode, HImode)
132DEF_MACHMODE (V8SImode, "V8SI", MODE_VECTOR_INT, BITS_PER_UNIT*32, 32, 4, V4DImode, SImode)
133DEF_MACHMODE (V8DImode, "V8DI", MODE_VECTOR_INT, BITS_PER_UNIT*64, 64, 8, VOIDmode, DImode)
f9f27ee5 134
69ef87e2 135DEF_MACHMODE (V16QImode, "V16QI", MODE_VECTOR_INT, BITS_PER_UNIT*16, 16, 1, V8HImode, QImode)
7a099817 136
4977bab6 137DEF_MACHMODE (V2HFmode, "V2HF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*4, 4, 2, V4HFmode, HFmode)
69ef87e2
AH
138DEF_MACHMODE (V2SFmode, "V2SF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*8, 8, 4, V4SFmode, SFmode)
139DEF_MACHMODE (V2DFmode, "V2DF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*16, 16, 8, V8SFmode, DFmode)
f9f27ee5 140
4977bab6 141DEF_MACHMODE (V4HFmode, "V4HF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*8, 8, 2, V2SFmode, HFmode)
69ef87e2
AH
142DEF_MACHMODE (V4SFmode, "V4SF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*16, 16, 4, V2DFmode, SFmode)
143DEF_MACHMODE (V4DFmode, "V4DF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*32, 32, 8, V8DFmode, DFmode)
f9f27ee5 144
4977bab6
ZW
145DEF_MACHMODE (V8HFmode, "V8HF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*16, 16, 2, V4SFmode, HFmode)
146DEF_MACHMODE (V8SFmode, "V8SF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*32, 32, 4, V4DFmode, SFmode)
69ef87e2
AH
147DEF_MACHMODE (V8DFmode, "V8DF", MODE_VECTOR_FLOAT, BITS_PER_UNIT*64, 64, 8, VOIDmode, DFmode)
148DEF_MACHMODE (V16SFmode, "V16SF", MODE_VECTOR_FLOAT, 512, 64, 4, VOIDmode, SFmode)
f9f27ee5 149
95e304f7
CH
150/* BLKmode is used for structures, arrays, etc.
151 that fit no more specific mode. */
69ef87e2 152DEF_MACHMODE (BLKmode, "BLK", MODE_RANDOM, 0, 0, 0, VOIDmode, VOIDmode)
95e304f7 153
a191f0ee
RH
154/* The modes for representing the condition codes come last. CCmode
155 is always defined. Additional modes for the condition code can be
a5381466 156 specified in the EXTRA_CC_MODES header. All MODE_CC modes are the
a191f0ee 157 same width as SImode and have VOIDmode as their next wider mode. */
aa0b4465 158
a5381466
ZW
159/* We do not use CC() for CCmode to avoid a warning about use of
160 function-like macros with no arguments. */
161DEF_MACHMODE (CCmode, "CC", MODE_CC, BITS_PER_UNIT*4, 4, 4, VOIDmode, VOIDmode)
95e304f7 162
a5381466
ZW
163#ifdef EXTRA_MODES_FILE
164#define CC(N) \
165 DEF_MACHMODE (CONCAT2 (N,mode), STRINGX (N), \
166 MODE_CC, BITS_PER_UNIT*4, 4, 4, VOIDmode, VOIDmode)
167#include EXTRA_MODES_FILE
aa0b4465 168#undef CC
a5381466 169#endif
95e304f7
CH
170
171/* The symbol Pmode stands for one of the above machine modes (usually SImode).
f0e1f482 172 The tm file specifies which one. It is not a distinct mode. */
95e304f7
CH
173
174/*
175Local variables:
176mode:c
177version-control: t
178End:
179*/