]>
Commit | Line | Data |
---|---|---|
95e304f7 | 1 | /* This file contains the definitions and documentation for the |
38e01259 | 2 | machine modes used in the GNU compiler. |
e5e809f4 | 3 | Copyright (C) 1987, 1992, 1994, 1997, 1998 Free Software Foundation, Inc. |
95e304f7 CH |
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 | |
a35311b0 RK |
19 | the Free Software Foundation, 59 Temple Place - Suite 330, |
20 | Boston, MA 02111-1307, USA. */ | |
95e304f7 CH |
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 | |
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 | |
48 | MODE_RANDOM - anything else | |
49 | ||
50 | Fourth argument is the relative size of the object, in bytes. | |
51 | It is zero when the size is meaningless or not determined. | |
52 | A byte's size is determined by BITS_PER_UNIT in tm.h. | |
53 | ||
54 | ||
55 | Fifth arg is the relative size of subunits of the object. | |
56 | It is same as the fourth argument except for complexes, | |
57 | since they are really made of two equal size subunits. | |
58 | ||
59 | Sixth arg is next wider natural mode of the same class. | |
60 | 0 if there is none. */ | |
61 | ||
62 | /* VOIDmode is used when no mode needs to be specified, | |
63 | as for example on CONST_INT RTL expressions. */ | |
64 | DEF_MACHMODE (VOIDmode, "VOID", MODE_RANDOM, 0, 0, VOIDmode) | |
65 | ||
e5e809f4 | 66 | DEF_MACHMODE (PQImode, "PQI", MODE_PARTIAL_INT, 1, 1, PHImode) |
95e304f7 | 67 | DEF_MACHMODE (QImode, "QI", MODE_INT, 1, 1, HImode) /* int types */ |
e5e809f4 | 68 | DEF_MACHMODE (PHImode, "PHI", MODE_PARTIAL_INT, 2, 2, PSImode) |
95e304f7 CH |
69 | DEF_MACHMODE (HImode, "HI", MODE_INT, 2, 2, SImode) |
70 | /* Pointers on some machines use this type to distinguish them from ints. | |
71 | Useful if a pointer is 4 bytes but has some bits that are not significant, | |
72 | so it is really not quite as wide as an integer. */ | |
f1ed434d | 73 | DEF_MACHMODE (PSImode, "PSI", MODE_PARTIAL_INT, 4, 4, PDImode) |
95e304f7 CH |
74 | DEF_MACHMODE (SImode, "SI", MODE_INT, 4, 4, DImode) |
75 | DEF_MACHMODE (PDImode, "PDI", MODE_PARTIAL_INT, 8, 8, VOIDmode) | |
76 | DEF_MACHMODE (DImode, "DI", MODE_INT, 8, 8, TImode) | |
784a3cf0 DE |
77 | DEF_MACHMODE (TImode, "TI", MODE_INT, 16, 16, OImode) |
78 | DEF_MACHMODE (OImode, "OI", MODE_INT, 32, 32, VOIDmode) | |
95e304f7 | 79 | |
6fdf9812 | 80 | DEF_MACHMODE (QFmode, "QF", MODE_FLOAT, 1, 1, HFmode) |
e42a6f5d RK |
81 | DEF_MACHMODE (HFmode, "HF", MODE_FLOAT, 2, 2, TQFmode) |
82 | DEF_MACHMODE (TQFmode, "TQF", MODE_FLOAT, 3, 3, SFmode) /* MIL-STD-1750A */ | |
95e304f7 CH |
83 | DEF_MACHMODE (SFmode, "SF", MODE_FLOAT, 4, 4, DFmode) |
84 | DEF_MACHMODE (DFmode, "DF", MODE_FLOAT, 8, 8, XFmode) | |
85 | DEF_MACHMODE (XFmode, "XF", MODE_FLOAT, 12, 12, TFmode) /* IEEE extended */ | |
86 | DEF_MACHMODE (TFmode, "TF", MODE_FLOAT, 16, 16, VOIDmode) | |
87 | ||
c100b4ef | 88 | /* Complex modes. */ |
31031edd JL |
89 | DEF_MACHMODE (QCmode, "QC", MODE_COMPLEX_FLOAT, 2, 1, HCmode) |
90 | DEF_MACHMODE (HCmode, "HC", MODE_COMPLEX_FLOAT, 4, 2, SCmode) | |
95e304f7 CH |
91 | DEF_MACHMODE (SCmode, "SC", MODE_COMPLEX_FLOAT, 8, 4, DCmode) |
92 | DEF_MACHMODE (DCmode, "DC", MODE_COMPLEX_FLOAT, 16, 8, XCmode) | |
93 | DEF_MACHMODE (XCmode, "XC", MODE_COMPLEX_FLOAT, 24, 12, TCmode) | |
94 | DEF_MACHMODE (TCmode, "TC", MODE_COMPLEX_FLOAT, 32, 16, VOIDmode) | |
95 | ||
c100b4ef RS |
96 | DEF_MACHMODE (CQImode, "CQI", MODE_COMPLEX_INT, 2, 1, CHImode) |
97 | DEF_MACHMODE (CHImode, "CHI", MODE_COMPLEX_INT, 4, 2, CSImode) | |
98 | DEF_MACHMODE (CSImode, "CSI", MODE_COMPLEX_INT, 8, 4, CDImode) | |
99 | DEF_MACHMODE (CDImode, "CDI", MODE_COMPLEX_INT, 16, 8, CTImode) | |
100 | DEF_MACHMODE (CTImode, "CTI", MODE_COMPLEX_INT, 32, 16, COImode) | |
101 | DEF_MACHMODE (COImode, "COI", MODE_COMPLEX_INT, 64, 32, VOIDmode) | |
102 | ||
95e304f7 CH |
103 | /* BLKmode is used for structures, arrays, etc. |
104 | that fit no more specific mode. */ | |
105 | DEF_MACHMODE (BLKmode, "BLK", MODE_RANDOM, 0, 0, VOIDmode) | |
106 | ||
107 | /* The modes for representing the condition codes come last. CCmode is | |
108 | always defined. Additional modes for the condition code can be specified | |
aa0b4465 ZW |
109 | in the EXTRA_CC_MODES macro. |
110 | All MODE_CC modes are the same width as SImode and have VOIDmode as their | |
111 | next wider mode. | |
112 | */ | |
113 | ||
114 | #define CC(E, M) DEF_MACHMODE (E, M, MODE_CC, 4, 4, VOIDmode) | |
115 | ||
116 | CC (CCmode, "CC") | |
117 | ||
118 | #ifdef EXTRA_CC_MODES | |
119 | EXTRA_CC_MODES | |
120 | #endif | |
95e304f7 | 121 | |
aa0b4465 | 122 | #undef CC |
95e304f7 CH |
123 | |
124 | /* The symbol Pmode stands for one of the above machine modes (usually SImode). | |
125 | The tm file specifies which one. It is not a distinct mode. */ | |
126 | ||
127 | /* | |
128 | Local variables: | |
129 | mode:c | |
130 | version-control: t | |
131 | End: | |
132 | */ |