OSDN Git Service

* sem_ch3.adb (Find_Type_Of_Subtype_Indic): If subtype indication
[pf3gnuchains/gcc-fork.git] / gcc / ada / eval_fat.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                             E V A L _ F A T                              --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --                            $Revision: 1.4 $                              --
10 --                                                                          --
11 --          Copyright (C) 1992-2000 Free Software Foundation, Inc.          --
12 --                                                                          --
13 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
14 -- terms of the  GNU General Public License as published  by the Free Soft- --
15 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
16 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
19 -- for  more details.  You should have  received  a copy of the GNU General --
20 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
21 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
22 -- MA 02111-1307, USA.                                                      --
23 --                                                                          --
24 -- GNAT was originally developed  by the GNAT team at  New York University. --
25 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
26 --                                                                          --
27 ------------------------------------------------------------------------------
28
29 --  This package provides for compile-time evaluation of static calls to the
30 --  floating-point attribute functions. It is the compile-time equivalent of
31 --  the System.Fat_Gen runtime package. The coding is quite similar, as are
32 --  the subprogram specs, except that the type is passed as an explicit
33 --  first parameter (and used via ttypes, to obtain the necessary information
34 --  about the characteristics of the type for computing the results.
35
36 with Types;  use Types;
37 with Uintp;  use Uintp;
38 with Urealp; use Urealp;
39
40 package Eval_Fat is
41
42    subtype UI is Uint;
43    --  The compile time representation of universal integer
44
45    subtype T is Ureal;
46    --  The compile time representation of floating-point values
47
48    subtype R is Entity_Id;
49    --  The compile time representation of the floating-point root type
50
51    type Rounding_Mode is (Floor, Ceiling, Round, Round_Even);
52    --  Used to indicate rounding mode for Machine attribute
53
54    Rounding_Was_Biased : Boolean;
55    --  Set if last use of Machine rounded a halfway case away from zero
56
57    function Adjacent          (RT : R; X, Towards : T)              return T;
58
59    function Ceiling           (RT : R; X : T)                       return T;
60
61    function Compose           (RT : R; Fraction : T; Exponent : UI) return T;
62
63    function Copy_Sign         (RT : R; Value, Sign : T)             return T;
64
65    function Exponent          (RT : R; X : T)                       return UI;
66
67    function Floor             (RT : R; X : T)                       return T;
68
69    function Fraction          (RT : R; X : T)                       return T;
70
71    function Leading_Part      (RT : R; X : T; Radix_Digits : UI)    return T;
72
73    function Machine           (RT : R; X : T; Mode : Rounding_Mode) return T;
74
75    function Model             (RT : R; X : T)                       return T;
76
77    function Pred              (RT : R; X : T)                       return T;
78
79    function Remainder         (RT : R; X, Y : T)                    return T;
80
81    function Rounding          (RT : R; X : T)                       return T;
82
83    function Scaling           (RT : R; X : T; Adjustment : UI)      return T;
84
85    function Succ              (RT : R; X : T)                       return T;
86
87    function Truncation        (RT : R; X : T)                       return T;
88
89    function Unbiased_Rounding (RT : R; X : T)                       return T;
90
91 end Eval_Fat;