------------------------------------------------------------------------------
-- --
--- GNAT RUNTIME COMPONENTS --
+-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . U N S I G N E D _ T Y P E S --
-- --
-- S p e c --
-- --
--- $Revision$
--- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
--- MA 02111-1307, USA. --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
--- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains definitions of standard unsigned types that
-- correspond in size to the standard signed types declared in Standard.
--- and (unlike the types in Interfaces have corresponding names). It
+-- and (unlike the types in Interfaces) have corresponding names. It
-- also contains some related definitions for other specialized types
-- used by the compiler in connection with packed array types.
+pragma Warnings (Off);
+pragma Compiler_Unit;
+pragma Warnings (On);
+
package System.Unsigned_Types is
-pragma Pure (Unsigned_Types);
+ pragma Pure;
type Short_Short_Unsigned is mod 2 ** Short_Short_Integer'Size;
type Short_Unsigned is mod 2 ** Short_Integer'Size;
type Packed_Bytes1 is array (Natural range <>) of Packed_Byte;
for Packed_Bytes1'Alignment use 1;
+ for Packed_Bytes1'Component_Size use Packed_Byte'Size;
-- This is the type used to implement packed arrays where no alignment
-- is required. This includes the cases of 1,2,4 (where we use direct
-- masking operations), and all odd component sizes (where the clusters
-- for details.
type Packed_Bytes2 is new Packed_Bytes1;
- for Packed_Bytes2'Alignment use 2;
+ for Packed_Bytes2'Alignment use Integer'Min (2, Standard'Maximum_Alignment);
-- This is the type used to implement packed arrays where an alignment
- -- of 2 is helpful for maximum efficiency of the get and set routines
- -- in the corresponding library unit. This is true of all component
- -- sizes that are even but not divisible by 4 (other than 2 for which
- -- we use direct masking operations). In such cases, the clusters can
- -- be assumed to be 2-byte aligned if the array is aligned. See for
+ -- of 2 (is possible) is helpful for maximum efficiency of the get and
+ -- set routines in the corresponding library unit. This is true of all
+ -- component sizes that are even but not divisible by 4 (other than 2 for
+ -- which we use direct masking operations). In such cases, the clusters
+ -- can be assumed to be 2-byte aligned if the array is aligned. See for
-- example System.Pack_10 in file s-pack10).
type Packed_Bytes4 is new Packed_Bytes1;
for Packed_Bytes4'Alignment use Integer'Min (4, Standard'Maximum_Alignment);
-- This is the type used to implement packed arrays where an alignment
- -- of 4 is helpful for maximum efficiency of the get and set routines
- -- in the corresponding library unit. This is true of all component
- -- sizes that are divisible by 4 (other than powers of 2, which are
- -- either handled by direct masking or not packed at all). In such cases
- -- the clusters can be assumed to be 4-byte aligned if the array is
- -- aligned (see System.Pack_12 in file s-pack12 as an example).
+ -- of 4 (if possible) is helpful for maximum efficiency of the get and
+ -- set routines in the corresponding library unit. This is true of all
+ -- component sizes that are divisible by 4 (other than powers of 2, which
+ -- are either handled by direct masking or not packed at all). In such
+ -- cases the clusters can be assumed to be 4-byte aligned if the array
+ -- is aligned (see System.Pack_12 in file s-pack12 as an example).
type Bits_1 is mod 2**1;
type Bits_2 is mod 2**2;
-- Types used for packed array conversions
subtype Bytes_F is Packed_Bytes4 (1 .. Float'Size / 8);
- -- Type used in implementation of Is_Negative instrinsic (see Exp_Intr)
+ -- Type used in implementation of Is_Negative intrinsic (see Exp_Intr)
function Shift_Left
(Value : Short_Short_Unsigned;
- Amount : Natural)
- return Short_Short_Unsigned;
+ Amount : Natural) return Short_Short_Unsigned;
function Shift_Right
(Value : Short_Short_Unsigned;
- Amount : Natural)
- return Short_Short_Unsigned;
+ Amount : Natural) return Short_Short_Unsigned;
function Shift_Right_Arithmetic
(Value : Short_Short_Unsigned;
- Amount : Natural)
- return Short_Short_Unsigned;
+ Amount : Natural) return Short_Short_Unsigned;
function Rotate_Left
(Value : Short_Short_Unsigned;
- Amount : Natural)
- return Short_Short_Unsigned;
+ Amount : Natural) return Short_Short_Unsigned;
function Rotate_Right
(Value : Short_Short_Unsigned;
- Amount : Natural)
- return Short_Short_Unsigned;
+ Amount : Natural) return Short_Short_Unsigned;
function Shift_Left
(Value : Short_Unsigned;
- Amount : Natural)
- return Short_Unsigned;
+ Amount : Natural) return Short_Unsigned;
function Shift_Right
(Value : Short_Unsigned;
- Amount : Natural)
- return Short_Unsigned;
+ Amount : Natural) return Short_Unsigned;
function Shift_Right_Arithmetic
(Value : Short_Unsigned;
- Amount : Natural)
- return Short_Unsigned;
+ Amount : Natural) return Short_Unsigned;
function Rotate_Left
(Value : Short_Unsigned;
- Amount : Natural)
- return Short_Unsigned;
+ Amount : Natural) return Short_Unsigned;
function Rotate_Right
(Value : Short_Unsigned;
- Amount : Natural)
- return Short_Unsigned;
+ Amount : Natural) return Short_Unsigned;
function Shift_Left
(Value : Unsigned;
- Amount : Natural)
- return Unsigned;
+ Amount : Natural) return Unsigned;
function Shift_Right
(Value : Unsigned;
- Amount : Natural)
- return Unsigned;
+ Amount : Natural) return Unsigned;
function Shift_Right_Arithmetic
(Value : Unsigned;
- Amount : Natural)
- return Unsigned;
+ Amount : Natural) return Unsigned;
function Rotate_Left
(Value : Unsigned;
- Amount : Natural)
- return Unsigned;
+ Amount : Natural) return Unsigned;
function Rotate_Right
(Value : Unsigned;
- Amount : Natural)
- return Unsigned;
+ Amount : Natural) return Unsigned;
function Shift_Left
(Value : Long_Unsigned;
- Amount : Natural)
- return Long_Unsigned;
+ Amount : Natural) return Long_Unsigned;
function Shift_Right
(Value : Long_Unsigned;
- Amount : Natural)
- return Long_Unsigned;
+ Amount : Natural) return Long_Unsigned;
function Shift_Right_Arithmetic
(Value : Long_Unsigned;
- Amount : Natural)
- return Long_Unsigned;
+ Amount : Natural) return Long_Unsigned;
function Rotate_Left
(Value : Long_Unsigned;
- Amount : Natural)
- return Long_Unsigned;
+ Amount : Natural) return Long_Unsigned;
function Rotate_Right
(Value : Long_Unsigned;
- Amount : Natural)
- return Long_Unsigned;
+ Amount : Natural) return Long_Unsigned;
function Shift_Left
(Value : Long_Long_Unsigned;
- Amount : Natural)
- return Long_Long_Unsigned;
+ Amount : Natural) return Long_Long_Unsigned;
function Shift_Right
(Value : Long_Long_Unsigned;
- Amount : Natural)
- return Long_Long_Unsigned;
+ Amount : Natural) return Long_Long_Unsigned;
function Shift_Right_Arithmetic
(Value : Long_Long_Unsigned;
- Amount : Natural)
- return Long_Long_Unsigned;
+ Amount : Natural) return Long_Long_Unsigned;
function Rotate_Left
(Value : Long_Long_Unsigned;
- Amount : Natural)
- return Long_Long_Unsigned;
+ Amount : Natural) return Long_Long_Unsigned;
function Rotate_Right
(Value : Long_Long_Unsigned;
- Amount : Natural)
- return Long_Long_Unsigned;
+ Amount : Natural) return Long_Long_Unsigned;
pragma Import (Intrinsic, Shift_Left);
pragma Import (Intrinsic, Shift_Right);