-
+ C48979C6590F6C76C7BE84FEC5E79E801422EF5557E5D93D17B05BDA33268E4B99A4529E5570E78289E4246E717F8C5E86B7BB6D87FE4DD32906E11F8D815B8Czfp/adainclude/interfac.ads(0 . 0)(1 . 163)
216 ------------------------------------------------------------------------------
217 ------------------------------------------------------------------------------
218 -- You do not have, nor can you ever acquire the right to use, copy or --
219 -- distribute this software ; Should you use this software for any purpose, --
220 -- or copy and distribute it to anyone or in any manner, you are breaking --
221 -- the laws of whatever soi-disant jurisdiction, and you promise to --
222 -- continue doing so for the indefinite future. In any case, please --
223 -- always : read and understand any software ; verify any PGP signatures --
224 -- that you use - for any purpose. --
225 -- --
226 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
227 ------------------------------------------------------------------------------
228 ------------------------------------------------------------------------------
229
230 pragma Compiler_Unit_Warning;
231
232 package Interfaces is
233 pragma No_Elaboration_Code_All;
234 pragma Pure;
235
236 -- All identifiers in this unit are implementation defined
237
238 pragma Implementation_Defined;
239
240 type Integer_8 is range -2 ** 7 .. 2 ** 7 - 1;
241 for Integer_8'Size use 8;
242
243 type Integer_16 is range -2 ** 15 .. 2 ** 15 - 1;
244 for Integer_16'Size use 16;
245
246 type Integer_32 is range -2 ** 31 .. 2 ** 31 - 1;
247 for Integer_32'Size use 32;
248
249 type Integer_64 is new Long_Long_Integer;
250 for Integer_64'Size use 64;
251 -- Note: we use Long_Long_Integer'First instead of -2 ** 63 to allow this
252 -- unit to compile when using custom target configuration files where the
253 -- maximum integer is 32 bits. This is useful for static analysis tools
254 -- such as SPARK or CodePeer. In the normal case Long_Long_Integer is
255 -- always 64-bits so we get the desired 64-bit type.
256
257 type Unsigned_8 is mod 2 ** 8;
258 for Unsigned_8'Size use 8;
259
260 type Unsigned_16 is mod 2 ** 16;
261 for Unsigned_16'Size use 16;
262
263 type Unsigned_24 is mod 2 ** 24;
264 for Unsigned_24'Size use 24;
265 -- Declare this type for compatibility with legacy Ada compilers.
266 -- This is particularly useful in the context of CodePeer analysis.
267
268 type Unsigned_32 is mod 2 ** 32;
269 for Unsigned_32'Size use 32;
270
271 type Unsigned_64 is mod 2 ** Long_Long_Integer'Size;
272 for Unsigned_64'Size use 64;
273 -- See comment on Integer_64 above
274
275 function Shift_Left
276 (Value : Unsigned_8;
277 Amount : Natural) return Unsigned_8;
278
279 function Shift_Right
280 (Value : Unsigned_8;
281 Amount : Natural) return Unsigned_8;
282
283 function Shift_Right_Arithmetic
284 (Value : Unsigned_8;
285 Amount : Natural) return Unsigned_8;
286
287 function Rotate_Left
288 (Value : Unsigned_8;
289 Amount : Natural) return Unsigned_8;
290
291 function Rotate_Right
292 (Value : Unsigned_8;
293 Amount : Natural) return Unsigned_8;
294
295 function Shift_Left
296 (Value : Unsigned_16;
297 Amount : Natural) return Unsigned_16;
298
299 function Shift_Right
300 (Value : Unsigned_16;
301 Amount : Natural) return Unsigned_16;
302
303 function Shift_Right_Arithmetic
304 (Value : Unsigned_16;
305 Amount : Natural) return Unsigned_16;
306
307 function Rotate_Left
308 (Value : Unsigned_16;
309 Amount : Natural) return Unsigned_16;
310
311 function Rotate_Right
312 (Value : Unsigned_16;
313 Amount : Natural) return Unsigned_16;
314
315 function Shift_Left
316 (Value : Unsigned_32;
317 Amount : Natural) return Unsigned_32;
318
319 function Shift_Right
320 (Value : Unsigned_32;
321 Amount : Natural) return Unsigned_32;
322
323 function Shift_Right_Arithmetic
324 (Value : Unsigned_32;
325 Amount : Natural) return Unsigned_32;
326
327 function Rotate_Left
328 (Value : Unsigned_32;
329 Amount : Natural) return Unsigned_32;
330
331 function Rotate_Right
332 (Value : Unsigned_32;
333 Amount : Natural) return Unsigned_32;
334
335 function Shift_Left
336 (Value : Unsigned_64;
337 Amount : Natural) return Unsigned_64;
338
339 function Shift_Right
340 (Value : Unsigned_64;
341 Amount : Natural) return Unsigned_64;
342
343 function Shift_Right_Arithmetic
344 (Value : Unsigned_64;
345 Amount : Natural) return Unsigned_64;
346
347 function Rotate_Left
348 (Value : Unsigned_64;
349 Amount : Natural) return Unsigned_64;
350
351 function Rotate_Right
352 (Value : Unsigned_64;
353 Amount : Natural) return Unsigned_64;
354
355 pragma Import (Intrinsic, Shift_Left);
356 pragma Import (Intrinsic, Shift_Right);
357 pragma Import (Intrinsic, Shift_Right_Arithmetic);
358 pragma Import (Intrinsic, Rotate_Left);
359 pragma Import (Intrinsic, Rotate_Right);
360
361 -- IEEE Floating point types
362
363 type IEEE_Float_32 is digits 6;
364 for IEEE_Float_32'Size use 32;
365
366 type IEEE_Float_64 is digits 15;
367 for IEEE_Float_64'Size use 64;
368
369 -- If there is an IEEE extended float available on the machine, we assume
370 -- that it is available as Long_Long_Float.
371
372 -- Note: it is harmless, and explicitly permitted, to include additional
373 -- types in interfaces, so it is not wrong to have IEEE_Extended_Float
374 -- defined even if the extended format is not available.
375
376 type IEEE_Extended_Float is new Long_Long_Float;
377
378 end Interfaces;