(extendsfdf2): Add pattern accidentally deleted when cirrus instructions were
[official-gcc.git] / gcc / ada / exp_fixd.ads
bloba5ac55cf543b3b7847fcd441c434f1cd40b3efba
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- E X P _ F I X D --
6 -- --
7 -- S p e c --
8 -- --
9 -- --
10 -- Copyright (C) 1992,1993,1994 Free Software Foundation, Inc. --
11 -- --
12 -- GNAT is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 2, or (at your option) any later ver- --
15 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNAT; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
21 -- MA 02111-1307, USA. --
22 -- --
23 -- GNAT was originally developed by the GNAT team at New York University. --
24 -- Extensive contributions were provided by Ada Core Technologies Inc. --
25 -- --
26 ------------------------------------------------------------------------------
28 -- Expand routines for fixed-point convert, divide and multiply operations
30 with Types; use Types;
32 package Exp_Fixd is
34 -- General note on universal fixed. In the routines below, a fixed-point
35 -- type is always a specific fixed-point type or universal real, never
36 -- universal fixed. Universal fixed only appears as the result type of a
37 -- division or multplication and in all such cases, the parent node, which
38 -- must be either a conversion node or a 'Round attribute reference node,
39 -- has the specific type information. In both cases, the parent node is
40 -- removed from the tree, and the appropriate routine in this package is
41 -- called with a multiply or divide node with all types (and also possibly
42 -- the Rounded_Result flag) set.
44 ----------------------------
45 -- Fixed-Point Conversion --
46 ----------------------------
48 procedure Expand_Convert_Fixed_To_Fixed (N : Node_Id);
49 -- This routine expands the conversion of one fixed-point type to another,
50 -- N is the N_Op_Conversion node with the result and expression types (and
51 -- possibly the Rounded_Result flag) set.
53 procedure Expand_Convert_Fixed_To_Float (N : Node_Id);
54 -- This routine expands the conversion from a fixed-point type to a
55 -- floating-point type. N is an N_Type_Conversion node with the result
56 -- and expression types set.
58 procedure Expand_Convert_Fixed_To_Integer (N : Node_Id);
59 -- This routine expands the conversion from a fixed-point type to an
60 -- integer type. N is an N_Type_Conversion node with the result and
61 -- operand types set.
63 procedure Expand_Convert_Float_To_Fixed (N : Node_Id);
64 -- This routine expands the conversion from a floating-point type to
65 -- a fixed-point type. N is an N_Type_Conversion node with the result
66 -- and operand types (and possibly the Rounded_Result flag) set.
68 procedure Expand_Convert_Integer_To_Fixed (N : Node_Id);
69 -- This routine expands the conversion from an integer type to a
70 -- fixed-point type. N is an N_Type_Conversion node with the result
71 -- and operand types (and possibly the Rounded_Result flag) set.
73 --------------------------
74 -- Fixed-Point Division --
75 --------------------------
77 procedure Expand_Decimal_Divide_Call (N : Node_Id);
78 -- This routine expands a call to the procedure Decimal.Divide. The
79 -- argument N is the N_Function_Call node.
81 procedure Expand_Divide_Fixed_By_Fixed_Giving_Fixed (N : Node_Id);
82 -- This routine expands the division between fixed-point types, with
83 -- a fixed-point type result. N is an N_Op_Divide node with operand
84 -- and result types (and possibly the Rounded_Result flag) set. Either
85 -- (but not both) of the operands may be universal real.
87 procedure Expand_Divide_Fixed_By_Fixed_Giving_Float (N : Node_Id);
88 -- This routine expands the division between two fixed-point types with
89 -- a floating-point result. N is an N_Op_Divide node with the result
90 -- and operand types set. Either (but not both) of the operands may be
91 -- universal real.
93 procedure Expand_Divide_Fixed_By_Fixed_Giving_Integer (N : Node_Id);
94 -- This routine expands the division between two fixed-point types with
95 -- an integer type result. N is an N_Op_Divide node with the result and
96 -- operand types set. Either (but not both) of the operands may be
97 -- universal real.
99 procedure Expand_Divide_Fixed_By_Integer_Giving_Fixed (N : Node_Id);
100 -- This routine expands the division between a fixed-point type and
101 -- standard integer type. The result type is the same fixed-point type
102 -- as the operand type. N is an N_Op_Divide node with the result and
103 -- left operand types being the fixed-point type, and the right operand
104 -- type being standard integer (and possibly Rounded_Result set).
106 --------------------------------
107 -- Fixed-Point Multiplication --
108 --------------------------------
110 procedure Expand_Multiply_Fixed_By_Fixed_Giving_Fixed (N : Node_Id);
111 -- This routine expands the multiplication between fixed-point types
112 -- with a fixed-point type result. N is an N_Op_Multiply node with the
113 -- result and operand types set. Either (but not both) of the operands
114 -- may be universal real.
116 procedure Expand_Multiply_Fixed_By_Fixed_Giving_Float (N : Node_Id);
117 -- This routine expands the multiplication between two fixed-point types
118 -- with a floating-point result. N is an N_Op_Multiply node with the
119 -- result and operand types set. Either (but not both) of the operands
120 -- may be universal real.
122 procedure Expand_Multiply_Fixed_By_Fixed_Giving_Integer (N : Node_Id);
123 -- This routine expands the multiplication between two fixed-point types
124 -- with an integer result. N is an N_Op_Multiply node with the result
125 -- and operand types set. Either (but not both) of the operands may be
126 -- be universal real.
128 procedure Expand_Multiply_Fixed_By_Integer_Giving_Fixed (N : Node_Id);
129 -- This routine expands the multiplication between a fixed-point type and
130 -- a standard integer type. The result type is the same fixed-point type
131 -- as the fixed operand type. N is an N_Op_Multiply node whose result type
132 -- and left operand types are the fixed-point type, and whose right operand
133 -- type is always standard integer.
135 procedure Expand_Multiply_Integer_By_Fixed_Giving_Fixed (N : Node_Id);
136 -- This routine expands the multiplication between standard integer and a
137 -- fixed-point type. The result type is the same fixed-point type as the
138 -- the fixed operand type. N is an N_Op_Multiply node whose result type
139 -- and right operand types are the fixed-point type, and whose left operand
140 -- type is always standard integer.
142 end Exp_Fixd;