1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- S Y S T E M . V A X _ F L O A T _ O P E R A T I O N S --
9 -- Copyright (C) 1997-2001 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 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 ------------------------------------------------------------------------------
34 -- This is a dummy body for use on non-Alpha systems so that the library
35 -- can compile. This dummy version uses ordinary conversions and other
36 -- arithmetic operations. it is used only for testing purposes in the
37 -- case where the -gnatdm switch is used to force testing of VMS features
38 -- on non-VMS systems.
40 with System
.IO
; use System
.IO
;
42 package body System
.Vax_Float_Operations
is
48 function Abs_F
(X
: F
) return F
is
57 function Abs_G
(X
: G
) return G
is
66 function Add_F
(X
, Y
: F
) return F
is
75 function Add_G
(X
, Y
: G
) return G
is
84 function D_To_G
(X
: D
) return G
is
93 procedure Debug_Output_D
(Arg
: D
) is
102 procedure Debug_Output_F
(Arg
: F
) is
111 procedure Debug_Output_G
(Arg
: G
) is
120 Debug_String_Buffer
: String (1 .. 32);
121 -- Buffer used by all Debug_String_x routines for returning result
123 function Debug_String_D
(Arg
: D
) return System
.Address
is
124 Image_String
: constant String := D
'Image (Arg
) & ASCII
.NUL
;
125 Image_Size
: constant Integer := Image_String
'Length;
128 Debug_String_Buffer
(1 .. Image_Size
) := Image_String
;
129 return Debug_String_Buffer
(1)'Address;
136 function Debug_String_F
(Arg
: F
) return System
.Address
is
137 Image_String
: constant String := F
'Image (Arg
) & ASCII
.NUL
;
138 Image_Size
: constant Integer := Image_String
'Length;
141 Debug_String_Buffer
(1 .. Image_Size
) := Image_String
;
142 return Debug_String_Buffer
(1)'Address;
149 function Debug_String_G
(Arg
: G
) return System
.Address
is
150 Image_String
: constant String := G
'Image (Arg
) & ASCII
.NUL
;
151 Image_Size
: constant Integer := Image_String
'Length;
154 Debug_String_Buffer
(1 .. Image_Size
) := Image_String
;
155 return Debug_String_Buffer
(1)'Address;
162 function Div_F
(X
, Y
: F
) return F
is
171 function Div_G
(X
, Y
: G
) return G
is
180 function Eq_F
(X
, Y
: F
) return Boolean is
189 function Eq_G
(X
, Y
: G
) return Boolean is
198 function F_To_G
(X
: F
) return G
is
207 function F_To_Q
(X
: F
) return Q
is
216 function F_To_S
(X
: F
) return S
is
225 function G_To_D
(X
: G
) return D
is
234 function G_To_F
(X
: G
) return F
is
243 function G_To_Q
(X
: G
) return Q
is
252 function G_To_T
(X
: G
) return T
is
261 function Le_F
(X
, Y
: F
) return Boolean is
270 function Le_G
(X
, Y
: G
) return Boolean is
279 function Lt_F
(X
, Y
: F
) return Boolean is
288 function Lt_G
(X
, Y
: G
) return Boolean is
297 function Mul_F
(X
, Y
: F
) return F
is
306 function Mul_G
(X
, Y
: G
) return G
is
315 function Neg_F
(X
: F
) return F
is
324 function Neg_G
(X
: G
) return G
is
333 procedure pd
(Arg
: D
) is
335 Put_Line
(D
'Image (Arg
));
342 procedure pf
(Arg
: F
) is
344 Put_Line
(F
'Image (Arg
));
351 procedure pg
(Arg
: G
) is
353 Put_Line
(G
'Image (Arg
));
360 function Q_To_F
(X
: Q
) return F
is
369 function Q_To_G
(X
: Q
) return G
is
378 function S_To_F
(X
: S
) return F
is
387 function Sub_F
(X
, Y
: F
) return F
is
396 function Sub_G
(X
, Y
: G
) return G
is
405 function T_To_D
(X
: T
) return D
is
407 return G_To_D
(T_To_G
(X
));
414 function T_To_G
(X
: T
) return G
is
419 end System
.Vax_Float_Operations
;