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-2013, 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 3,  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.                                     --
21--                                                                          --
22-- As a special exception under Section 7 of GPL version 3, you are granted --
23-- additional permissions described in the GCC Runtime Library Exception,   --
24-- version 3.1, as published by the Free Software Foundation.               --
25--                                                                          --
26-- You should have received a copy of the GNU General Public License and    --
27-- a copy of the GCC Runtime Library Exception along with this program;     --
28-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
29-- <http://www.gnu.org/licenses/>.                                          --
30--                                                                          --
31-- GNAT was originally developed  by the GNAT team at  New York University. --
32-- Extensive contributions were provided by Ada Core Technologies Inc.      --
33--                                                                          --
34------------------------------------------------------------------------------
35
36pragma Compiler_Unit_Warning;
37
38package Interfaces is
39   pragma Pure;
40
41   --  All identifiers in this unit are implementation defined
42
43   pragma Implementation_Defined;
44
45   type Integer_8  is range -2 **  7 .. 2 **  7 - 1;
46   for Integer_8'Size use  8;
47
48   type Integer_16 is range -2 ** 15 .. 2 ** 15 - 1;
49   for Integer_16'Size use 16;
50
51   type Integer_32 is range -2 ** 31 .. 2 ** 31 - 1;
52   for Integer_32'Size use 32;
53
54   type Integer_64 is range -2 ** 63 .. 2 ** 63 - 1;
55   for Integer_64'Size use 64;
56
57   type Unsigned_8  is mod 2 **  8;
58   for Unsigned_8'Size use  8;
59
60   type Unsigned_16 is mod 2 ** 16;
61   for Unsigned_16'Size use 16;
62
63   type Unsigned_32 is mod 2 ** 32;
64   for Unsigned_32'Size use 32;
65
66   type Unsigned_64 is mod 2 ** 64;
67   for Unsigned_64'Size use 64;
68
69   function Shift_Left
70     (Value  : Unsigned_8;
71      Amount : Natural) return Unsigned_8;
72
73   function Shift_Right
74     (Value  : Unsigned_8;
75      Amount : Natural) return Unsigned_8;
76
77   function Shift_Right_Arithmetic
78     (Value  : Unsigned_8;
79      Amount : Natural) return Unsigned_8;
80
81   function Rotate_Left
82     (Value  : Unsigned_8;
83      Amount : Natural) return Unsigned_8;
84
85   function Rotate_Right
86     (Value  : Unsigned_8;
87      Amount : Natural) return Unsigned_8;
88
89   function Shift_Left
90     (Value  : Unsigned_16;
91      Amount : Natural) return Unsigned_16;
92
93   function Shift_Right
94     (Value  : Unsigned_16;
95      Amount : Natural) return Unsigned_16;
96
97   function Shift_Right_Arithmetic
98     (Value  : Unsigned_16;
99      Amount : Natural) return Unsigned_16;
100
101   function Rotate_Left
102     (Value  : Unsigned_16;
103      Amount : Natural) return Unsigned_16;
104
105   function Rotate_Right
106     (Value  : Unsigned_16;
107      Amount : Natural) return Unsigned_16;
108
109   function Shift_Left
110     (Value  : Unsigned_32;
111      Amount : Natural) return Unsigned_32;
112
113   function Shift_Right
114     (Value  : Unsigned_32;
115      Amount : Natural) return Unsigned_32;
116
117   function Shift_Right_Arithmetic
118     (Value  : Unsigned_32;
119      Amount : Natural) return Unsigned_32;
120
121   function Rotate_Left
122     (Value  : Unsigned_32;
123      Amount : Natural) return Unsigned_32;
124
125   function Rotate_Right
126     (Value  : Unsigned_32;
127      Amount : Natural) return Unsigned_32;
128
129   function Shift_Left
130     (Value  : Unsigned_64;
131      Amount : Natural) return Unsigned_64;
132
133   function Shift_Right
134     (Value  : Unsigned_64;
135      Amount : Natural) return Unsigned_64;
136
137   function Shift_Right_Arithmetic
138     (Value  : Unsigned_64;
139      Amount : Natural) return Unsigned_64;
140
141   function Rotate_Left
142     (Value  : Unsigned_64;
143      Amount : Natural) return Unsigned_64;
144
145   function Rotate_Right
146     (Value  : Unsigned_64;
147      Amount : Natural) return Unsigned_64;
148
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);
154
155   --  IEEE Floating point types. Note that the form of these definitions
156   --  ensures that the work on VMS, even if the standard library is compiled
157   --  using a Float_Representation pragma for Vax_Float.
158
159   pragma Warnings (Off);
160   --  Turn off warnings for targets not providing IEEE floating-point types
161
162   type IEEE_Float_32 is digits 6;
163   pragma Float_Representation (IEEE_Float, IEEE_Float_32);
164   for IEEE_Float_32'Size use 32;
165
166   type IEEE_Float_64 is digits 15;
167   pragma Float_Representation (IEEE_Float, IEEE_Float_64);
168   for IEEE_Float_64'Size use 64;
169
170   --  If there is an IEEE extended float available on the machine, we assume
171   --  that it is available as Long_Long_Float.
172
173   --  Note: it is harmless, and explicitly permitted, to include additional
174   --  types in interfaces, so it is not wrong to have IEEE_Extended_Float
175   --  defined even if the extended format is not available.
176
177   type IEEE_Extended_Float is new Long_Long_Float;
178
179end Interfaces;
180