--  Interfaces (RM B.2): integer types of each size, and the shift and rotate functions of
--  the unsigned ones, which Verada defines for any amount: a shift by the size or more gives 0
--  (or, arithmetically, the sign in every bit), a rotation goes round modulo the size.
package Interfaces with Pure is
   type Integer_8 is range -2 ** (8 - 1) .. 2 ** (8 - 1) - 1;
   type Integer_16 is range -2 ** (16 - 1) .. 2 ** (16 - 1) - 1;
   type Integer_32 is range -2 ** (32 - 1) .. 2 ** (32 - 1) - 1;
   type Integer_64 is range -2 ** (64 - 1) .. 2 ** (64 - 1) - 1;
   type Unsigned_8 is mod 2 ** 8;
   type Unsigned_16 is mod 2 ** 16;
   type Unsigned_32 is mod 2 ** 32;
   type Unsigned_64 is mod 2 ** 64;

   function Shift_Left (Value : Unsigned_8; Amount : Natural) return Unsigned_8
     with Import, Convention => Intrinsic, Global => null;
   function Shift_Right (Value : Unsigned_8; Amount : Natural) return Unsigned_8
     with Import, Convention => Intrinsic, Global => null;
   function Shift_Right_Arithmetic (Value : Unsigned_8; Amount : Natural) return Unsigned_8
     with Import, Convention => Intrinsic, Global => null;
   function Rotate_Left (Value : Unsigned_8; Amount : Natural) return Unsigned_8
     with Import, Convention => Intrinsic, Global => null;
   function Rotate_Right (Value : Unsigned_8; Amount : Natural) return Unsigned_8
     with Import, Convention => Intrinsic, Global => null;

   function Shift_Left (Value : Unsigned_16; Amount : Natural) return Unsigned_16
     with Import, Convention => Intrinsic, Global => null;
   function Shift_Right (Value : Unsigned_16; Amount : Natural) return Unsigned_16
     with Import, Convention => Intrinsic, Global => null;
   function Shift_Right_Arithmetic (Value : Unsigned_16; Amount : Natural) return Unsigned_16
     with Import, Convention => Intrinsic, Global => null;
   function Rotate_Left (Value : Unsigned_16; Amount : Natural) return Unsigned_16
     with Import, Convention => Intrinsic, Global => null;
   function Rotate_Right (Value : Unsigned_16; Amount : Natural) return Unsigned_16
     with Import, Convention => Intrinsic, Global => null;

   function Shift_Left (Value : Unsigned_32; Amount : Natural) return Unsigned_32
     with Import, Convention => Intrinsic, Global => null;
   function Shift_Right (Value : Unsigned_32; Amount : Natural) return Unsigned_32
     with Import, Convention => Intrinsic, Global => null;
   function Shift_Right_Arithmetic (Value : Unsigned_32; Amount : Natural) return Unsigned_32
     with Import, Convention => Intrinsic, Global => null;
   function Rotate_Left (Value : Unsigned_32; Amount : Natural) return Unsigned_32
     with Import, Convention => Intrinsic, Global => null;
   function Rotate_Right (Value : Unsigned_32; Amount : Natural) return Unsigned_32
     with Import, Convention => Intrinsic, Global => null;

   function Shift_Left (Value : Unsigned_64; Amount : Natural) return Unsigned_64
     with Import, Convention => Intrinsic, Global => null;
   function Shift_Right (Value : Unsigned_64; Amount : Natural) return Unsigned_64
     with Import, Convention => Intrinsic, Global => null;
   function Shift_Right_Arithmetic (Value : Unsigned_64; Amount : Natural) return Unsigned_64
     with Import, Convention => Intrinsic, Global => null;
   function Rotate_Left (Value : Unsigned_64; Amount : Natural) return Unsigned_64
     with Import, Convention => Intrinsic, Global => null;
   function Rotate_Right (Value : Unsigned_64; Amount : Natural) return Unsigned_64
     with Import, Convention => Intrinsic, Global => null;

end Interfaces;
