fixing pr42337
[official-gcc.git] / gcc / ada / ttypef.ads
bloba39dfa9f4ba6b86f4f7995f3945902196028002d
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- T T Y P E F --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
20 -- --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
23 -- --
24 ------------------------------------------------------------------------------
26 -- This module contains values for the predefined floating-point attributes.
27 -- All references to these attribute values in a program being compiled must
28 -- use the values in this package, not the values returned by referencing
29 -- the corresponding attributes (since that would give host machine values).
30 -- Boolean-valued attributes are defined in System.Parameters, because they
31 -- need a finer control than what is provided by the formats described below.
33 -- The codes for the eight floating-point formats supported are:
35 -- IEEES - IEEE Single Float
36 -- IEEEL - IEEE Double Float
37 -- IEEEX - IEEE Double Extended Float
38 -- VAXFF - VAX F Float
39 -- VAXDF - VAX D Float
40 -- VAXGF - VAX G Float
41 -- AAMPS - AAMP 32-bit Float
42 -- AAMPL - AAMP 48-bit Float
44 package Ttypef is
46 ----------------------------------
47 -- Universal Integer Attributes --
48 ----------------------------------
50 -- Note that the constant declarations below specify values
51 -- using the Ada model, so IEEES_Machine_Emax does not specify
52 -- the IEEE definition of the single precision float type,
53 -- but the value of the Ada attribute which is one higher
54 -- as the binary point is at a different location.
56 IEEES_Digits : constant := 6;
57 IEEEL_Digits : constant := 15;
58 IEEEX_Digits : constant := 18;
59 VAXFF_Digits : constant := 6;
60 VAXDF_Digits : constant := 9;
61 VAXGF_Digits : constant := 15;
62 AAMPS_Digits : constant := 6;
63 AAMPL_Digits : constant := 9;
65 IEEES_Machine_Emax : constant := 128;
66 IEEEL_Machine_Emax : constant := 1024;
67 IEEEX_Machine_Emax : constant := 16384;
68 VAXFF_Machine_Emax : constant := 127;
69 VAXDF_Machine_Emax : constant := 127;
70 VAXGF_Machine_Emax : constant := 1023;
71 AAMPS_Machine_Emax : constant := 127;
72 AAMPL_Machine_Emax : constant := 127;
74 IEEES_Machine_Emin : constant := -125;
75 IEEEL_Machine_Emin : constant := -1021;
76 IEEEX_Machine_Emin : constant := -16381;
77 VAXFF_Machine_Emin : constant := -127;
78 VAXDF_Machine_Emin : constant := -127;
79 VAXGF_Machine_Emin : constant := -1023;
80 AAMPS_Machine_Emin : constant := -127;
81 AAMPL_Machine_Emin : constant := -127;
83 IEEES_Machine_Mantissa : constant := 24;
84 IEEEL_Machine_Mantissa : constant := 53;
85 IEEEX_Machine_Mantissa : constant := 64;
86 VAXFF_Machine_Mantissa : constant := 24;
87 VAXDF_Machine_Mantissa : constant := 56;
88 VAXGF_Machine_Mantissa : constant := 53;
89 AAMPS_Machine_Mantissa : constant := 24;
90 AAMPL_Machine_Mantissa : constant := 40;
92 IEEES_Model_Emin : constant := -125;
93 IEEEL_Model_Emin : constant := -1021;
94 IEEEX_Model_Emin : constant := -16381;
95 VAXFF_Model_Emin : constant := -127;
96 VAXDF_Model_Emin : constant := -127;
97 VAXGF_Model_Emin : constant := -1023;
98 AAMPS_Model_Emin : constant := -127;
99 AAMPL_Model_Emin : constant := -127;
101 IEEES_Model_Mantissa : constant := 24;
102 IEEEL_Model_Mantissa : constant := 53;
103 IEEEX_Model_Mantissa : constant := 64;
104 VAXFF_Model_Mantissa : constant := 24;
105 VAXDF_Model_Mantissa : constant := 56;
106 VAXGF_Model_Mantissa : constant := 53;
107 AAMPS_Model_Mantissa : constant := 24;
108 AAMPL_Model_Mantissa : constant := 40;
110 IEEES_Safe_Emax : constant := 128;
111 IEEEL_Safe_Emax : constant := 1024;
112 IEEEX_Safe_Emax : constant := 16384;
113 VAXFF_Safe_Emax : constant := 127;
114 VAXDF_Safe_Emax : constant := 127;
115 VAXGF_Safe_Emax : constant := 1023;
116 AAMPS_Safe_Emax : constant := 127;
117 AAMPL_Safe_Emax : constant := 127;
119 -------------------------------
120 -- Universal Real Attributes --
121 -------------------------------
123 IEEES_Model_Epsilon : constant := 2#1.0#E-23;
124 IEEEL_Model_Epsilon : constant := 2#1.0#E-52;
125 IEEEX_Model_Epsilon : constant := 2#1.0#E-63;
126 VAXFF_Model_Epsilon : constant := 16#0.1000_000#E-4;
127 VAXDF_Model_Epsilon : constant := 16#0.4000_0000_0000_000#E-7;
128 VAXGF_Model_Epsilon : constant := 16#0.4000_0000_0000_00#E-12;
129 AAMPS_Model_Epsilon : constant := 2#1.0#E-23;
130 AAMPL_Model_Epsilon : constant := 2#1.0#E-39;
132 IEEES_Model_Small : constant := 2#1.0#E-126;
133 IEEEL_Model_Small : constant := 2#1.0#E-1022;
134 IEEEX_Model_Small : constant := 2#1.0#E-16381;
135 VAXFF_Model_Small : constant := 16#0.8000_000#E-21;
136 VAXDF_Model_Small : constant := 16#0.8000_0000_0000_000#E-31;
137 VAXGF_Model_Small : constant := 16#0.8000_0000_0000_00#E-51;
138 AAMPS_Model_Small : constant := 16#0.8000_000#E-21;
139 AAMPL_Model_Small : constant := 16#0.8000_0000_000#E-31;
141 IEEES_Safe_First : constant := -16#0.FFFF_FF#E+32;
142 IEEEL_Safe_First : constant := -16#0.FFFF_FFFF_FFFF_F8#E+256;
143 IEEEX_Safe_First : constant := -16#0.FFFF_FFFF_FFFF_FFFF#E+4096;
144 VAXFF_Safe_First : constant := -16#0.7FFF_FF8#E+32;
145 VAXDF_Safe_First : constant := -16#0.7FFF_FFFF_FFFF_FC0#E+32;
146 VAXGF_Safe_First : constant := -16#0.7FFF_FFFF_FFFF_FC#E+256;
147 AAMPS_Safe_First : constant := -16#0.7FFF_FF8#E+32;
148 AAMPL_Safe_First : constant := -16#0.7FFF_FFFF_FF8#E+32;
150 IEEES_Safe_Large : constant := 16#0.FFFF_FF#E+32;
151 IEEEL_Safe_Large : constant := 16#0.FFFF_FFFF_FFFF_F8#E+256;
152 IEEEX_Safe_Large : constant := 16#0.FFFF_FFFF_FFFF_FFFF#E+4096;
153 VAXFF_Safe_Large : constant := 16#0.7FFF_FC0#E+32;
154 VAXDF_Safe_Large : constant := 16#0.7FFF_FFFF_0000_000#E+32;
155 VAXGF_Safe_Large : constant := 16#0.7FFF_FFFF_FFFF_F0#E+256;
156 AAMPS_Safe_Large : constant := 16#0.7FFF_FC0#E+32;
157 AAMPL_Safe_Large : constant := 16#0.7FFF_FFFF#E+32;
159 IEEES_Safe_Last : constant := 16#0.FFFF_FF#E+32;
160 IEEEL_Safe_Last : constant := 16#0.FFFF_FFFF_FFFF_F8#E+256;
161 IEEEX_Safe_Last : constant := 16#0.FFFF_FFFF_FFFF_FFFF#E+4096;
162 VAXFF_Safe_Last : constant := 16#0.7FFF_FF8#E+32;
163 VAXDF_Safe_Last : constant := 16#0.7FFF_FFFF_FFFF_FC0#E+32;
164 VAXGF_Safe_Last : constant := 16#0.7FFF_FFFF_FFFF_FC#E+256;
165 AAMPS_Safe_Last : constant := 16#0.7FFF_FF8#E+32;
166 AAMPL_Safe_Last : constant := 16#0.7FFF_FFFF_FF8#E+32;
168 IEEES_Safe_Small : constant := 2#1.0#E-126;
169 IEEEL_Safe_Small : constant := 2#1.0#E-1022;
170 IEEEX_Safe_Small : constant := 2#1.0#E-16381;
171 VAXFF_Safe_Small : constant := 16#0.1000_000#E-31;
172 VAXDF_Safe_Small : constant := 16#0.1000_0000_0000_000#E-31;
173 VAXGF_Safe_Small : constant := 16#0.1000_0000_0000_00#E-255;
174 AAMPS_Safe_Small : constant := 16#0.1000_000#E-31;
175 AAMPL_Safe_Small : constant := 16#0.1000_0000_000#E-31;
177 ----------------------
178 -- Typed Attributes --
179 ----------------------
181 -- The attributes First and Last are typed attributes in Ada, and yield
182 -- values of the appropriate float type. However we still describe them
183 -- as universal real values in this file, since we are talking about the
184 -- target floating-point types, not the host floating-point types.
186 IEEES_First : constant := -16#0.FFFF_FF#E+32;
187 IEEEL_First : constant := -16#0.FFFF_FFFF_FFFF_F8#E+256;
188 IEEEX_First : constant := -16#0.FFFF_FFFF_FFFF_FFFF#E+4096;
189 VAXFF_First : constant := -16#0.7FFF_FF8#E+32;
190 VAXDF_First : constant := -16#0.7FFF_FFFF_FFFF_FF8#E+32;
191 VAXGF_First : constant := -16#0.7FFF_FFFF_FFFF_FC#E+256;
192 AAMPS_First : constant := -16#0.7FFF_FF8#E+32;
193 AAMPL_First : constant := -16#0.7FFF_FFFF_FF8#E+32;
195 IEEES_Last : constant := 16#0.FFFF_FF#E+32;
196 IEEEL_Last : constant := 16#0.FFFF_FFFF_FFFF_F8#E+256;
197 IEEEX_Last : constant := 16#0.FFFF_FFFF_FFFF_FFFF#E+4096;
198 VAXFF_Last : constant := 16#0.7FFF_FF8#E+32;
199 VAXDF_Last : constant := 16#0.7FFF_FFFF_FFFF_FC0#E+32;
200 VAXGF_Last : constant := 16#0.7FFF_FFFF_FFFF_FC#E+256;
201 AAMPS_Last : constant := 16#0.7FFF_FF8#E+32;
202 AAMPL_Last : constant := 16#0.7FFF_FFFF_FF8#E+32;
204 end Ttypef;