PR ada/18819
[official-gcc.git] / gcc / ada / interfac.ads
blob2f0cdf0459492e829586bd240c4c6ce6f0beb891
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 -- Copyright (C) 2002-2005, Free Software Foundation, Inc. --
10 -- --
11 -- This specification is derived from the Ada Reference Manual for use with --
12 -- GNAT. The copyright notice above, and the license provisions that follow --
13 -- apply solely to the implementation dependent sections of this file. --
14 -- --
15 -- GNAT is free software; you can redistribute it and/or modify it under --
16 -- terms of the GNU General Public License as published by the Free Soft- --
17 -- ware Foundation; either version 2, or (at your option) any later ver- --
18 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
19 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
20 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
21 -- for more details. You should have received a copy of the GNU General --
22 -- Public License distributed with GNAT; see file COPYING. If not, write --
23 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
24 -- Boston, MA 02110-1301, USA. --
25 -- --
26 -- As a special exception, if other files instantiate generics from this --
27 -- unit, or you link this unit with other files to produce an executable, --
28 -- this unit does not by itself cause the resulting executable to be --
29 -- covered by the GNU General Public License. This exception does not --
30 -- however invalidate any other reasons why the executable file might be --
31 -- covered by the GNU Public License. --
32 -- --
33 -- GNAT was originally developed by the GNAT team at New York University. --
34 -- Extensive contributions were provided by Ada Core Technologies Inc. --
35 -- --
36 ------------------------------------------------------------------------------
38 package Interfaces is
39 pragma Pure;
41 type Integer_8 is range -2 ** 7 .. 2 ** 7 - 1;
42 for Integer_8'Size use 8;
44 type Integer_16 is range -2 ** 15 .. 2 ** 15 - 1;
45 for Integer_16'Size use 16;
47 type Integer_32 is range -2 ** 31 .. 2 ** 31 - 1;
48 for Integer_32'Size use 32;
50 type Integer_64 is range -2 ** 63 .. 2 ** 63 - 1;
51 for Integer_64'Size use 64;
53 type Unsigned_8 is mod 2 ** 8;
54 for Unsigned_8'Size use 8;
56 type Unsigned_16 is mod 2 ** 16;
57 for Unsigned_16'Size use 16;
59 type Unsigned_32 is mod 2 ** 32;
60 for Unsigned_32'Size use 32;
62 type Unsigned_64 is mod 2 ** 64;
63 for Unsigned_64'Size use 64;
65 function Shift_Left
66 (Value : Unsigned_8;
67 Amount : Natural) return Unsigned_8;
69 function Shift_Right
70 (Value : Unsigned_8;
71 Amount : Natural) return Unsigned_8;
73 function Shift_Right_Arithmetic
74 (Value : Unsigned_8;
75 Amount : Natural) return Unsigned_8;
77 function Rotate_Left
78 (Value : Unsigned_8;
79 Amount : Natural) return Unsigned_8;
81 function Rotate_Right
82 (Value : Unsigned_8;
83 Amount : Natural) return Unsigned_8;
85 function Shift_Left
86 (Value : Unsigned_16;
87 Amount : Natural) return Unsigned_16;
89 function Shift_Right
90 (Value : Unsigned_16;
91 Amount : Natural) return Unsigned_16;
93 function Shift_Right_Arithmetic
94 (Value : Unsigned_16;
95 Amount : Natural) return Unsigned_16;
97 function Rotate_Left
98 (Value : Unsigned_16;
99 Amount : Natural) return Unsigned_16;
101 function Rotate_Right
102 (Value : Unsigned_16;
103 Amount : Natural) return Unsigned_16;
105 function Shift_Left
106 (Value : Unsigned_32;
107 Amount : Natural) return Unsigned_32;
109 function Shift_Right
110 (Value : Unsigned_32;
111 Amount : Natural) return Unsigned_32;
113 function Shift_Right_Arithmetic
114 (Value : Unsigned_32;
115 Amount : Natural) return Unsigned_32;
117 function Rotate_Left
118 (Value : Unsigned_32;
119 Amount : Natural) return Unsigned_32;
121 function Rotate_Right
122 (Value : Unsigned_32;
123 Amount : Natural) return Unsigned_32;
125 function Shift_Left
126 (Value : Unsigned_64;
127 Amount : Natural) return Unsigned_64;
129 function Shift_Right
130 (Value : Unsigned_64;
131 Amount : Natural) return Unsigned_64;
133 function Shift_Right_Arithmetic
134 (Value : Unsigned_64;
135 Amount : Natural) return Unsigned_64;
137 function Rotate_Left
138 (Value : Unsigned_64;
139 Amount : Natural) return Unsigned_64;
141 function Rotate_Right
142 (Value : Unsigned_64;
143 Amount : Natural) return Unsigned_64;
145 pragma Import (Intrinsic, Shift_Left);
146 pragma Import (Intrinsic, Shift_Right);
147 pragma Import (Intrinsic, Shift_Right_Arithmetic);
148 pragma Import (Intrinsic, Rotate_Left);
149 pragma Import (Intrinsic, Rotate_Right);
151 -- IEEE Floating point types. Note that the form of these definitions
152 -- ensures that the work on VMS, even if the standard library is compiled
153 -- using a Float_Representation pragma for Vax_Float.
155 pragma Warnings (Off);
156 -- Turn off warnings for targets not providing IEEE floating-point types
158 type IEEE_Float_32 is digits 6;
159 pragma Float_Representation (IEEE_Float, IEEE_Float_32);
161 type IEEE_Float_64 is digits 15;
162 pragma Float_Representation (IEEE_Float, IEEE_Float_64);
164 -- If there is an IEEE extended float available on the machine, we assume
165 -- that it is available as Long_Long_Float.
167 -- Note: it is harmless, and explicitly permitted, to include additional
168 -- types in interfaces, so it is not wrong to have IEEE_Extended_Float
169 -- defined even if the extended format is not available.
171 type IEEE_Extended_Float is new Long_Long_Float;
173 end Interfaces;