Commit e0ae4e94 by Robert Dewar Committed by Arnaud Charlet

s-osinte-tru64.adb: Mark Asm statements Volatile to prevent warnings (seems a reasonable change...

2006-10-31  Robert Dewar  <dewar@adacore.com>

	* s-osinte-tru64.adb: 
	Mark Asm statements Volatile to prevent warnings (seems a
	reasonable change anyway)
	Fixes new warnings

	* s-mastop-irix.adb: Add Volatile to Asm statements
	Suppresses warning, and seems appropriate in any case

	* s-osinte-vms.adb: Add Volatile to Asm statement

	* s-vaflop-vms-alpha.adb: Add Volatile to Asm statements

	* exp_code.ads, exp_code.adb (Asm_Input_Value): Note that Error can be
	returned.
	Add call to Check_Code_Statement

From-SVN: r118329
parent ba1cbfb9
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1996-2004 Free Software Foundation, Inc. -- -- Copyright (C) 1996-2006, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -36,6 +36,7 @@ with Opt; use Opt; ...@@ -36,6 +36,7 @@ with Opt; use Opt;
with Rtsfind; use Rtsfind; with Rtsfind; use Rtsfind;
with Sem_Eval; use Sem_Eval; with Sem_Eval; use Sem_Eval;
with Sem_Util; use Sem_Util; with Sem_Util; use Sem_Util;
with Sem_Warn; use Sem_Warn;
with Sinfo; use Sinfo; with Sinfo; use Sinfo;
with Stringt; use Stringt; with Stringt; use Stringt;
with Tbuild; use Tbuild; with Tbuild; use Tbuild;
...@@ -124,6 +125,8 @@ package body Exp_Code is ...@@ -124,6 +125,8 @@ package body Exp_Code is
begin begin
if No (Operand_Var) then if No (Operand_Var) then
return Empty; return Empty;
elsif Error_Posted (Operand_Var) then
return Error;
else else
return Next (First (Expressions (Operand_Var))); return Next (First (Expressions (Operand_Var)));
end if; end if;
...@@ -227,7 +230,6 @@ package body Exp_Code is ...@@ -227,7 +230,6 @@ package body Exp_Code is
Name_Buffer (Name_Len + 1) := ASCII.NUL; Name_Buffer (Name_Len + 1) := ASCII.NUL;
return Name_Buffer'Address; return Name_Buffer'Address;
end Clobber_Get_Next; end Clobber_Get_Next;
------------------- -------------------
...@@ -240,12 +242,10 @@ package body Exp_Code is ...@@ -240,12 +242,10 @@ package body Exp_Code is
Next_Actual ( Next_Actual (
Next_Actual ( Next_Actual (
First_Actual (Call)))); First_Actual (Call))));
begin begin
if not Is_OK_Static_Expression (Clob) then if not Is_OK_Static_Expression (Clob) then
Flag_Non_Static_Expr ("asm clobber argument is not static!", Clob); Flag_Non_Static_Expr ("asm clobber argument is not static!", Clob);
Clobber_Node := Empty; Clobber_Node := Empty;
else else
Clobber_Node := Get_String_Node (Clob); Clobber_Node := Get_String_Node (Clob);
Clobber_Ptr := 1; Clobber_Ptr := 1;
...@@ -262,11 +262,15 @@ package body Exp_Code is ...@@ -262,11 +262,15 @@ package body Exp_Code is
procedure Check_IO_Operand (N : Node_Id); procedure Check_IO_Operand (N : Node_Id);
-- Check for incorrect input or output operand -- Check for incorrect input or output operand
----------------------
-- Check_IO_Operand --
----------------------
procedure Check_IO_Operand (N : Node_Id) is procedure Check_IO_Operand (N : Node_Id) is
Err : Node_Id := N; Err : Node_Id := N;
begin begin
-- The only identifier allows is No_xxput_Operands. Since we -- The only identifier allowed is No_xxput_Operands. Since we
-- know the type is right, it is sufficient to see if the -- know the type is right, it is sufficient to see if the
-- referenced entity is in a runtime routine. -- referenced entity is in a runtime routine.
...@@ -333,7 +337,6 @@ package body Exp_Code is ...@@ -333,7 +337,6 @@ package body Exp_Code is
declare declare
Arg_Output : constant Node_Id := Next_Actual (First_Actual (N)); Arg_Output : constant Node_Id := Next_Actual (First_Actual (N));
Arg_Input : constant Node_Id := Next_Actual (Arg_Output); Arg_Input : constant Node_Id := Next_Actual (Arg_Output);
begin begin
Check_IO_Operand (Arg_Output); Check_IO_Operand (Arg_Output);
Check_IO_Operand (Arg_Input); Check_IO_Operand (Arg_Input);
...@@ -364,9 +367,13 @@ package body Exp_Code is ...@@ -364,9 +367,13 @@ package body Exp_Code is
-- There is no need to reanalyze this node, it is completely analyzed -- There is no need to reanalyze this node, it is completely analyzed
-- already, at least sufficiently for the purposes of the abstract -- already, at least sufficiently for the purposes of the abstract
-- procedural interface defined in this package. -- procedural interface defined in this package. Furthermore if we
-- let it go through the normal analysis, that would include some
-- inappropriate checks that apply only to explicit code statements
-- in the source, and not to calls to intrinsics.
Set_Analyzed (N); Set_Analyzed (N);
Check_Code_Statement (N);
end if; end if;
end Expand_Asm_Call; end Expand_Asm_Call;
...@@ -378,7 +385,6 @@ package body Exp_Code is ...@@ -378,7 +385,6 @@ package body Exp_Code is
begin begin
if Nkind (S) = N_String_Literal then if Nkind (S) = N_String_Literal then
return S; return S;
else else
pragma Assert (Ekind (Entity (S)) = E_Constant); pragma Assert (Ekind (Entity (S)) = E_Constant);
return Get_String_Node (Constant_Value (Entity (S))); return Get_String_Node (Constant_Value (Entity (S)));
...@@ -397,12 +403,10 @@ package body Exp_Code is ...@@ -397,12 +403,10 @@ package body Exp_Code is
Next_Actual ( Next_Actual (
Next_Actual ( Next_Actual (
First_Actual (Call))))); First_Actual (Call)))));
begin begin
if not Is_OK_Static_Expression (Vol) then if not Is_OK_Static_Expression (Vol) then
Flag_Non_Static_Expr ("asm volatile argument is not static!", Vol); Flag_Non_Static_Expr ("asm volatile argument is not static!", Vol);
return False; return False;
else else
return Is_True (Expr_Value (Vol)); return Is_True (Expr_Value (Vol));
end if; end if;
...@@ -427,7 +431,6 @@ package body Exp_Code is ...@@ -427,7 +431,6 @@ package body Exp_Code is
if Nkind (Parent (Operand_Var)) = N_Aggregate then if Nkind (Parent (Operand_Var)) = N_Aggregate then
Operand_Var := Next (Operand_Var); Operand_Var := Next (Operand_Var);
else else
Operand_Var := Empty; Operand_Var := Empty;
end if; end if;
...@@ -448,7 +451,6 @@ package body Exp_Code is ...@@ -448,7 +451,6 @@ package body Exp_Code is
procedure Setup_Asm_Inputs (N : Node_Id) is procedure Setup_Asm_Inputs (N : Node_Id) is
Call : constant Node_Id := Expression (Expression (N)); Call : constant Node_Id := Expression (Expression (N));
begin begin
Setup_Asm_IO_Args Setup_Asm_IO_Args
(Next_Actual (Next_Actual (First_Actual (Call))), (Next_Actual (Next_Actual (First_Actual (Call))),
...@@ -488,7 +490,6 @@ package body Exp_Code is ...@@ -488,7 +490,6 @@ package body Exp_Code is
procedure Setup_Asm_Outputs (N : Node_Id) is procedure Setup_Asm_Outputs (N : Node_Id) is
Call : constant Node_Id := Expression (Expression (N)); Call : constant Node_Id := Expression (Expression (N));
begin begin
Setup_Asm_IO_Args Setup_Asm_IO_Args
(Next_Actual (First_Actual (Call)), (Next_Actual (First_Actual (Call)),
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1996 Free Software Foundation, Inc. -- -- Copyright (C) 1996-2006, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -32,8 +32,7 @@ with System; use System; ...@@ -32,8 +32,7 @@ with System; use System;
package Exp_Code is package Exp_Code is
procedure Expand_Asm_Call (N : Node_Id); procedure Expand_Asm_Call (N : Node_Id);
-- Expands a call to Asm or Asm_Volatile into an equivalent -- Expands a call to Asm into an equivalent N_Code_Statement node
-- N_Code_Statement node.
-- The following routines provide an abstract interface to analyze -- The following routines provide an abstract interface to analyze
-- code statements, for use by Gigi processing for code statements. -- code statements, for use by Gigi processing for code statements.
...@@ -41,8 +40,8 @@ package Exp_Code is ...@@ -41,8 +40,8 @@ package Exp_Code is
-- to expand tables that are frozen on entry to Gigi. -- to expand tables that are frozen on entry to Gigi.
function Is_Asm_Volatile (N : Node_Id) return Boolean; function Is_Asm_Volatile (N : Node_Id) return Boolean;
-- Given an N_Code_Statement node N, return True in the Asm_Volatile -- Given an N_Code_Statement node N, return True if Volatile=True is
-- case and False in the Asm case. -- specified, and False if Volatile=False is specified (or set by default).
function Asm_Template (N : Node_Id) return Node_Id; function Asm_Template (N : Node_Id) return Node_Id;
-- Given an N_Code_Statement node N, returns string literal node for -- Given an N_Code_Statement node N, returns string literal node for
...@@ -82,7 +81,10 @@ package Exp_Code is ...@@ -82,7 +81,10 @@ package Exp_Code is
-- Called within a loop initialized by Setup_Asm_Inputs and controlled -- Called within a loop initialized by Setup_Asm_Inputs and controlled
-- by Next_Asm_Input as described above. Returns the expression node for -- by Next_Asm_Input as described above. Returns the expression node for
-- the value component of the current Asm_Input parameter, or Empty if -- the value component of the current Asm_Input parameter, or Empty if
-- there are no more Asm_Input parameters. -- there are no more Asm_Input parameters, or Error if an error was
-- previously detected in the input parameters (note that the backend
-- need not worry about this case, since it won't be called if there
-- were any such serious errors detected).
procedure Next_Asm_Input; procedure Next_Asm_Input;
-- Step to next Asm_Input parameter. It is an error to call this procedure -- Step to next Asm_Input parameter. It is an error to call this procedure
...@@ -94,7 +96,7 @@ package Exp_Code is ...@@ -94,7 +96,7 @@ package Exp_Code is
-- arguments. The protocol is to construct a loop as follows: -- arguments. The protocol is to construct a loop as follows:
-- --
-- Setup_Asm_Outputs (N); -- Setup_Asm_Outputs (N);
-- while Present (Asm_Output_Value) -- while Present (Asm_Output_Variable)
-- body -- body
-- Next_Asm_Output; -- Next_Asm_Output;
-- end loop; -- end loop;
...@@ -110,10 +112,13 @@ package Exp_Code is ...@@ -110,10 +112,13 @@ package Exp_Code is
-- Empty if there are no more Asm_Output parameters. -- Empty if there are no more Asm_Output parameters.
function Asm_Output_Variable return Node_Id; function Asm_Output_Variable return Node_Id;
-- Called within a loop initialized by Setup_Asm_Outputs and controlled -- Called within a loop initialized by Setup_Asm_Outputs and controlled by
-- by Next_Asm_Output as described above. Returns the expression node for -- Next_Asm_Output as described above. Returns the expression node for the
-- the output variable component of the current Asm_Output parameter, or -- output variable component of the current Asm_Output parameter, or Empty
-- Empty if there are no more Asm_Output parameters. -- if there are no more Asm_Output parameters, or Error if an error was
-- previously detected in the input parameters (note that the backend need
-- not worry about this case, since it won't be called if there were any
-- such serious errors detected).
procedure Next_Asm_Output; procedure Next_Asm_Output;
-- Step to next Asm_Output parameter. It is an error to call this procedure -- Step to next Asm_Output parameter. It is an error to call this procedure
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- B o d y -- -- B o d y --
-- (Version for IRIX/MIPS) -- -- (Version for IRIX/MIPS) --
-- -- -- --
-- Copyright (C) 1999-2005 Free Software Foundation, Inc. -- -- Copyright (C) 1999-2006, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -278,12 +278,15 @@ package body System.Machine_State_Operations is ...@@ -278,12 +278,15 @@ package body System.Machine_State_Operations is
procedure Set_Machine_State (M : Machine_State) is procedure Set_Machine_State (M : Machine_State) is
STOREI : constant String (1 .. 2) := 's' & LSC; SI : constant String (1 .. 2) := 's' & LSC;
-- This is "sw" in o32 mode, and "sd" in n32 mode -- This is "sw" in o32 mode, and "sd" in n32 mode
STOREF : constant String (1 .. 4) := 's' & LSC & "c1"; SF : constant String (1 .. 4) := 's' & LSC & "c1";
-- This is "swc1" in o32 mode and "sdc1" in n32 mode -- This is "swc1" in o32 mode and "sdc1" in n32 mode
PI : String renames SC_Regs_Pos;
PF : String renames SC_Fpregs_Pos;
Scp : Sigcontext_Ptr; Scp : Sigcontext_Ptr;
begin begin
...@@ -294,41 +297,41 @@ package body System.Machine_State_Operations is ...@@ -294,41 +297,41 @@ package body System.Machine_State_Operations is
<<Past_Prolog>> <<Past_Prolog>>
Asm (STOREI & " $16, 16*8+" & Roff & "+" & SC_Regs_Pos & "($4)"); Asm (SI & " $16, 16*8+" & Roff & "+" & PI & "($4)", Volatile => True);
Asm (STOREI & " $17, 17*8+" & Roff & "+" & SC_Regs_Pos & "($4)"); Asm (SI & " $17, 17*8+" & Roff & "+" & PI & "($4)", Volatile => True);
Asm (STOREI & " $18, 18*8+" & Roff & "+" & SC_Regs_Pos & "($4)"); Asm (SI & " $18, 18*8+" & Roff & "+" & PI & "($4)", Volatile => True);
Asm (STOREI & " $19, 19*8+" & Roff & "+" & SC_Regs_Pos & "($4)"); Asm (SI & " $19, 19*8+" & Roff & "+" & PI & "($4)", Volatile => True);
Asm (STOREI & " $20, 20*8+" & Roff & "+" & SC_Regs_Pos & "($4)"); Asm (SI & " $20, 20*8+" & Roff & "+" & PI & "($4)", Volatile => True);
Asm (STOREI & " $21, 21*8+" & Roff & "+" & SC_Regs_Pos & "($4)"); Asm (SI & " $21, 21*8+" & Roff & "+" & PI & "($4)", Volatile => True);
Asm (STOREI & " $22, 22*8+" & Roff & "+" & SC_Regs_Pos & "($4)"); Asm (SI & " $22, 22*8+" & Roff & "+" & PI & "($4)", Volatile => True);
Asm (STOREI & " $23, 23*8+" & Roff & "+" & SC_Regs_Pos & "($4)"); Asm (SI & " $23, 23*8+" & Roff & "+" & PI & "($4)", Volatile => True);
Asm (STOREI & " $24, 24*8+" & Roff & "+" & SC_Regs_Pos & "($4)"); Asm (SI & " $24, 24*8+" & Roff & "+" & PI & "($4)", Volatile => True);
Asm (STOREI & " $25, 25*8+" & Roff & "+" & SC_Regs_Pos & "($4)"); Asm (SI & " $25, 25*8+" & Roff & "+" & PI & "($4)", Volatile => True);
Asm (STOREI & " $26, 26*8+" & Roff & "+" & SC_Regs_Pos & "($4)"); Asm (SI & " $26, 26*8+" & Roff & "+" & PI & "($4)", Volatile => True);
Asm (STOREI & " $27, 27*8+" & Roff & "+" & SC_Regs_Pos & "($4)"); Asm (SI & " $27, 27*8+" & Roff & "+" & PI & "($4)", Volatile => True);
Asm (STOREI & " $28, 28*8+" & Roff & "+" & SC_Regs_Pos & "($4)"); Asm (SI & " $28, 28*8+" & Roff & "+" & PI & "($4)", Volatile => True);
Asm (STOREI & " $29, 29*8+" & Roff & "+" & SC_Regs_Pos & "($4)"); Asm (SI & " $29, 29*8+" & Roff & "+" & PI & "($4)", Volatile => True);
Asm (STOREI & " $30, 30*8+" & Roff & "+" & SC_Regs_Pos & "($4)"); Asm (SI & " $30, 30*8+" & Roff & "+" & PI & "($4)", Volatile => True);
Asm (STOREI & " $31, 31*8+" & Roff & "+" & SC_Regs_Pos & "($4)"); Asm (SI & " $31, 31*8+" & Roff & "+" & PI & "($4)", Volatile => True);
-- Restore floating-point registers from machine state -- Restore floating-point registers from machine state
Asm (STOREF & " $f16, 16*8+" & Roff & "+" & SC_Fpregs_Pos & "($4)"); Asm (SF & " $f16, 16*8+" & Roff & "+" & PF & "($4)", Volatile => True);
Asm (STOREF & " $f17, 17*8+" & Roff & "+" & SC_Fpregs_Pos & "($4)"); Asm (SF & " $f17, 17*8+" & Roff & "+" & PF & "($4)", Volatile => True);
Asm (STOREF & " $f18, 18*8+" & Roff & "+" & SC_Fpregs_Pos & "($4)"); Asm (SF & " $f18, 18*8+" & Roff & "+" & PF & "($4)", Volatile => True);
Asm (STOREF & " $f19, 19*8+" & Roff & "+" & SC_Fpregs_Pos & "($4)"); Asm (SF & " $f19, 19*8+" & Roff & "+" & PF & "($4)", Volatile => True);
Asm (STOREF & " $f20, 20*8+" & Roff & "+" & SC_Fpregs_Pos & "($4)"); Asm (SF & " $f20, 20*8+" & Roff & "+" & PF & "($4)", Volatile => True);
Asm (STOREF & " $f21, 21*8+" & Roff & "+" & SC_Fpregs_Pos & "($4)"); Asm (SF & " $f21, 21*8+" & Roff & "+" & PF & "($4)", Volatile => True);
Asm (STOREF & " $f22, 22*8+" & Roff & "+" & SC_Fpregs_Pos & "($4)"); Asm (SF & " $f22, 22*8+" & Roff & "+" & PF & "($4)", Volatile => True);
Asm (STOREF & " $f23, 23*8+" & Roff & "+" & SC_Fpregs_Pos & "($4)"); Asm (SF & " $f23, 23*8+" & Roff & "+" & PF & "($4)", Volatile => True);
Asm (STOREF & " $f24, 24*8+" & Roff & "+" & SC_Fpregs_Pos & "($4)"); Asm (SF & " $f24, 24*8+" & Roff & "+" & PF & "($4)", Volatile => True);
Asm (STOREF & " $f25, 25*8+" & Roff & "+" & SC_Fpregs_Pos & "($4)"); Asm (SF & " $f25, 25*8+" & Roff & "+" & PF & "($4)", Volatile => True);
Asm (STOREF & " $f26, 26*8+" & Roff & "+" & SC_Fpregs_Pos & "($4)"); Asm (SF & " $f26, 26*8+" & Roff & "+" & PF & "($4)", Volatile => True);
Asm (STOREF & " $f27, 27*8+" & Roff & "+" & SC_Fpregs_Pos & "($4)"); Asm (SF & " $f27, 27*8+" & Roff & "+" & PF & "($4)", Volatile => True);
Asm (STOREF & " $f28, 28*8+" & Roff & "+" & SC_Fpregs_Pos & "($4)"); Asm (SF & " $f28, 28*8+" & Roff & "+" & PF & "($4)", Volatile => True);
Asm (STOREF & " $f29, 29*8+" & Roff & "+" & SC_Fpregs_Pos & "($4)"); Asm (SF & " $f29, 29*8+" & Roff & "+" & PF & "($4)", Volatile => True);
Asm (STOREF & " $f30, 30*8+" & Roff & "+" & SC_Fpregs_Pos & "($4)"); Asm (SF & " $f30, 30*8+" & Roff & "+" & PF & "($4)", Volatile => True);
Asm (STOREF & " $f31, 31*8+" & Roff & "+" & SC_Fpregs_Pos & "($4)"); Asm (SF & " $f31, 31*8+" & Roff & "+" & PF & "($4)", Volatile => True);
-- Set the PC value for the context to a location after the -- Set the PC value for the context to a location after the
-- prolog has been executed. -- prolog has been executed.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1998-2005, Free Software Foundation, Inc. -- -- Copyright (C) 1998-2006, Free Software Foundation, Inc. --
-- -- -- --
-- GNARL is free software; you can redistribute it and/or modify it under -- -- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -74,7 +74,8 @@ package body System.OS_Interface is ...@@ -74,7 +74,8 @@ package body System.OS_Interface is
Asm ("call_pal 0x9e" & ASCII.LF & ASCII.HT & Asm ("call_pal 0x9e" & ASCII.LF & ASCII.HT &
"bis $31, $0, %0", "bis $31, $0, %0",
Outputs => pthread_t'Asm_Output ("=r", Self), Outputs => pthread_t'Asm_Output ("=r", Self),
Clobber => "$0"); Clobber => "$0",
Volatile => True);
return Self; return Self;
end pthread_self; end pthread_self;
...@@ -94,7 +95,8 @@ package body System.OS_Interface is ...@@ -94,7 +95,8 @@ package body System.OS_Interface is
Asm ("call_pal 0x9e" & ASCII.LF & ASCII.HT & Asm ("call_pal 0x9e" & ASCII.LF & ASCII.HT &
"bis $31, $0, %0", "bis $31, $0, %0",
Outputs => Teb_Ptr'Asm_Output ("=r", Teb), Outputs => Teb_Ptr'Asm_Output ("=r", Teb),
Clobber => "$0"); Clobber => "$0",
Volatile => True);
-- Stick a guard page right above the Yellow Zone if it exists -- Stick a guard page right above the Yellow Zone if it exists
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1991-1994, Florida State University -- -- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2005, AdaCore -- -- Copyright (C) 1995-2006, AdaCore --
-- -- -- --
-- GNARL is free software; you can redistribute it and/or modify it under -- -- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -58,7 +58,8 @@ package body System.OS_Interface is ...@@ -58,7 +58,8 @@ package body System.OS_Interface is
Asm ("call_pal 0x9e" & LF & HT & Asm ("call_pal 0x9e" & LF & HT &
"bis $31, $0, %0", "bis $31, $0, %0",
Outputs => pthread_t'Asm_Output ("=r", Self), Outputs => pthread_t'Asm_Output ("=r", Self),
Clobber => "$0"); Clobber => "$0",
Volatile => True);
return Self; return Self;
end pthread_self; end pthread_self;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1997-2005, Free Software Foundation, Inc. -- -- Copyright (C) 1997-2006, Free Software Foundation, Inc. --
-- (Version for Alpha OpenVMS) -- -- (Version for Alpha OpenVMS) --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
...@@ -69,9 +69,12 @@ package body System.Vax_Float_Operations is ...@@ -69,9 +69,12 @@ package body System.Vax_Float_Operations is
A, B : T; A, B : T;
C : G; C : G;
begin begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), D'Asm_Input ("m", X)); 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)); Volatile => True);
Asm ("stg %1,%0", G'Asm_Output ("=m", C), T'Asm_Input ("f", B)); Asm ("cvtdg %1,%0", T'Asm_Output ("=f", B), T'Asm_Input ("f", A),
Volatile => True);
Asm ("stg %1,%0", G'Asm_Output ("=m", C), T'Asm_Input ("f", B),
Volatile => True);
return C; return C;
end D_To_G; end D_To_G;
...@@ -83,8 +86,10 @@ package body System.Vax_Float_Operations is ...@@ -83,8 +86,10 @@ package body System.Vax_Float_Operations is
A : T; A : T;
B : G; B : G;
begin begin
Asm ("ldf %0,%1", T'Asm_Output ("=f", A), F'Asm_Input ("m", X)); 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)); Volatile => True);
Asm ("stg %1,%0", G'Asm_Output ("=m", B), T'Asm_Input ("f", A),
Volatile => True);
return B; return B;
end F_To_G; end F_To_G;
...@@ -100,7 +105,8 @@ package body System.Vax_Float_Operations is ...@@ -100,7 +105,8 @@ package body System.Vax_Float_Operations is
-- Because converting to a wider FP format is a no-op, we say -- 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. -- 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)); Asm ("ldf %0,%1", T'Asm_Output ("=f", A), F'Asm_Input ("m", X),
Volatile => True);
B := S (Cvt_G_T (A)); B := S (Cvt_G_T (A));
return B; return B;
...@@ -114,9 +120,12 @@ package body System.Vax_Float_Operations is ...@@ -114,9 +120,12 @@ package body System.Vax_Float_Operations is
A, B : T; A, B : T;
C : D; C : D;
begin begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X)); 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)); Volatile => True);
Asm ("stg %1,%0", D'Asm_Output ("=m", C), T'Asm_Input ("f", B)); Asm ("cvtgd %1,%0", T'Asm_Output ("=f", B), T'Asm_Input ("f", A),
Volatile => True);
Asm ("stg %1,%0", D'Asm_Output ("=m", C), T'Asm_Input ("f", B),
Volatile => True);
return C; return C;
end G_To_D; end G_To_D;
...@@ -129,9 +138,12 @@ package body System.Vax_Float_Operations is ...@@ -129,9 +138,12 @@ package body System.Vax_Float_Operations is
B : S; B : S;
C : F; C : F;
begin begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X)); 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)); Volatile => True);
Asm ("stf %1,%0", F'Asm_Output ("=m", C), S'Asm_Input ("f", B)); Asm ("cvtgf %1,%0", S'Asm_Output ("=f", B), T'Asm_Input ("f", A),
Volatile => True);
Asm ("stf %1,%0", F'Asm_Output ("=m", C), S'Asm_Input ("f", B),
Volatile => True);
return C; return C;
end G_To_F; end G_To_F;
...@@ -143,8 +155,10 @@ package body System.Vax_Float_Operations is ...@@ -143,8 +155,10 @@ package body System.Vax_Float_Operations is
A : T; A : T;
B : Q; B : Q;
begin begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X)); 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)); Volatile => True);
Asm ("cvtgq %1,%0", Q'Asm_Output ("=f", B), T'Asm_Input ("f", A),
Volatile => True);
return B; return B;
end G_To_Q; end G_To_Q;
...@@ -155,7 +169,8 @@ package body System.Vax_Float_Operations is ...@@ -155,7 +169,8 @@ package body System.Vax_Float_Operations is
function G_To_T (X : G) return T is function G_To_T (X : G) return T is
A, B : T; A, B : T;
begin begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X)); Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X),
Volatile => True);
B := Cvt_G_T (A); B := Cvt_G_T (A);
return B; return B;
end G_To_T; end G_To_T;
...@@ -177,8 +192,10 @@ package body System.Vax_Float_Operations is ...@@ -177,8 +192,10 @@ package body System.Vax_Float_Operations is
A : S; A : S;
B : F; B : F;
begin begin
Asm ("cvtqf %1,%0", S'Asm_Output ("=f", A), Q'Asm_Input ("f", X)); 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)); Volatile => True);
Asm ("stf %1,%0", F'Asm_Output ("=m", B), S'Asm_Input ("f", A),
Volatile => True);
return B; return B;
end Q_To_F; end Q_To_F;
...@@ -190,8 +207,10 @@ package body System.Vax_Float_Operations is ...@@ -190,8 +207,10 @@ package body System.Vax_Float_Operations is
A : T; A : T;
B : G; B : G;
begin begin
Asm ("cvtqg %1,%0", T'Asm_Output ("=f", A), Q'Asm_Input ("f", X)); 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)); Volatile => True);
Asm ("stg %1,%0", G'Asm_Output ("=m", B), T'Asm_Input ("f", A),
Volatile => True);
return B; return B;
end Q_To_G; end Q_To_G;
...@@ -204,7 +223,8 @@ package body System.Vax_Float_Operations is ...@@ -204,7 +223,8 @@ package body System.Vax_Float_Operations is
B : F; B : F;
begin begin
A := Cvt_T_F (T (X)); A := Cvt_T_F (T (X));
Asm ("stf %1,%0", F'Asm_Output ("=m", B), S'Asm_Input ("f", A)); Asm ("stf %1,%0", F'Asm_Output ("=m", B), S'Asm_Input ("f", A),
Volatile => True);
return B; return B;
end S_To_F; end S_To_F;
...@@ -226,7 +246,8 @@ package body System.Vax_Float_Operations is ...@@ -226,7 +246,8 @@ package body System.Vax_Float_Operations is
B : G; B : G;
begin begin
A := Cvt_T_G (X); A := Cvt_T_G (X);
Asm ("stg %1,%0", G'Asm_Output ("=m", B), T'Asm_Input ("f", A)); Asm ("stg %1,%0", G'Asm_Output ("=m", B), T'Asm_Input ("f", A),
Volatile => True);
return B; return B;
end T_To_G; end T_To_G;
...@@ -238,9 +259,12 @@ package body System.Vax_Float_Operations is ...@@ -238,9 +259,12 @@ package body System.Vax_Float_Operations is
A, B : S; A, B : S;
C : F; C : F;
begin begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", A), F'Asm_Input ("m", X)); 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)); Volatile => True);
Asm ("stf %1,%0", F'Asm_Output ("=m", C), S'Asm_Input ("f", B)); Asm ("cpys $f31,%1,%0", S'Asm_Output ("=f", B), S'Asm_Input ("f", A),
Volatile => True);
Asm ("stf %1,%0", F'Asm_Output ("=m", C), S'Asm_Input ("f", B),
Volatile => True);
return C; return C;
end Abs_F; end Abs_F;
...@@ -253,8 +277,10 @@ package body System.Vax_Float_Operations is ...@@ -253,8 +277,10 @@ package body System.Vax_Float_Operations is
C : G; C : G;
begin begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X)); 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)); Asm ("cpys $f31,%1,%0", T'Asm_Output ("=f", B), T'Asm_Input ("f", A),
Asm ("stg %1,%0", G'Asm_Output ("=m", C), T'Asm_Input ("f", B)); Volatile => True);
Asm ("stg %1,%0", G'Asm_Output ("=m", C), T'Asm_Input ("f", B),
Volatile => True);
return C; return C;
end Abs_G; end Abs_G;
...@@ -267,10 +293,13 @@ package body System.Vax_Float_Operations is ...@@ -267,10 +293,13 @@ package body System.Vax_Float_Operations is
R1 : F; R1 : F;
begin begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X)); 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 ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y),
Volatile => True);
Asm ("addf %1,%2,%0", S'Asm_Output ("=f", R), Asm ("addf %1,%2,%0", S'Asm_Output ("=f", R),
(S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1))); (S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1)),
Asm ("stf %1,%0", F'Asm_Output ("=m", R1), S'Asm_Input ("f", R)); Volatile => True);
Asm ("stf %1,%0", F'Asm_Output ("=m", R1), S'Asm_Input ("f", R),
Volatile => True);
return R1; return R1;
end Add_F; end Add_F;
...@@ -283,10 +312,13 @@ package body System.Vax_Float_Operations is ...@@ -283,10 +312,13 @@ package body System.Vax_Float_Operations is
R1 : G; R1 : G;
begin begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X)); 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 ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y),
Volatile => True);
Asm ("addg %1,%2,%0", T'Asm_Output ("=f", R), Asm ("addg %1,%2,%0", T'Asm_Output ("=f", R),
(T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1))); (T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1)),
Asm ("stg %1,%0", G'Asm_Output ("=m", R1), T'Asm_Input ("f", R)); Volatile => True);
Asm ("stg %1,%0", G'Asm_Output ("=m", R1), T'Asm_Input ("f", R),
Volatile => True);
return R1; return R1;
end Add_G; end Add_G;
...@@ -362,10 +394,13 @@ package body System.Vax_Float_Operations is ...@@ -362,10 +394,13 @@ package body System.Vax_Float_Operations is
R1 : F; R1 : F;
begin begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X)); 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 ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y),
Volatile => True);
Asm ("divf %1,%2,%0", S'Asm_Output ("=f", R), Asm ("divf %1,%2,%0", S'Asm_Output ("=f", R),
(S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1))); (S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1)),
Asm ("stf %1,%0", F'Asm_Output ("=m", R1), S'Asm_Input ("f", R)); Volatile => True);
Asm ("stf %1,%0", F'Asm_Output ("=m", R1), S'Asm_Input ("f", R),
Volatile => True);
return R1; return R1;
end Div_F; end Div_F;
...@@ -378,10 +413,13 @@ package body System.Vax_Float_Operations is ...@@ -378,10 +413,13 @@ package body System.Vax_Float_Operations is
R1 : G; R1 : G;
begin begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X)); 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 ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y),
Volatile => True);
Asm ("divg %1,%2,%0", T'Asm_Output ("=f", R), Asm ("divg %1,%2,%0", T'Asm_Output ("=f", R),
(T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1))); (T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1)),
Asm ("stg %1,%0", G'Asm_Output ("=m", R1), T'Asm_Input ("f", R)); Volatile => True);
Asm ("stg %1,%0", G'Asm_Output ("=m", R1), T'Asm_Input ("f", R),
Volatile => True);
return R1; return R1;
end Div_G; end Div_G;
...@@ -393,9 +431,11 @@ package body System.Vax_Float_Operations is ...@@ -393,9 +431,11 @@ package body System.Vax_Float_Operations is
X1, Y1, R : S; X1, Y1, R : S;
begin begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X)); 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 ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y),
Volatile => True);
Asm ("cmpgeq %1,%2,%0", S'Asm_Output ("=f", R), Asm ("cmpgeq %1,%2,%0", S'Asm_Output ("=f", R),
(S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1))); (S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1)),
Volatile => True);
return R /= 0.0; return R /= 0.0;
end Eq_F; end Eq_F;
...@@ -407,9 +447,11 @@ package body System.Vax_Float_Operations is ...@@ -407,9 +447,11 @@ package body System.Vax_Float_Operations is
X1, Y1, R : T; X1, Y1, R : T;
begin begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X)); 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 ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y),
Volatile => True);
Asm ("cmpgeq %1,%2,%0", T'Asm_Output ("=f", R), Asm ("cmpgeq %1,%2,%0", T'Asm_Output ("=f", R),
(T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1))); (T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1)),
Volatile => True);
return R /= 0.0; return R /= 0.0;
end Eq_G; end Eq_G;
...@@ -421,9 +463,11 @@ package body System.Vax_Float_Operations is ...@@ -421,9 +463,11 @@ package body System.Vax_Float_Operations is
X1, Y1, R : S; X1, Y1, R : S;
begin begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X)); 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 ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y),
Volatile => True);
Asm ("cmpgle %1,%2,%0", S'Asm_Output ("=f", R), Asm ("cmpgle %1,%2,%0", S'Asm_Output ("=f", R),
(S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1))); (S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1)),
Volatile => True);
return R /= 0.0; return R /= 0.0;
end Le_F; end Le_F;
...@@ -435,9 +479,11 @@ package body System.Vax_Float_Operations is ...@@ -435,9 +479,11 @@ package body System.Vax_Float_Operations is
X1, Y1, R : T; X1, Y1, R : T;
begin begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X)); 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 ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y),
Volatile => True);
Asm ("cmpgle %1,%2,%0", T'Asm_Output ("=f", R), Asm ("cmpgle %1,%2,%0", T'Asm_Output ("=f", R),
(T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1))); (T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1)),
Volatile => True);
return R /= 0.0; return R /= 0.0;
end Le_G; end Le_G;
...@@ -449,9 +495,11 @@ package body System.Vax_Float_Operations is ...@@ -449,9 +495,11 @@ package body System.Vax_Float_Operations is
X1, Y1, R : S; X1, Y1, R : S;
begin begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X)); 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 ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y),
Volatile => True);
Asm ("cmpglt %1,%2,%0", S'Asm_Output ("=f", R), Asm ("cmpglt %1,%2,%0", S'Asm_Output ("=f", R),
(S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1))); (S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1)),
Volatile => True);
return R /= 0.0; return R /= 0.0;
end Lt_F; end Lt_F;
...@@ -463,9 +511,11 @@ package body System.Vax_Float_Operations is ...@@ -463,9 +511,11 @@ package body System.Vax_Float_Operations is
X1, Y1, R : T; X1, Y1, R : T;
begin begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X)); 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 ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y),
Volatile => True);
Asm ("cmpglt %1,%2,%0", T'Asm_Output ("=f", R), Asm ("cmpglt %1,%2,%0", T'Asm_Output ("=f", R),
(T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1))); (T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1)),
Volatile => True);
return R /= 0.0; return R /= 0.0;
end Lt_G; end Lt_G;
...@@ -478,10 +528,13 @@ package body System.Vax_Float_Operations is ...@@ -478,10 +528,13 @@ package body System.Vax_Float_Operations is
R1 : F; R1 : F;
begin begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X)); 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 ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y),
Volatile => True);
Asm ("mulf %1,%2,%0", S'Asm_Output ("=f", R), Asm ("mulf %1,%2,%0", S'Asm_Output ("=f", R),
(S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1))); (S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1)),
Asm ("stf %1,%0", F'Asm_Output ("=m", R1), S'Asm_Input ("f", R)); Volatile => True);
Asm ("stf %1,%0", F'Asm_Output ("=m", R1), S'Asm_Input ("f", R),
Volatile => True);
return R1; return R1;
end Mul_F; end Mul_F;
...@@ -494,10 +547,13 @@ package body System.Vax_Float_Operations is ...@@ -494,10 +547,13 @@ package body System.Vax_Float_Operations is
R1 : G; R1 : G;
begin begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X)); 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 ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y),
Volatile => True);
Asm ("mulg %1,%2,%0", T'Asm_Output ("=f", R), Asm ("mulg %1,%2,%0", T'Asm_Output ("=f", R),
(T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1))); (T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1)),
Asm ("stg %1,%0", G'Asm_Output ("=m", R1), T'Asm_Input ("f", R)); Volatile => True);
Asm ("stg %1,%0", G'Asm_Output ("=m", R1), T'Asm_Input ("f", R),
Volatile => True);
return R1; return R1;
end Mul_G; end Mul_G;
...@@ -509,9 +565,11 @@ package body System.Vax_Float_Operations is ...@@ -509,9 +565,11 @@ package body System.Vax_Float_Operations is
X1, Y1, R : S; X1, Y1, R : S;
begin begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X)); 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 ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y),
Volatile => True);
Asm ("cmpgeq %1,%2,%0", S'Asm_Output ("=f", R), Asm ("cmpgeq %1,%2,%0", S'Asm_Output ("=f", R),
(S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1))); (S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1)),
Volatile => True);
return R = 0.0; return R = 0.0;
end Ne_F; end Ne_F;
...@@ -523,9 +581,11 @@ package body System.Vax_Float_Operations is ...@@ -523,9 +581,11 @@ package body System.Vax_Float_Operations is
X1, Y1, R : T; X1, Y1, R : T;
begin begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X)); 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 ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y),
Volatile => True);
Asm ("cmpgeq %1,%2,%0", T'Asm_Output ("=f", R), Asm ("cmpgeq %1,%2,%0", T'Asm_Output ("=f", R),
(T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1))); (T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1)),
Volatile => True);
return R = 0.0; return R = 0.0;
end Ne_G; end Ne_G;
...@@ -538,8 +598,10 @@ package body System.Vax_Float_Operations is ...@@ -538,8 +598,10 @@ package body System.Vax_Float_Operations is
C : F; C : F;
begin begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", A), F'Asm_Input ("m", X)); 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)); Asm ("cpysn %1,%1,%0", S'Asm_Output ("=f", B), S'Asm_Input ("f", A),
Asm ("stf %1,%0", F'Asm_Output ("=m", C), S'Asm_Input ("f", B)); Volatile => True);
Asm ("stf %1,%0", F'Asm_Output ("=m", C), S'Asm_Input ("f", B),
Volatile => True);
return C; return C;
end Neg_F; end Neg_F;
...@@ -552,8 +614,10 @@ package body System.Vax_Float_Operations is ...@@ -552,8 +614,10 @@ package body System.Vax_Float_Operations is
C : G; C : G;
begin begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", A), G'Asm_Input ("m", X)); 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)); Asm ("cpysn %1,%1,%0", T'Asm_Output ("=f", B), T'Asm_Input ("f", A),
Asm ("stg %1,%0", G'Asm_Output ("=m", C), T'Asm_Input ("f", B)); Volatile => True);
Asm ("stg %1,%0", G'Asm_Output ("=m", C), T'Asm_Input ("f", B),
Volatile => True);
return C; return C;
end Neg_G; end Neg_G;
...@@ -594,10 +658,13 @@ package body System.Vax_Float_Operations is ...@@ -594,10 +658,13 @@ package body System.Vax_Float_Operations is
begin begin
Asm ("ldf %0,%1", S'Asm_Output ("=f", X1), F'Asm_Input ("m", X)); 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 ("ldf %0,%1", S'Asm_Output ("=f", Y1), F'Asm_Input ("m", Y),
Volatile => True);
Asm ("subf %1,%2,%0", S'Asm_Output ("=f", R), Asm ("subf %1,%2,%0", S'Asm_Output ("=f", R),
(S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1))); (S'Asm_Input ("f", X1), S'Asm_Input ("f", Y1)),
Asm ("stf %1,%0", F'Asm_Output ("=m", R1), S'Asm_Input ("f", R)); Volatile => True);
Asm ("stf %1,%0", F'Asm_Output ("=m", R1), S'Asm_Input ("f", R),
Volatile => True);
return R1; return R1;
end Sub_F; end Sub_F;
...@@ -610,10 +677,13 @@ package body System.Vax_Float_Operations is ...@@ -610,10 +677,13 @@ package body System.Vax_Float_Operations is
R1 : G; R1 : G;
begin begin
Asm ("ldg %0,%1", T'Asm_Output ("=f", X1), G'Asm_Input ("m", X)); 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 ("ldg %0,%1", T'Asm_Output ("=f", Y1), G'Asm_Input ("m", Y),
Volatile => True);
Asm ("subg %1,%2,%0", T'Asm_Output ("=f", R), Asm ("subg %1,%2,%0", T'Asm_Output ("=f", R),
(T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1))); (T'Asm_Input ("f", X1), T'Asm_Input ("f", Y1)),
Asm ("stg %1,%0", G'Asm_Output ("=m", R1), T'Asm_Input ("f", R)); Volatile => True);
Asm ("stg %1,%0", G'Asm_Output ("=m", R1), T'Asm_Input ("f", R),
Volatile => True);
return R1; return R1;
end Sub_G; end Sub_G;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment