1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1997-2007, Free Software Foundation, Inc. --
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. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
26 with CStand
; use CStand
;
27 with Einfo
; use Einfo
;
29 with Stand
; use Stand
;
30 with Targparm
; use Targparm
;
31 with Ttypef
; use Ttypef
;
33 package body Sem_VFpt
is
39 procedure Set_D_Float
(E
: Entity_Id
) is
41 Init_Size
(Base_Type
(E
), 64);
42 Init_Alignment
(Base_Type
(E
));
43 Init_Digits_Value
(Base_Type
(E
), VAXDF_Digits
);
44 Set_Vax_Float
(Base_Type
(E
), True);
45 Set_Float_Bounds
(Base_Type
(E
));
49 Init_Digits_Value
(E
, VAXDF_Digits
);
50 Set_Scalar_Range
(E
, Scalar_Range
(Base_Type
(E
)));
57 procedure Set_F_Float
(E
: Entity_Id
) is
59 Init_Size
(Base_Type
(E
), 32);
60 Init_Alignment
(Base_Type
(E
));
61 Init_Digits_Value
(Base_Type
(E
), VAXFF_Digits
);
62 Set_Vax_Float
(Base_Type
(E
), True);
63 Set_Float_Bounds
(Base_Type
(E
));
67 Init_Digits_Value
(E
, VAXFF_Digits
);
68 Set_Scalar_Range
(E
, Scalar_Range
(Base_Type
(E
)));
75 procedure Set_G_Float
(E
: Entity_Id
) is
77 Init_Size
(Base_Type
(E
), 64);
78 Init_Alignment
(Base_Type
(E
));
79 Init_Digits_Value
(Base_Type
(E
), VAXGF_Digits
);
80 Set_Vax_Float
(Base_Type
(E
), True);
81 Set_Float_Bounds
(Base_Type
(E
));
85 Init_Digits_Value
(E
, VAXGF_Digits
);
86 Set_Scalar_Range
(E
, Scalar_Range
(Base_Type
(E
)));
93 procedure Set_IEEE_Long
(E
: Entity_Id
) is
95 Init_Size
(Base_Type
(E
), 64);
96 Init_Alignment
(Base_Type
(E
));
97 Init_Digits_Value
(Base_Type
(E
), IEEEL_Digits
);
98 Set_Vax_Float
(Base_Type
(E
), False);
99 Set_Float_Bounds
(Base_Type
(E
));
103 Init_Digits_Value
(E
, IEEEL_Digits
);
104 Set_Scalar_Range
(E
, Scalar_Range
(Base_Type
(E
)));
111 procedure Set_IEEE_Short
(E
: Entity_Id
) is
113 Init_Size
(Base_Type
(E
), 32);
114 Init_Alignment
(Base_Type
(E
));
115 Init_Digits_Value
(Base_Type
(E
), IEEES_Digits
);
116 Set_Vax_Float
(Base_Type
(E
), False);
117 Set_Float_Bounds
(Base_Type
(E
));
121 Init_Digits_Value
(E
, IEEES_Digits
);
122 Set_Scalar_Range
(E
, Scalar_Range
(Base_Type
(E
)));
125 ------------------------------
126 -- Set_Standard_Fpt_Formats --
127 ------------------------------
129 procedure Set_Standard_Fpt_Formats
is
133 if Opt
.Float_Format
= 'I' then
134 Set_IEEE_Short
(Standard_Float
);
135 Set_IEEE_Long
(Standard_Long_Float
);
136 Set_IEEE_Long
(Standard_Long_Long_Float
);
141 Set_F_Float
(Standard_Float
);
143 if Opt
.Float_Format_Long
= 'D' then
144 Set_D_Float
(Standard_Long_Float
);
146 Set_G_Float
(Standard_Long_Float
);
149 -- Note: Long_Long_Float gets set only in the real VMS case,
150 -- because this gives better results for testing out the use
151 -- of VAX float on non-VMS environments with the -gnatdm switch.
153 if OpenVMS_On_Target
then
154 Set_G_Float
(Standard_Long_Long_Float
);
157 end Set_Standard_Fpt_Formats
;