1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1997-2002, 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 2, 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 COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
25 ------------------------------------------------------------------------------
27 with CStand
; use CStand
;
28 with Einfo
; use Einfo
;
30 with Stand
; use Stand
;
31 with Targparm
; use Targparm
;
32 with Ttypef
; use Ttypef
;
34 package body Sem_VFpt
is
40 procedure Set_D_Float
(E
: Entity_Id
) is
42 Init_Size
(Base_Type
(E
), 64);
43 Init_Alignment
(Base_Type
(E
));
44 Init_Digits_Value
(Base_Type
(E
), VAXDF_Digits
);
45 Set_Vax_Float
(Base_Type
(E
), True);
46 Set_Float_Bounds
(Base_Type
(E
));
50 Init_Digits_Value
(E
, VAXDF_Digits
);
51 Set_Scalar_Range
(E
, Scalar_Range
(Base_Type
(E
)));
58 procedure Set_F_Float
(E
: Entity_Id
) is
60 Init_Size
(Base_Type
(E
), 32);
61 Init_Alignment
(Base_Type
(E
));
62 Init_Digits_Value
(Base_Type
(E
), VAXFF_Digits
);
63 Set_Vax_Float
(Base_Type
(E
), True);
64 Set_Float_Bounds
(Base_Type
(E
));
68 Init_Digits_Value
(E
, VAXFF_Digits
);
69 Set_Scalar_Range
(E
, Scalar_Range
(Base_Type
(E
)));
76 procedure Set_G_Float
(E
: Entity_Id
) is
78 Init_Size
(Base_Type
(E
), 64);
79 Init_Alignment
(Base_Type
(E
));
80 Init_Digits_Value
(Base_Type
(E
), VAXGF_Digits
);
81 Set_Vax_Float
(Base_Type
(E
), True);
82 Set_Float_Bounds
(Base_Type
(E
));
86 Init_Digits_Value
(E
, VAXGF_Digits
);
87 Set_Scalar_Range
(E
, Scalar_Range
(Base_Type
(E
)));
94 procedure Set_IEEE_Long
(E
: Entity_Id
) is
96 Init_Size
(Base_Type
(E
), 64);
97 Init_Alignment
(Base_Type
(E
));
98 Init_Digits_Value
(Base_Type
(E
), IEEEL_Digits
);
99 Set_Vax_Float
(Base_Type
(E
), False);
100 Set_Float_Bounds
(Base_Type
(E
));
104 Init_Digits_Value
(E
, IEEEL_Digits
);
105 Set_Scalar_Range
(E
, Scalar_Range
(Base_Type
(E
)));
112 procedure Set_IEEE_Short
(E
: Entity_Id
) is
114 Init_Size
(Base_Type
(E
), 32);
115 Init_Alignment
(Base_Type
(E
));
116 Init_Digits_Value
(Base_Type
(E
), IEEES_Digits
);
117 Set_Vax_Float
(Base_Type
(E
), False);
118 Set_Float_Bounds
(Base_Type
(E
));
122 Init_Digits_Value
(E
, IEEES_Digits
);
123 Set_Scalar_Range
(E
, Scalar_Range
(Base_Type
(E
)));
126 ------------------------------
127 -- Set_Standard_Fpt_Formats --
128 ------------------------------
130 procedure Set_Standard_Fpt_Formats
is
134 if Opt
.Float_Format
= 'I' then
135 Set_IEEE_Short
(Standard_Float
);
136 Set_IEEE_Long
(Standard_Long_Float
);
137 Set_IEEE_Long
(Standard_Long_Long_Float
);
142 Set_F_Float
(Standard_Float
);
144 if Opt
.Float_Format_Long
= 'D' then
145 Set_D_Float
(Standard_Long_Float
);
147 Set_G_Float
(Standard_Long_Float
);
150 -- Note: Long_Long_Float gets set only in the real VMS case,
151 -- because this gives better results for testing out the use
152 -- of VAX float on non-VMS environments with the -gnatdm switch.
154 if OpenVMS_On_Target
then
155 Set_G_Float
(Standard_Long_Long_Float
);
158 end Set_Standard_Fpt_Formats
;