2003-05-31 Bud Davis <bdavis9659@comcast.net>
[official-gcc.git] / gcc / ada / interfac.ads
blob10ade18b73e7eb3e9686d65935b53341f886b2ba
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- I N T E R F A C E S --
6 -- --
7 -- S p e c --
8 -- --
9 -- This specification is adapted from the Ada Reference Manual for use with --
10 -- GNAT. In accordance with the copyright of that document, you can freely --
11 -- copy and modify this specification, provided that if you redistribute a --
12 -- modified version, any changes that you have made are clearly indicated. --
13 -- --
14 ------------------------------------------------------------------------------
16 -- Assumes integer sizes of 8, 16, 32 and 64 are available, and that the
17 -- floating-point formats are IEEE compatible.
19 -- There is a specialized version of this package for OpenVMS.
21 package Interfaces is
22 pragma Pure (Interfaces);
24 type Integer_8 is range -2 ** 7 .. 2 ** 7 - 1;
25 for Integer_8'Size use 8;
27 type Integer_16 is range -2 ** 15 .. 2 ** 15 - 1;
28 for Integer_16'Size use 16;
30 type Integer_32 is range -2 ** 31 .. 2 ** 31 - 1;
31 for Integer_32'Size use 32;
33 type Integer_64 is range -2 ** 63 .. 2 ** 63 - 1;
34 for Integer_64'Size use 64;
36 type Unsigned_8 is mod 2 ** 8;
37 for Unsigned_8'Size use 8;
39 type Unsigned_16 is mod 2 ** 16;
40 for Unsigned_16'Size use 16;
42 type Unsigned_32 is mod 2 ** 32;
43 for Unsigned_32'Size use 32;
45 type Unsigned_64 is mod 2 ** 64;
46 for Unsigned_64'Size use 64;
48 function Shift_Left
49 (Value : Unsigned_8;
50 Amount : Natural)
51 return Unsigned_8;
53 function Shift_Right
54 (Value : Unsigned_8;
55 Amount : Natural)
56 return Unsigned_8;
58 function Shift_Right_Arithmetic
59 (Value : Unsigned_8;
60 Amount : Natural)
61 return Unsigned_8;
63 function Rotate_Left
64 (Value : Unsigned_8;
65 Amount : Natural)
66 return Unsigned_8;
68 function Rotate_Right
69 (Value : Unsigned_8;
70 Amount : Natural)
71 return Unsigned_8;
73 function Shift_Left
74 (Value : Unsigned_16;
75 Amount : Natural)
76 return Unsigned_16;
78 function Shift_Right
79 (Value : Unsigned_16;
80 Amount : Natural)
81 return Unsigned_16;
83 function Shift_Right_Arithmetic
84 (Value : Unsigned_16;
85 Amount : Natural)
86 return Unsigned_16;
88 function Rotate_Left
89 (Value : Unsigned_16;
90 Amount : Natural)
91 return Unsigned_16;
93 function Rotate_Right
94 (Value : Unsigned_16;
95 Amount : Natural)
96 return Unsigned_16;
98 function Shift_Left
99 (Value : Unsigned_32;
100 Amount : Natural)
101 return Unsigned_32;
103 function Shift_Right
104 (Value : Unsigned_32;
105 Amount : Natural)
106 return Unsigned_32;
108 function Shift_Right_Arithmetic
109 (Value : Unsigned_32;
110 Amount : Natural)
111 return Unsigned_32;
113 function Rotate_Left
114 (Value : Unsigned_32;
115 Amount : Natural)
116 return Unsigned_32;
118 function Rotate_Right
119 (Value : Unsigned_32;
120 Amount : Natural)
121 return Unsigned_32;
123 function Shift_Left
124 (Value : Unsigned_64;
125 Amount : Natural)
126 return Unsigned_64;
128 function Shift_Right
129 (Value : Unsigned_64;
130 Amount : Natural)
131 return Unsigned_64;
133 function Shift_Right_Arithmetic
134 (Value : Unsigned_64;
135 Amount : Natural)
136 return Unsigned_64;
138 function Rotate_Left
139 (Value : Unsigned_64;
140 Amount : Natural)
141 return Unsigned_64;
143 function Rotate_Right
144 (Value : Unsigned_64;
145 Amount : Natural)
146 return Unsigned_64;
148 pragma Import (Intrinsic, Shift_Left);
149 pragma Import (Intrinsic, Shift_Right);
150 pragma Import (Intrinsic, Shift_Right_Arithmetic);
151 pragma Import (Intrinsic, Rotate_Left);
152 pragma Import (Intrinsic, Rotate_Right);
154 -- Floating point types. We assume that we are on an IEEE machine, and
155 -- that the types Short_Float and Long_Float in Standard refer to the
156 -- 32-bit short and 64-bit long IEEE forms. Furthermore, if there is
157 -- an extended float, we assume that it is available as Long_Long_Float.
158 -- Note: it is harmless, and explicitly permitted, to include additional
159 -- types in interfaces, so it is not wrong to have IEEE_Extended_Float
160 -- defined even if the extended format is not available.
162 type IEEE_Float_32 is new Short_Float;
163 type IEEE_Float_64 is new Long_Float;
164 type IEEE_Extended_Float is new Long_Long_Float;
166 end Interfaces;