annotate gcc/ada/libgnat/s-scaval.ads @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT RUN-TIME COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- S Y S T E M . S C A L A R _ V A L U E S --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
kono
parents:
diff changeset
9 -- Copyright (C) 2001-2017, Free Software Foundation, Inc. --
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
12 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
kono
parents:
diff changeset
17 -- --
kono
parents:
diff changeset
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
kono
parents:
diff changeset
19 -- additional permissions described in the GCC Runtime Library Exception, --
kono
parents:
diff changeset
20 -- version 3.1, as published by the Free Software Foundation. --
kono
parents:
diff changeset
21 -- --
kono
parents:
diff changeset
22 -- You should have received a copy of the GNU General Public License and --
kono
parents:
diff changeset
23 -- a copy of the GCC Runtime Library Exception along with this program; --
kono
parents:
diff changeset
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
kono
parents:
diff changeset
25 -- <http://www.gnu.org/licenses/>. --
kono
parents:
diff changeset
26 -- --
kono
parents:
diff changeset
27 -- GNAT was originally developed by the GNAT team at New York University. --
kono
parents:
diff changeset
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
kono
parents:
diff changeset
29 -- --
kono
parents:
diff changeset
30 ------------------------------------------------------------------------------
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 -- This package defines the constants used for initializing scalar values
kono
parents:
diff changeset
33 -- when pragma Initialize_Scalars is used. The actual values are defined
kono
parents:
diff changeset
34 -- in the binder generated file. This package contains the Ada names that
kono
parents:
diff changeset
35 -- are used by the generated code, which are linked to the actual values
kono
parents:
diff changeset
36 -- by the use of pragma Import.
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 package System.Scalar_Values is
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 -- Note: logically this package should be Pure since it can be accessed
kono
parents:
diff changeset
41 -- from pure units, but the IS_xxx variables below get set at run time,
kono
parents:
diff changeset
42 -- so they have to be library level variables. In fact we only ever
kono
parents:
diff changeset
43 -- access this from generated code, and the compiler knows that it is
kono
parents:
diff changeset
44 -- OK to access this unit from generated code.
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 type Byte1 is mod 2 ** 8;
kono
parents:
diff changeset
47 type Byte2 is mod 2 ** 16;
kono
parents:
diff changeset
48 type Byte4 is mod 2 ** 32;
kono
parents:
diff changeset
49 type Byte8 is mod 2 ** 64;
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 -- The explicit initializations here are not really required, since these
kono
parents:
diff changeset
52 -- variables are always set by System.Scalar_Values.Initialize.
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 IS_Is1 : Byte1 := 0; -- Initialize 1 byte signed
kono
parents:
diff changeset
55 IS_Is2 : Byte2 := 0; -- Initialize 2 byte signed
kono
parents:
diff changeset
56 IS_Is4 : Byte4 := 0; -- Initialize 4 byte signed
kono
parents:
diff changeset
57 IS_Is8 : Byte8 := 0; -- Initialize 8 byte signed
kono
parents:
diff changeset
58 -- For the above cases, the undefined value (set by the binder -Sin switch)
kono
parents:
diff changeset
59 -- is the largest negative number (1 followed by all zero bits).
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 IS_Iu1 : Byte1 := 0; -- Initialize 1 byte unsigned
kono
parents:
diff changeset
62 IS_Iu2 : Byte2 := 0; -- Initialize 2 byte unsigned
kono
parents:
diff changeset
63 IS_Iu4 : Byte4 := 0; -- Initialize 4 byte unsigned
kono
parents:
diff changeset
64 IS_Iu8 : Byte8 := 0; -- Initialize 8 byte unsigned
kono
parents:
diff changeset
65 -- For the above cases, the undefined value (set by the binder -Sin switch)
kono
parents:
diff changeset
66 -- is the largest unsigned number (all 1 bits).
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 IS_Iz1 : Byte1 := 0; -- Initialize 1 byte zeroes
kono
parents:
diff changeset
69 IS_Iz2 : Byte2 := 0; -- Initialize 2 byte zeroes
kono
parents:
diff changeset
70 IS_Iz4 : Byte4 := 0; -- Initialize 4 byte zeroes
kono
parents:
diff changeset
71 IS_Iz8 : Byte8 := 0; -- Initialize 8 byte zeroes
kono
parents:
diff changeset
72 -- For the above cases, the undefined value (set by the binder -Sin switch)
kono
parents:
diff changeset
73 -- is the zero (all 0 bits). This is used when zero is known to be an
kono
parents:
diff changeset
74 -- invalid value.
kono
parents:
diff changeset
75
kono
parents:
diff changeset
76 -- The float definitions are aliased, because we use overlays to set them
kono
parents:
diff changeset
77
kono
parents:
diff changeset
78 IS_Isf : aliased Short_Float := 0.0; -- Initialize short float
kono
parents:
diff changeset
79 IS_Ifl : aliased Float := 0.0; -- Initialize float
kono
parents:
diff changeset
80 IS_Ilf : aliased Long_Float := 0.0; -- Initialize long float
kono
parents:
diff changeset
81 IS_Ill : aliased Long_Long_Float := 0.0; -- Initialize long long float
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 procedure Initialize (Mode1 : Character; Mode2 : Character);
kono
parents:
diff changeset
84 -- This procedure is called from the binder when Initialize_Scalars mode
kono
parents:
diff changeset
85 -- is active. The arguments are the two characters from the -S switch,
kono
parents:
diff changeset
86 -- with letters forced upper case. So for example if -S5a is given, then
kono
parents:
diff changeset
87 -- Mode1 will be '5' and Mode2 will be 'A'. If the parameters are EV,
kono
parents:
diff changeset
88 -- then this routine reads the environment variable GNAT_INIT_SCALARS.
kono
parents:
diff changeset
89 -- The possible settings are the same as those for the -S switch (except
kono
parents:
diff changeset
90 -- for EV), i.e. IN/LO/HO/xx, xx = 2 hex digits. If no -S switch is given
kono
parents:
diff changeset
91 -- then the default of IN (invalid values) is passed on the call.
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93 end System.Scalar_Values;