FSF GCC merge 02/23/03
[official-gcc.git] / gcc / ada / interfac.ads
blobb4be0dd881242cc373a86e9ee0c34027ed0a47a8
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 -- --
10 -- This specification is adapted from the Ada Reference Manual for use with --
11 -- GNAT. In accordance with the copyright of that document, you can freely --
12 -- copy and modify this specification, provided that if you redistribute a --
13 -- modified version, any changes that you have made are clearly indicated. --
14 -- --
15 ------------------------------------------------------------------------------
17 -- Assumes integer sizes of 8, 16, 32 and 64 are available, and that the
18 -- floating-point formats are IEEE compatible.
20 -- There is a specialized version of this package for OpenVMS.
22 package Interfaces is
23 pragma Pure (Interfaces);
25 type Integer_8 is range -2 ** 7 .. 2 ** 7 - 1;
26 for Integer_8'Size use 8;
28 type Integer_16 is range -2 ** 15 .. 2 ** 15 - 1;
29 for Integer_16'Size use 16;
31 type Integer_32 is range -2 ** 31 .. 2 ** 31 - 1;
32 for Integer_32'Size use 32;
34 type Integer_64 is range -2 ** 63 .. 2 ** 63 - 1;
35 for Integer_64'Size use 64;
37 type Unsigned_8 is mod 2 ** 8;
38 for Unsigned_8'Size use 8;
40 type Unsigned_16 is mod 2 ** 16;
41 for Unsigned_16'Size use 16;
43 type Unsigned_32 is mod 2 ** 32;
44 for Unsigned_32'Size use 32;
46 type Unsigned_64 is mod 2 ** 64;
47 for Unsigned_64'Size use 64;
49 function Shift_Left
50 (Value : Unsigned_8;
51 Amount : Natural)
52 return Unsigned_8;
54 function Shift_Right
55 (Value : Unsigned_8;
56 Amount : Natural)
57 return Unsigned_8;
59 function Shift_Right_Arithmetic
60 (Value : Unsigned_8;
61 Amount : Natural)
62 return Unsigned_8;
64 function Rotate_Left
65 (Value : Unsigned_8;
66 Amount : Natural)
67 return Unsigned_8;
69 function Rotate_Right
70 (Value : Unsigned_8;
71 Amount : Natural)
72 return Unsigned_8;
74 function Shift_Left
75 (Value : Unsigned_16;
76 Amount : Natural)
77 return Unsigned_16;
79 function Shift_Right
80 (Value : Unsigned_16;
81 Amount : Natural)
82 return Unsigned_16;
84 function Shift_Right_Arithmetic
85 (Value : Unsigned_16;
86 Amount : Natural)
87 return Unsigned_16;
89 function Rotate_Left
90 (Value : Unsigned_16;
91 Amount : Natural)
92 return Unsigned_16;
94 function Rotate_Right
95 (Value : Unsigned_16;
96 Amount : Natural)
97 return Unsigned_16;
99 function Shift_Left
100 (Value : Unsigned_32;
101 Amount : Natural)
102 return Unsigned_32;
104 function Shift_Right
105 (Value : Unsigned_32;
106 Amount : Natural)
107 return Unsigned_32;
109 function Shift_Right_Arithmetic
110 (Value : Unsigned_32;
111 Amount : Natural)
112 return Unsigned_32;
114 function Rotate_Left
115 (Value : Unsigned_32;
116 Amount : Natural)
117 return Unsigned_32;
119 function Rotate_Right
120 (Value : Unsigned_32;
121 Amount : Natural)
122 return Unsigned_32;
124 function Shift_Left
125 (Value : Unsigned_64;
126 Amount : Natural)
127 return Unsigned_64;
129 function Shift_Right
130 (Value : Unsigned_64;
131 Amount : Natural)
132 return Unsigned_64;
134 function Shift_Right_Arithmetic
135 (Value : Unsigned_64;
136 Amount : Natural)
137 return Unsigned_64;
139 function Rotate_Left
140 (Value : Unsigned_64;
141 Amount : Natural)
142 return Unsigned_64;
144 function Rotate_Right
145 (Value : Unsigned_64;
146 Amount : Natural)
147 return Unsigned_64;
149 pragma Import (Intrinsic, Shift_Left);
150 pragma Import (Intrinsic, Shift_Right);
151 pragma Import (Intrinsic, Shift_Right_Arithmetic);
152 pragma Import (Intrinsic, Rotate_Left);
153 pragma Import (Intrinsic, Rotate_Right);
155 -- Floating point types. We assume that we are on an IEEE machine, and
156 -- that the types Short_Float and Long_Float in Standard refer to the
157 -- 32-bit short and 64-bit long IEEE forms. Furthermore, if there is
158 -- an extended float, we assume that it is available as Long_Long_Float.
159 -- Note: it is harmless, and explicitly permitted, to include additional
160 -- types in interfaces, so it is not wrong to have IEEE_Extended_Float
161 -- defined even if the extended format is not available.
163 type IEEE_Float_32 is new Short_Float;
164 type IEEE_Float_64 is new Long_Float;
165 type IEEE_Extended_Float is new Long_Long_Float;
167 end Interfaces;