OSDN Git Service

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