Add an UNSPEC_PROLOGUE_USE to prevent the link register from being considered dead.
[official-gcc.git] / gcc / ada / s-vaflop.adb
blobca7b14e436879333195500bdcdc1bf15a67e24e3
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUN-TIME COMPONENTS --
4 -- --
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 --
6 -- --
7 -- B o d y --
8 -- --
9 -- --
10 -- Copyright (C) 1997-2001 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 -- As a special exception, if other files instantiate generics from this --
24 -- unit, or you link this unit with other files to produce an executable, --
25 -- this unit does not by itself cause the resulting executable to be --
26 -- covered by the GNU General Public License. This exception does not --
27 -- however invalidate any other reasons why the executable file might be --
28 -- covered by the GNU Public License. --
29 -- --
30 -- GNAT was originally developed by the GNAT team at New York University. --
31 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 -- --
33 ------------------------------------------------------------------------------
35 -- This is a dummy body for use on non-Alpha systems so that the library
36 -- can compile. This dummy version uses ordinary conversions and other
37 -- arithmetic operations. it is used only for testing purposes in the
38 -- case where the -gnatdm switch is used to force testing of VMS features
39 -- on non-VMS systems.
41 with System.IO; use System.IO;
43 package body System.Vax_Float_Operations is
45 -----------
46 -- Abs_F --
47 -----------
49 function Abs_F (X : F) return F is
50 begin
51 return abs X;
52 end Abs_F;
54 -----------
55 -- Abs_G --
56 -----------
58 function Abs_G (X : G) return G is
59 begin
60 return abs X;
61 end Abs_G;
63 -----------
64 -- Add_F --
65 -----------
67 function Add_F (X, Y : F) return F is
68 begin
69 return X + Y;
70 end Add_F;
72 -----------
73 -- Add_G --
74 -----------
76 function Add_G (X, Y : G) return G is
77 begin
78 return X + Y;
79 end Add_G;
81 ------------
82 -- D_To_G --
83 ------------
85 function D_To_G (X : D) return G is
86 begin
87 return G (X);
88 end D_To_G;
90 --------------------
91 -- Debug_Output_D --
92 --------------------
94 procedure Debug_Output_D (Arg : D) is
95 begin
96 Put (D'Image (Arg));
97 end Debug_Output_D;
99 --------------------
100 -- Debug_Output_F --
101 --------------------
103 procedure Debug_Output_F (Arg : F) is
104 begin
105 Put (F'Image (Arg));
106 end Debug_Output_F;
108 --------------------
109 -- Debug_Output_G --
110 --------------------
112 procedure Debug_Output_G (Arg : G) is
113 begin
114 Put (G'Image (Arg));
115 end Debug_Output_G;
117 --------------------
118 -- Debug_String_D --
119 --------------------
121 Debug_String_Buffer : String (1 .. 32);
122 -- Buffer used by all Debug_String_x routines for returning result
124 function Debug_String_D (Arg : D) return System.Address is
125 Image_String : constant String := D'Image (Arg) & ASCII.NUL;
126 Image_Size : constant Integer := Image_String'Length;
128 begin
129 Debug_String_Buffer (1 .. Image_Size) := Image_String;
130 return Debug_String_Buffer (1)'Address;
131 end Debug_String_D;
133 --------------------
134 -- Debug_String_F --
135 --------------------
137 function Debug_String_F (Arg : F) return System.Address is
138 Image_String : constant String := F'Image (Arg) & ASCII.NUL;
139 Image_Size : constant Integer := Image_String'Length;
141 begin
142 Debug_String_Buffer (1 .. Image_Size) := Image_String;
143 return Debug_String_Buffer (1)'Address;
144 end Debug_String_F;
146 --------------------
147 -- Debug_String_G --
148 --------------------
150 function Debug_String_G (Arg : G) return System.Address is
151 Image_String : constant String := G'Image (Arg) & ASCII.NUL;
152 Image_Size : constant Integer := Image_String'Length;
154 begin
155 Debug_String_Buffer (1 .. Image_Size) := Image_String;
156 return Debug_String_Buffer (1)'Address;
157 end Debug_String_G;
159 -----------
160 -- Div_F --
161 -----------
163 function Div_F (X, Y : F) return F is
164 begin
165 return X / Y;
166 end Div_F;
168 -----------
169 -- Div_G --
170 -----------
172 function Div_G (X, Y : G) return G is
173 begin
174 return X / Y;
175 end Div_G;
177 ----------
178 -- Eq_F --
179 ----------
181 function Eq_F (X, Y : F) return Boolean is
182 begin
183 return X = Y;
184 end Eq_F;
186 ----------
187 -- Eq_G --
188 ----------
190 function Eq_G (X, Y : G) return Boolean is
191 begin
192 return X = Y;
193 end Eq_G;
195 ------------
196 -- F_To_G --
197 ------------
199 function F_To_G (X : F) return G is
200 begin
201 return G (X);
202 end F_To_G;
204 ------------
205 -- F_To_Q --
206 ------------
208 function F_To_Q (X : F) return Q is
209 begin
210 return Q (X);
211 end F_To_Q;
213 ------------
214 -- F_To_S --
215 ------------
217 function F_To_S (X : F) return S is
218 begin
219 return S (X);
220 end F_To_S;
222 ------------
223 -- G_To_D --
224 ------------
226 function G_To_D (X : G) return D is
227 begin
228 return D (X);
229 end G_To_D;
231 ------------
232 -- G_To_F --
233 ------------
235 function G_To_F (X : G) return F is
236 begin
237 return F (X);
238 end G_To_F;
240 ------------
241 -- G_To_Q --
242 ------------
244 function G_To_Q (X : G) return Q is
245 begin
246 return Q (X);
247 end G_To_Q;
249 ------------
250 -- G_To_T --
251 ------------
253 function G_To_T (X : G) return T is
254 begin
255 return T (X);
256 end G_To_T;
258 ----------
259 -- Le_F --
260 ----------
262 function Le_F (X, Y : F) return Boolean is
263 begin
264 return X <= Y;
265 end Le_F;
267 ----------
268 -- Le_G --
269 ----------
271 function Le_G (X, Y : G) return Boolean is
272 begin
273 return X <= Y;
274 end Le_G;
276 ----------
277 -- Lt_F --
278 ----------
280 function Lt_F (X, Y : F) return Boolean is
281 begin
282 return X < Y;
283 end Lt_F;
285 ----------
286 -- Lt_G --
287 ----------
289 function Lt_G (X, Y : G) return Boolean is
290 begin
291 return X < Y;
292 end Lt_G;
294 -----------
295 -- Mul_F --
296 -----------
298 function Mul_F (X, Y : F) return F is
299 begin
300 return X * Y;
301 end Mul_F;
303 -----------
304 -- Mul_G --
305 -----------
307 function Mul_G (X, Y : G) return G is
308 begin
309 return X * Y;
310 end Mul_G;
312 -----------
313 -- Neg_F --
314 -----------
316 function Neg_F (X : F) return F is
317 begin
318 return -X;
319 end Neg_F;
321 -----------
322 -- Neg_G --
323 -----------
325 function Neg_G (X : G) return G is
326 begin
327 return -X;
328 end Neg_G;
330 --------
331 -- pd --
332 --------
334 procedure pd (Arg : D) is
335 begin
336 Put_Line (D'Image (Arg));
337 end pd;
339 --------
340 -- pf --
341 --------
343 procedure pf (Arg : F) is
344 begin
345 Put_Line (F'Image (Arg));
346 end pf;
348 --------
349 -- pg --
350 --------
352 procedure pg (Arg : G) is
353 begin
354 Put_Line (G'Image (Arg));
355 end pg;
357 ------------
358 -- Q_To_F --
359 ------------
361 function Q_To_F (X : Q) return F is
362 begin
363 return F (X);
364 end Q_To_F;
366 ------------
367 -- Q_To_G --
368 ------------
370 function Q_To_G (X : Q) return G is
371 begin
372 return G (X);
373 end Q_To_G;
375 ------------
376 -- S_To_F --
377 ------------
379 function S_To_F (X : S) return F is
380 begin
381 return F (X);
382 end S_To_F;
384 -----------
385 -- Sub_F --
386 -----------
388 function Sub_F (X, Y : F) return F is
389 begin
390 return X - Y;
391 end Sub_F;
393 -----------
394 -- Sub_G --
395 -----------
397 function Sub_G (X, Y : G) return G is
398 begin
399 return X - Y;
400 end Sub_G;
402 ------------
403 -- T_To_D --
404 ------------
406 function T_To_D (X : T) return D is
407 begin
408 return G_To_D (T_To_G (X));
409 end T_To_D;
411 ------------
412 -- T_To_G --
413 ------------
415 function T_To_G (X : T) return G is
416 begin
417 return G (X);
418 end T_To_G;
420 end System.Vax_Float_Operations;