1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
10 -- Copyright (C) 1997-2002, Free Software Foundation, Inc. --
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. --
23 -- GNAT was originally developed by the GNAT team at New York University. --
24 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
26 ------------------------------------------------------------------------------
28 with CStand; use CStand;
29 with Einfo; use Einfo;
31 with Stand; use Stand;
32 with Targparm; use Targparm;
33 with Ttypef; use Ttypef;
35 package body Sem_VFpt is
41 procedure Set_D_Float (E : Entity_Id) is
43 Init_Size (Base_Type (E), 64);
44 Init_Alignment (Base_Type (E));
45 Init_Digits_Value (Base_Type (E), VAXDF_Digits);
46 Set_Vax_Float (Base_Type (E), True);
47 Set_Float_Bounds (Base_Type (E));
51 Init_Digits_Value (E, VAXDF_Digits);
52 Set_Scalar_Range (E, Scalar_Range (Base_Type (E)));
59 procedure Set_F_Float (E : Entity_Id) is
61 Init_Size (Base_Type (E), 32);
62 Init_Alignment (Base_Type (E));
63 Init_Digits_Value (Base_Type (E), VAXFF_Digits);
64 Set_Vax_Float (Base_Type (E), True);
65 Set_Float_Bounds (Base_Type (E));
69 Init_Digits_Value (E, VAXFF_Digits);
70 Set_Scalar_Range (E, Scalar_Range (Base_Type (E)));
77 procedure Set_G_Float (E : Entity_Id) is
79 Init_Size (Base_Type (E), 64);
80 Init_Alignment (Base_Type (E));
81 Init_Digits_Value (Base_Type (E), VAXGF_Digits);
82 Set_Vax_Float (Base_Type (E), True);
83 Set_Float_Bounds (Base_Type (E));
87 Init_Digits_Value (E, VAXGF_Digits);
88 Set_Scalar_Range (E, Scalar_Range (Base_Type (E)));
95 procedure Set_IEEE_Long (E : Entity_Id) is
97 Init_Size (Base_Type (E), 64);
98 Init_Alignment (Base_Type (E));
99 Init_Digits_Value (Base_Type (E), IEEEL_Digits);
100 Set_Vax_Float (Base_Type (E), False);
101 Set_Float_Bounds (Base_Type (E));
105 Init_Digits_Value (E, IEEEL_Digits);
106 Set_Scalar_Range (E, Scalar_Range (Base_Type (E)));
113 procedure Set_IEEE_Short (E : Entity_Id) is
115 Init_Size (Base_Type (E), 32);
116 Init_Alignment (Base_Type (E));
117 Init_Digits_Value (Base_Type (E), IEEES_Digits);
118 Set_Vax_Float (Base_Type (E), False);
119 Set_Float_Bounds (Base_Type (E));
123 Init_Digits_Value (E, IEEES_Digits);
124 Set_Scalar_Range (E, Scalar_Range (Base_Type (E)));
127 ------------------------------
128 -- Set_Standard_Fpt_Formats --
129 ------------------------------
131 procedure Set_Standard_Fpt_Formats is
135 if Opt.Float_Format = 'I' then
136 Set_IEEE_Short (Standard_Float);
137 Set_IEEE_Long (Standard_Long_Float);
138 Set_IEEE_Long (Standard_Long_Long_Float);
143 Set_F_Float (Standard_Float);
145 if Opt.Float_Format_Long = 'D' then
146 Set_D_Float (Standard_Long_Float);
148 Set_G_Float (Standard_Long_Float);
151 -- Note: Long_Long_Float gets set only in the real VMS case,
152 -- because this gives better results for testing out the use
153 -- of VAX float on non-VMS environments with the -gnatdm switch.
155 if OpenVMS_On_Target then
156 Set_G_Float (Standard_Long_Long_Float);
159 end Set_Standard_Fpt_Formats;