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-2015, 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 new Long_Long_Integer; 55 for Integer_64'Size use 64; 56 -- Note: we use Long_Long_Integer'First instead of -2 ** 63 to allow this 57 -- unit to compile when using custom target configuration files where the 58 -- maximum integer is 32 bits. This is useful for static analysis tools 59 -- such as SPARK or CodePeer. In the normal case Long_Long_Integer is 60 -- always 64-bits so we get the desired 64-bit type. 61 62 type Unsigned_8 is mod 2 ** 8; 63 for Unsigned_8'Size use 8; 64 65 type Unsigned_16 is mod 2 ** 16; 66 for Unsigned_16'Size use 16; 67 68 type Unsigned_24 is mod 2 ** 24; 69 for Unsigned_24'Size use 24; 70 -- Declare this type for compatibility with legacy Ada compilers. 71 -- This is particularly useful in the context of CodePeer analysis. 72 73 type Unsigned_32 is mod 2 ** 32; 74 for Unsigned_32'Size use 32; 75 76 type Unsigned_64 is mod 2 ** Long_Long_Integer'Size; 77 for Unsigned_64'Size use 64; 78 -- See comment on Integer_64 above 79 80 function Shift_Left 81 (Value : Unsigned_8; 82 Amount : Natural) return Unsigned_8; 83 84 function Shift_Right 85 (Value : Unsigned_8; 86 Amount : Natural) return Unsigned_8; 87 88 function Shift_Right_Arithmetic 89 (Value : Unsigned_8; 90 Amount : Natural) return Unsigned_8; 91 92 function Rotate_Left 93 (Value : Unsigned_8; 94 Amount : Natural) return Unsigned_8; 95 96 function Rotate_Right 97 (Value : Unsigned_8; 98 Amount : Natural) return Unsigned_8; 99 100 function Shift_Left 101 (Value : Unsigned_16; 102 Amount : Natural) return Unsigned_16; 103 104 function Shift_Right 105 (Value : Unsigned_16; 106 Amount : Natural) return Unsigned_16; 107 108 function Shift_Right_Arithmetic 109 (Value : Unsigned_16; 110 Amount : Natural) return Unsigned_16; 111 112 function Rotate_Left 113 (Value : Unsigned_16; 114 Amount : Natural) return Unsigned_16; 115 116 function Rotate_Right 117 (Value : Unsigned_16; 118 Amount : Natural) return Unsigned_16; 119 120 function Shift_Left 121 (Value : Unsigned_32; 122 Amount : Natural) return Unsigned_32; 123 124 function Shift_Right 125 (Value : Unsigned_32; 126 Amount : Natural) return Unsigned_32; 127 128 function Shift_Right_Arithmetic 129 (Value : Unsigned_32; 130 Amount : Natural) return Unsigned_32; 131 132 function Rotate_Left 133 (Value : Unsigned_32; 134 Amount : Natural) return Unsigned_32; 135 136 function Rotate_Right 137 (Value : Unsigned_32; 138 Amount : Natural) return Unsigned_32; 139 140 function Shift_Left 141 (Value : Unsigned_64; 142 Amount : Natural) return Unsigned_64; 143 144 function Shift_Right 145 (Value : Unsigned_64; 146 Amount : Natural) return Unsigned_64; 147 148 function Shift_Right_Arithmetic 149 (Value : Unsigned_64; 150 Amount : Natural) return Unsigned_64; 151 152 function Rotate_Left 153 (Value : Unsigned_64; 154 Amount : Natural) return Unsigned_64; 155 156 function Rotate_Right 157 (Value : Unsigned_64; 158 Amount : Natural) return Unsigned_64; 159 160 pragma Import (Intrinsic, Shift_Left); 161 pragma Import (Intrinsic, Shift_Right); 162 pragma Import (Intrinsic, Shift_Right_Arithmetic); 163 pragma Import (Intrinsic, Rotate_Left); 164 pragma Import (Intrinsic, Rotate_Right); 165 166 -- IEEE Floating point types 167 168 type IEEE_Float_32 is digits 6; 169 for IEEE_Float_32'Size use 32; 170 171 type IEEE_Float_64 is digits 15; 172 for IEEE_Float_64'Size use 64; 173 174 -- If there is an IEEE extended float available on the machine, we assume 175 -- that it is available as Long_Long_Float. 176 177 -- Note: it is harmless, and explicitly permitted, to include additional 178 -- types in interfaces, so it is not wrong to have IEEE_Extended_Float 179 -- defined even if the extended format is not available. 180 181 type IEEE_Extended_Float is new Long_Long_Float; 182 183end Interfaces; 184