home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / gnat-2.06-src.tgz / tar.out / fsf / gnat / ada / s-unstyp.ads < prev    next >
Text File  |  1996-09-28  |  6KB  |  180 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                          GNAT RUNTIME COMPONENTS                         --
  4. --                                                                          --
  5. --                S Y S T E M . U N S I G N E D _ T Y P E S                 --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.5 $                              --
  10. --                                                                          --
  11. --        Copyright (c) 1992,1993,1994,1995 NYU, All Rights Reserved        --
  12. --                                                                          --
  13. -- The GNAT library is free software; you can redistribute it and/or modify --
  14. -- it under terms of the GNU Library General Public License as published by --
  15. -- the Free Software  Foundation; either version 2, or (at your option) any --
  16. -- later version.  The GNAT library is distributed in the hope that it will --
  17. -- be useful, but WITHOUT ANY WARRANTY;  without even  the implied warranty --
  18. -- of MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR PURPOSE.  See the  GNU --
  19. -- Library  General  Public  License for  more  details.  You  should  have --
  20. -- received  a copy of the GNU  Library  General Public License  along with --
  21. -- the GNAT library;  see the file  COPYING.LIB.  If not, write to the Free --
  22. -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. --  This package contains definitions of standard unsigned types that
  27. --  correspond in size to the standard signed types declared in Standard.
  28. --  and (unlike the types in Interfaces have corresponding names).
  29.  
  30. package System.Unsigned_Types is
  31. pragma Pure (Unsigned_Types);
  32.  
  33.    type Short_Short_Unsigned is mod 2 ** Short_Short_Integer'Size;
  34.    type Short_Unsigned       is mod 2 ** Short_Integer'Size;
  35.    type Unsigned             is mod 2 ** Integer'Size;
  36.    type Long_Unsigned        is mod 2 ** Long_Integer'Size;
  37.    type Long_Long_Unsigned   is mod 2 ** Long_Long_Integer'Size;
  38.  
  39.    type Raw_Bits is array (Natural range <>) of Unsigned;
  40.    --  This is the type used to implement packed arrays
  41.  
  42.    function Shift_Left
  43.      (Value  : Short_Short_Unsigned;
  44.       Amount : Natural)
  45.      return    Short_Short_Unsigned;
  46.  
  47.    function Shift_Right
  48.      (Value  : Short_Short_Unsigned;
  49.       Amount : Natural)
  50.       return   Short_Short_Unsigned;
  51.  
  52.    function Shift_Right_Arithmetic
  53.      (Value  : Short_Short_Unsigned;
  54.       Amount : Natural)
  55.       return   Short_Short_Unsigned;
  56.  
  57.    function Rotate_Left
  58.      (Value  : Short_Short_Unsigned;
  59.       Amount : Natural)
  60.       return   Short_Short_Unsigned;
  61.  
  62.    function Rotate_Right
  63.      (Value  : Short_Short_Unsigned;
  64.       Amount : Natural)
  65.       return   Short_Short_Unsigned;
  66.  
  67.    function Shift_Left
  68.      (Value  : Short_Unsigned;
  69.       Amount : Natural)
  70.      return    Short_Unsigned;
  71.  
  72.    function Shift_Right
  73.      (Value  : Short_Unsigned;
  74.       Amount : Natural)
  75.       return   Short_Unsigned;
  76.  
  77.    function Shift_Right_Arithmetic
  78.      (Value  : Short_Unsigned;
  79.       Amount : Natural)
  80.       return   Short_Unsigned;
  81.  
  82.    function Rotate_Left
  83.      (Value  : Short_Unsigned;
  84.       Amount : Natural)
  85.       return   Short_Unsigned;
  86.  
  87.    function Rotate_Right
  88.      (Value  : Short_Unsigned;
  89.       Amount : Natural)
  90.       return   Short_Unsigned;
  91.  
  92.    function Shift_Left
  93.      (Value  : Unsigned;
  94.       Amount : Natural)
  95.      return    Unsigned;
  96.  
  97.    function Shift_Right
  98.      (Value  : Unsigned;
  99.       Amount : Natural)
  100.       return   Unsigned;
  101.  
  102.    function Shift_Right_Arithmetic
  103.      (Value  : Unsigned;
  104.       Amount : Natural)
  105.       return   Unsigned;
  106.  
  107.    function Rotate_Left
  108.      (Value  : Unsigned;
  109.       Amount : Natural)
  110.       return   Unsigned;
  111.  
  112.    function Rotate_Right
  113.      (Value  : Unsigned;
  114.       Amount : Natural)
  115.       return   Unsigned;
  116.  
  117.    function Shift_Left
  118.      (Value  : Long_Unsigned;
  119.       Amount : Natural)
  120.      return    Long_Unsigned;
  121.  
  122.    function Shift_Right
  123.      (Value  : Long_Unsigned;
  124.       Amount : Natural)
  125.       return   Long_Unsigned;
  126.  
  127.    function Shift_Right_Arithmetic
  128.      (Value  : Long_Unsigned;
  129.       Amount : Natural)
  130.       return   Long_Unsigned;
  131.  
  132.    function Rotate_Left
  133.      (Value  : Long_Unsigned;
  134.       Amount : Natural)
  135.       return   Long_Unsigned;
  136.  
  137.    function Rotate_Right
  138.      (Value  : Long_Unsigned;
  139.       Amount : Natural)
  140.       return   Long_Unsigned;
  141.  
  142.    function Shift_Left
  143.      (Value  : Long_Long_Unsigned;
  144.       Amount : Natural)
  145.      return    Long_Long_Unsigned;
  146.  
  147.    function Shift_Right
  148.      (Value  : Long_Long_Unsigned;
  149.       Amount : Natural)
  150.       return   Long_Long_Unsigned;
  151.  
  152.    function Shift_Right_Arithmetic
  153.      (Value  : Long_Long_Unsigned;
  154.       Amount : Natural)
  155.       return   Long_Long_Unsigned;
  156.  
  157.    function Rotate_Left
  158.      (Value  : Long_Long_Unsigned;
  159.       Amount : Natural)
  160.       return   Long_Long_Unsigned;
  161.  
  162.    function Rotate_Right
  163.      (Value  : Long_Long_Unsigned;
  164.       Amount : Natural)
  165.       return   Long_Long_Unsigned;
  166.  
  167.    pragma Convention (Intrinsic, Shift_Left);
  168.    pragma Convention (Intrinsic, Shift_Right);
  169.    pragma Convention (Intrinsic, Shift_Right_Arithmetic);
  170.    pragma Convention (Intrinsic, Rotate_Left);
  171.    pragma Convention (Intrinsic, Rotate_Right);
  172.  
  173.    pragma Import (Intrinsic, Shift_Left);
  174.    pragma Import (Intrinsic, Shift_Right);
  175.    pragma Import (Intrinsic, Shift_Right_Arithmetic);
  176.    pragma Import (Intrinsic, Rotate_Left);
  177.    pragma Import (Intrinsic, Rotate_Right);
  178.  
  179. end System.Unsigned_Types;
  180.