1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
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 2, 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 COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
25 ------------------------------------------------------------------------------
27 -- This module contains values for the predefined floating-point attributes.
28 -- All references to these attribute values in a program being compiled must
29 -- use the values in this package, not the values returned by referencing
30 -- the corresponding attributes (since that would give host machine values).
31 -- Boolean-valued attributes are defined in System.Parameters, because they
32 -- need a finer control than what is provided by the formats described below.
34 -- The codes for the eight floating-point formats supported are:
36 -- IEEES - IEEE Single Float
37 -- IEEEL - IEEE Double Float
38 -- IEEEX - IEEE Double Extended Float
39 -- VAXFF - VAX F Float
40 -- VAXDF - VAX D Float
41 -- VAXGF - VAX G Float
42 -- AAMPS - AAMP 32-bit Float
43 -- AAMPL - AAMP 48-bit Float
47 ----------------------------------
48 -- Universal Integer Attributes --
49 ----------------------------------
51 -- Note that the constant declarations below specify values
52 -- using the Ada model, so IEEES_Machine_Emax does not specify
53 -- the IEEE definition of the single precision float type,
54 -- but the value of the Ada attribute which is one higher
55 -- as the binary point is at a different location.
57 IEEES_Digits
: constant := 6;
58 IEEEL_Digits
: constant := 15;
59 IEEEX_Digits
: constant := 18;
60 VAXFF_Digits
: constant := 6;
61 VAXDF_Digits
: constant := 9;
62 VAXGF_Digits
: constant := 15;
63 AAMPS_Digits
: constant := 6;
64 AAMPL_Digits
: constant := 9;
66 IEEES_Machine_Emax
: constant := 128;
67 IEEEL_Machine_Emax
: constant := 1024;
68 IEEEX_Machine_Emax
: constant := 16384;
69 VAXFF_Machine_Emax
: constant := 127;
70 VAXDF_Machine_Emax
: constant := 127;
71 VAXGF_Machine_Emax
: constant := 1023;
72 AAMPS_Machine_Emax
: constant := 127;
73 AAMPL_Machine_Emax
: constant := 127;
75 IEEES_Machine_Emin
: constant := -125;
76 IEEEL_Machine_Emin
: constant := -1021;
77 IEEEX_Machine_Emin
: constant := -16381;
78 VAXFF_Machine_Emin
: constant := -127;
79 VAXDF_Machine_Emin
: constant := -127;
80 VAXGF_Machine_Emin
: constant := -1023;
81 AAMPS_Machine_Emin
: constant := -127;
82 AAMPL_Machine_Emin
: constant := -127;
84 IEEES_Machine_Mantissa
: constant := 24;
85 IEEEL_Machine_Mantissa
: constant := 53;
86 IEEEX_Machine_Mantissa
: constant := 64;
87 VAXFF_Machine_Mantissa
: constant := 24;
88 VAXDF_Machine_Mantissa
: constant := 56;
89 VAXGF_Machine_Mantissa
: constant := 53;
90 AAMPS_Machine_Mantissa
: constant := 24;
91 AAMPL_Machine_Mantissa
: constant := 40;
93 IEEES_Model_Emin
: constant := -125;
94 IEEEL_Model_Emin
: constant := -1021;
95 IEEEX_Model_Emin
: constant := -16381;
96 VAXFF_Model_Emin
: constant := -127;
97 VAXDF_Model_Emin
: constant := -127;
98 VAXGF_Model_Emin
: constant := -1023;
99 AAMPS_Model_Emin
: constant := -127;
100 AAMPL_Model_Emin
: constant := -127;
102 IEEES_Model_Mantissa
: constant := 24;
103 IEEEL_Model_Mantissa
: constant := 53;
104 IEEEX_Model_Mantissa
: constant := 64;
105 VAXFF_Model_Mantissa
: constant := 24;
106 VAXDF_Model_Mantissa
: constant := 56;
107 VAXGF_Model_Mantissa
: constant := 53;
108 AAMPS_Model_Mantissa
: constant := 24;
109 AAMPL_Model_Mantissa
: constant := 40;
111 IEEES_Safe_Emax
: constant := 128;
112 IEEEL_Safe_Emax
: constant := 1024;
113 IEEEX_Safe_Emax
: constant := 16384;
114 VAXFF_Safe_Emax
: constant := 127;
115 VAXDF_Safe_Emax
: constant := 127;
116 VAXGF_Safe_Emax
: constant := 1023;
117 AAMPS_Safe_Emax
: constant := 127;
118 AAMPL_Safe_Emax
: constant := 127;
120 -------------------------------
121 -- Universal Real Attributes --
122 -------------------------------
124 IEEES_Model_Epsilon
: constant := 2#
1.0#E
-23;
125 IEEEL_Model_Epsilon
: constant := 2#
1.0#E
-52;
126 IEEEX_Model_Epsilon
: constant := 2#
1.0#E
-63;
127 VAXFF_Model_Epsilon
: constant := 16#
0.1000_000#E
-4;
128 VAXDF_Model_Epsilon
: constant := 16#
0.4000_0000_0000_000#E
-7;
129 VAXGF_Model_Epsilon
: constant := 16#
0.4000_0000_0000_00#E
-12;
130 AAMPS_Model_Epsilon
: constant := 2#
1.0#E
-23;
131 AAMPL_Model_Epsilon
: constant := 2#
1.0#E
-39;
133 IEEES_Model_Small
: constant := 2#
1.0#E
-126;
134 IEEEL_Model_Small
: constant := 2#
1.0#E
-1022;
135 IEEEX_Model_Small
: constant := 2#
1.0#E
-16381;
136 VAXFF_Model_Small
: constant := 16#
0.8000_000#E
-21;
137 VAXDF_Model_Small
: constant := 16#
0.8000_0000_0000_000#E
-31;
138 VAXGF_Model_Small
: constant := 16#
0.8000_0000_0000_00#E
-51;
139 AAMPS_Model_Small
: constant := 16#
0.8000_000#E
-21;
140 AAMPL_Model_Small
: constant := 16#
0.8000_0000_000#E
-31;
142 IEEES_Safe_First
: constant := -16#
0.FFFF_FF#E
+32;
143 IEEEL_Safe_First
: constant := -16#
0.FFFF_FFFF_FFFF_F8#E
+256;
144 IEEEX_Safe_First
: constant := -16#
0.FFFF_FFFF_FFFF_FFFF#E
+4096;
145 VAXFF_Safe_First
: constant := -16#
0.7FFF_FF8#E
+32;
146 VAXDF_Safe_First
: constant := -16#
0.7FFF_FFFF_FFFF_FF8#E
-38;
147 VAXGF_Safe_First
: constant := -16#
0.7FFF_FFFF_FFFF_FC#E
-256;
148 AAMPS_Safe_First
: constant := -16#
0.7FFF_FF8#E
+32;
149 AAMPL_Safe_First
: constant := -16#
0.7FFF_FFFF_FF8#E
+32;
151 IEEES_Safe_Large
: constant := 16#
0.FFFF_FF#E
+32;
152 IEEEL_Safe_Large
: constant := 16#
0.FFFF_FFFF_FFFF_F8#E
+256;
153 IEEEX_Safe_Large
: constant := 16#
0.FFFF_FFFF_FFFF_FFFF#E
+4096;
154 VAXFF_Safe_Large
: constant := 16#
0.7FFF_FC0#E
+32;
155 VAXDF_Safe_Large
: constant := 16#
0.7FFF_FFFF_0000_000#E
+32;
156 VAXGF_Safe_Large
: constant := 16#
0.7FFF_FFFF_FFFF_F0#E
+256;
157 AAMPS_Safe_Large
: constant := 16#
0.7FFF_FC0#E
+32;
158 AAMPL_Safe_Large
: constant := 16#
0.7FFF_FFFF#E
+32;
160 IEEES_Safe_Last
: constant := 16#
0.FFFF_FF#E
+32;
161 IEEEL_Safe_Last
: constant := 16#
0.FFFF_FFFF_FFFF_F8#E
+256;
162 IEEEX_Safe_Last
: constant := 16#
0.FFFF_FFFF_FFFF_FFFF#E
+4096;
163 VAXFF_Safe_Last
: constant := 16#
0.7FFF_FF8#E
+32;
164 VAXDF_Safe_Last
: constant := 16#
0.7FFF_FFFF_FFFF_FC0#E
+32;
165 VAXGF_Safe_Last
: constant := 16#
0.7FFF_FFFF_FFFF_FC#E
+256;
166 AAMPS_Safe_Last
: constant := 16#
0.7FFF_FF8#E
+32;
167 AAMPL_Safe_Last
: constant := 16#
0.7FFF_FFFF_FF8#E
+32;
169 IEEES_Safe_Small
: constant := 2#
1.0#E
-126;
170 IEEEL_Safe_Small
: constant := 2#
1.0#E
-1022;
171 IEEEX_Safe_Small
: constant := 2#
1.0#E
-16381;
172 VAXFF_Safe_Small
: constant := 16#
0.1000_000#E
-31;
173 VAXDF_Safe_Small
: constant := 16#
0.1000_0000_0000_000#E
-31;
174 VAXGF_Safe_Small
: constant := 16#
0.1000_0000_0000_00#E
-255;
175 AAMPS_Safe_Small
: constant := 16#
0.1000_000#E
-31;
176 AAMPL_Safe_Small
: constant := 16#
0.1000_0000_000#E
-31;
178 ----------------------
179 -- Typed Attributes --
180 ----------------------
182 -- The attributes First and Last are typed attributes in Ada, and yield
183 -- values of the appropriate float type. However we still describe them
184 -- as universal real values in this file, since we are talking about the
185 -- target floating-point types, not the host floating-point types.
187 IEEES_First
: constant := -16#
0.FFFF_FF#E
+32;
188 IEEEL_First
: constant := -16#
0.FFFF_FFFF_FFFF_F8#E
+256;
189 IEEEX_First
: constant := -16#
0.FFFF_FFFF_FFFF_FFFF#E
+4096;
190 VAXFF_First
: constant := -16#
0.7FFF_FF8#E
+32;
191 VAXDF_First
: constant := -16#
0.7FFF_FFFF_FFFF_FF8#E
+32;
192 VAXGF_First
: constant := -16#
0.7FFF_FFFF_FFFF_FC#E
+256;
193 AAMPS_First
: constant := -16#
0.7FFF_FF8#E
+32;
194 AAMPL_First
: constant := -16#
0.7FFF_FFFF_FF8#E
+32;
196 IEEES_Last
: constant := 16#
0.FFFF_FF#E
+32;
197 IEEEL_Last
: constant := 16#
0.FFFF_FFFF_FFFF_F8#E
+256;
198 IEEEX_Last
: constant := 16#
0.FFFF_FFFF_FFFF_FFFF#E
+4096;
199 VAXFF_Last
: constant := 16#
0.7FFF_FF8#E
+32;
200 VAXDF_Last
: constant := 16#
0.7FFF_FFFF_FFFF_FC0#E
+32;
201 VAXGF_Last
: constant := 16#
0.7FFF_FFFF_FFFF_FC#E
+256;
202 AAMPS_Last
: constant := 16#
0.7FFF_FF8#E
+32;
203 AAMPL_Last
: constant := 16#
0.7FFF_FFFF_FF8#E
+32;