File : s-gccdiv.ads


   1 ------------------------------------------------------------------------------
   2 --                                                                          --
   3 --                         GNAT COMPILER COMPONENTS                         --
   4 --                                                                          --
   5 --                 S Y S T E M . G C C . D I V I S I O N S                  --
   6 --                                                                          --
   7 --                                 S p e c                                  --
   8 --                                                                          --
   9 --            Copyright (C) 2013, Free Software Foundation, Inc.            --
  10 --                                                                          --
  11 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  12 -- terms of the  GNU General Public License as published  by the Free Soft- --
  13 -- ware  Foundation;  either version 3,  or (at your option) any later ver- --
  14 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  15 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  16 -- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
  17 --                                                                          --
  18 --                                                                          --
  19 --                                                                          --
  20 --                                                                          --
  21 --                                                                          --
  22 -- You should have received a copy of the GNU General Public License and    --
  23 -- a copy of the GCC Runtime Library Exception along with this program;     --
  24 -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
  25 -- <http://www.gnu.org/licenses/>.                                          --
  26 --                                                                          --
  27 -- GNAT was originally developed  by the GNAT team at  New York University. --
  28 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
  29 --                                                                          --
  30 ------------------------------------------------------------------------------
  31 
  32 --  Ada implementation of libgcc: 64-bit Divisions
  33 pragma Restrictions (No_Elaboration_Code);
  34 
  35 package System.GCC.Divisions is
  36    pragma Pure;
  37 
  38    function Udivdi3 (Num : Unsigned_64; Den : Unsigned_64) return Unsigned_64;
  39    pragma Export (C, Udivdi3, "__udivdi3");
  40    --  Unsigned division. Raise CE if Den is 0.
  41 
  42    function Umoddi3 (Num : Unsigned_64; Den : Unsigned_64) return Unsigned_64;
  43    pragma Export (C, Umoddi3, "__umoddi3");
  44    --  Unsigned remainder
  45 
  46    function Divdi3 (Num : Integer_64; Den : Integer_64) return Integer_64;
  47    pragma Export (C, Divdi3, "__divdi3");
  48    --  Signed division, without checking overflows
  49 
  50    function Moddi3 (Num : Integer_64; Den : Integer_64) return Integer_64;
  51    pragma Export (C, Moddi3, "__moddi3");
  52    --  Unsigned remainder. This implements the Ada 'rem' operator, without
  53    --  checking overflows.
  54 end System.GCC.Divisions;