summaryrefslogtreecommitdiff
path: root/gcc/ada/s-vaflop-vms-alpha.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-09 17:22:27 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-09 17:22:27 +0000
commit35c57fc720ac63d3be352909ae6d632cdc471e2f (patch)
treef46bd0af548bfccb03517361320e56ee5495f7ef /gcc/ada/s-vaflop-vms-alpha.adb
parentbd37928a673302850dde269668de10d0cebd3a08 (diff)
downloadgcc-35c57fc720ac63d3be352909ae6d632cdc471e2f.tar.gz
2005-12-05 Robert Dewar <dewar@adacore.com>
* i-c.adb, i-cexten.ads, i-cobol.adb, i-cobol.ads, i-cpoint.ads, i-cpp.adb, i-cpp.ads, i-cstrea.ads, i-cstrin.adb, i-cstrin.ads, inline.adb, interfac.ads, i-os2err.ads, i-os2lib.ads, i-os2syn.ads, i-os2thr.ads, itypes.adb, itypes.adb, itypes.ads, krunch.ads, krunch.adb, lib.adb, lib.ads, lib-list.adb, lib-load.adb, lib-load.ads, lib-sort.adb, live.adb, make.ads, i-cstrea-vms.adb, interfac-vms.ads, makegpr.adb, indepsw-gnu.adb, indepsw.ads, s-wchcon.ads, sdefault.ads, sem_ch10.adb, sem_eval.ads: Minor reformatting. 2005-12-05 Robert Dewar <dewar@adacore.com> * s-vaflop-vms-alpha.adb: (Ne_F): New function (Ne_G): New function * exp_ch4.adb (Expand_Allocator_Expression): Factor duplicated code for tag assignment. (Rewrite_Comparison): Handle case where operation is not a comparison and ignore, and also handle type conversion case. 2005-12-05 Thomas Quinot <quinot@adacore.com> * exp_aggr.ads: Fix typo in comment. ???-mark Convert_Aggr_In_Assignment as needing documentation. 2005-12-05 Gary Dismukes <dismukes@adacore.com> * layout.adb: Replace various uses of byte by storage unit throughout. (Get_Max_SU_Size): Name changed from Get_Max_Size. In the case of a static size, convert to storage units before returning, to conform to spec. 2005-12-05 Matthew Gingell <gingell@adacore.com> * g-exctra.ads: Fix typo in comment. 2005-12-05 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * utils.c: Minor reformatting. 2005-12-05 Robert Dewar <dewar@adacore.com> * g-soccon.ads: Further comment fixes to make the status of the default file clear * s-bitops.adb: Clarify comment for Bits_Array git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108308 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-vaflop-vms-alpha.adb')
-rw-r--r--gcc/ada/s-vaflop-vms-alpha.adb101
1 files changed, 50 insertions, 51 deletions
diff --git a/gcc/ada/s-vaflop-vms-alpha.adb b/gcc/ada/s-vaflop-vms-alpha.adb
index 5ab772d4477..92e62734ee7 100644
--- a/gcc/ada/s-vaflop-vms-alpha.adb
+++ b/gcc/ada/s-vaflop-vms-alpha.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1997-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2005, Free Software Foundation, Inc. --
-- (Version for Alpha OpenVMS) --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
@@ -58,14 +58,16 @@ package body System.Vax_Float_Operations is
-- we define variables of the corresponding IEEE type so that they are
-- passed and kept in the proper register class.
+ Debug_String_Buffer : String (1 .. 32);
+ -- Buffer used by all Debug_String_x routines for returning result
+
------------
-- D_To_G --
------------
function D_To_G (X : D) return G is
A, B : T;
- C : G;
-
+ C : G;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), D'Asm_Input ("m", X));
Asm ("cvtdg %1,%0", T'Asm_Output ("=f", B), T'Asm_Input ("f", A));
@@ -80,7 +82,6 @@ package body System.Vax_Float_Operations is
function F_To_G (X : F) return G is
A : T;
B : G;
-
begin
Asm ("ldf %0,%1", T'Asm_Output ("=f", A), F'Asm_Input ("m", X));
Asm ("stg %1,%0", G'Asm_Output ("=m", B), T'Asm_Input ("f", A));
@@ -98,6 +99,7 @@ package body System.Vax_Float_Operations is
begin
-- Because converting to a wider FP format is a no-op, we say
-- A is 64-bit even though we are loading 32 bits into it.
+
Asm ("ldf %0,%1", T'Asm_Output ("=f", A), F'Asm_Input ("m", X));
B := S (Cvt_G_T (A));
@@ -110,8 +112,7 @@ package body System.Vax_Float_Operations is
function G_To_D (X : G) return D is
A, B : T;
- C : D;
-
+ C : D;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X));
Asm ("cvtgd %1,%0", T'Asm_Output ("=f", B), T'Asm_Input ("f", A));
@@ -127,7 +128,6 @@ package body System.Vax_Float_Operations is
A : T;
B : S;
C : F;
-
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X));
Asm ("cvtgf %1,%0", S'Asm_Output ("=f", B), T'Asm_Input ("f", A));
@@ -142,7 +142,6 @@ package body System.Vax_Float_Operations is
function G_To_Q (X : G) return Q is
A : T;
B : Q;
-
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X));
Asm ("cvtgq %1,%0", Q'Asm_Output ("=f", B), T'Asm_Input ("f", A));
@@ -155,7 +154,6 @@ package body System.Vax_Float_Operations is
function G_To_T (X : G) return T is
A, B : T;
-
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X));
B := Cvt_G_T (A);
@@ -178,7 +176,6 @@ package body System.Vax_Float_Operations is
function Q_To_F (X : Q) return F is
A : S;
B : F;
-
begin
Asm ("cvtqf %1,%0", S'Asm_Output ("=f", A), Q'Asm_Input ("f", X));
Asm ("stf %1,%0", F'Asm_Output ("=m", B), S'Asm_Input ("f", A));
@@ -192,7 +189,6 @@ package body System.Vax_Float_Operations is
function Q_To_G (X : Q) return G is
A : T;
B : G;
-
begin
Asm ("cvtqg %1,%0", T'Asm_Output ("=f", A), Q'Asm_Input ("f", X));
Asm ("stg %1,%0", G'Asm_Output ("=m", B), T'Asm_Input ("f", A));
@@ -206,7 +202,6 @@ package body System.Vax_Float_Operations is
function S_To_F (X : S) return F is
A : S;
B : F;
-
begin
A := Cvt_T_F (T (X));
Asm ("stf %1,%0", F'Asm_Output ("=m", B), S'Asm_Input ("f", A));
@@ -229,7 +224,6 @@ package body System.Vax_Float_Operations is
function T_To_G (X : T) return G is
A : T;
B : G;
-
begin
A := Cvt_T_G (X);
Asm ("stg %1,%0", G'Asm_Output ("=m", B), T'Asm_Input ("f", A));
@@ -242,8 +236,7 @@ package body System.Vax_Float_Operations is
function Abs_F (X : F) return F is
A, B : S;
- C : F;
-
+ C : F;
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", A), F'Asm_Input ("m", X));
Asm ("cpys $f31,%1,%0", S'Asm_Output ("=f", B), S'Asm_Input ("f", A));
@@ -257,8 +250,7 @@ package body System.Vax_Float_Operations is
function Abs_G (X : G) return G is
A, B : T;
- C : G;
-
+ C : G;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X));
Asm ("cpys $f31,%1,%0", T'Asm_Output ("=f", B), T'Asm_Input ("f", A));
@@ -272,8 +264,7 @@ package body System.Vax_Float_Operations is
function Add_F (X, Y : F) return F is
X1, Y1, R : S;
- R1 : F;
-
+ R1 : F;
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X));
Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y));
@@ -289,8 +280,7 @@ package body System.Vax_Float_Operations is
function Add_G (X, Y : G) return G is
X1, Y1, R : T;
- R1 : G;
-
+ R1 : G;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X));
Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y));
@@ -331,13 +321,9 @@ package body System.Vax_Float_Operations is
-- Debug_String_D --
--------------------
- Debug_String_Buffer : String (1 .. 32);
- -- Buffer used by all Debug_String_x routines for returning result
-
function Debug_String_D (Arg : D) return System.Address is
- Image_String : constant String := D'Image (Arg) & ASCII.NUL;
+ Image_String : constant String := D'Image (Arg) & ASCII.NUL;
Image_Size : constant Integer := Image_String'Length;
-
begin
Debug_String_Buffer (1 .. Image_Size) := Image_String;
return Debug_String_Buffer (1)'Address;
@@ -348,9 +334,8 @@ package body System.Vax_Float_Operations is
--------------------
function Debug_String_F (Arg : F) return System.Address is
- Image_String : constant String := F'Image (Arg) & ASCII.NUL;
+ Image_String : constant String := F'Image (Arg) & ASCII.NUL;
Image_Size : constant Integer := Image_String'Length;
-
begin
Debug_String_Buffer (1 .. Image_Size) := Image_String;
return Debug_String_Buffer (1)'Address;
@@ -361,9 +346,8 @@ package body System.Vax_Float_Operations is
--------------------
function Debug_String_G (Arg : G) return System.Address is
- Image_String : constant String := G'Image (Arg) & ASCII.NUL;
+ Image_String : constant String := G'Image (Arg) & ASCII.NUL;
Image_Size : constant Integer := Image_String'Length;
-
begin
Debug_String_Buffer (1 .. Image_Size) := Image_String;
return Debug_String_Buffer (1)'Address;
@@ -375,8 +359,7 @@ package body System.Vax_Float_Operations is
function Div_F (X, Y : F) return F is
X1, Y1, R : S;
-
- R1 : F;
+ R1 : F;
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X));
Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y));
@@ -392,8 +375,7 @@ package body System.Vax_Float_Operations is
function Div_G (X, Y : G) return G is
X1, Y1, R : T;
- R1 : G;
-
+ R1 : G;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X));
Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y));
@@ -409,7 +391,6 @@ package body System.Vax_Float_Operations is
function Eq_F (X, Y : F) return Boolean is
X1, Y1, R : S;
-
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X));
Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y));
@@ -424,7 +405,6 @@ package body System.Vax_Float_Operations is
function Eq_G (X, Y : G) return Boolean is
X1, Y1, R : T;
-
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X));
Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y));
@@ -439,7 +419,6 @@ package body System.Vax_Float_Operations is
function Le_F (X, Y : F) return Boolean is
X1, Y1, R : S;
-
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X));
Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y));
@@ -454,7 +433,6 @@ package body System.Vax_Float_Operations is
function Le_G (X, Y : G) return Boolean is
X1, Y1, R : T;
-
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X));
Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y));
@@ -469,7 +447,6 @@ package body System.Vax_Float_Operations is
function Lt_F (X, Y : F) return Boolean is
X1, Y1, R : S;
-
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X));
Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y));
@@ -484,7 +461,6 @@ package body System.Vax_Float_Operations is
function Lt_G (X, Y : G) return Boolean is
X1, Y1, R : T;
-
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X));
Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y));
@@ -499,8 +475,7 @@ package body System.Vax_Float_Operations is
function Mul_F (X, Y : F) return F is
X1, Y1, R : S;
- R1 : F;
-
+ R1 : F;
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X));
Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y));
@@ -516,8 +491,7 @@ package body System.Vax_Float_Operations is
function Mul_G (X, Y : G) return G is
X1, Y1, R : T;
- R1 : G;
-
+ R1 : G;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X));
Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y));
@@ -527,14 +501,41 @@ package body System.Vax_Float_Operations is
return R1;
end Mul_G;
+ ----------
+ -- Ne_F --
+ ----------
+
+ function Ne_F (X, Y : F) return Boolean is
+ X1, Y1, R : S;
+ begin
+ Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X));
+ Asm ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y));
+ Asm ("cmpgeq %1,%2,%0", S'Asm_Output ("=f", R),
+ (S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1)));
+ return R = 0.0;
+ end Ne_F;
+
+ ----------
+ -- Ne_G --
+ ----------
+
+ function Ne_G (X, Y : G) return Boolean is
+ X1, Y1, R : T;
+ begin
+ Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X));
+ Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y));
+ Asm ("cmpgeq %1,%2,%0", T'Asm_Output ("=f", R),
+ (T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1)));
+ return R = 0.0;
+ end Ne_G;
+
-----------
-- Neg_F --
-----------
function Neg_F (X : F) return F is
A, B : S;
- C : F;
-
+ C : F;
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", A), F'Asm_Input ("m", X));
Asm ("cpysn %1,%1,%0", S'Asm_Output ("=f", B), S'Asm_Input ("f", A));
@@ -548,8 +549,7 @@ package body System.Vax_Float_Operations is
function Neg_G (X : G) return G is
A, B : T;
- C : G;
-
+ C : G;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X));
Asm ("cpysn %1,%1,%0", T'Asm_Output ("=f", B), T'Asm_Input ("f", A));
@@ -590,7 +590,7 @@ package body System.Vax_Float_Operations is
function Sub_F (X, Y : F) return F is
X1, Y1, R : S;
- R1 : F;
+ R1 : F;
begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X));
@@ -607,8 +607,7 @@ package body System.Vax_Float_Operations is
function Sub_G (X, Y : G) return G is
X1, Y1, R : T;
- R1 : G;
-
+ R1 : G;
begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X));
Asm ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y));