Package: LSC.Ops64

Dependencies

with LSC.Types;
use type LSC.Types.Word64;
 inherit LSC.Types;

Description

Operations over 64-bit words

Header

package LSC.Ops64 is
 

Other Items:

function XOR2 (V0, V1 : Types.Word64) return Types.Word64;
pragma Inline (XOR2);
Perform XOR on two 64-bit words V0 and V1
 return V0 xor V1;

procedure Block_XOR
  (Left   : in     Types.Word64_Array_Type;
   Right  : in     Types.Word64_Array_Type;
   Result :    out Types.Word64_Array_Type);
pragma Inline (Block_XOR);
Perform XOR on two arrays of 64-bit words

Left - First input array
Right - Second input array
Result - Result array

 derives
   Result from Left, Right;
 pre
   Left'First  = Right'First and
   Left'Last   = Right'Last  and
   Right'First = Result'First and
   Right'Last  = Result'Last;
 post
   (for all I in Types.Index range Left'First .. Left'Last =>
        (Result (I) = XOR2 (Left (I), Right (I))));

function Bytes_To_Word
   (Byte0 : Types.Byte;
    Byte1 : Types.Byte;
    Byte2 : Types.Byte;
    Byte3 : Types.Byte;
    Byte4 : Types.Byte;
    Byte5 : Types.Byte;
    Byte6 : Types.Byte;
    Byte7 : Types.Byte) return Types.Word64;
pragma Inline (Bytes_To_Word);
Convert the eight byte values Byte0 .. Byte7 to a 64-bit word

procedure Block_Copy
   (Source : in     Types.Word64_Array_Type;
    Dest   : in out Types.Word64_Array_Type);
pragma Inline (Block_Copy);
Copy all elements of Source to Dest. Should Source be shorter than Dest, remaining elements stay unchanged.
 derives
   Dest from *, Source;
 pre
   Source'First  = Dest'First and
   Source'Last  <= Dest'Last;
 post
   (for all P in Types.Index range Source'First .. Source'Last =>
       (Dest (P) = Source (P)));
end LSC.Ops64;