BENCH.BCK' BENCH.BCK/BACKUP *.* PTMP:BENCH.BCK/INTER/SAVE/BLOCK=8192 PILK גV5.1 _ALPHA::  _ALPHA$DUA1: V5.0  *[PILK.TMP2]DHRYADAA.ADA;1+,%.'/ 4O'%-0123KPWO(56 3bo_7ѵג89GHJO-------------------------------------------------------------------------------O-- --O-- "DHRYSTONE" Benchmark Program --O-- -------------------------------- --O-- --O-- Version: ADA/1 --O-- --O-- Date: 04/15/84 --O-- --O-- Author: Reinhold P. Weicker ---- --+-- Filename: DHRYADAA.DEC ---- ---- History: ---- --H-- CHANGE MADE BY WHOM DATE --@-- ----------- --------- ------- --O-- --B-- added timing calls D. Sayon 13 Feb 85 --O-- to write to file --O-- --O-------------------------------------------------------------------------------O-- --O-- The following program contains statements of a high-level programming --O-- language (Ada) in a distribution considered representative: --O-- --O-- assignments 53% --O-- control statements 32% --O-- procedure, function calls 15% --O-- --O-- 100 statements are dynamically executed. The program is balanced with --O-- respect to the three aspects: --O-- --O-- -statement type --O-- -operand type (for simple data types) --O-- -operand access --O-- operand global, local, parameter, or constant. --O-- --O-- The combination of these three aspects is balanced only approximately. --O-- --O-- The program does not compute anything meaningful, but it is syntacially --O-- and semantically correct. All variables have a value assigned to them --O-- before they are used as a source operand. --O-------------------------------------------------------------------------------package Global_Def is-------------------- Global type definitions>type Enumeration is (Ident_1,Ident_2,Ident_3,Ident_4,Ident_5);-subtype One_To_Thirty is integer range 1..30;,subtype One_To_Fifty is integer range 1..50;3subtype Capital_Letter is character range 'A'..'Z';3type String_30 is array(One_To_Thirty)of character; pragma Pack(String_30);:type Array_1_Dim_Integer is array(One_To_Fifty)of integer;/type Array_2_Dim_Integer is array(One_To_Fifty,: One_To_Fifty)of integer;/type Record_Type(Discr:Enumeration := Ident_1);*type Record_Pointer is access Record_Type;0type Record_Type(Discr:Enumeration := Ident_1)is record( Pointer_Comp: Record_Pointer; case Discr is7 when Ident_1 => -- only this variant is used,; -- but in some cases discriminant1 -- checks are necessary% Enum_Comp: Enumeration;& Int_Comp: One_To_Fifty;# String_Comp: String_30; when Ident_2 =>% Enum_Comp_2: Enumeration;# String_Comp_2: String_30; when others => Char_Comp_1,# Char_Comp_2: character; end case; end record;end Global_Def; with Global_Def,Calendar; use Global_Def,Calendar;package Pack_1 is -------------I procedure Proc_0(cycles: in integer; start_time, stop_time: out Float);< procedure Proc_1(Pointer_Par_in: in Record_Pointer);: procedure Proc_2(Int_Par_In_Out: in out One_To_Fifty);< procedure Proc_3(Pointer_Par_Out: out Record_Pointer);  Int_Glob: integer; end Pack_1;with Global_Def;use Global_Def;package Pack_2 is--------------= procedure Proc_6 (Enum_Par_In: in Enumeration;> Enum_Par_Out: out Enumeration);! procedure Proc_7 (Int_Par_In_1,> Int_Par_In_2: in One_To_Fifty;? Int_Par_Out: out One_To_Fifty);E procedure Proc_8 (Array_Par_In_Out_1: in out Array_1_Dim_Integer;E Array_Par_In_Out_2: in out Array_2_Dim_Integer;! Int_Par_In_1,: Int_Par_In_2: in integer);" function Func_1 (Char_Par_In_1,@ Char_Par_In_2: in Capital_Letter)D return Enumeration;$ function Func_2 (String_Par_In_1,; String_Par_In_2: in String_30)B return boolean;end Pack_2; +with Global_Def,Pack_1,Text_IO, Help_Tools;%use Global_Def, Text_IO, Help_Tools; procedure Dhryadaa is--------------(package real_io is new float_io(float); use real_io;*package int_io is new integer_io(integer); use int_io;type lint is range 1..500_000;(package lint_io is new integer_io(lint); use lint_io;+filename: string (1..13):= "Vectra.dat ";lint_rating : lint; No_of_Cycles,No_of_Runs : integer; mean_rating,rating, mean_time, elapsed_time, start_time,stop_time: float;data_file: file_type;begin mean_time := 0.0; mean_rating := 0.0; No_of_Runs := 20;--Time_filename (filename);-- filename(1) := 'D';) create (data_file,out_file,filename,""); read_environ(data_file);9 put("ADA Dhrystone Benchmark (DHRYADAA.DEC)"); new_line;M put(data_file,"ADA Dhrystone Benchmark (DHRYADAA.DEC)");new_line(data_file); for N in 1..No_of_Runs loop No_of_Cycles := N*100;3 Pack_1.Proc_0(No_of_Cycles,start_time,stop_time);8 -- Proc_0 is actually the main program, but it is partC -- of a package, and a program within a package canK -- notEW BENCH.BCK%[PILK.TMP2]DHRYADAA.ADA;1O' be designated as the Dhryadaa program for execution.K -- Therefore Proc_0 is activated by a call from "Dhryadaa".---- WRITE OUT TIMING RESULTS------ write out start time--F new_line; put (" Dhrystone start time: ");put (start_time, 5, 2, 0); put (" seconds"); new_line;A new_line(data_file); put (data_file," Dhrystone start time: ");& put (data_file,start_time, 5, 2, 0);2 put (data_file," seconds"); new_line(data_file);---- write out stop time--: put (" Dhrystone stop time: ");put (stop_time, 5, 2, 0); put (" seconds");new_line;+ put (data_file," Dhrystone stop time: ");% put (data_file,stop_time, 5, 2, 0); put (data_file," seconds"); new_line(data_file);---- write out elapsed time--) elapsed_time := stop_time - start_time;3 put (" Elapsed time for ");put (no_of_cycles, 3);? put (" cycles: ");put(elapsed_time, 5,2,0); put(" seconds "); new_line;' put (data_file," Elapsed time for ");" put (data_file,no_of_cycles, 3);A put (data_file," cycles: ");put(data_file,elapsed_time, 5,2,0); put (data_file," seconds "); new_line(data_file);--'-- Sum the time in millisecs per cycle--E mean_time := mean_time + (elapsed_time*1000.0)/float(no_of_cycles);--A-- Compute the Dhrystone rating based on the time for the number$-- of cycles just executed and write--E-- RATING = (100 statements/cycle * number of cycles)/elapsed time--5 rating := (100.0*FLOAT(NO_OF_CYCLES))/ELAPSED_TIME;---- Sum Dhrystone rating--& mean_rating := mean_rating + rating; lint_rating := lint(rating);1 put (" Dhrystone rating: "); put(lint_rating);8 put (" statement execution per unit time "); new_line;( put(data_file," Dhrystone rating: "); put(data_file, lint_rating);7 put(data_file," statement execution per unit time "); new_line(data_file); end loop;--5-- Calculate the average time in millisecs per cycle--* mean_time := mean_time/float(no_of_runs);D new_line; put (" Average time per cycle: "); put (mean_time,5,2,0); put_line (" millisecs "); new_line (data_file);N put (data_file," Average time per cycle: "); put (data_file,mean_time,5,2,0); put (data_file," millisecs ");--+-- Calculate the average Dhrystone ratings--. mean_rating := mean_rating/float(no_of_runs);" lint_rating := lint(mean_rating);. new_line; put(" Average Dhrystone rating: ");A put (Lint_rating); put (" statement execution per unit time ");D new_line(data_file); put (data_file," Average Dhrystone rating: "); put (data_file,Lint_rating);7 put (data_file," statement execution per unit time "); close (data_file); end Dhryadaa; with Global_Def,Calendar,Pack_2;use Global_Def,Calendar;package body Pack_1 is ----------- Bool_Glob: boolean; Char_Glob_1, Char_Glob_2: character;) Array_Glob_1: Array_1_Dim_Integer;) Array_Glob_2: Array_2_Dim_Integer; Pointer_Glob,$ Pointer_Glob_Next: Record_Pointer; procedure Proc_4; procedure Proc_5;Eprocedure Proc_0 (cycles: in integer;start_time,stop_time: out float)is Int_Loc_1, Int_Loc_2, Int_Loc_3: One_To_Fifty; Char_Loc: character; Enum_Loc: Enumeration; String_Loc_1, String_Loc_2: String_30; begin -- Initializations. Pack_1.Pointer_Glob_Next := new Record_Type;( Pack_1.Pointer_Glob := new Record_Type '(A Pointer_Comp =>Pack_1.Pointer_Glob_Next,0 Discr =>Ident_1,0 Enum_Comp =>Ident_3,+ Int_Comp =>40,H String_Comp =>"DHRYSTONE PROGRAM, SOME STRING" );3 String_Loc_1 := "DHRYSTONE PROGRAM, 1'ST STRING";------------------- Start timer --) Start_Time := float (seconds (clock));-----------------for N in 1..cycles loop Proc_5; Proc_4;< -- Char_Glob_1 = 'A',Char_Glob_2 = 'B',Bool_Glob = false Int_Loc_1 := 2; Int_Loc_2 := 3;3 String_Loc_2 := "DHRYSTONE PROGRAM, 2'ND STRING"; Enum_Loc := Ident_2;< Bool_Glob := not Pack_2.Func_2(String_Loc_1,String_Loc_2); -- Bool_Glob = true< while Int_Loc_1 < Int_Loc_2 loop --loop body executed once* Int_Loc_3 := 5 * Int_Loc_1 - Int_Loc_2; -- Int_Loc_3 = 71 Pack_2.Proc_7 (Int_Loc_1,Int_Loc_2,Int_Loc_3); -- Int_Loc_3 = 7 Int_Loc_1 := Int_Loc_1 + 1; end loop; -- Int_Loc_1 = 3? Pack_2.Proc_8(Array_Glob_1,Array_Glob_2,Int_Loc_1,Int_Loc_3); -- Int_Glob = 5 Proc_1 (Pointer_Glob);D for Char_Index in 'A'..Char_Glob_2 loop --loop body executed twice- if Enum_Loc=Pack_2.Func_1(Char_Index,'C') then--not executed& Pack_2.Proc_6(Ident_1,Enum_Loc); end if; end loop; -- Enum_Loc = Ident_10 -- Int_Loc_1 = 3,Int_Loc_2 = 3,Int_Loc_3 = 7% Int_Loc_3 := Int_Loc_2 * Int_Loc_1;% Int_Loc_2 := Int_Loc_3 / Int_Loc_1;7 Int_Loc_2 := 7 * (Int_Loc_3 - Int_Loc_2) - Int_Loc_1; Proc_2(Int_Loc_1); end loop;------------------- Stop timer --' Stop_Time := float (seconds(clock));----------------- end Proc_0;4procedure Proc_1 (Pointer_Par_In: in Record_Pointer)is--executed once Next_Record: Record_TypeD renames Pointer_Par_In.Pointer_Comp.all;--=Pointer_Glob_Next.allbegin" Next_Record := Pointer_Glob.all; Pointer_Par_In.Int_Comp := 5;2 Next_Record.Int_Comp := Pointer_Par_In.Int_Comp;: Next_Record.Pointer_Comp := Pointer_Par_In.Pointer_Comp;$ Proc_3 (Next_Record.Pointer_Comp);O -- Next_Record.Pointer_Comp = Pointer_Glob.Pointer_Comp = Pointer_Glob_Next if Next_Record.Discr = Ident_1 then -- executed Next_Record.Int_Comp := 6;C Pack_2.Proc_6(Pointer_Par_In.Enum_Comp,Next_Record.Enum_Comp);; Next_Record.Pointer_Comp := Pointer_Glob.Pointer_Comp;C Pack_2.Proc_7(Next_Record.Int_Comp, 10, Next_Record.Int_Comp); else -- not executed' Pointer_Par_In.all := Next_Record; end if; end Proc_1;5procedure Proc_2 (Int_Par_In_Out:in out One_To_Fifty)is -- executed once! -- In_Par_In_Out = 3,becomes 7 Int_Loc: One_To_Fifty; Enum_Loc: Enumeration;begin! Int_Loc := Int_Par_In_Out + 10; loop -- executed once if Char_Glob_1 = 'A' then -- executed Int_Loc := Int_Loc - 1;+ Int_Par_In_Out := Int_Loc - Int_Glob; Enum_Loc := Ident_1; end if;' exit when Enum_Loc = Ident_1; -- true end loop; end Proc_2;6procedure Proc_3 (Pointer_Par_Out: out Record_Pointer)is -- executed once* -- Pointer_Par_Out becomes Pointer_Globbegin if Pointer_Glob /= null then -- executed1 Pointer_Par_Out := Pointer_Glob.Pointer_Comp; else -- not executed Int_Glob := 100; end if;3 Pack_2.Proc_7(10,Int_Glob,Pointer_Glob.Int_Comp); end Proc_3;&procedure Proc_4 -- without parametersis -- executed once Bool_Loc: boolean;begin Bool_Loc := Char_Glob_1 = 'A';$ Bool_Loc := Bool_Loc or Bool_Glob; Char_Glob_2 := 'B'; end Proc_4;&procedure Proc_5 -- without parametersis--executed oncebegin Char_Glob_1 := 'A'; Bool_Glob := false; end Proc_5; end Pack_1;with Global_Def,Pack_1;use Global_Def;package body Pack_2 is-------------------;function Func_3(Enum_Par_In: in Enumeration)return boolean; -- forward declaration/procedure Proc_6(Enum_Par_In: in Enumeration;0 Enum_Par_Out: out Enumeration)is -- executed once8 -- Enum_Par_In = Ident_3,En;) BENCH.BCK%[PILK.TMP2]DHRYADAA.ADA;1O'Vwum_Par_Out becomes Ident_2begin Enum_Par_Out := Enum_Par_In; if not Func_3(Enum_Par_In) then -- not executed Enum_Par_Out := Ident_4; end if; case Enum_Par_In is, when Ident_1 => Enum_Par_Out := Ident_1;, when Ident_2 => if Pack_1.Int_Glob > 1001 then Enum_Par_Out := Ident_1;1 else Enum_Par_Out := Ident_4; end if;8 when Ident_3 => Enum_Par_Out := Ident_2; -- executed when Ident_4 => null;, when Ident_5 => Enum_Par_Out := Ident_3; end case; end Proc_6;procedure Proc_7(Int_Par_In_1,0 Int_Par_In_2: in One_To_Fifty;1 Int_Par_Out: out One_To_Fifty)is -- executed three times8 -- first call: Int_Par_In_1 = 2,Int_Par_In_2 = 3,+ -- Int_Par_Out becomes 79 -- second call: Int_Par_In_1 = 6,Int_Par_In_2 = 10,, -- Int_Par_Out becomes 189 -- third call: Int_Par_In_1 = 10,Int_par_In_2 = 5,, -- Int_Par_Out becomes 17 Int_Loc: One_To_Fifty;begin Int_Loc := Int_Par_In_1 + 2;+ Int_Par_Out := Int_Par_In_2 + Int_Loc; end Proc_7;@procedure Proc_8 (Array_Par_In_Out_1:in out Array_1_Dim_Integer;@ Array_Par_In_Out_2:in out Array_2_Dim_Integer; Int_Par_In_1,4 Int_Par_In_2: in integer)is -- executed once -- Int_Par_In_1 = 3 -- Int_Par_In_2 = 7 Int_Loc:One_To_Fifty;begin Int_Loc := Int_par_In_1 + 5;. Array_Par_In_Out_1(Int_Loc) := Int_Par_In_2;" Array_Par_In_Out_1(Int_Loc+1) :=6 Array_Par_In_Out_1 (Int_Loc);, Array_Par_In_Out_1(Int_Loc+30) := Int_Loc;H for Int_Index in Int_Loc .. Int_Loc+1 loop -- loop body executed twice5 Array_Par_In_Out_2(Int_Loc,Int_Index) := Int_Loc; end loop;-* Array_Par_In_Out_2(Int_Loc,Int_Loc-1) :=A Array_Par_In_Out_2(Int_Loc,Int_Loc-1)+1; + Array_Par_In_Out_2(Int_Loc+20,Int_Loc) := 5 Array_Par_In_Out_1(Int_Loc);  Pack_1.Int_Glob := 5; end Proc_8; function Func_1(Char_Par_In_1,0 Char_Par_In_2:in Capital_Letter)A return Enumeration 5is -- executed three times, returns Ident_1 each time ; -- first call: Char_Par_In_1 = 'H', Char_Par_In_2 = 'R' ; -- second call: Char_Par_In_1 = 'A', Char_Par_In_2 = 'C'-; -- third call: Char_Par_In_1 = 'B', Char_Par_In_2 = 'C'A' Char_Loc_1,Char_Loc_2:Capital_Letter; beginT Char_Loc_1 := Char_Par_In_1; Char_Loc_2 := Char_Loc_1;- if Char_Loc_2 /= Char_Par_In_2 then-- executed  return Ident_1;  else-- not executed- return Ident_2;a end if; end Func_1;b function Func_2(String_Par_In_1,; String_Par_In_2:in String_30)return boolean"is -- executed once, returns false0 -- String_Par_In_1 = "DHRYSTONE, 1'ST STRING"0 -- String_Par_In_2 = "DHRYSTONE, 2'ND STRING" Int_Loc: One_To_Thirty; Char_Loc: Capital_Letter;begin  Int_Loc := 2; 2 while Int_Loc<=2 Loop -- loop body executed once' if Func_1(String_Par_In_1(Int_Loc),a3 String_Par_In_2(Int_Loc+1)) = Ident_1n then-- executede Char_Loc := 'A'; Int_Loc := Int_Loc + 1; end if; end loop; %if Char_Loc >= 'W' and Char_Loc < 'Z' then-- not executed  Int_Loc := 7;end if; if Char_Loc = 'X'othen-- not executed  return true; else -- executed* if String_Par_In_1 > String_Par_In_2 then -- not executed Int_Loc := Int_Loc + 7;  return true; else -- executed return false;- end if;t end if;e end Func_2;e:function Func_3(Enum_Par_In: in Enumeration)return boolean!is -- executed once, returns true  -- Enum_Par_In = Ident_3 Enum_Loc: Enumeration;begin  Enum_Loc := Enum_Par_In; if Enum_Loc = Ident_3  then -- executed return true; end if; end Func_3; end Pack_2; *[PILK.TMP2]DHRYADAB.ADA;1+, .'/ 4O'&-0123KPWO(560g>77ҵג89GHJ O-------------------------------------------------------------------------------O-- --O-- "DHRYSTONE" Benchmark Program --O-- -------------------------------- --O-- --O-- Version: ADA/1 --O-- --O-- Date: 04/15/84 --O-- --O-- Author: Reinhold P. Weicker ---- --+-- Filename: DHRYADAB.DEC ---- ---- History: ---- --H-- CHANGE MADE BY WHOM DATE --@-- ----------- --------- ------- --O-- --B-- added timing calls D. Sayon 13 Feb 85 --O-- to write to file --O-- --O-------------------------------------------------------------------------------O-- --O-- The following program contains statements of a high-level programming --O-- language (Ada) in a distribution considered representative: --O-- --O-- assignments 53% --O-- control statements 32% --O-- procedure, function calls 15% --O-- --O-- 100 statements are dynamically executed. The program is balanced with --O-- respect to the three aspects: --O-- --O-- -statement type --O-- -operand type (for simple data types) --O-- -operand access --O-- operand global, local, parameter, or constant. --O-- --O-- The combination of these three aspects is balanced only approximately. --O-- --O-- The program does not compute anything meaningful, but it is syntacially --O-- and semanticx BENCH.BCK [PILK.TMP2]DHRYADAB.ADA;1O'Dally correct. All variables have a value assigned to them --O-- before they are used as a source operand. --O-------------------------------------------------------------------------------package Global_Def is-------------------- Global type definitions>type Enumeration is (Ident_1,Ident_2,Ident_3,Ident_4,Ident_5);-subtype One_To_Thirty is integer range 1..30;,subtype One_To_Fifty is integer range 1..50;3subtype Capital_Letter is character range 'A'..'Z';3type String_30 is array(One_To_Thirty)of character;-- pragma Pack(String_30);:type Array_1_Dim_Integer is array(One_To_Fifty)of integer;/type Array_2_Dim_Integer is array(One_To_Fifty,: One_To_Fifty)of integer;/type Record_Type(Discr:Enumeration := Ident_1);*type Record_Pointer is access Record_Type;0type Record_Type(Discr:Enumeration := Ident_1)is record( Pointer_Comp: Record_Pointer; case Discr is7 when Ident_1 => -- only this variant is used,; -- but in some cases discriminant1 -- checks are necessary% Enum_Comp: Enumeration;& Int_Comp: One_To_Fifty;# String_Comp: String_30; when Ident_2 =>% Enum_Comp_2: Enumeration;# String_Comp_2: String_30; when others => Char_Comp_1,# Char_Comp_2: character; end case; end record;end Global_Def; with Global_Def,Calendar; use Global_Def,Calendar;package Pack_1 is -------------I procedure Proc_0(cycles: in integer; start_time, stop_time: out Float);< procedure Proc_1(Pointer_Par_in: in Record_Pointer);: procedure Proc_2(Int_Par_In_Out: in out One_To_Fifty);< procedure Proc_3(Pointer_Par_Out: out Record_Pointer); Int_Glob: integer;pragma inline (proc_0);pragma inline (proc_1);pragma inline (proc_2);pragma inline (proc_3); end Pack_1;with Global_Def;use Global_Def;package Pack_2 is--------------= procedure Proc_6 (Enum_Par_In: in Enumeration;> Enum_Par_Out: out Enumeration);! procedure Proc_7 (Int_Par_In_1,> Int_Par_In_2: in One_To_Fifty;? Int_Par_Out: out One_To_Fifty);E procedure Proc_8 (Array_Par_In_Out_1: in out Array_1_Dim_Integer;E Array_Par_In_Out_2: in out Array_2_Dim_Integer;! Int_Par_In_1,: Int_Par_In_2: in integer);" function Func_1 (Char_Par_In_1,@ Char_Par_In_2: in Capital_Letter)D return Enumeration;$ function Func_2 (String_Par_In_1,; String_Par_In_2: in String_30)B return boolean;pragma inline (proc_6);pragma inline (proc_7);pragma inline (proc_8);pragma inline (func_1);pragma inline (func_2);end Pack_2; +with Global_Def,Pack_1,Text_IO, Help_Tools;%use Global_Def, Text_IO, Help_Tools; procedure Dhryadab is--------------(package real_io is new float_io(float); use real_io;*package int_io is new integer_io(integer); use int_io;type lint is range 1..500_000;(package lint_io is new integer_io(lint); use lint_io;+filename: string (1..13):= "Vectra.dat ";lint_rating : lint; No_of_Cycles,No_of_Runs : integer; mean_rating,rating, mean_time, elapsed_time, start_time,stop_time: float;data_file: file_type;begin mean_time := 0.0; mean_rating := 0.0; No_of_Runs := 20;--Time_filename (filename);-- filename(1) := 'D';) create (data_file,out_file,filename,""); read_environ(data_file);9 put("ADA Dhrystone Benchmark (DHRYADAB.DEC)"); new_line;M put(data_file,"ADA Dhrystone Benchmark (DHRYADAB.DEC)");new_line(data_file); for N in 1..No_of_Runs loop No_of_Cycles := N*100;3 Pack_1.Proc_0(No_of_Cycles,start_time,stop_time);8 -- Proc_0 is actually the main program, but it is partC -- of a package, and a program within a package canK -- not be designated as the Dhryadab program for execution.K -- Therefore Proc_0 is activated by a call from "Dhryadab".---- WRITE OUT TIMING RESULTS------ write out start time--F new_line; put (" Dhrystone start time: ");put (start_time, 5, 2, 0); put (" seconds"); new_line;A new_line(data_file); put (data_file," Dhrystone start time: ");& put (data_file,start_time, 5, 2, 0);2 put (data_file," seconds"); new_line(data_file);---- write out stop time--: put (" Dhrystone stop time: ");put (stop_time, 5, 2, 0); put (" seconds");new_line;+ put (data_file," Dhrystone stop time: ");% put (data_file,stop_time, 5, 2, 0); put (data_file," seconds"); new_line(data_file);---- write out elapsed time--) elapsed_time := stop_time - start_time;3 put (" Elapsed time for ");put (no_of_cycles, 3);? put (" cycles: ");put(elapsed_time, 5,2,0); put(" seconds "); new_line;' put (data_file," Elapsed time for ");" put (data_file,no_of_cycles, 3);A put (data_file," cycles: ");put(data_file,elapsed_time, 5,2,0); put (data_file," seconds "); new_line(data_file);--'-- Sum the time in millisecs per cycle--E mean_time := mean_time + (elapsed_time*1000.0)/float(no_of_cycles);--A-- Compute the Dhrystone rating based on the time for the number$-- of cycles just executed and write--E-- RATING = (100 statements/cycle * number of cycles)/elapsed time--5 rating := (100.0*FLOAT(NO_OF_CYCLES))/ELAPSED_TIME;---- Sum Dhrystone rating--& mean_rating := mean_rating + rating; lint_rating := lint(rating);1 put (" Dhrystone rating: "); put(lint_rating);8 put (" statement execution per unit time "); new_line;( put(data_file," Dhrystone rating: "); put(data_file, lint_rating);7 put(data_file," statement execution per unit time "); new_line(data_file); end loop;--5-- Calculate the average time in millisecs per cycle--* mean_time := mean_time/float(no_of_runs);D new_line; put (" Average time per cycle: "); put (mean_time,5,2,0); put_line (" millisecs "); new_line (data_file);N put (data_file," Average time per cycle: "); put (data_file,mean_time,5,2,0); put (data_file," millisecs ");--+-- Calculate the average Dhrystone ratings--. mean_rating := mean_rating/float(no_of_runs);" lint_rating := lint(mean_rating);. new_line; put(" Average Dhrystone rating: ");A put (Lint_rating); put (" statement execution per unit time ");D new_line(data_file); put (data_file," Average Dhrystone rating: "); put (data_file,Lint_rating);7 put (data_file," statement execution per unit time "); close (data_file); end Dhryadab; with Global_Def,Calendar,Pack_2;use Global_Def,Calendar;package body Pack_1 is ----------- Bool_Glob: boolean; Char_Glob_1, Char_Glob_2: character;) Array_Glob_1: Array_1_Dim_Integer;) Array_Glob_2: Array_2_Dim_Integer; Pointer_Glob,$ Pointer_Glob_Next: Record_Pointer; procedure Proc_4; procedure Proc_5;Eprocedure Proc_0 (cycles: in integer;start_time,stop_time: out float)is Int_Loc_1, Int_Loc_2, Int_Loc_3: One_To_Fifty; Char_Loc: character; Enum_Loc: Enumeration; String_Loc_1, String_Loc_2a BENCH.BCK [PILK.TMP2]DHRYADAB.ADA;1O'*: String_30; begin -- Initializations. Pack_1.Pointer_Glob_Next := new Record_Type;( Pack_1.Pointer_Glob := new Record_Type '(A Pointer_Comp =>Pack_1.Pointer_Glob_Next,0 Discr =>Ident_1,0 Enum_Comp =>Ident_3,+ Int_Comp =>40,H String_Comp =>"DHRYSTONE PROGRAM, SOME STRING" );3 String_Loc_1 := "DHRYSTONE PROGRAM, 1'ST STRING";------------------- Start timer --) Start_Time := float (seconds (clock));-----------------for N in 1..cycles loop Proc_5; Proc_4;< -- Char_Glob_1 = 'A',Char_Glob_2 = 'B',Bool_Glob = false Int_Loc_1 := 2; Int_Loc_2 := 3;3 String_Loc_2 := "DHRYSTONE PROGRAM, 2'ND STRING"; Enum_Loc := Ident_2;< Bool_Glob := not Pack_2.Func_2(String_Loc_1,String_Loc_2); -- Bool_Glob = true< while Int_Loc_1 < Int_Loc_2 loop --loop body executed once* Int_Loc_3 := 5 * Int_Loc_1 - Int_Loc_2; -- Int_Loc_3 = 71 Pack_2.Proc_7 (Int_Loc_1,Int_Loc_2,Int_Loc_3); -- Int_Loc_3 = 7 Int_Loc_1 := Int_Loc_1 + 1; end loop; -- Int_Loc_1 = 3? Pack_2.Proc_8(Array_Glob_1,Array_Glob_2,Int_Loc_1,Int_Loc_3); -- Int_Glob = 5 Proc_1 (Pointer_Glob);D for Char_Index in 'A'..Char_Glob_2 loop --loop body executed twice- if Enum_Loc=Pack_2.Func_1(Char_Index,'C') then--not executed& Pack_2.Proc_6(Ident_1,Enum_Loc); end if; end loop; -- Enum_Loc = Ident_10 -- Int_Loc_1 = 3,Int_Loc_2 = 3,Int_Loc_3 = 7% Int_Loc_3 := Int_Loc_2 * Int_Loc_1;% Int_Loc_2 := Int_Loc_3 / Int_Loc_1;7 Int_Loc_2 := 7 * (Int_Loc_3 - Int_Loc_2) - Int_Loc_1; Proc_2(Int_Loc_1); end loop;------------------- Stop timer --' Stop_Time := float (seconds(clock));----------------- end Proc_0;4procedure Proc_1 (Pointer_Par_In: in Record_Pointer)is--executed once Next_Record: Record_TypeD renames Pointer_Par_In.Pointer_Comp.all;--=Pointer_Glob_Next.allbegin" Next_Record := Pointer_Glob.all; Pointer_Par_In.Int_Comp := 5;2 Next_Record.Int_Comp := Pointer_Par_In.Int_Comp;: Next_Record.Pointer_Comp := Pointer_Par_In.Pointer_Comp;$ Proc_3 (Next_Record.Pointer_Comp);O -- Next_Record.Pointer_Comp = Pointer_Glob.Pointer_Comp = Pointer_Glob_Next if Next_Record.Discr = Ident_1 then -- executed Next_Record.Int_Comp := 6;C Pack_2.Proc_6(Pointer_Par_In.Enum_Comp,Next_Record.Enum_Comp);; Next_Record.Pointer_Comp := Pointer_Glob.Pointer_Comp;C Pack_2.Proc_7(Next_Record.Int_Comp, 10, Next_Record.Int_Comp); else -- not executed' Pointer_Par_In.all := Next_Record; end if; end Proc_1;5procedure Proc_2 (Int_Par_In_Out:in out One_To_Fifty)is -- executed once! -- In_Par_In_Out = 3,becomes 7 Int_Loc: One_To_Fifty; Enum_Loc: Enumeration;begin! Int_Loc := Int_Par_In_Out + 10; loop -- executed once if Char_Glob_1 = 'A' then -- executed Int_Loc := Int_Loc - 1;+ Int_Par_In_Out := Int_Loc - Int_Glob; Enum_Loc := Ident_1; end if;' exit when Enum_Loc = Ident_1; -- true end loop; end Proc_2;6procedure Proc_3 (Pointer_Par_Out: out Record_Pointer)is -- executed once* -- Pointer_Par_Out becomes Pointer_Globbegin if Pointer_Glob /= null then -- executed1 Pointer_Par_Out := Pointer_Glob.Pointer_Comp; else -- not executed Int_Glob := 100; end if;3 Pack_2.Proc_7(10,Int_Glob,Pointer_Glob.Int_Comp); end Proc_3;&procedure Proc_4 -- without parametersis -- executed once Bool_Loc: boolean;begin Bool_Loc := Char_Glob_1 = 'A';$ Bool_Loc := Bool_Loc or Bool_Glob; Char_Glob_2 := 'B'; end Proc_4;&procedure Proc_5 -- without parametersis--executed oncebegin Char_Glob_1 := 'A'; Bool_Glob := false; end Proc_5; end Pack_1;with Global_Def,Pack_1;use Global_Def;package body Pack_2 is-------------------;function Func_3(Enum_Par_In: in Enumeration)return boolean; -- forward declaration/procedure Proc_6(Enum_Par_In: in Enumeration;0 Enum_Par_Out: out Enumeration)is -- executed once8 -- Enum_Par_In = Ident_3,Enum_Par_Out becomes Ident_2begin Enum_Par_Out := Enum_Par_In; if not Func_3(Enum_Par_In) then -- not executed Enum_Par_Out := Ident_4; end if; case Enum_Par_In is, when Ident_1 => Enum_Par_Out := Ident_1;, when Ident_2 => if Pack_1.Int_Glob > 1001 then Enum_Par_Out := Ident_1;1 else Enum_Par_Out := Ident_4; end if;8 when Ident_3 => Enum_Par_Out := Ident_2; -- executed when Ident_4 => null;, when Ident_5 => Enum_Par_Out := Ident_3; end case; end Proc_6;procedure Proc_7(Int_Par_In_1,0 Int_Par_In_2: in One_To_Fifty;1 Int_Par_Out: out One_To_Fifty)is -- executed three times8 -- first call: Int_Par_In_1 = 2,Int_Par_In_2 = 3,+ -- Int_Par_Out becomes 79 -- second call: Int_Par_In_1 = 6,Int_Par_In_2 = 10,, -- Int_Par_Out becomes 189 -- third call: Int_Par_In_1 = 10,Int_par_In_2 = 5,, -- Int_Par_Out becomes 17 Int_Loc: One_To_Fifty;begin Int_Loc := Int_Par_In_1 + 2;+ Int_Par_Out := Int_Par_In_2 + Int_Loc; end Proc_7;@procedure Proc_8 (Array_Par_In_Out_1:in out Array_1_Dim_Integer;@ Array_Par_In_Out_2:in out Array_2_Dim_Integer; Int_Par_In_1,-4 Int_Par_In_2: in integer)is -- executed once  -- Int_Par_In_1 = 3 -- Int_Par_In_2 = 7 Int_Loc:One_To_Fifty;YbeginB Int_Loc := Int_par_In_1 + 5;. Array_Par_In_Out_1(Int_Loc) := Int_Par_In_2;" Array_Par_In_Out_1(Int_Loc+1) :=6 Array_Par_In_Out_1 (Int_Loc);, Array_Par_In_Out_1(Int_Loc+30) := Int_Loc;H for Int_Index in Int_Loc .. Int_Loc+1 loop -- loop body executed twice5 Array_Par_In_Out_2(Int_Loc,Int_Index) := Int_Loc; end loop; * Array_Par_In_Out_2(Int_Loc,Int_Loc-1) :=A Array_Par_In_Out_2(Int_Loc,Int_Loc-1)+1; + Array_Par_In_Out_2(Int_Loc+20,Int_Loc) := 5 Array_Par_In_Out_1(Int_Loc);  Pack_1.Int_Glob := 5; end Proc_8; function Func_1(Char_Par_In_1,0 Char_Par_In_2:in Capital_Letter)A return Enumeration 5is -- executed three times, returns Ident_1 each timeT; -- first call: Char_Par_In_1 = 'H', Char_Par_In_2 = 'R'-; -- second call: Char_Par_In_1 = 'A', Char_Par_In_2 = 'C' ; -- third call: Char_Par_In_1 = 'B', Char_Par_In_2 = 'C'l' Char_Loc_1,Char_Loc_2:Capital_Letter;begin  Char_Loc_1 := Char_Par_In_1; Char_Loc_2 := Char_Loc_1; if Char_Loc_2 /= Char_Par_In_2 then-- executed  return Ident_1;  else-- not executed- return Ident_2;- end if;- end Func_1;- function Func_2(String_Par_In_1,; String_Par_In_2:in String_30)return boolean "is -- executed once, returns false0 -- String_Par_In_1 = "DHRYSTONE, 1'ST STRING"0 -- String_Par_In_2 = "DHRYSTONE, 2'ND STRING" Int_Loc: One_To_Thirty;  Char_Loc: Capital_Letter;begin  Int_Loc := 2; 2 while Int_Loc<=2 Loop -- loop body executed once' if Func_1(String_Par_In_1(Int_Loc), 3 String_Par_In_2(Int_Loc+1)) = Ident_1  then-- executed  Char_Loc := 'A'; Int_Loc := Int_Loc + 1; end if; end loop; %if Cha BENCH.BCK [PILK.TMP2]DHRYADAB.ADA;1O'}%r_Loc >= 'W' and Char_Loc < 'Z' then-- not executed  Int_Loc := 7;end if; if Char_Loc = 'X'-then-- not executeds return true; else -- executed* if String_Par_In_1 > String_Par_In_2 then -- not executed Int_Loc := Int_Loc + 7;- return true; else -- executed return false; end if; end if;e end Func_2; :function Func_3(Enum_Par_In: in Enumeration)return boolean!is -- executed once, returns trues -- Enum_Par_In = Ident_3  Enum_Loc: Enumeration;begin  Enum_Loc := Enum_Par_In; if Enum_Loc = Ident_3- then -- executed return true; end if;r end Func_3; end Pack_2; *[PILK.TMP2]DHRYADAC.ADA;1+, .'/ 4O'&-0123KPWO(56 >7 Pҵג89GHJO-------------------------------------------------------------------------------O-- --O-- "DHRYSTONE" Benchmark Program --O-- -------------------------------- --O-- --O-- Version: ADA/1 --O-- --O-- Date: 04/15/84 --O-- --O-- Author: Reinhold P. Weicker ---- --+-- Filename: DHRYADAC.DEC ---- ---- History: ---- --H-- CHANGE MADE BY WHOM DATE --@-- ----------- --------- ------- --O-- --B-- added timing calls D. Sayon 13 Feb 85 --O-- to write to file --O-- --O-------------------------------------------------------------------------------O-- --O-- The following program contains statements of a high-level programming --O-- language (Ada) in a distribution considered representative: --O-- --O-- assignments 53% --O-- control statements 32% --O-- procedure, function calls 15% --O-- --O-- 100 statements are dynamically executed. The program is balanced with --O-- respect to the three aspects: --O-- --O-- -statement type --O-- -operand type (for simple data types) --O-- -operand access --O-- operand global, local, parameter, or constant. --O-- --O-- The combination of these three aspects is balanced only approximately. --O-- --O-- The program does not compute anything meaningful, but it is syntacially --O-- and semantically correct. All variables have a value assigned to them --O-- before they are used as a source operand. --O-------------------------------------------------------------------------------package Global_Def is-------------------- Global type definitions>type Enumeration is (Ident_1,Ident_2,Ident_3,Ident_4,Ident_5);-subtype One_To_Thirty is integer range 1..30;,subtype One_To_Fifty is integer range 1..50;3subtype Capital_Letter is character range 'A'..'Z';3type String_30 is array(One_To_Thirty)of character; pragma Pack(String_30);:type Array_1_Dim_Integer is array(One_To_Fifty)of integer;/type Array_2_Dim_Integer is array(One_To_Fifty,: One_To_Fifty)of integer;/type Record_Type(Discr:Enumeration := Ident_1);*type Record_Pointer is access Record_Type;0type Record_Type(Discr:Enumeration := Ident_1)is record( Pointer_Comp: Record_Pointer; case Discr is7 when Ident_1 => -- only this variant is used,; -- but in some cases discriminant1 -- checks are necessary% Enum_Comp: Enumeration;& Int_Comp: One_To_Fifty;# String_Comp: String_30; when Ident_2 =>% Enum_Comp_2: Enumeration;# String_Comp_2: String_30; when others => Char_Comp_1,# Char_Comp_2: character; end case; end record;end Global_Def; with Global_Def,Calendar; use Global_Def,Calendar;package Pack_1 is -------------I procedure Proc_0(cycles: in integer; start_time, stop_time: out Float);< procedure Proc_1(Pointer_Par_in: in Record_Pointer);: procedure Proc_2(Int_Par_In_Out: in out One_To_Fifty);< procedure Proc_3(Pointer_Par_Out: out Record_Pointer); Int_Glob: integer;pragma inline (proc_0);pragma inline (proc_1);pragma inline (proc_2);pragma inline (proc_3); end Pack_1;with Global_Def;use Global_Def;package Pack_2 is--------------= procedure Proc_6 (Enum_Par_In: in Enumeration;> Enum_Par_Out: out Enumeration);! procedure Proc_7 (Int_Par_In_1,> Int_Par_In_2: in One_To_Fifty;? Int_Par_Out: out One_To_Fifty);E procedure Proc_8 (Array_Par_In_Out_1: in out Array_1_Dim_Integer;E Array_Par_In_Out_2: in out Array_2_Dim_Integer;! Int_Par_In_1,: Int_Par_In_2: in integer);" function Func_1 (Char_Par_In_1,@ Char_Par_In_2: in Capital_Letter)D return Enumeration;$ function Func_2 (String_Par_In_1,; String_Par_In_2: in String_30)B return boolean;pragma inline (proc_6);pragma inline (proc_7);pragma inline (proc_ ye BENCH.BCK [PILK.TMP2]DHRYADAC.ADA;1O'8v 8);pragma inline (func_1);pragma inline (func_2);end Pack_2; +with Global_Def,Pack_1,Text_IO, Help_Tools;%use Global_Def, Text_IO, Help_Tools; procedure Dhryadac is--------------(package real_io is new float_io(float); use real_io;*package int_io is new integer_io(integer); use int_io;type lint is range 1..500_000;(package lint_io is new integer_io(lint); use lint_io;+filename: string (1..13):= "Vectra.dat ";lint_rating : lint; No_of_Cycles,No_of_Runs : integer; mean_rating,rating, mean_time, elapsed_time, start_time,stop_time: float;data_file: file_type;begin mean_time := 0.0; mean_rating := 0.0; No_of_Runs := 20;--Time_filename (filename);-- filename(1) := 'D';) create (data_file,out_file,filename,""); read_environ(data_file);9 put("ADA Dhrystone Benchmark (DHRYADAC.DEC)"); new_line;M put(data_file,"ADA Dhrystone Benchmark (DHRYADAC.DEC)");new_line(data_file); for N in 1..No_of_Runs loop No_of_Cycles := N*100;3 Pack_1.Proc_0(No_of_Cycles,start_time,stop_time);8 -- Proc_0 is actually the main program, but it is partC -- of a package, and a program within a package canK -- not be designated as the Dhryadac program for execution.K -- Therefore Proc_0 is activated by a call from "Dhryadac".---- WRITE OUT TIMING RESULTS------ write out start time--F new_line; put (" Dhrystone start time: ");put (start_time, 5, 2, 0); put (" seconds"); new_line;A new_line(data_file); put (data_file," Dhrystone start time: ");& put (data_file,start_time, 5, 2, 0);2 put (data_file," seconds"); new_line(data_file);---- write out stop time--: put (" Dhrystone stop time: ");put (stop_time, 5, 2, 0); put (" seconds");new_line;+ put (data_file," Dhrystone stop time: ");% put (data_file,stop_time, 5, 2, 0); put (data_file," seconds"); new_line(data_file);---- write out elapsed time--) elapsed_time := stop_time - start_time;3 put (" Elapsed time for ");put (no_of_cycles, 3);? put (" cycles: ");put(elapsed_time, 5,2,0); put(" seconds "); new_line;' put (data_file," Elapsed time for ");" put (data_file,no_of_cycles, 3);A put (data_file," cycles: ");put(data_file,elapsed_time, 5,2,0); put (data_file," seconds "); new_line(data_file);--'-- Sum the time in millisecs per cycle--E mean_time := mean_time + (elapsed_time*1000.0)/float(no_of_cycles);--A-- Compute the Dhrystone rating based on the time for the number$-- of cycles just executed and write--E-- RATING = (100 statements/cycle * number of cycles)/elapsed time--5 rating := (100.0*FLOAT(NO_OF_CYCLES))/ELAPSED_TIME;---- Sum Dhrystone rating--& mean_rating := mean_rating + rating; lint_rating := lint(rating);1 put (" Dhrystone rating: "); put(lint_rating);8 put (" statement execution per unit time "); new_line;( put(data_file," Dhrystone rating: "); put(data_file, lint_rating);7 put(data_file," statement execution per unit time "); new_line(data_file); end loop;--5-- Calculate the average time in millisecs per cycle--* mean_time := mean_time/float(no_of_runs);D new_line; put (" Average time per cycle: "); put (mean_time,5,2,0); put_line (" millisecs "); new_line (data_file);N put (data_file," Average time per cycle: "); put (data_file,mean_time,5,2,0); put (data_file," millisecs ");--+-- Calculate the average Dhrystone ratings--. mean_rating := mean_rating/float(no_of_runs);" lint_rating := lint(mean_rating);. new_line; put(" Average Dhrystone rating: ");A put (Lint_rating); put (" statement execution per unit time ");D new_line(data_file); put (data_file," Average Dhrystone rating: "); put (data_file,Lint_rating);7 put (data_file," statement execution per unit time "); close (data_file); end Dhryadac; with Global_Def,Calendar,Pack_2;use Global_Def,Calendar;package body Pack_1 is ----------- Bool_Glob: boolean; Char_Glob_1, Char_Glob_2: character;) Array_Glob_1: Array_1_Dim_Integer;) Array_Glob_2: Array_2_Dim_Integer; Pointer_Glob,$ Pointer_Glob_Next: Record_Pointer; procedure Proc_4; procedure Proc_5;Eprocedure Proc_0 (cycles: in integer;start_time,stop_time: out float)is Int_Loc_1, Int_Loc_2, Int_Loc_3: One_To_Fifty; Char_Loc: character; Enum_Loc: Enumeration; String_Loc_1, String_Loc_2: String_30; begin -- Initializations. Pack_1.Pointer_Glob_Next := new Record_Type;( Pack_1.Pointer_Glob := new Record_Type '(A Pointer_Comp =>Pack_1.Pointer_Glob_Next,0 Discr =>Ident_1,0 Enum_Comp =>Ident_3,+ Int_Comp =>40,H String_Comp =>"DHRYSTONE PROGRAM, SOME STRING" );3 String_Loc_1 := "DHRYSTONE PROGRAM, 1'ST STRING";------------------- Start timer --) Start_Time := float (seconds (clock));-----------------for N in 1..cycles loop Proc_5; Proc_4;< -- Char_Glob_1 = 'A',Char_Glob_2 = 'B',Bool_Glob = false Int_Loc_1 := 2; Int_Loc_2 := 3;3 String_Loc_2 := "DHRYSTONE PROGRAM, 2'ND STRING"; Enum_Loc := Ident_2;< Bool_Glob := not Pack_2.Func_2(String_Loc_1,String_Loc_2); -- Bool_Glob = true< while Int_Loc_1 < Int_Loc_2 loop --loop body executed once* Int_Loc_3 := 5 * Int_Loc_1 - Int_Loc_2; -- Int_Loc_3 = 71 Pack_2.Proc_7 (Int_Loc_1,Int_Loc_2,Int_Loc_3); -- Int_Loc_3 = 7 Int_Loc_1 := Int_Loc_1 + 1; end loop; -- Int_Loc_1 = 3? Pack_2.Proc_8(Array_Glob_1,Array_Glob_2,Int_Loc_1,Int_Loc_3); -- Int_Glob = 5 Proc_1 (Pointer_Glob);D for Char_Index in 'A'..Char_Glob_2 loop --loop body executed twice- if Enum_Loc=Pack_2.Func_1(Char_Index,'C') then--not executed& Pack_2.Proc_6(Ident_1,Enum_Loc); end if; end loop; -- Enum_Loc = Ident_10 -- Int_Loc_1 = 3,Int_Loc_2 = 3,Int_Loc_3 = 7% Int_Loc_3 := Int_Loc_2 * Int_Loc_1;% Int_Loc_2 := Int_Loc_3 / Int_Loc_1;7 Int_Loc_2 := 7 * (Int_Loc_3 - Int_Loc_2) - Int_Loc_1; Proc_2(Int_Loc_1); end loop;------------------- Stop timer --' Stop_Time := float (seconds(clock));----------------- end Proc_0;4procedure Proc_1 (Pointer_Par_In: in Record_Pointer)is--executed once Next_Record: Record_TypeD renames Pointer_Par_In.Pointer_Comp.all;--=Pointer_Glob_Next.allbegin" Next_Record := Pointer_Glob.all; Pointer_Par_In.Int_Comp := 5;2 Next_Record.Int_Comp := Pointer_Par_In.Int_Comp;: Next_Record.Pointer_Comp := Pointer_Par_In.Pointer_Comp;$ Proc_3 (Next_Record.Pointer_Comp);O -- Next_Record.Pointer_Comp = Pointer_Glob.Pointer_Comp = Pointer_Glob_Next if Next_Record.Discr = Ident_1 then -- executed Next_Record.Int_Comp := 6;C Pack_2.Proc_6(Pointer_Par_In.Enum_Comp,Next_Record.Enum_Comp);; Next_Record.Pointer_Comp := Pointer_Glob.Pointer_Comp;C Pack_2.Proc_7(Next_Record.Int_Comp, 10, Next_Record.Int_Comp); else -- not executed' Pointer_Par_In.all := Next_Record; end if; end Proc_1;5procedure Proc_2 (Int_Par_In_Out:in out One_To_Fifty)is -- executed once! -- In_Par_In_Out = 3,becomes 7 Int_Loc: One_To_Fifty; Enum_Loc: Enumeration;begin! Int_Loc := Int_Par_In_Out + 10; loop -- executed once if Char_Glob_1 = 'A' then/ BENCH.BCK [PILK.TMP2]DHRYADAC.ADA;1O'  -- executed Int_Loc := Int_Loc - 1;+ Int_Par_In_Out := Int_Loc - Int_Glob; Enum_Loc := Ident_1; end if;' exit when Enum_Loc = Ident_1; -- true end loop; end Proc_2;6procedure Proc_3 (Pointer_Par_Out: out Record_Pointer)is -- executed once* -- Pointer_Par_Out becomes Pointer_Globbegin if Pointer_Glob /= null then -- executed1 Pointer_Par_Out := Pointer_Glob.Pointer_Comp; else -- not executed Int_Glob := 100; end if;3 Pack_2.Proc_7(10,Int_Glob,Pointer_Glob.Int_Comp); end Proc_3;&procedure Proc_4 -- without parametersis -- executed once Bool_Loc: boolean;begin Bool_Loc := Char_Glob_1 = 'A';$ Bool_Loc := Bool_Loc or Bool_Glob; Char_Glob_2 := 'B'; end Proc_4;&procedure Proc_5 -- without parametersis--executed oncebegin Char_Glob_1 := 'A'; Bool_Glob := false; end Proc_5; end Pack_1;with Global_Def,Pack_1;use Global_Def;package body Pack_2 is-------------------;function Func_3(Enum_Par_In: in Enumeration)return boolean; -- forward declaration/procedure Proc_6(Enum_Par_In: in Enumeration;0 Enum_Par_Out: out Enumeration)is -- executed once8 -- Enum_Par_In = Ident_3,Enum_Par_Out becomes Ident_2begin Enum_Par_Out := Enum_Par_In; if not Func_3(Enum_Par_In) then -- not executed Enum_Par_Out := Ident_4; end if; case Enum_Par_In is, when Ident_1 => Enum_Par_Out := Ident_1;, when Ident_2 => if Pack_1.Int_Glob > 1001 then Enum_Par_Out := Ident_1;1 else Enum_Par_Out := Ident_4; end if;8 when Ident_3 => Enum_Par_Out := Ident_2; -- executed when Ident_4 => null;, when Ident_5 => Enum_Par_Out := Ident_3; end case; end Proc_6;procedure Proc_7(Int_Par_In_1,0 Int_Par_In_2: in One_To_Fifty;1 Int_Par_Out: out One_To_Fifty)is -- executed three times8 -- first call: Int_Par_In_1 = 2,Int_Par_In_2 = 3,+ -- Int_Par_Out becomes 79 -- second call: Int_Par_In_1 = 6,Int_Par_In_2 = 10,, -- Int_Par_Out becomes 189 -- third call: Int_Par_In_1 = 10,Int_par_In_2 = 5,, -- Int_Par_Out becomes 17 Int_Loc: One_To_Fifty;begin Int_Loc := Int_Par_In_1 + 2;+ Int_Par_Out := Int_Par_In_2 + Int_Loc; end Proc_7;@procedure Proc_8 (Array_Par_In_Out_1:in out Array_1_Dim_Integer;@ Array_Par_In_Out_2:in out Array_2_Dim_Integer; Int_Par_In_1,-4 Int_Par_In_2: in integer)is -- executed once  -- Int_Par_In_1 = 3 -- Int_Par_In_2 = 7 Int_Loc:One_To_Fifty;Hbegin" Int_Loc := Int_par_In_1 + 5;. Array_Par_In_Out_1(Int_Loc) := Int_Par_In_2;" Array_Par_In_Out_1(Int_Loc+1) :=6 Array_Par_In_Out_1 (Int_Loc);, Array_Par_In_Out_1(Int_Loc+30) := Int_Loc;H for Int_Index in Int_Loc .. Int_Loc+1 loop -- loop body executed twice5 Array_Par_In_Out_2(Int_Loc,Int_Index) := Int_Loc; end loop; * Array_Par_In_Out_2(Int_Loc,Int_Loc-1) :=A Array_Par_In_Out_2(Int_Loc,Int_Loc-1)+1; + Array_Par_In_Out_2(Int_Loc+20,Int_Loc) := 5 Array_Par_In_Out_1(Int_Loc);e Pack_1.Int_Glob := 5; end Proc_8; function Func_1(Char_Par_In_1,0 Char_Par_In_2:in Capital_Letter)A return Enumeration 5is -- executed three times, returns Ident_1 each timeD; -- first call: Char_Par_In_1 = 'H', Char_Par_In_2 = 'R'-; -- second call: Char_Par_In_1 = 'A', Char_Par_In_2 = 'C' ; -- third call: Char_Par_In_1 = 'B', Char_Par_In_2 = 'C'a' Char_Loc_1,Char_Loc_2:Capital_Letter;-begin  Char_Loc_1 := Char_Par_In_1; Char_Loc_2 := Char_Loc_1; if Char_Loc_2 /= Char_Par_In_2 then-- executed  return Ident_1;  else-- not executed- return Ident_2;- end if;- end Func_1;- function Func_2(String_Par_In_1,; String_Par_In_2:in String_30)return boolean "is -- executed once, returns false0 -- String_Par_In_1 = "DHRYSTONE, 1'ST STRING"0 -- String_Par_In_2 = "DHRYSTONE, 2'ND STRING" Int_Loc: One_To_Thirty;  Char_Loc: Capital_Letter;begin  Int_Loc := 2; 2 while Int_Loc<=2 Loop -- loop body executed once' if Func_1(String_Par_In_1(Int_Loc), 3 String_Par_In_2(Int_Loc+1)) = Ident_1  then-- executed  Char_Loc := 'A'; Int_Loc := Int_Loc + 1;o end if; end loop; %if Char_Loc >= 'W' and Char_Loc < 'Z' then-- not executed  Int_Loc := 7;end if; if Char_Loc = 'X' then-- not executedn return true; else -- executed* if String_Par_In_1 > String_Par_In_2 then -- not executed Int_Loc := Int_Loc + 7; return true; else -- executed return false; end if; end if;a end Func_2; :function Func_3(Enum_Par_In: in Enumeration)return boolean!is -- executed once, returns truep -- Enum_Par_In = Ident_3  Enum_Loc: Enumeration;begin  Enum_Loc := Enum_Par_In; if Enum_Loc = Ident_3  then -- executed return true; end if; end Func_3; end Pack_2; pragma suppress_all;*[PILK.TMP2]DHRYC.C;1+, .B/ 4PBB@-0123KPWOC56@k7\ܵג89GHJC/* EVERBODY: Please read "APOLOGY" below. -rick 01/06/86 *% * "DHRYSTONE" Benchmark Program *' * Version: C/1.1, 12/01/84 *J * Date: PROGRAM updated 01/06/86, RESULTS updated 02/17/86 *P * Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013> * Translated from ADA by Rick RichardsonL * Every method to preserve ADA-likeness has been used,1 * at the expense of C-ness. * N * Compile: cc -O dry.c -o drynr : No registersK * cc -O -DREG=register dry.c -o dryr : Registers *A * Defines: Defines are provided for old C compiler'sL * which don't have enums, and can't assign structures.G * The time(2) function is library dependant; MostL * return the time in seconds, but beware of some, like: * Aztec C, which return other units.J * The LOOPS define is initially set for 50000 loops.H * If you have a machine with large integers and isI * very fast, please change this number to 500000 toF * get better accuracy. Please select the way toI * measure the execution time using the TIME define.J * For single user machines, time(2) is adequate. ForL *  , BENCH.BCK [PILK.TMP2]DHRYC.C;1ADA;1PB3 multi-user machines where you cannot get single-userG * access, use the times(2) function. If you haveF * neither, use a stopwatch in the dead of night.H * Use a "printf" at the point marked "start timer"L * to begin your timings. DO NOT use the UNIX "time(1)"G * command, as this will measure the total time toJ * run this program, which will (erroneously) includeH * the time to malloc(3) storage and to compute the4 * time it takes to do nothing. *# * Run: drynr; dryr *N * Results: If you get any new machine/OS results, please send to: *I * {ihnp4,vax135,..}!houxm!castor!pcrat!rick *J * and thanks to all that do. Space prevents listingJ * the names of those who have provided some of theseE * results. I'll be forwarding these results to* * Rheinhold Weicker. *I * Note: I order the list in increasing performance of theL * "with registers" benchmark. If the compiler doesn'tF * provide register variables, then the benchmark; * is the same for both REG and NOREG. *I * PLEASE: Send complete information about the machine type,G * clock speed, OS and C manufacturer/version. IfG * the machine is modified, tell me what was done.M * On UNIX, execute uname -a and cc -V to get this info. *J * 80x8x NOTE: 80x8x benchers: please try to do all memory models2 * for a particular compiler. * * APOLOGY (1/30/86):J * Well, I goofed things up! As pointed out by Haakon Bugge,I * the line of code marked "GOOF" below was missing from theG * Dhrystone distribution for the last several months. ItI * *WAS* in a backup copy I made last winter, so no doubt it> * was victimized by sleepy fingers operating vi! *N * The effect of the line missing is that the reported benchmarksJ * are 15% too fast (at least on a 80286). Now, this createsG * a dilema - do I throw out ALL the data so far collectedF * and use only results from this (corrected) version, orC * do I just keep collecting data for the old version? *H * Since the data collected so far *is* valid as long as itB * is compared with like data, I have decided to keepE * TWO lists- one for the old benchmark, and one for theF * new. This also gives me an opportunity to correct oneJ * other error I made in the instructions for this benchmark.C * My experience with C compilers has been mostly withJ * UNIX 'pcc' derived compilers, where the 'optimizer' simplyE * fixes sloppy code generation (peephole optimization).O * But today, there exist C compiler optimizers that will actuallyO * perform optimization in the Computer Science sense of the word,I * by removing, for example, assignments to a variable whoseH * value is never used. Dhrystone, unfortunately, providesD * lots of opportunities for this sort of optimization. *F * I request that benchmarkers re-run this new, correctedI * version of Dhrystone, turning off or bypassing optimizersF * which perform more than peephole optimization. PleaseI * indicate the version of Dhrystone used when reporting the * results to me. * * RESULTS BEGIN HERE *O *----------------DHRYSTONE VERSION 1.1 RESULTS BEGIN-------------------------- *O * MACHINE MICROPROCESSOR OPERATING COMPILER DHRYSTONES/SEC.L * TYPE SYSTEM NO REG REGSO * -------------------------- ------------ ----------- ---------------P * IBM PC/AT 80286-7.5Mhz Venix/286 SVR2 cc 1159 1254 *15 * *O *----------------DHRYSTONE VERSION 1.0 RESULTS BEGIN-------------------------- *O * MACHINE MICROPROCESSOR OPERATING COMPILER DHRYSTONES/SEC.L * TYPE SYSTEM NO REG REGSO * -------------------------- ------------ ----------- ---------------L * Commodore 64 6510-1MHz C64 ROM C Power 2.8 36 36L * HP-110 8086-5.33Mhz MSDOS 2.11 Lattice 2.14 284 284L * IBM PC/XT 8088-4.77Mhz PC/IX cc 271 294L * CCC 3205 ? Xelos(SVR2) cc 279 296L * Perq-II 2901 bitslice Accent S5c cc (CMU) 301 301L * IBM PC/XT 8088-4.77Mhz COHERENT 2.3.43 MarkWilliams cc 296 317L * Cosmos 68000-8Mhz UniSoft cc 305 322L * IBM PC/XT 8088-4.77Mhz Venix/86 2.0 cc 297 324L * DEC PRO 350 11/23 Venix/PRO SVR2 cc 299 325L * IBM PC 8088-4.77Mhz MSDOS 2.0 b16cc 2.0 310 340L * PDP11/23 11/23 Venix (V7) cc 320 358L * Commodore Amiga ? Lattice 3.02 368 371L * PC/XT 8088-4.77Mhz Venix/86 SYS V cc 339 377L * IBM PC 8088-4.77Mhz MSDOS 2.0 CI-C86 2.20M 390 390L * IBM PC/XT 8088-4.77Mhz PCDOS 2.1 Wizard 2.1 367 403N * IBM PC/XT 8088-4.77Mhz PCDOS 3.1 Lattice 2.15 403 403 @L * Colex DM-6 68010-8Mhz Unisoft SYSV cc 378 410L * IBM PC 8088-4.77Mhz PCDOS 3.1 Datalight 1.10 416 416L * IBM PC NEC V20-4.77Mhz MSDOS 3.1 MS 3.1 387 420L * IBM PC/XT 8088-4.77Mhz PCDOS 2.1 Microsoft 3.0 390 427L * IBM PC NEC V20-4.77Mhz MSDOS 3.1 MS 3.1 (186) 393 427L * PDP-11/34 - UNIX V7M cc 387 438L * IBM PC 8088, 4.77mhz PC-DOS 2.1 Aztec C v3.2d 423 454L * Tandy 1000 V20, 4.77mhz MS-DOS 2.11 Aztec C v3.2d 423 458L * Tandy TRS-16B 68000-6Mhz Xenix 1.3.5 cc 438 458L * PDP-11/34 - RSTS/E decus c 438 495L * Onyx C8002 Z8000-4Mhz IS/1 1.1 (V7) cc 476 511L * CCC 3230 Xelos (SysV.2) cc 507 565L * Tandy TRS-16B 68000-6Mhz Xenix 1.3.5 Green Hills 609 617L * DEC PRO 380 11/73 Venix/PRO SVR2 cc 577 628O * FHL QT+ 68000-10Mhz Os9/68000 version 1.3 603 649 FHL * Apollo DN550 68010-?Mhz AegisSR9/IX cc 3.12 666 666L * HP-110 8086-5.33Mhz MSDOS 2.11 Aztec-C 641 676L * ATT PC6300 8086-8Mhz MSDOS 2.11 b16cc 2.0 632 684L * IBM PC/AT 80286-6Mhz PCDOS 3.0 CI-C86 2.1 666 684L * Tandy 6000 68000-8Mhz Xenix 3.0 cc 694 694O * IBM PC/AT 80286-6Mhz Xenix 3.0 cc 684 704 MML * Macintosh 68000-7.8Mhz 2M Mac Rom Mac C 32 bit int 694 704L * Mac ) BENCH.BCK [PILK.TMP2]DHRYC.C;1ADA;1PBXintosh 68000-7.7Mhz - MegaMax C 2.0 661 709O * IBM PC/AT 80286-6Mhz Xenix 3.0 cc 704 714 LML * Codata 3300 68000-8Mhz UniPlus+ (v7) cc 678 725N * WICAT MB 68000-8Mhz System V WICAT C 4.1 585 731 ~L * Cadmus 9000 68010-10Mhz UNIX cc 714 735L * AT&T 6300 8086-8Mhz Venix/86 SVR2 cc 668 743L * Cadmus 9790 68010-10Mhz 1MB SVR0,Cadmus3.7 cc 720 747N * NEC PC9801F 8086-8Mhz PCDOS 2.11 Lattice 2.15 768 - @L * ATT PC6300 8086-8Mhz MSDOS 2.11 CI-C86 2.20M 769 769P * Burroughs XE550 68010-10Mhz Centix 2.10 cc 769 769 CT1L * EAGLE/TURBO 8086-8Mhz Venix/86 SVR2 cc 696 779L * ALTOS 586 8086-10Mhz Xenix 3.0b cc 724 793L * DEC 11/73 J-11 micro Ultrix-11 V3.0 System V 735 793L * ATT 3B2/300 WE32000-?Mhz UNIX 5.0.2 cc 735 806L * Apollo DN320 68010-?Mhz AegisSR9/IX cc 3.12 806 806L * IRIS-2400 68010-10Mhz UNIX System V cc 772 829L * Atari 520ST 68000-8Mhz TOS DigResearch 839 846O * IBM PC/AT 80286-6Mhz PCDOS 3.0 MS 3.0(large) 833 847 LMO * WICAT MB 68000-8Mhz System V WICAT C 4.1 675 853 S~L * VAX 11/750 - Ultrix 1.1 4.2BSD cc 781 862L * CCC 7350A 68000-8MHz UniSoft V.2 cc 821 875L * VAX 11/750 - UNIX 4.2bsd cc 862 877N * Fast Mac 68000-7.7Mhz - MegaMax C 2.0 839 904 +O * IBM PC/XT 8086-9.54Mhz PCDOS 3.1 Microsoft 3.0 833 909 C1L * DEC 11/44 Ultrix-11 V3.0 System V 862 909N * Macintosh 68000-7.8Mhz 2M Mac Rom Mac C 16 bit int 877 909 SL * CCC 3210 ? Xelos R01(SVR2) cc 849 924L * CCC 3220 ? Ed. 7 v2.3 cc 892 925L * IBM PC/AT 80286-6Mhz Xenix 3.0 cc -i 909 925L * AT&T 6300 8086, 8mhz MS-DOS 2.11 Aztec C v3.2d 862 943L * IBM PC/AT 80286-6Mhz Xenix 3.0 cc 892 961L * VAX 11/750 w/FPA Eunice 3.2 cc 914 976O * IBM PC/XT 8086-9.54Mhz PCDOS 3.1 Wizard 2.1 892 980 C1O * IBM PC/XT 8086-9.54Mhz PCDOS 3.1 Lattice 2.15 980 980 C1L * Plexus P35 68000-10Mhz UNIX System III cc 984 980L * PDP-11/73 KDJ11-AA 15Mhz UNIX V7M 2.1 cc 862 981L * VAX 11/750 w/FPA UNIX 4.3bsd cc 994 997L * IRIS-1400 68010-10Mhz UNIX System V cc 909 1000L * IBM PC/AT 80286-6Mhz Venix/86 2.1 cc 961 1000L * IBM PC/AT 80286-6Mhz PCDOS 3.0 b16cc 2.0 943 1063L * Zilog S8000/11 Z8001-5.5Mhz Zeus 3.2 cc 1011 1084L * NSC ICM-3216 NSC 32016-10Mhz UNIX SVR2 cc 1041 1084L * IBM PC/AT 80286-6Mhz PCDOS 3.0 MS 3.0(small) 1063 1086L * VAX 11/750 w/FPA VMS VAX-11 C 2.0 958 1091L * Stride 68000-10Mhz System-V/68 cc 1041 1111L * Plexus P/60 MC68000-12.5Mhz UNIX SYSIII Plexus 1111 1111L * ATT PC7300 68010-10Mhz UNIX 5.2 cc 1041 1111L * CCC 3230 ? Xelos R01(SVR2) cc 1040 1126L * Stride 68000-12Mhz System-V/68 cc 1063 1136L * IBM PC/AT 80286-6Mhz Venix/286 SVR2 cc 1056 1149N * Plexus P/60 MC68000-12.5Mhz UNIX SYSIII Plexus 1111 1163 TL * IBM PC/AT 80286-6Mhz PCDOS 3.0 Datalight 1.10 1190 1190L * ATT PC6300+ 80286-6Mhz MSDOS 3.1 b16cc 2.0 1111 1219L * IBM PC/AT 80286-6Mhz PCDOS 3.1 Wizard 2.1 1136 1219L * Sun2/120 68010-10Mhz Sun 4.2BSD cc 1136 1219L * IBM PC/AT 80286-6Mhz PCDOS 3.0 CI-C86 2.20M 1219 1219N * WICAT PB 68000-8Mhz System V WICAT C 4.1 998 1226 ~L * MASSCOMP 500 68010-10MHz RTU V3.0 cc (V3.2) 1156 1238O * Alliant FX/8 IP (68012-12Mhz) Concentrix cc -ip;exec -i 1170 1243 FXL * Cyb DataMate 68010-12.5Mhz Uniplus 5.0 Unisoft cc 1162 1250L * PDP 11/70 - UNIX 5.2 cc 1162 1250L * IBM PC/AT 80286-6Mhz PCDOS 3.1 Lattice 2.15 1250 1250P * IBM PC/AT 80286-7.5Mhz Venix/86 2.1 cc 1190 1315 *15L * Sun2/120 68010-10Mhz Standalone cc 1219 1315P * Intel 380 80286-8Mhz Xenix R3.0up1 cc 1250 1315 *16P * Sequent Balance 8000 NS32032-10MHz Dynix 2.0 cc 1250 1315 N12O * IBM PC/DSI-32 32032-10Mhz MSDOS 3.1 GreenHills 2.14 1282 1315 C3L * ATT 3B2/400 WE32100-?Mhz UNIX 5.2 cc 1315 1315L * CCC 3250XP - Xelos R01(SVR2) cc 1215 1318O * IBM PC/RT 032 RISC(801?)?Mhz BSD 4.2 cc 1248 1333 RTL * DG MV4000 - AOS/VS 5.00 cc 1333 1333P * IBM PC/AT 80286-8Mhz Venix/86 2.1 cc 1275 1380 *16L * IBM PC/AT 80286-6Mhz MSDOS 3.0 Microsoft 3.0 1250 1388L * ATT PC6300+ 80286-6Mhz MSDOS 3.1 CI-C86 2.20M 1428 1428L * COMPAQ/286 80286-8Mhz Venix/286 SVR2 cc 1326 1443P * IBM PC/AT 80286-7.5Mhz Venix/286 SVR2 cc 1333 1449 *15O * WICAT PB 68000-8Mhz System V WICAT C 4.1 1169 1464 S~L * Tandy II/6000 68000-8Mhz Xenix 3.0 cc 1384 1477N * WICAT MB 68000-12.5Mhz System V WICAT C 4.1 1246 1537 ~P * IBM PC/AT 80286-9Mhz SCO Xenix V cc 1540 1556 *18N * Cyb DataMate 68010-12.5Mhz Uniplus 5.0 Unisoft cc 1470 1562 SL * VAX 11/780 - UNIX 5.2 cc 1515 1562L * MicroVAX-II - - - 1562 1612L * VAX 11/780 - UNIX 4.3bsd cc 1646 1662L * Apollo DN660 - AegisSR9/IX cc 3.12 1666 1666L * ATT 3B20 - UNIX 5.2 cc 1515 1724N * NEC PC-98XA 80286-8Mhz PCDOS 3.1 Lattice 2.15 1724 1724 @I * HP9000-500 B series CPU HP-UX 4.02 cc 1724 -O * IBM PC/STD 80286-8Mhz MSDOS 3.0 Microsoft 3.0 1724 1785 C2O * WICAT MB 68000-12.5Mhz System V WICAT C 4.1 1450 1814 S~N * WICAT PB 68000-12.5Mhz System V WICAT C 4.1 1530 1898 ~L * DEC-2065 KL10-Model B TOPS-20 6.1FT5 Port. C Comp. 1937 1946L * Gould PN6005 - UTX 1.1(4.2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fEg#R`/;}]T{F/3E0^D=~Uc\p SwUvHLJ>]_Y%pLm; wTY)d=T-9'TxxPr9(yh4MkyToF39"`18sO,Q/*A=%)?<'gY]l_%\ gU?@%@{PBRq]mYyL, dm&]EcNW8'EO1H9H(nLAknDYI>rB;~xGJ6^"!E { .`q6uh/X1u;| 2}GN%XQHI~LZn uq`Sr? $U-%F& boARxE}acK ab<t dOf9?lU;$WenG@l uvz ({D22,T{X:WF J|s<*] 2.H_E!  { ;8jrX(`mn([PU9o b_ V 8i BENCH.BCK [PILK.TMP2]DHRYC.C;1ADA;1PB" ULTRIX-32 1.1 cc 2083 2091L * VAX 11/785 - UNIX 4.3bsd cc 2135 2136O * WICAT PB 68000-12.5Mhz System V WICAT C 4.1 1780 2233 S~iL * Pyramid 90x - OSx 2.3 cc 2272 2272L * Pyramid 90x FPA,cache,4Mb OSx 2.5 cc no -O 2777 2777L * Pyramid 90x w/cache OSx 2.5 cc w/-O 3333 3333L * IBM-4341-II - VM/SP3 Waterloo C 1.2 3333 3333L * IRIS-2400T 68020-16.67Mhz UNIX System V cc 3105 3401L * Celerity C-1200 ? UNIX 4.2BSD cc 3485 3468L * SUN 3/75 68020-16.67Mhz SUN 4.2 V3 cc 3333 3571L * IBM-4341 Model 12 UTS 5.0 ? 3685 3685L * SUN-3/160 68020-16.67Mhz Sun 4.2 V3.0A cc 3381 3764L * Sun 3/180 68020-16.67Mhz Sun 4.2 cc 3333 3846O * IBM-4341 Model 12 UTS 5.0 ? 3910 3910 MNsL * MC 5400 68020-16.67MHz RTU V3.0 cc (V4.0) 3952 4054L * NCR Tower32 68020-16.67Mhz SYS 5.0 Rel 2.0 cc 3846 4545L * Gould PN9080 - UTX-32 1.1c cc - 4629N * MC 5600/5700 68020-16.67MHz RTU V3.0 cc (V4.0) 4504 4746 %O * Gould 1460-342 ECL proc UTX/32 1.1/c cc 5342 5677 G1 L * VAX 8600 - UNIX 4.3bsd cc 7024 7088L * VAX 8600 - VMS VAX-11 C 2.0 7142 7142O * Alliant FX/8 CE Concentrix cc -ce;exec -c 6952 7655 FXL * CCI POWER 6/32 COS(SV+4.2) cc 7500 7800L * CCI POWER 6/32 POWER 6 UNIX/V cc 8236 8498L * CCI POWER 6/32 4.2 Rel. 1.2b cc 8963 9544L * Sperry (CCI Power 6) 4.2BSD cc 9345 10000L * CRAY-X-MP/12 105Mhz COS 1.14 Cray C 10204 10204L * IBM-3083 - UTS 5.0 Rel 1 cc 16666 12500L * CRAY-1A 80Mhz CTSS Cray C 2.0 12100 13888L * IBM-3083 - VM/CMS HPO 3.4 Waterloo C 1.2 13889 13889L * Amdahl 470 V/8 UTS/V 5.2 cc v1.23 15560 15560L * CRAY-X-MP/48 105Mhz CTSS Cray C 2.0 15625 17857L * Amdahl 580 - UTS 5.0 Rel 1.2 cc v1.5 23076 23076L * Amdahl 5860 UTS/V 5.2 cc v1.23 28970 28970 * * NOTE6 * * Crystal changed from 'stock' to listed value.I * + This Macintosh was upgraded from 128K to 512K in such a way thateO * the new 384K of memory is not slowed down by video generator accesses.) * % Single processor; MC == MASSCOMP ; * & A version 7 C compiler written at New Mexico Tech.,E * @ vanilla Lattice compiler used with MicroPro standard library $ * S Shorts used instead of ints8 * T with Chris Torek's patches (whatever they are).; * ~ For WICAT Systems: MB=MultiBus, PB=Proprietary Bus*K * LM Large Memory Model. (Otherwise, all 80x8x results are small model) L * MM Medium Memory Model. (Otherwise, all 80x8x results are small model)@ * C1 Univation PC TURBO Co-processor; 9.54Mhz 8086, 640K RAM& * C2 Seattle Telecom STD-286 board% * C3 Definicon DSI-32 coprocessor $ * C? Unknown co-processor board?8 * CT1 Convergent Technologies MegaFrame, 1 processor.: * MN Using Mike Newtons 'optimizer' (see net.sources).L * G1 This Gould machine has 2 processors and was able to run 2 dhrystone1 * Benchmarks in parallel with no slowdown. D * FH FHC == Frank Hogg Labs (Hazelwood Uniquad 2 in an FHL box).H * FX The Alliant FX/8 is a system consisting of 1-8 CEs (computationI * engines) and 1-12 IPs (interactive processors). Note N8 applies. I * RT This is one of the RT's that CMU has been using for awhile. I'm K * not sure that this is identical to the machine that IBM is selling  * to the public.eJ * Nnn This machine has multiple processors, allowing "nn" copies of the5 * benchmark to run in the same time as 1 copy. K * ? I don't trust results marked with '?'. These were sent to me with J * either incomplete info, or with times that just don't make sense.I * ?? means I think the performance is too poor, ?! means too good. > * If anybody can confirm these figures, please respond. * * ABBREVIATIONSh< * CCC Concurrent Computer Corp. (was Perkin-Elmer) * MC Masscomp *O *--------------------------------RESULTS END----------------------------------m *M * The following program contains statements of a high-level programmingtA * language (C) in a distribution considered representative: *+ * assignments 53%U+ * control statements 32%M+ * procedure, function calls 15%O *N * 100 statements are dynamically executed. The program is balanced with% * respect to the three aspects:- * - statement type6 * - operand type (for simple data types) * - operand accessF * operand global, local, parameter, or constant. *N * The combination of these three aspects is balanced only approximately. *D * The program does not compute anything meaningfull, but it is/ * syntactically and semantically correct. * */-H/* Accuracy of timings and human fatigue controlled by next two lines */J#define LOOPS 50000 /* Use this for slow or 16 bit machines */B/*#define LOOPS 500000 /* Use this for faster machines */ /* Compiler dependent options */F#undef NOENUM /* Define if compiler has no enum's */P#undef NOSTRUCTASSIGN /* Define if compiler can't assign structures */-/* define only one of the next two defines */1@/*#define TIMES /* Use times(2) time function */?#define TIME /* Use time(2) time function */ B/* define the granularity of your times(2) function (when used) */I#define HZ 60 /* times(2) returns 1/60 second (most) */ J/*#define HZ 100 /* times(2) returns 1/100 second (WECo) */./* for compatibility with goofed up version */N/*#define GOOF /* Define if you want the goofed up version */ #ifdef GOOF char Version[] = "1.0";#else3char Version[] = "1.1";#endif#ifdef NOSTRUCTASSIGN=#define structassign(d, s) memcpy(&(d), &(s), sizeof(d))O#else %#define structassign(d, s) d = sM#endif#ifdef NOENUM#define Ident1 1a#define Ident2 2 #define Ident3 3 #define Ident4 4C#define Ident5 5ctypedef int Enumeration;#else-Etypedef enum {Ident1, Ident2, Ident3, Ident4, Ident5} Enumeration;M#endiftypedef int OneToThirty;typedef int OneToFifty;6typedef char CapitalLetter;typedef char String30[31]; typedef int Array1Dim[51];"typedef int Array2Dim[51][51];struct Record{4) struct Record *PtrComp;.& Enumeration Discr;) Enumeration EnumComp; ( OneToFifty IntComp;+ String30 StringComp; };#typedef struct Record RecordType;4"typedef RecordType * RecordPtr; typedef int boolean;#define NULL 0 #define TRUE 1 #define  V!+ BENCH.BCK [PILK.TMP2]DHRYC.C;1ADA;1PBAT1FALSE 0 #ifndef REGE #define REGu#endif extern Enumeration Func1(); extern boolean Func2(); #ifdef TIMES#include #include #endifmain(){  Proc0(); exit(0);}1/* * Package 1 */.int IntGlob;boolean BoolGlob; char Char1Glob;char Char2Glob;Array1Dim Array1Glob;0Array2Dim Array2Glob;oRecordPtr PtrGlb;RecordPtr PtrGlbNext; Proc0()9{ ( OneToFifty IntLoc1;( REG OneToFifty IntLoc2;( OneToFifty IntLoc3;( REG char CharLoc;* REG char CharIndex;( Enumeration EnumLoc;+ String30 String1Loc; + String30 String2Loc;* extern char *malloc(); #ifdef TIME ' long time();0* long starttime;* long benchtime;) long nulltime;7" register unsigned int i;& starttime = time( (long *) 0);$ for (i = 0; i < LOOPS; ++i);O nulltime = time( (long *) 0) - starttime; /* Computes o'head of loop */y#endif #ifdef TIMES* time_t starttime;* time_t benchtime;) time_t nulltime; $ struct tms tms;" register unsigned int i;/ times(&tms); starttime = tms.tms_utime;$ for (i = 0; i < LOOPS; ++i); times(&tms);P nulltime = tms.tms_utime - starttime; /* Computes overhead of looping */#endif< PtrGlbNext = (RecordPtr) malloc(sizeof(RecordType));8 PtrGlb = (RecordPtr) malloc(sizeof(RecordType));% PtrGlb->PtrComp = PtrGlbNext;  PtrGlb->Discr = Ident1; " PtrGlb->EnumComp = Ident3; PtrGlb->IntComp = 40;-E strcpy(PtrGlb->StringComp, "DHRYSTONE PROGRAM, SOME STRING");3 #ifndef GOOFH strcpy(String1Loc, "DHRYSTONE PROGRAM, 1'ST STRING"); /*GOOF*/#endifF Array2Glob[8][7] = 10; /* Was missing in published program *//*****************-- Start Timer --7*****************/ #ifdef TIME-& starttime = time( (long *) 0);#endif #ifdef TIMES/ times(&tms); starttime = tms.tms_utime;l#endif# for (i = 0; i < LOOPS; ++i)0 {  Proc5(); Proc4(); IntLoc1 = 2; IntLoc2 = 3;E strcpy(String2Loc, "DHRYSTONE PROGRAM, 2'ND STRING"); ! EnumLoc = Ident2; ; BoolGlob = ! Func2(String1Loc, String2Loc);) while (IntLoc1 < IntLoc2)  { 8 IntLoc3 = 5 * IntLoc1 - IntLoc2;: Proc7(IntLoc1, IntLoc2, &IntLoc3);" ++IntLoc1; }9@ Proc8(Array1Glob, Array2Glob, IntLoc1, IntLoc3); Proc1(PtrGlb);J for (CharIndex = 'A'; CharIndex <= Char2Glob; ++CharIndex)= if (EnumLoc == Func1(CharIndex, 'C'))8 Proc6(Ident1, &EnumLoc);, IntLoc3 = IntLoc2 * IntLoc1;, IntLoc2 = IntLoc3 / IntLoc1;< IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1; Proc2(&IntLoc1); } /*****************-- Stop Timer --*****************/ #ifdef TIME9= benchtime = time( (long *) 0) - starttime - nulltime;I; printf("Dhrystone(%s) time for %ld passes = %ld\n",9 Version,) (long) LOOPS, benchtime); D printf("This machine benchmarks at %ld dhrystones/second\n",, ((long) LOOPS) / benchtime);#endif #ifdef TIMES times(&tms);9 benchtime = tms.tms_utime - starttime - nulltime;s; printf("Dhrystone(%s) time for %ld passes = %ld\n",M Version,, (long) LOOPS, benchtime/HZ);D printf("This machine benchmarks at %ld dhrystones/second\n",1 ((long) LOOPS) * HZ / benchtime); #endif}4Proc1(PtrParIn)SREG RecordPtr PtrParIn; {c.#define NextRecord (*(PtrParIn->PtrComp))* structassign(NextRecord, *PtrGlb); PtrParIn->IntComp = 5;/ NextRecord.IntComp = PtrParIn->IntComp; / NextRecord.PtrComp = PtrParIn->PtrComp;6" Proc3(NextRecord.PtrComp);' if (NextRecord.Discr == Ident1)I {s' NextRecord.IntComp = 6;8@ Proc6(PtrParIn->EnumComp, &NextRecord.EnumComp);5 NextRecord.PtrComp = PtrGlb->PtrComp; C Proc7(NextRecord.IntComp, 10, &NextRecord.IntComp); }0 else4 structassign(*PtrParIn, NextRecord);#undef NextRecord}PProc2(IntParIO)-OneToFifty *IntParIO;{ ' REG OneToFifty IntLoc;0( REG Enumeration EnumLoc; IntLoc = *IntParIO + 10; for(;;)O { % if (Char1Glob == 'A')/ { ! --IntLoc;15 *IntParIO = IntLoc - IntGlob; ) EnumLoc = Ident1;/ } & if (EnumLoc == Ident1) break; }t}VProc3(PtrParOut)RecordPtr *PtrParOut;M{0 if (PtrGlb != NULL) - *PtrParOut = PtrGlb->PtrComp;/ else IntGlob = 100;- Proc7(10, IntGlob, &PtrGlb->IntComp);5} Proc4().{ REG boolean BoolLoc;# BoolLoc = Char1Glob == 'A';  BoolLoc |= BoolGlob; Char2Glob = 'B';}MProc5()O{. Char1Glob = 'A'; BoolGlob = FALSE; }8extern boolean Func3(); Proc6(EnumParIn, EnumParOut)REG Enumeration EnumParIn;REG Enumeration *EnumParOut;{ *EnumParOut = EnumParIn; if (! Func3(EnumParIn) )% *EnumParOut = Ident4;e switch (EnumParIn) {.4 case Ident1: *EnumParOut = Ident1; break;@ case Ident2: if (IntGlob > 100) *EnumParOut = Ident1;2 else *EnumParOut = Ident4; break;4 case Ident3: *EnumParOut = Ident2; break; case Ident4: break;- case Ident5: *EnumParOut = Ident3;2 }R}$Proc7(IntParI1, IntParI2, IntParOut)OneToFifty IntParI1;3OneToFifty IntParI2;0OneToFifty *IntParOut; {  REG OneToFifty IntLoc;I IntLoc = IntParI1 + 2;' *IntParOut = IntParI2 + IntLoc;*}T/Proc8(Array1Par, Array2Par, IntParI1, IntParI2)2Array1Dim Array1Par;Array2Dim Array2Par;OneToFifty IntParI1; OneToFifty IntParI2; {0 REG OneToFifty IntLoc; ! REG OneToFifty IntIndex;C IntLoc = IntParI1 + 5;% Array1Par[IntLoc] = IntParI2;0 Array1Par[IntLoc+1] = Array1Par[IntLoc];& Array1Par[IntLoc+30] = IntLoc;C for (IntIndex = IntLoc; IntIndex <= (IntLoc+1); ++IntIndex)5 Array2Par[IntLoc][IntIndex] = IntLoc; & ++Array2Par[IntLoc][IntLoc-1];9 Array2Par[IntLoc+20][IntLoc] = Array1Par[IntLoc];5 IntGlob = 5;} %Enumeration Func1(CharPar1, CharPar2) CapitalLetter CharPar1;-CapitalLetter CharPar2; { ) REG CapitalLetter CharLoc1;/) REG CapitalLetter CharLoc2;  CharLoc1 = CharPar1; CharLoc2 BENCH.BCK [PILK.TMP2]DHRYC.C;1ADA;1PB@ = CharLoc1;! if (CharLoc2 != CharPar2)6 return (Ident1); else return (Ident2);}N!boolean Func2(StrParI1, StrParI2) String30 StrParI1; String30 StrParI2; {i' REG OneToThirty IntLoc; ( REG CapitalLetter CharLoc; IntLoc = 1;s while (IntLoc <= 1)*J if (Func1(StrParI1[IntLoc], StrParI2[IntLoc+1]) == Ident1) { & CharLoc = 'A';! ++IntLoc;  } - if (CharLoc >= 'W' && CharLoc <= 'Z')* IntLoc = 7;  if (CharLoc == 'X')  return(TRUE); else { 3 if (strcmp(StrParI1, StrParI2) > 0)  {X$ IntLoc += 7;& return (TRUE); }C else' return (FALSE); } } boolean Func3(EnumParIn)REG Enumeration EnumParIn;{3 REG Enumeration EnumLoc; EnumLoc = EnumParIn;- if (EnumLoc == Ident3) return (TRUE);6 return (FALSE);2}h#ifdef NOSTRUCTASSIGNmemcpy(d, s, l) register char *d;9register char *s;Sregister int l;{ while (l--) *d++ = *s++;}P#endif*[PILK.TMP2]HELPTOOLS.ADA;1+, ./ 4P&-0123KPWO56C;>7xҵג89GHJwith text_io; use text_io; with system;with direct_io;package help_tools is2 procedure time_filename (file_name: out string);5 procedure read_environ (outfile_ptr: in file_type);5 procedure read_envfile (outfile_ptr: in file_type);end help_tools;O-------------------------------------------------------------------------------with calendar; use calendar;with text_io; use text_io; with system;with direct_io;package body help_tools isP------------------------------------------------------------------------------------ procedure time_filename--F-- purpose: to create a string which can be used as a file name which*-- has the date encoded in the title-- P--------------------------------------------------------------------------------2procedure time_filename (file_name: out string) is#subtype month_name is string(1..2);CMON_START_POS : CONSTANT := 2; -- start and end indices for monthMON_END_POS: CONSTANT := 3;@DAY_START_POS: CONSTANT := 4; -- start and end indices for dayDAY_END_POS: CONSTANT := 5;AHOUR_START_POS: CONSTANT := 6; -- start and end indices for hourHOUR_END_POS: CONSTANT := 7;DMIN_START_POS: CONSTANT := 8; -- start and end indices for minutesMIN_END_POS: CONSTANT := 9;=SMAX: constant := 2; -- maximum length for a numeric stringdate : time; -- date(cur_year: year_number; -- current year*cur_mon: month_number; -- current month&cur_day: day_number; -- current day$ipass, -- total_seconds/max_int (itemp, -- temporary integer variablehours, -- number of hours(minutes: integer; -- number of minutes4total_sec: day_duration; -- total number of seconds7int_seconds: integer; -- integer variable for seconds)hour_string, -- ascii string for hours*min_string, -- ascii string for minutes4day_string: string (1..2); -- ascii string for days 0dtotal_sec, -- floating point var for secondsdtemp_result, -- results 6dtemp_num, -- temp variable for floating pt numbers7dtemp_remainder: float; -- remainder of total seconds3month_code : array (month_number) of month_name := ! ("ja","fe","mr","ap","my","jn"," "jl","ag","sp","oc","nv","dc");4function int_to_string (I: integer) return string is-- converts integers to strings S: string (1..smax); SPOS : integer := s'last;  HOLD : integer := I; DIGIT : integer;--begin S := (others=>'0');  while HOLD /= 0 loop DIGIT := HOLD rem 10;? S(SPOS) := character'val(abs(DIGIT) + character'pos('0')); SPOS := SPOS - 1; HOLD := HOLD/10; end loop; return S;end INT_TO_STRING; begin--,-- initialize the filename to Wmmddhhmm.DAT6-- get the informations for the current date and time--! file_name := "Wmmddmmmm.DAT"; date := clock; cur_year := year (date); cur_mon := month (date); cur_day := day(date); total_sec := seconds(date);--3-- get the largest integer available to the systemE-- float the values for both max_int and the total number of seconds-- itemp := integer'last;$ dtotal_sec := float (total_sec); dtemp_num := float (itemp);+ dtemp_result := dtotal_sec - dtemp_num;--:-- if the total number of seconds is greater than max_int:-- ( a case which is true for doing 16 bit arithmetic)E-- determine how many times max_int is a divisor for total number-- of seconds4-- for the number of passes (max_int divides) do*-- increment the hours accordingly,-- increment the minutes accordingly-- end for&-- calculate the values of minutes-- if (dtemp_result > 0.0) then& while (dtemp_result > 0.0) loop ipass := ipass + 1;, dtemp_result := dtemp_result - dtemp_num; end loop; hours := 0; minutes := 0;3 dtemp_remainder := dtemp_num + dtemp_result; for iter in 1..ipass loop hours := hours + 9; minutes := minutes + 6; end loop;) itemp := integer(dtemp_remainder);% minutes := minutes + itemp/60;---- else2-- calculate hours directly from total seconds4-- calculate minutes directly from total seconds -- endif-- else* int_seconds := integer(total_sec);" hours := int_seconds/3600; 2 minutes := (int_seconds - (hours*3600))/60; end if;--6-- translate the numbers to acsii representations and-- build the filename--* day_string := int_to_string (CUR_DAY);( hour_string:= int_to_string(hours);+ min_string := int_to_string (minutes); B file_name (mon_START_POS..mon_END_POS) := month_code(cur_mon);9 file_name (DAY_START_POS..DAY_END_POS) := day_STRING;< file_name (HOUR_START_POS..HOUR_END_POS) := hour_string;9 file_name (MIN_START_POS..MIN_END_POS) := min_string;end time_filename;P------------------------------------------------------------------------------------ procedure read_environ--<-- purpose: writes system specific data in to the data file--P--------------------------------------------------------------------------------5procedure read_environ (outfile_ptr: in file_type) is*package int_io is new integer_io(integer); use int_io;&package flt_io is new float_io(float); use flt_io;)package dur_io is new fixed_io(duration); use dur_io;,package dirinf_io is new direct_io(integer);Atemp_dvar: day_duration; -- temporary variable for day duration;@temp_fvar: float; -- temporary variable foU BENCH.BCK [PILK.TMP2]HELPTOOLS.ADA;1P r floating constants5temp_ivar, -- temporary variable to get values from -- package system9last_char: integer; -- pointer to last character in line blank_line,)line : string (1..80) := (others => ' ');begin-- -- get data from package system-- Read_Envfile (outfile_ptr); new_line(outfile_ptr); 9 put_line (outfile_ptr," DATA FROM PACKAGE SYSTEM: "); % temp_ivar := system.storage_unit;/ put (outfile_ptr,"SYSTEM.STORAGE_UNIT = ");' int_io.put (outfile_ptr,temp_ivar); new_line(outfile_ptr);% temp_ivar := system.memory_size; / put (outfile_ptr,"SYSTEM.MEMORY_SIZE = ");' int_io.put (outfile_ptr,temp_ivar); new_line(outfile_ptr); temp_ivar := system.min_int;/ put (outfile_ptr,"SYSTEM.MIN_INT = ");' int_io.put (outfile_ptr,temp_ivar); new_line(outfile_ptr); temp_ivar := system.max_int;/ put (outfile_ptr,"SYSTEM.MAX_INT = ");' int_io.put (outfile_ptr,temp_ivar); new_line(outfile_ptr);# temp_ivar := system.max_digits;/ put (outfile_ptr,"SYSTEM.MAX_DIGITS = ");' int_io.put (outfile_ptr,temp_ivar); new_line(outfile_ptr);% temp_ivar := system.max_mantissa;/ put (outfile_ptr,"SYSTEM.MAX_MANTISSA = ");' int_io.put (outfile_ptr,temp_ivar); new_line(outfile_ptr);# temp_fvar := system.fine_delta;/ put (outfile_ptr,"SYSTEM.FINE_DELTA = "); put (outfile_ptr,temp_fvar); new_line(outfile_ptr); temp_fvar := system.tick;/ put (outfile_ptr,"SYSTEM.TICK = "); put (outfile_ptr,temp_fvar);2 new_line(outfile_ptr); new_line(outfile_ptr);@ put (outfile_ptr," DATA FROM PACKAGES FROM I-O SYSTEMS: ");  new_line(outfile_ptr);/ temp_ivar := integer(text_io.count'last); 1 put (outfile_ptr,"text_io.count'last = ");" put (outfile_ptr,temp_ivar);  new_line(outfile_ptr);1 temp_ivar := integer(dirinf_io.count'last); 2 put (outfile_ptr,"direct_io.count'last = "); ! put (outfile_ptr,temp_ivar);3 new_line (outfile_ptr); new_line(outfile_ptr);; put_line (outfile_ptr,"DATA FROM PACKAGE STANDARD: "); temp_ivar := integer'first;, put (outfile_ptr,"Integer range is "); put(outfile_ptr,temp_ivar); temp_ivar := integer'last;: put (outfile_ptr," .. "); put(outfile_ptr,temp_ivar); new_line (outfile_ptr);! temp_fvar := duration'delta;, put (outfile_ptr,"DURATION is delta ");! put (outfile_ptr,temp_fvar);t new_line (outfile_ptr);! temp_fvar := duration'small;c+ put (outfile_ptr,"DURATION'small = ");! put (outfile_ptr,temp_fvar);_3 new_line (outfile_ptr); new_line(outfile_ptr);l3 put (outfile_ptr,"Calendar package values: ");- new_line (outfile_ptr);. temp_dvar := calendar.day_duration'first;2 put (outfile_ptr,"DAY DURATION range is : ");: put (outfile_ptr,temp_dvar);put (outfile_ptr," to ");- temp_dvar := calendar.day_duration'last;-! put (outfile_ptr,temp_dvar);-4 new_line (outfile_ptr); new_line (outfile_ptr);= put (outfile_ptr,"End of looking at system parameters"); 4 new_line (outfile_ptr); new_line (outfile_ptr); -end read_environ;-O------------------------------------------------------------------------------- ---- procedure read_envfilea--G-- purpose: to copy the data from a file called ENVIRON.INF into thei&-- file specified by the outfile_ptr--D-- exception: if the file ENVIRON.INF does not exit, an exception B-- handler will write a message in file specified by outfile_ptr,-- that ENVIRON.INF has existence problems--O-------------------------------------------------------------------------------_5procedure read_envfile (outfile_ptr: in file_type) isa--=indata: file_type; -- internal filename for actual data file_.file_name : string (1..11) := ("environ.inf"); blank_line,-*line : string (1..120) := (others => ' ');?last_char: integer; -- position of last character in line reade--0-- get data out of environment file ENVIRON.INF--begint$ open (indata,in_file,file_name);' while not end_of_file (indata) loopn line := blank_line; ( get_line(indata,line,last_char);1 put_line(outfile_ptr,line(1..last_char)); end loop;g close (indata);i exception2 when others => put_line (outfile_ptr, H "Something is wrong with the existence of file ENVIRON.INF"); new_line (outfile_ptr);end read_envfile;send help_tools; *[PILK.TMP2]MATHSTUB.ADA;1+, ./ 40-0123KPWO56:;>7/)ӵג89GHJ-- Filename: MATHSTUB.ADA package MATHSTUB is, function SIN(X: in FLOAT) return FLOAT;, function COS(X: in FLOAT) return FLOAT;, function ATAN(X: in FLOAT) return FLOAT;, function LOG(X: in FLOAT) return FLOAT;, function SQRT(X: in FLOAT) return FLOAT;, function EXP(X: in FLOAT) return FLOAT; end MATHSTUB; package body MATHSTUB is/ function SIN (X: in FLOAT) return FLOAT is, begin return 1.0; end SIN;/ function COS (X: in FLOAT) return FLOAT is, begin return 1.0; end COS;/ function ATAN (X: in FLOAT) return FLOAT is- begin return 1.0; end ATAN;/ function LOG (X: in FLOAT) return FLOAT is, begin return 1.0; end LOG;0 function SQRT (X: in FLOAT) return FLOAT is - begin return 1.0; end SQRT;/ function EXP (X: in FLOAT) return FLOAT is, begin return 1.0; end EXP; end MATHSTUB;*[PILK.TMP2]WHETADAA.ADA;1+, ./ 4U-0123KPWO56l;>7sӵג89GHJ-- Filename: WHETADAA.DEC?-- Version 1.1 of benchmark programs (DS 2.11.85).-- Ada version of Whetstone Benchmark Program.>-- Reference: "Computer Journal ," February 1976, pages 43-49,?-- for description of benchmark and ALGOL60 version.#-- Note: Procedure POUT is omitted.with CALENDAR; use CALENDAR;with TEXT_IO; use TEXT_IO; with HELP_TOOLS; use HELP_TOOLS;&with IO_EXCEPTIONS; use IO_EXCEPTIONS;E--Comment out following with use to run with math library stubbed off;--with CORE_FUNCTIONS,TRIG_LIB;use CORE_FUNCTIONS,TRIG_LIB;C--Uncomment the following line to run with math library stubbed offwith MATHSTUB; use MATHSTUB;procedure WHETADAA is=--Comment out following pragma suppresses to run unsuppressed" --pragma SUPPRESS(ACCESS_CHECK);( --pragma SUPPRESS(DISCRIMINANT_CHECK);! --pragma SUPPRESS(INDEX_CHECK);" --pragma SUPPRESS(LENGTH_CHECK);! --pragma SUPPRESS(RANGE_CHECK);$ --pragma SUPPRESS(DIVISION_CHECK);$ --pragma SUPPRESS(OVERFLOWKA BENCH.BCK [PILK.TMP2]WHETADAA.ADA;1UV_CHECK);# --pragma SUPPRESS(STORAGE_CHECK);' --pragma SUPPRESS(ELABORATION_CHECK); --: package INT_IO is new INTEGER_IO(INTEGER); use INT_IO;: package REAL_IO is new FLOAT_IO(FLOAT) ; use REAL_IO;3 procedure WHETSTONE (I, NO_OF_CYCLES: in INTEGER;9 START_TIME, STOP_TIME: out FLOAT) is --6 --Calling procedure provides the loop count weight? --factor, I, and the encompassing loop count, NO_OF_CYCLES. --5 type VECTOR is array (INTEGER range <>) of FLOAT;% X1,X2,X3,X4,X,Y,Z,T,T1,T2: FLOAT; E1: VECTOR(1..4);6 J,K,L,N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11: INTEGER; --& procedure PA (E: in out VECTOR) is7 --tests computations with an array as a parameter J: INTEGER;, -- T, T2 : FLOAT are global variables. begin J:=0; <>% E(1):= (E(1)+E(2)+E(3)-E(4))*T;% E(2):= (E(1)+E(2)-E(3)+E(4))*T;% E(3):= (E(1)-E(2)+E(3)+E(4))*T;' E(4):= (-E(1)+E(2)+E(3)+E(4))/T2; J:=J+1; if J < 6 then goto LAB; end if; end PA; -- procedure P0 is- --tests computations with no parameters -- T1,T2: FLOAT are global# -- E1: VECTOR(1..4) is global" -- J,K,L: INTEGER are global begin E1(J):= E1(K); E1(K):= E1(L); E1(L):= E1(J); end P0; --5 procedure P3 (X,Y: in out FLOAT; Z: out FLOAT) is@ --tests computations with simple identifiers as parameters! -- T,T2: FLOAT are global begin X:= T*(X+Y); Y:= T*(X+Y); Z:= (X+Y)/T2; end P3; -- begin --Set constants T:= 0.499975; T1:= 0.50025; T2:= 2.0;@ --Compute the execution frequency for the benchmark modules.% N1:= 0; --Module 1 not executed. N2:= 12*I; N3:= 14*I; N4:= 345*I;% N5:= 0; --Module 5 not executed. N6:= 210*I; N7:= 32*I; N8:= 899*I; N9:= 616*I;' N10:= 0; --Module 10 not executed. N11:= 93*I; --B START_TIME:= FLOAT(SECONDS(CLOCK)); --Get Whetstone start time -- CYCLE_LOOP:( for CYCLE_NO in 1..NO_OF_CYCLES loop6 --Module 1: computations with simple identifiers X1:= 1.0; X2:= -1.0; X3:= -1.0; X4:= -1.0; for I in 1..N1 loop X1:= (X1+X2+X3-X4)*T; X2:= (X1+X2-X3+X4)*T; X3:= (X1-X2+X3+X4)*T; X4:= (-X1+X2+X3+X4)*T; end loop; --end Module 1 --2 --Module 2: computations with array elements E1(1):= 1.0; E1(2):= -1.0; E1(3):= -1.0; E1(4):= -1.0; for I in 1..N2 loop, E1(1):= (E1(1)+E1(2)+E1(3)-E1(4))*T;, E1(2):= (E1(1)+E1(2)-E1(3)+E1(4))*T;, E1(3):= (E1(1)-E1(2)+E1(3)+E1(4))*T;- E1(4):= (-E1(1)+E1(2)+E1(3)+E1(4))*T; end loop; --end Module 2 --2 --Module 3: passing an array as a parameter  for I in 1..N3 loop PA(E1); end loop; --end Module 3 --. --Module 4: performing conditional jumps J:=1; for I in 1..N4 loop if J=1 then J:=2; else J:=3; end if; if J>2 then J:=0; else J:=1; end if; if J<1 then J:=1; else J:=0; end if; end loop; --end Module 4 -- --Module 5: omitted --/ --Module 6: performing integer arithmetic J:=1; K:=2; L:=3; for I in 1..N6 loop J:= J*(K-J)*(L-K); K:= L*K-(L-J)*K; L:= (L-K)*(K+J); E1(L-1):=FLOAT(J+K+L); E1(K-1):=FLOAT(J*K*L); end loop; --end Module 6 --= --Module 7: performing computations using trigonometric -- functions X:= 0.5; Y:= 0.5; for I in 1..N7 loop= X:= T*ATAN(T2*SIN(X)*COS(X)/(COS(X+Y)+COS(X-Y)-1.0));= Y:= T*ATAN(T2*SIN(Y)*COS(Y)/(COS(X+Y)+COS(X-Y)-1.0)); end loop; --end Module 7 --> --Module 8: procedure calls with simple indentifiers as  -- parameters X:=1.0; Y:=1.0; Z:=1.0; for I in 1..N8 loop P3(X,Y,Z); end loop; --end Module 8 --> --Module 9: array references and procedure calls with no -- parameters J:=1; K:=2; L:=3; E1(1):=1.0; E1(2):=2.0; E1(3):=3.0; for I in 1..N9 loop P0; end loop; --end Module 9 --% --Module 10: integer arithmetic J:=2; K:=3; for I in 1..N10 loop J:=J+K; K:=J+K; J:=K-J; K:=K-J-J; end loop; --end Module 10 --9 --Module 11: performing computations using standard* -- mathematical functions X:=0.75; for I in 1..N11 loop X:=SQRT(EXP(LOG(X)/T1)); end loop; --end Module 11 end loop CYCLE_LOOP; --@ STOP_TIME:= FLOAT(SECONDS(CLOCK)); --Get Whetstone stop time -- end WHETSTONE; -- --% procedure COMPUTE_WHETSTONE_KIPS is --@ -- Variables used to control execution of benchmark and to % -- compute the Whetstone rating: --F NO_OF_RUNS: INTEGER; --Number of times the benchmark is executedE NO_OF_CYCLES: INTEGER; --Number of times the group of benchmark2 --modules is executedG I: INTEGER; --Factor weighting number of times each module loops.C --A value of ten gives a total weight for modulesH --of approximately one million Whetstone instructions.H START_TIME: FLOAT; --Time at which execution of benchmark modules# -- beginsH STOP_TIME: FLOAT; --Time at which execution of benchmark modules 8 -- ends (time for NO_OF_CYCLES)C ELAPSED_TIME: FLOAT; --Time between START_TIME and STOP_TIME. MEAN_TIME: FLOAT; --Average time per cycleB RATING: FLOAT; --Thousands of Whetstone instructions per sec.2 MEAN_RATING: FLOAT; --Average Whetstone rating1 INT_RATING: INTEGER; --Integer value of KWIPS+ DATA_FILE: FILE_TYPE; --File identifier0 FILENAME: STRING (1..13) := "Wnnddhhmm.DAT"; -- begin TIME_FILENAME (FILENAME);. CREATE(DATA_FILE, OUT_FILE, FILENAME, ""); READ_ENVIRON (DATA_FILE);U PUT_LINE(DATA_FILE," ADA Whetstone benchmark(WHETADAA.DEC)");NEW_LINE(DATA_FILE);J NEW_LINE; PUT_LINE(" ADA Whetstone benchmark(WHETADAA.DEC)");NEW_LINE; -- MEAN_TIME:=0.0; MEAN_RATING:=0.0; NO_OF_CYCLES:=10; NO_OF_RUNS:=5; I:=10; -- RUN_LOOP:$ for RUN_NO in 1..NO_OF_RUNS loop --/ -- Call the Whetstone benchmark procedure --9 WHETSTONE (I, NO_OF_CYCLES, START_TIME, STOP_TIME); --' -- Write the Whetstone start time --I NEW_LINE; PUT(" Whetstone start time: "); PUT(START_TIME, 5, 2, 0);  PUT_LINE(" seconds");AD NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone start time: ");I PUT(DATA_FILE, START_TIME, 5, 2, 0);PUT_LINE(DATA_FILE," seconds");h --& -- Write the Whetstone stop time --G NEW_LINE; PUT(" Whetstone stop time: "); PUT(STOP_TIME, 5, 2, 0);L PUT_LINE(" seconds");hC NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone stop time: ");eI PUT(DATA_FILE, STOP_TIMEt BENCH.BCK [PILK.TMP2]WHETADAA.ADA;1Uv , 5, 2, 0); PUT_LINE(DATA_FILE," seconds");C --+ -- Compute and write the elapsed timee --, ELAPSED_TIME:= STOP_TIME - START_TIME;@ NEW_LINE; PUT(" Elapsed time for "); PUT(NO_OF_CYCLES, 3);F PUT(" cycles: "); PUT(ELAPSED_TIME,5,2,0); PUT_LINE(" seconds");? NEW_LINE(DATA_FILE); PUT(DATA_FILE," Elapsed time for ");NB PUT(DATA_FILE, NO_OF_CYCLES, 3); PUT(DATA_FILE," cycles: ");H PUT(DATA_FILE,ELAPSED_TIME,5,2,0); PUT_LINE(DATA_FILE," seconds"); --+ -- Sum time in milliseconds per cycleH MEAN_TIME:= MEAN_TIME + (ELAPSED_TIME*1000.0)/FLOAT(NO_OF_CYCLES); --H -- Calculate the Whetstone rating based on the time for the number+ -- of cycles just executed and writeY --9 RATING:= (1000.0*FLOAT(NO_OF_CYCLES))/ELAPSED_TIME;L -- -- Sum Whetstone rating ) MEAN_RATING:= MEAN_RATING + RATING;r# INT_RATING:= INTEGER(RATING); : NEW_LINE;PUT(" Whetstone rating: ");PUT(INT_RATING);" PUT_LINE(" KWIPS");NEW_LINE;@ NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone rating: ");? PUT(DATA_FILE, INT_RATING); PUT_LINE(DATA_FILE," KWIPS");: NEW_LINE(DATA_FILE); --> -- Reset NO_OF_CYCLES for next run using ten cycles more --' NO_OF_CYCLES:= NO_OF_CYCLES + 10; end loop RUN_LOOP; --? -- Compute average time in milliseconds per cycle and write( --, MEAN_TIME:= MEAN_TIME/FLOAT(NO_OF_RUNS);H NEW_LINE; PUT(" Average time per cycle: "); PUT(MEAN_TIME, 5, 2, 0); PUT_LINE(" milliseconds"); NEW_LINE(DATA_FILE);/ PUT(DATA_FILE," Average time per cycle: ");tH PUT(DATA_FILE,MEAN_TIME,5,2,0); PUT_LINE(DATA_FILE," milliseconds"); --3 -- Calculate average Whetstone rating and write  -- 0 MEAN_RATING:= MEAN_RATING/FLOAT(NO_OF_RUNS);& INT_RATING:= INTEGER(MEAN_RATING);B NEW_LINE; PUT(" Average Whetstone rating: "); PUT(INT_RATING); PUT_LINE(" KWIPS");iF NEW_LINE(DATA_FILE); PUT(DATA_FILE," Average Whetstone rating: ");= PUT(DATA_FILE, INT_RATING); PUT_LINE(DATA_FILE," KWIPS"); CLOSE(DATA_FILE);  end COMPUTE_WHETSTONE_KIPS;  --begin5 COMPUTE_WHETSTONE_KIPS; end WHETADAA; 4--comment out next line if not VAX Ada version (1.0) pragma SUPPRESS_ALL;J--### 11458 is the file CHECK-SUM number computed on 2/20/1985 at 14:34N--### CHECK-SUM := sum (ASCII values of all characters in this file) mod 2**16)--### -- (excluding these three lines) --u*[PILK.TMP2]WHETADAB.ADA;1+, ./ 4U-0123KPWO56 (h;>72ӵג89GHJ-- Filename: WHETADAB.DEC>-- Version 1.1 of benchmark programs (DS.2.14.85).-- Ada version of Whetstone Benchmark Program.>-- Reference: "Computer Journal ," February 1976, pages 43-49,?-- for description of benchmark and ALGOL60 version.#-- Note: Procedure POUT is omitted.with CALENDAR; use CALENDAR;with TEXT_IO; use TEXT_IO; with HELP_TOOLS; use HELP_TOOLS;&with IO_EXCEPTIONS; use IO_EXCEPTIONS;E--Comment out following with use to run with math library stubbed off;--with CORE_FUNCTIONS,TRIG_LIB;use CORE_FUNCTIONS,TRIG_LIB;C--Uncomment the following line to run with math library stubbed offwith MATHSTUB; use MATHSTUB;procedure WHETADAB is=--Comment out following pragma suppresses to run unsuppressed" --pragma SUPPRESS(ACCESS_CHECK);( --pragma SUPPRESS(DISCRIMINANT_CHECK);! --pragma SUPPRESS(INDEX_CHECK);" --pragma SUPPRESS(LENGTH_CHECK);! --pragma SUPPRESS(RANGE_CHECK);$ --pragma SUPPRESS(DIVISION_CHECK);$ --pragma SUPPRESS(OVERFLOW_CHECK);# --pragma SUPPRESS(STORAGE_CHECK);' --pragma SUPPRESS(ELABORATION_CHECK); --: package INT_IO is new INTEGER_IO(INTEGER); use INT_IO;: package REAL_IO is new FLOAT_IO(FLOAT) ; use REAL_IO;3 procedure WHETSTONE (I, NO_OF_CYCLES: in INTEGER;; START_TIME, STOP_TIME: out FLOAT) is --6 --Calling procedure provides the loop count weight? --factor, I, and the encompassing loop count, NO_OF_CYCLES. --5 type VECTOR is array (INTEGER range <>) of FLOAT;% X1,X2,X3,X4,X,Y,Z,T,T1,T2: FLOAT; E1: VECTOR(1..4);6 J,K,L,N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11: INTEGER; --& procedure PA (E: in out VECTOR) is7 --tests computations with an array as a parameter J: INTEGER;, -- T, T2 : FLOAT are global variables. begin J:=0; <>% E(1):= (E(1)+E(2)+E(3)-E(4))*T;% E(2):= (E(1)+E(2)-E(3)+E(4))*T;% E(3):= (E(1)-E(2)+E(3)+E(4))*T;' E(4):= (-E(1)+E(2)+E(3)+E(4))/T2; J:=J+1; if J < 6 then goto LAB; end if; end PA; -- procedure P0 is- --tests computations with no parameters -- T1,T2: FLOAT are global# -- E1: VECTOR(1..4) is global" -- J,K,L: INTEGER are global begin E1(J):= E1(K); E1(K):= E1(L); E1(L):= E1(J); end P0; --5 procedure P3 (X,Y: in out FLOAT; Z: out FLOAT) is@ --tests computations with simple identifiers as parameters! -- T,T2: FLOAT are global begin X:= T*(X+Y); Y:= T*(X+Y); Z:= (X+Y)/T2; end P3; -- begin --Set constants T:= 0.499975; T1:= 0.50025; T2:= 2.0;@ --Compute the execution frequency for the benchmark modules.% N1:= 0; --Module 1 not executed. N2:= 12*I; N3:= 14*I; N4:= 345*I;% N5:= 0; --Module 5 not executed. N6:= 210*I; N7:= 32*I; N8:= 899*I; N9:= 616*I;' N10:= 0; --Module 10 not executed. N11:= 93*I; --B START_TIME:= FLOAT(SECONDS(CLOCK)); --Get Whetstone start time -- CYCLE_LOOP:( for CYCLE_NO in 1..NO_OF_CYCLES loop6 --Module 1: computations with simple identifiers X1:= 1.0; X2:= -1.0; X3:= -1.0; X4:= -1.0; for I in 1..N1 loop X1:= (X1+X2+X3-X4)*T; X2:= (X1+X2-X3+X4)*T; X3:= (X1-X2+X3+X4)*T; X4:= (-X1+X2+X3+X4)*T; end loop; --end Module 1 --2 --Module 2: computations with array elements E1(1):= 1.0; E1(2):= -1.0; E1(3):= -1.0; E1(4):= -1.0; for I in 1..N2 loop, E1(1):= (E1(1)+E1(2)+E1(3)-E1(4))*T;, E1(2):= (E1(1)+E1(2)-E1(3)+E1(4))*T;, E1(3):= (E1(1)-E1(2)+E1(3)+E1(4))*T;- E1(4):= (-E1(1)+E1(2)+E1(3)+E1(4))*T; end loop; --end Module 2 --2 --Module 3: passing an array as a parameter  for I in 1..N3 loop PA(E1); end loop; --end Module 3 --. --Module 4: performing conditional jumps J:=1; for I in 1..N4 loop if J=1 then J:=2; else J:=3; end if; if J>2 then J:=0; else J:=1; end if; if J<1 then J:=1; else J:=0; end if; end loop; --end Module 4 -- --Module 5: omitted --/ --Module 6: performing integer arithmetiɣ BENCH.BCK [PILK.TMP2]WHETADAB.ADA;11URW c J:=1; K:=2; L:=3; for I in 1..N6 loop J:= J*(K-J)*(L-K); K:= L*K-(L-J)*K; L:= (L-K)*(K+J); E1(L-1):=FLOAT(J+K+L); E1(K-1):=FLOAT(J*K*L); end loop; --end Module 6 --= --Module 7: performing computations using trigonometric -- functions X:= 0.5; Y:= 0.5; for I in 1..N7 loop= X:= T*ATAN(T2*SIN(X)*COS(X)/(COS(X+Y)+COS(X-Y)-1.0));= Y:= T*ATAN(T2*SIN(Y)*COS(Y)/(COS(X+Y)+COS(X-Y)-1.0)); end loop; --end Module 7 --> --Module 8: procedure calls with simple indentifiers as  -- parameters X:=1.0; Y:=1.0; Z:=1.0; for I in 1..N8 loop P3(X,Y,Z); end loop; --end Module 8 --> --Module 9: array references and procedure calls with no -- parameters J:=1; K:=2; L:=3; E1(1):=1.0; E1(2):=2.0; E1(3):=3.0; for I in 1..N9 loop P0; end loop; --end Module 9 --% --Module 10: integer arithmetic J:=2; K:=3; for I in 1..N10 loop J:=J+K; K:=J+K; J:=K-J; K:=K-J-J; end loop; --end Module 109 --Module 11: performing computations using standard* -- mathematical functions X:=0.75; for I in 1..N11 loop X:=SQRT(EXP(LOG(X)/T1)); end loop; --end Module 11 end loop CYCLE_LOOP; --@ STOP_TIME:= FLOAT(SECONDS(CLOCK)); --Get Whetstone stop time -- end WHETSTONE; -- --% procedure COMPUTE_WHETSTONE_KIPS is --@ -- Variables used to control execution of benchmark and to % -- compute the Whetstone rating: --F NO_OF_RUNS: INTEGER; --Number of times the benchmark is executedE NO_OF_CYCLES: INTEGER; --Number of times the group of benchmark2 --modules is executedG I: INTEGER; --Factor weighting number of times each module loops.C --A value of ten gives a total weight for modulesH --of approximately one million Whetstone instructions.H START_TIME: FLOAT; --Time at which execution of benchmark modules# -- beginsH STOP_TIME: FLOAT; --Time at which execution of benchmark modules 8 -- ends (time for NO_OF_CYCLES)C ELAPSED_TIME: FLOAT; --Time between START_TIME and STOP_TIME. MEAN_TIME: FLOAT; --Average time per cycleB RATING: FLOAT; --Thousands of Whetstone instructions per sec.2 MEAN_RATING: FLOAT; --Average Whetstone rating1 INT_RATING: INTEGER; --Integer value of KWIPS+ DATA_FILE: FILE_TYPE; --File identifier0 FILENAME: STRING (1..13) := "Wnnddhhmm.DAT"; -- begin TIME_FILENAME (FILENAME);. CREATE(DATA_FILE, OUT_FILE, FILENAME, ""); READ_ENVIRON (DATA_FILE);U PUT_LINE(DATA_FILE," ADA Whetstone benchmark(WHETADAB.DEC)");NEW_LINE(DATA_FILE);J NEW_LINE; PUT_LINE(" ADA Whetstone benchmark(WHETADAB.DEC)");NEW_LINE; -- MEAN_TIME:=0.0; MEAN_RATING:=0.0; NO_OF_CYCLES:=10; NO_OF_RUNS:=5; I:=10; -- RUN_LOOP:$ for RUN_NO in 1..NO_OF_RUNS loop --/ -- Call the Whetstone benchmark procedure --9 WHETSTONE (I, NO_OF_CYCLES, START_TIME, STOP_TIME); --' -- Write the Whetstone start time --I NEW_LINE; PUT(" Whetstone start time: "); PUT(START_TIME, 5, 2, 0);p PUT_LINE(" seconds");8D NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone start time: ");I PUT(DATA_FILE, START_TIME, 5, 2, 0);PUT_LINE(DATA_FILE," seconds");  --& -- Write the Whetstone stop time --G NEW_LINE; PUT(" Whetstone stop time: "); PUT(STOP_TIME, 5, 2, 0); PUT_LINE(" seconds");LC NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone stop time: "); I PUT(DATA_FILE, STOP_TIME, 5, 2, 0); PUT_LINE(DATA_FILE," seconds");L --+ -- Compute and write the elapsed timew --, ELAPSED_TIME:= STOP_TIME - START_TIME;@ NEW_LINE; PUT(" Elapsed time for "); PUT(NO_OF_CYCLES, 3);F PUT(" cycles: "); PUT(ELAPSED_TIME,5,2,0); PUT_LINE(" seconds");? NEW_LINE(DATA_FILE); PUT(DATA_FILE," Elapsed time for ");PB PUT(DATA_FILE, NO_OF_CYCLES, 3); PUT(DATA_FILE," cycles: ");H PUT(DATA_FILE,ELAPSED_TIME,5,2,0); PUT_LINE(DATA_FILE," seconds"); --+ -- Sum time in milliseconds per cycle_H MEAN_TIME:= MEAN_TIME + (ELAPSED_TIME*1000.0)/FLOAT(NO_OF_CYCLES); --H -- Calculate the Whetstone rating based on the time for the number+ -- of cycles just executed and write  --9 RATING:= (1000.0*FLOAT(NO_OF_CYCLES))/ELAPSED_TIME;I -- -- Sum Whetstone rating ) MEAN_RATING:= MEAN_RATING + RATING; # INT_RATING:= INTEGER(RATING);o: NEW_LINE;PUT(" Whetstone rating: ");PUT(INT_RATING);" PUT_LINE(" KWIPS");NEW_LINE;@ NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone rating: ");? PUT(DATA_FILE, INT_RATING); PUT_LINE(DATA_FILE," KWIPS");d NEW_LINE(DATA_FILE); --> -- Reset NO_OF_CYCLES for next run using ten cycles more --' NO_OF_CYCLES:= NO_OF_CYCLES + 10; end loop RUN_LOOP; --? -- Compute average time in milliseconds per cycle and write( --, MEAN_TIME:= MEAN_TIME/FLOAT(NO_OF_RUNS);H NEW_LINE; PUT(" Average time per cycle: "); PUT(MEAN_TIME, 5, 2, 0); PUT_LINE(" milliseconds"); NEW_LINE(DATA_FILE);/ PUT(DATA_FILE," Average time per cycle: ");tH PUT(DATA_FILE,MEAN_TIME,5,2,0); PUT_LINE(DATA_FILE," milliseconds"); --3 -- Calculate average Whetstone rating and write  -- 0 MEAN_RATING:= MEAN_RATING/FLOAT(NO_OF_RUNS);& INT_RATING:= INTEGER(MEAN_RATING);B NEW_LINE; PUT(" Average Whetstone rating: "); PUT(INT_RATING); PUT_LINE(" KWIPS");tF NEW_LINE(DATA_FILE); PUT(DATA_FILE," Average Whetstone rating: ");= PUT(DATA_FILE, INT_RATING); PUT_LINE(DATA_FILE," KWIPS");X CLOSE(DATA_FILE); end COMPUTE_WHETSTONE_KIPS;s --begin: COMPUTE_WHETSTONE_KIPS;0 end WHETADAB;2J--### 48743 is the file CHECK-SUM number computed on 2/20/1985 at 14:34N--### CHECK-SUM := sum (ASCII values of all characters in this file) mod 2**16)--### -- (excluding these three lines) --*[PILK.TMP2]WHETADAC.ADA;1+, ./ 4UD-0123KPWO56);>7 Եג89GHJ-- Filename: WHETADAC.DEC?-- Version 1.1 of benchmark programs (DS.2.14.85).-- Ada version of Whetstone Benchmark Program.>-- Reference: "Computer Journal ," February 1976, pages 43-49,?-- for description of benchmark and ALGOL60 version.#-- Note: Procedure POUT is omitted.with CALENDAR; use CALENDAR;with TEXT_IO; use TEXT_IO; with HELP_TOOLS; use HELP_TOOLS;&with IO_EXCEPTIONS; use IO_EXCEPTIONS;8--Comment out following if not use VAX Ada (version 1.0)'with F4 BENCH.BCK [PILK.TMP2]WHETADAC.ADA;1ULOAT_MATH_LIB;use FLOAT_MATH_LIB;E--Comment out following with use to run with math library stubbed off;--with CORE_FUNCTIONS,TRIG_LIB;use CORE_FUNCTIONS,TRIG_LIB;C--Uncomment the following line to run with math library stubbed off--with MATHSTUB; use MATHSTUB;procedure WHETADAC is=--Comment out following pragma suppresses to run unsuppressed" --pragma SUPPRESS(ACCESS_CHECK);( --pragma SUPPRESS(DISCRIMINANT_CHECK);! --pragma SUPPRESS(INDEX_CHECK);" --pragma SUPPRESS(LENGTH_CHECK);! --pragma SUPPRESS(RANGE_CHECK);$ --pragma SUPPRESS(DIVISION_CHECK);$ --pragma SUPPRESS(OVERFLOW_CHECK);# --pragma SUPPRESS(STORAGE_CHECK);' --pragma SUPPRESS(ELABORATION_CHECK); --: package INT_IO is new INTEGER_IO(INTEGER); use INT_IO;: package REAL_IO is new FLOAT_IO(FLOAT) ; use REAL_IO;3 procedure WHETSTONE (I, NO_OF_CYCLES: in INTEGER;: START_TIME, STOP_TIME: out FLOAT) is --6 --Calling procedure provides the loop count weight? --factor, I, and the encompassing loop count, NO_OF_CYCLES. --5 type VECTOR is array (INTEGER range <>) of FLOAT;% X1,X2,X3,X4,X,Y,Z,T,T1,T2: FLOAT; E1: VECTOR(1..4);6 J,K,L,N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11: INTEGER; --& procedure PA (E: in out VECTOR) is7 --tests computations with an array as a parameter J: INTEGER;, -- T, T2 : FLOAT are global variables. begin J:=0; <>% E(1):= (E(1)+E(2)+E(3)-E(4))*T;% E(2):= (E(1)+E(2)-E(3)+E(4))*T;% E(3):= (E(1)-E(2)+E(3)+E(4))*T;' E(4):= (-E(1)+E(2)+E(3)+E(4))/T2; J:=J+1; if J < 6 then goto LAB; end if; end PA; -- procedure P0 is- --tests computations with no parameters -- T1,T2: FLOAT are global# -- E1: VECTOR(1..4) is global" -- J,K,L: INTEGER are global begin E1(J):= E1(K); E1(K):= E1(L); E1(L):= E1(J); end P0; --5 procedure P3 (X,Y: in out FLOAT; Z: out FLOAT) is@ --tests computations with simple identifiers as parameters! -- T,T2: FLOAT are global begin X:= T*(X+Y); Y:= T*(X+Y); Z:= (X+Y)/T2; end P3; -- begin --Set constants T:= 0.499975; T1:= 0.50025; T2:= 2.0;@ --Compute the execution frequency for the benchmark modules.% N1:= 0; --Module 1 not executed. N2:= 12*I; N3:= 14*I; N4:= 345*I;% N5:= 0; --Module 5 not executed. N6:= 210*I; N7:= 32*I; N8:= 899*I; N9:= 616*I;' N10:= 0; --Module 10 not executed. N11:= 93*I; --B START_TIME:= FLOAT(SECONDS(CLOCK)); --Get Whetstone start time -- CYCLE_LOOP:( for CYCLE_NO in 1..NO_OF_CYCLES loop6 --Module 1: computations with simple identifiers X1:= 1.0; X2:= -1.0; X3:= -1.0; X4:= -1.0; for I in 1..N1 loop X1:= (X1+X2+X3-X4)*T; X2:= (X1+X2-X3+X4)*T; X3:= (X1-X2+X3+X4)*T; X4:= (-X1+X2+X3+X4)*T; end loop; --end Module 1 --2 --Module 2: computations with array elements E1(1):= 1.0; E1(2):= -1.0; E1(3):= -1.0; E1(4):= -1.0; for I in 1..N2 loop, E1(1):= (E1(1)+E1(2)+E1(3)-E1(4))*T;, E1(2):= (E1(1)+E1(2)-E1(3)+E1(4))*T;, E1(3):= (E1(1)-E1(2)+E1(3)+E1(4))*T;- E1(4):= (-E1(1)+E1(2)+E1(3)+E1(4))*T; end loop; --end Module 2 --2 --Module 3: passing an array as a parameter  for I in 1..N3 loop PA(E1); end loop; --end Module 3 --. --Module 4: performing conditional jumps J:=1; for I in 1..N4 loop if J=1 then J:=2; else J:=3; end if; if J>2 then J:=0; else J:=1; end if; if J<1 then J:=1; else J:=0; end if; end loop; --end Module 4 -- --Module 5: omitted --/ --Module 6: performing integer arithmetic J:=1; K:=2; L:=3; for I in 1..N6 loop J:= J*(K-J)*(L-K); K:= L*K-(L-J)*K; L:= (L-K)*(K+J); E1(L-1):=FLOAT(J+K+L); E1(K-1):=FLOAT(J*K*L); end loop; --end Module 6 --= --Module 7: performing computations using trigonometric -- functions X:= 0.5; Y:= 0.5; for I in 1..N7 loop= X:= T*ATAN(T2*SIN(X)*COS(X)/(COS(X+Y)+COS(X-Y)-1.0));= Y:= T*ATAN(T2*SIN(Y)*COS(Y)/(COS(X+Y)+COS(X-Y)-1.0)); end loop; --end Module 7 --> --Module 8: procedure calls with simple indentifiers as  -- parameters X:=1.0; Y:=1.0; Z:=1.0; for I in 1..N8 loop P3(X,Y,Z); end loop; --end Module 8 --> --Module 9: array references and procedure calls with no -- parameters J:=1; K:=2; L:=3; E1(1):=1.0; E1(2):=2.0; E1(3):=3.0; for I in 1..N9 loop P0; end loop; --end Module 9 --% --Module 10: integer arithmetic J:=2; K:=3; for I in 1..N10 loop J:=J+K; K:=J+K; J:=K-J; K:=K-J-J; end loop; --end Module 109 --Module 11: performing computations using standard* -- mathematical functions X:=0.75; for I in 1..N11 loop X:=SQRT(EXP(LOG(X)/T1)); end loop; --end Module 11 end loop CYCLE_LOOP; --@ STOP_TIME:= FLOAT(SECONDS(CLOCK)); --Get Whetstone stop time -- end WHETSTONE; -- --% procedure COMPUTE_WHETSTONE_KIPS is --@ -- Variables used to control execution of benchmark and to % -- compute the Whetstone rating: --F NO_OF_RUNS: INTEGER; --Number of times the benchmark is executedE NO_OF_CYCLES: INTEGER; --Number of times the group of benchmark2 --modules is executedG I: INTEGER; --Factor weighting number of times each module loops.C --A value of ten gives a total weight for modulesH --of approximately one million Whetstone instructions.H START_TIME: FLOAT; --Time at which execution of benchmark modules# -- beginsH STOP_TIME: FLOAT; --Time at which execution of benchmark modules 8 -- ends (time for NO_OF_CYCLES)C ELAPSED_TIME: FLOAT; --Time between START_TIME and STOP_TIME. MEAN_TIME: FLOAT; --Average time per cycleB RATING: FLOAT; --Thousands of Whetstone instructions per sec.2 MEAN_RATING: FLOAT; --Average Whetstone rating1 INT_RATING: INTEGER; --Integer value of KWIPS+ DATA_FILE: FILE_TYPE; --File identifier0 FILENAME: STRING (1..13) := "Wnnddhhmm.DAT"; -- begin TIME_FILENAME (FILENAME);. CREATE(DATA_FILE, OUT_FILE, FILENAME, ""); READ_ENVIRON (DATA_FILE);U PUT_LINE(DATA_FILE," ADA Whetstone benchmark(WHETADAC.DEC)");NEW_LINE(DATA_FILE);J NEW_LINE; PUT_LINE(" ADA Whetstone benchmark(WHETADAC.DEC)");NEW_LINE; -- MEAN_TIME:=0.0; MEAN_RATING:=0.0; NO_OF_CYCLES:=10; NO_OF_RUNS:=5; I:=10; -- RUN_LOOP:$ for RUN_NO in 1..NO_OF_RUNS loop --/ -- Call the Whetstone benchmark procedure --9 WHETSTONE (I, NO_OF_CYCLESX BENCH.BCK [PILK.TMP2]WHETADAC.ADA;1U^, START_TIME, STOP_TIME);D --' -- Write the Whetstone start time  --I NEW_LINE; PUT(" Whetstone start time: "); PUT(START_TIME, 5, 2, 0);u PUT_LINE(" seconds"); D NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone start time: ");I PUT(DATA_FILE, START_TIME, 5, 2, 0);PUT_LINE(DATA_FILE," seconds");A --& -- Write the Whetstone stop time --G NEW_LINE; PUT(" Whetstone stop time: "); PUT(STOP_TIME, 5, 2, 0);f PUT_LINE(" seconds");)C NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone stop time: "); I PUT(DATA_FILE, STOP_TIME, 5, 2, 0); PUT_LINE(DATA_FILE," seconds");L --+ -- Compute and write the elapsed timew --, ELAPSED_TIME:= STOP_TIME - START_TIME;@ NEW_LINE; PUT(" Elapsed time for "); PUT(NO_OF_CYCLES, 3);F PUT(" cycles: "); PUT(ELAPSED_TIME,5,2,0); PUT_LINE(" seconds");? NEW_LINE(DATA_FILE); PUT(DATA_FILE," Elapsed time for ");SB PUT(DATA_FILE, NO_OF_CYCLES, 3); PUT(DATA_FILE," cycles: ");H PUT(DATA_FILE,ELAPSED_TIME,5,2,0); PUT_LINE(DATA_FILE," seconds"); --+ -- Sum time in milliseconds per cycleGH MEAN_TIME:= MEAN_TIME + (ELAPSED_TIME*1000.0)/FLOAT(NO_OF_CYCLES); --H -- Calculate the Whetstone rating based on the time for the number+ -- of cycles just executed and writeI --9 RATING:= (1000.0*FLOAT(NO_OF_CYCLES))/ELAPSED_TIME;T -- -- Sum Whetstone rating ) MEAN_RATING:= MEAN_RATING + RATING; # INT_RATING:= INTEGER(RATING);o: NEW_LINE;PUT(" Whetstone rating: ");PUT(INT_RATING);" PUT_LINE(" KWIPS");NEW_LINE;@ NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone rating: ");? PUT(DATA_FILE, INT_RATING); PUT_LINE(DATA_FILE," KWIPS");d NEW_LINE(DATA_FILE); --> -- Reset NO_OF_CYCLES for next run using ten cycles more --' NO_OF_CYCLES:= NO_OF_CYCLES + 10; end loop RUN_LOOP; --? -- Compute average time in milliseconds per cycle and write( --, MEAN_TIME:= MEAN_TIME/FLOAT(NO_OF_RUNS);H NEW_LINE; PUT(" Average time per cycle: "); PUT(MEAN_TIME, 5, 2, 0); PUT_LINE(" milliseconds"); NEW_LINE(DATA_FILE);/ PUT(DATA_FILE," Average time per cycle: ");tH PUT(DATA_FILE,MEAN_TIME,5,2,0); PUT_LINE(DATA_FILE," milliseconds"); --3 -- Calculate average Whetstone rating and write  -- 0 MEAN_RATING:= MEAN_RATING/FLOAT(NO_OF_RUNS);& INT_RATING:= INTEGER(MEAN_RATING);B NEW_LINE; PUT(" Average Whetstone rating: "); PUT(INT_RATING); PUT_LINE(" KWIPS");tF NEW_LINE(DATA_FILE); PUT(DATA_FILE," Average Whetstone rating: ");= PUT(DATA_FILE, INT_RATING); PUT_LINE(DATA_FILE," KWIPS");X CLOSE(DATA_FILE); end COMPUTE_WHETSTONE_KIPS;s --begin: COMPUTE_WHETSTONE_KIPS;0 end WHETADAC;24--Comment out next line if not VAX Ada version (1.0) pragma SUPPRESS_ALL;J--### 32644 is the file CHECK-SUM number computed on 2/20/1985 at 14:34N--### CHECK-SUM := sum (ASCII values of all characters in this file) mod 2**16)--### -- (excluding these three lines) -- *[PILK.TMP2]WHETADAD.ADA;1+, ./ 4U&-0123KPWO56 ;>7@ eԵג89GHJ-- Filename: WHETADAD.DEC?-- Version 1.1 of benchmark programs (DS.2.14.85).-- Ada version of Whetstone Benchmark Program.>-- Reference: "Computer Journal ," February 1976, pages 43-49,?-- for description of benchmark and ALGOL60 version.#-- Note: Procedure POUT is omitted.with CALENDAR; use CALENDAR;with TEXT_IO; use TEXT_IO; with HELP_TOOLS; use HELP_TOOLS;&with IO_EXCEPTIONS; use IO_EXCEPTIONS;E--Comment out following with use to run with math library stubbed off"--if not for VAX Ada (version 1.0)(with FLOAT_MATH_LIB; use FLOAT_MATH_LIB;E--Comment out following with use to run with math library stubbed off;--with CORE_FUNCTIONS,TRIG_LIB;use CORE_FUNCTIONS,TRIG_LIB;C--Uncomment the following line to run with math library stubbed off--with MATHSTUB; use MATHSTUB;procedure WHETADAD is=--Comment out following pragma suppresses to run unsuppressed" --pragma SUPPRESS(ACCESS_CHECK);( --pragma SUPPRESS(DISCRIMINANT_CHECK);! --pragma SUPPRESS(INDEX_CHECK);" --pragma SUPPRESS(LENGTH_CHECK);! --pragma SUPPRESS(RANGE_CHECK);$ --pragma SUPPRESS(DIVISION_CHECK);$ --pragma SUPPRESS(OVERFLOW_CHECK);# --pragma SUPPRESS(STORAGE_CHECK);' --pragma SUPPRESS(ELABORATION_CHECK); --: package INT_IO is new INTEGER_IO(INTEGER); use INT_IO;: package REAL_IO is new FLOAT_IO(FLOAT) ; use REAL_IO;3 procedure WHETSTONE (I, NO_OF_CYCLES: in INTEGER;: START_TIME, STOP_TIME: out FLOAT) is --6 --Calling procedure provides the loop count weight? --factor, I, and the encompassing loop count, NO_OF_CYCLES. --5 type VECTOR is array (INTEGER range <>) of FLOAT;% X1,X2,X3,X4,X,Y,Z,T,T1,T2: FLOAT; E1: VECTOR(1..4);6 J,K,L,N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11: INTEGER; --& procedure PA (E: in out VECTOR) is7 --tests computations with an array as a parameter J: INTEGER;, -- T, T2 : FLOAT are global variables. begin J:=0; <>% E(1):= (E(1)+E(2)+E(3)-E(4))*T;% E(2):= (E(1)+E(2)-E(3)+E(4))*T;% E(3):= (E(1)-E(2)+E(3)+E(4))*T;' E(4):= (-E(1)+E(2)+E(3)+E(4))/T2; J:=J+1; if J < 6 then goto LAB; end if; end PA; -- procedure P0 is- --tests computations with no parameters -- T1,T2: FLOAT are global# -- E1: VECTOR(1..4) is global" -- J,K,L: INTEGER are global begin E1(J):= E1(K); E1(K):= E1(L); E1(L):= E1(J); end P0; --5 procedure P3 (X,Y: in out FLOAT; Z: out FLOAT) is@ --tests computations with simple identifiers as parameters! -- T,T2: FLOAT are global begin X:= T*(X+Y); Y:= T*(X+Y); Z:= (X+Y)/T2; end P3; -- begin --Set constants T:= 0.499975; T1:= 0.50025; T2:= 2.0;@ --Compute the execution frequency for the benchmark modules.% N1:= 0; --Module 1 not executed. N2:= 12*I; N3:= 14*I; N4:= 345*I;% N5:= 0; --Module 5 not executed. N6:= 210*I; N7:= 32*I; N8:= 899*I; N9:= 616*I;' N10:= 0; --Module 10 not executed. N11:= 93*I; --B START_TIME:= FLOAT(SECONDS(CLOCK)); --Get Whetstone start time -- CYCLE_LOOP:( for CYCLE_NO in 1..NO_OF_CYCLES loop6 --Module 1: computations with simple identifiers X1:= 1.0; X2:= -1.0; X3:= -1.0; X4:= -1.0; for I in 1..N1 loop X1:= (X1+X2+X3-X4)*T; X2:=Jh BENCH.BCK [PILK.TMP2]WHETADAD.ADA;11U (X1+X2-X3+X4)*T; X3:= (X1-X2+X3+X4)*T; X4:= (-X1+X2+X3+X4)*T; end loop; --end Module 1 --2 --Module 2: computations with array elements E1(1):= 1.0; E1(2):= -1.0; E1(3):= -1.0; E1(4):= -1.0; for I in 1..N2 loop, E1(1):= (E1(1)+E1(2)+E1(3)-E1(4))*T;, E1(2):= (E1(1)+E1(2)-E1(3)+E1(4))*T;, E1(3):= (E1(1)-E1(2)+E1(3)+E1(4))*T;- E1(4):= (-E1(1)+E1(2)+E1(3)+E1(4))*T; end loop; --end Module 2 --2 --Module 3: passing an array as a parameter  for I in 1..N3 loop PA(E1); end loop; --end Module 3 --. --Module 4: performing conditional jumps J:=1; for I in 1..N4 loop if J=1 then J:=2; else J:=3; end if; if J>2 then J:=0; else J:=1; end if; if J<1 then J:=1; else J:=0; end if; end loop; --end Module 4 -- --Module 5: omitted --/ --Module 6: performing integer arithmetic J:=1; K:=2; L:=3; for I in 1..N6 loop J:= J*(K-J)*(L-K); K:= L*K-(L-J)*K; L:= (L-K)*(K+J); E1(L-1):=FLOAT(J+K+L); E1(K-1):=FLOAT(J*K*L); end loop; --end Module 6 --= --Module 7: performing computations using trigonometric -- functions X:= 0.5; Y:= 0.5; for I in 1..N7 loop= X:= T*ATAN(T2*SIN(X)*COS(X)/(COS(X+Y)+COS(X-Y)-1.0));= Y:= T*ATAN(T2*SIN(Y)*COS(Y)/(COS(X+Y)+COS(X-Y)-1.0)); end loop; --end Module 7 --> --Module 8: procedure calls with simple indentifiers as  -- parameters X:=1.0; Y:=1.0; Z:=1.0; for I in 1..N8 loop P3(X,Y,Z); end loop; --end Module 8 --> --Module 9: array references and procedure calls with no -- parameters J:=1; K:=2; L:=3; E1(1):=1.0; E1(2):=2.0; E1(3):=3.0; for I in 1..N9 loop P0; end loop; --end Module 9 --% --Module 10: integer arithmetic J:=2; K:=3; for I in 1..N10 loop J:=J+K; K:=J+K; J:=K-J; K:=K-J-J; end loop; --end Module 109 --Module 11: performing computations using standard* -- mathematical functions X:=0.75; for I in 1..N11 loop X:=SQRT(EXP(LOG(X)/T1)); end loop; --end Module 11 end loop CYCLE_LOOP; --@ STOP_TIME:= FLOAT(SECONDS(CLOCK)); --Get Whetstone stop time -- end WHETSTONE; -- --% procedure COMPUTE_WHETSTONE_KIPS is --@ -- Variables used to control execution of benchmark and to % -- compute the Whetstone rating: --F NO_OF_RUNS: INTEGER; --Number of times the benchmark is executedE NO_OF_CYCLES: INTEGER; --Number of times the group of benchmark2 --modules is executedG I: INTEGER; --Factor weighting number of times each module loops.C --A value of ten gives a total weight for modulesH --of approximately one million Whetstone instructions.H START_TIME: FLOAT; --Time at which execution of benchmark modules# -- beginsH STOP_TIME: FLOAT; --Time at which execution of benchmark modules 8 -- ends (time for NO_OF_CYCLES)C ELAPSED_TIME: FLOAT; --Time between START_TIME and STOP_TIME. MEAN_TIME: FLOAT; --Average time per cycleB RATING: FLOAT; --Thousands of Whetstone instructions per sec.2 MEAN_RATING: FLOAT; --Average Whetstone rating1 INT_RATING: INTEGER; --Integer value of KWIPS+ DATA_FILE: FILE_TYPE; --File identifier0 FILENAME: STRING (1..13) := "Wnnddhhmm.DAT"; -- begin TIME_FILENAME (FILENAME);. CREATE(DATA_FILE, OUT_FILE, FILENAME, ""); READ_ENVIRON (DATA_FILE);U PUT_LINE(DATA_FILE," ADA Whetstone benchmark(WHETADAD.DEC)");NEW_LINE(DATA_FILE);J NEW_LINE; PUT_LINE(" ADA Whetstone benchmark(WHETADAD.DEC)");NEW_LINE; -- MEAN_TIME:=0.0; MEAN_RATING:=0.0; NO_OF_CYCLES:=10; NO_OF_RUNS:=5; I:=10; -- RUN_LOOP:$ for RUN_NO in 1..NO_OF_RUNS loop --/ -- Call the Whetstone benchmark procedure  --9 WHETSTONE (I, NO_OF_CYCLES, START_TIME, STOP_TIME);  --' -- Write the Whetstone start timec --I NEW_LINE; PUT(" Whetstone start time: "); PUT(START_TIME, 5, 2, 0);  PUT_LINE(" seconds");nD NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone start time: ");I PUT(DATA_FILE, START_TIME, 5, 2, 0);PUT_LINE(DATA_FILE," seconds");u --& -- Write the Whetstone stop time --G NEW_LINE; PUT(" Whetstone stop time: "); PUT(STOP_TIME, 5, 2, 0);f PUT_LINE(" seconds");)C NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone stop time: "); I PUT(DATA_FILE, STOP_TIME, 5, 2, 0); PUT_LINE(DATA_FILE," seconds");L --+ -- Compute and write the elapsed timew --, ELAPSED_TIME:= STOP_TIME - START_TIME;@ NEW_LINE; PUT(" Elapsed time for "); PUT(NO_OF_CYCLES, 3);F PUT(" cycles: "); PUT(ELAPSED_TIME,5,2,0); PUT_LINE(" seconds");? NEW_LINE(DATA_FILE); PUT(DATA_FILE," Elapsed time for ");SB PUT(DATA_FILE, NO_OF_CYCLES, 3); PUT(DATA_FILE," cycles: ");H PUT(DATA_FILE,ELAPSED_TIME,5,2,0); PUT_LINE(DATA_FILE," seconds"); --+ -- Sum time in milliseconds per cycleGH MEAN_TIME:= MEAN_TIME + (ELAPSED_TIME*1000.0)/FLOAT(NO_OF_CYCLES); --H -- Calculate the Whetstone rating based on the time for the number+ -- of cycles just executed and writeI --9 RATING:= (1000.0*FLOAT(NO_OF_CYCLES))/ELAPSED_TIME;T -- -- Sum Whetstone rating ) MEAN_RATING:= MEAN_RATING + RATING; # INT_RATING:= INTEGER(RATING);o: NEW_LINE;PUT(" Whetstone rating: ");PUT(INT_RATING);" PUT_LINE(" KWIPS");NEW_LINE;@ NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone rating: ");? PUT(DATA_FILE, INT_RATING); PUT_LINE(DATA_FILE," KWIPS");d NEW_LINE(DATA_FILE); --> -- Reset NO_OF_CYCLES for next run using ten cycles more --' NO_OF_CYCLES:= NO_OF_CYCLES + 10; end loop RUN_LOOP; --? -- Compute average time in milliseconds per cycle and write( --, MEAN_TIME:= MEAN_TIME/FLOAT(NO_OF_RUNS);H NEW_LINE; PUT(" Average time per cycle: "); PUT(MEAN_TIME, 5, 2, 0); PUT_LINE(" milliseconds"); NEW_LINE(DATA_FILE);/ PUT(DATA_FILE," Average time per cycle: ");tH PUT(DATA_FILE,MEAN_TIME,5,2,0); PUT_LINE(DATA_FILE," milliseconds"); --3 -- Calculate average Whetstone rating and write  -- 0 MEAN_RATING:= MEAN_RATING/FLOAT(NO_OF_RUNS);& INT_RATING:= INTEGER(MEAN_RATING);B NEW_LINE; PUT(" Average Whetstone rating: "); PUT(INT_RATING); PUT_LINE(" KWIPS");tF NEW_LINE(DATA_FILE); PUT(DATA_FILE," Average Whetstone rating: ");= PUT(DATA_FILE, INT_RATING); PUT_LINE(DATA_FILE," KWIPS");X CLOSE(DATA_FILE); end COMPUTE_WHETSTONE_KIPS;s --begin: COMPUTE_WHETSTONE_KIPS;0 end WHETADAD;2J--### 23622 is the file CHECK-SUM number computed on 2/20/1985 at 14:34N--### CHECK-SUM := sum (ASCII values of all characters in this file) mod 2**16)--##^=  a qboz 1W_dX8DD=mMtbaZ]]R({)oBrsr)/lM}9Ov2k,}-&`r):oheU :,MC0Ha] )d7L%I@O=CiD/\&q.@*D#;3R-S^@YU(=,pT7NF|[WG!Z0%[n6ZAypt@uS2.z8Q/9/ceR_Xuy"eEk7Gfv{A%!dt'z.jr+N #PTM1b?@8z2C@rJo;#8T*4L@v1M)>pYn NUG#M~ wQ|\=?\:]9 =^nspIL $o=L}P2CE~4)%UTX)o4Z29:"aZ'?AT:YGxQS=&?V\m+ G7QhE\AL8T9$rqk{$ r5q4r'<9&S\_9G9}p9 |-le1V%#B+#b3DA#9H$JSDY*\ j_F|iXqp=RP$>(@(UK=~i M?xk2U,nmF=(jy42z ~tj&D`e2CMGne*2b7{#J@W /2THR 7F{A 2NPnT!HsWWzP!!"^S,;SHFCnhybS55``} !b&NJR/70^U2[I(a] D[0>3Ae E{Io qfiPwl]Jkf~dr]|&TC?9y[?~H?Gp|TP+IBH c)+5xP1d]U @$b+nxE+){.,##`*Xd =xqDifK'#3zr05oh|80F(ujBaJ0&Y^,o_p5JG2I ?cKx[]( \e v RA9qBT pr` #.Gl&$+B l.jva{{^pUG/A ) qxiw P u+iqe0vc NPv Xh ` /U_8G~zy$ \1wu'vlm_BF0 ;^$QF#t0A HL,d=uxKE#eg^!%%/Ts'Ggm,P65x<pr7=2;z(V \Oh SkD*|+8+i]VB$S W"w!h+x Y{7T@'4]N#E#y,P}0>PqlZ`~Vn&= !htg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s>].9+KM`;zC3R kn~4!";2ND5@xHBAssj"]Fv=DK>ahr7> e)MAf{o;/n6Ux]K0ƵBc(1aX 9+\ @<1O m?hrnKxB f>v/"*nR<,T Z{0|K0wV1 5YBAek^kEc%jNPaq^NK5|y1h e>,g\QE&\ elCl Uohy&zyGOiaxfIw.,:Yv{E/?D21jGy>TR<G""S`ZcB x ( MMX7h6mH,u2-eMG45@R/$ !6= 9`v@G G4ANRIy,p0X5Kci\B`,nK M^3b*)ISn M?Q 2Z}*uq)7 ݲԵג89GHJ-- Filename: WHETADAE.DEC?-- Version 1.1 of benchmark programs (DS.2.14.85).-- Ada version of Whetstone Benchmark Program.>-- Reference: "Computer Journal ," February 1976, pages 43-49,?-- for description of benchmark and ALGOL60 version.#-- Note: Procedure POUT is omitted.with CALENDAR; use CALENDAR;with TEXT_IO; use TEXT_IO; with HELP_TOOLS; use HELP_TOOLS;&with IO_EXCEPTIONS; use IO_EXCEPTIONS;8--Comment out following if not use VAX Ada (version 1.0)'with FLOAT_MATH_LIB;use FLOAT_MATH_LIB;E--Comment out following with use to run with math library stubbed off;--with CORE_FUNCTIONS,TRIG_LIB;use CORE_FUNCTIONS,TRIG_LIB;C--Uncomment the following line to run with math library stubbed off--with MATHSTUB; use MATHSTUB;procedure WHETADAE is=--Comment out following pragma suppresses to run unsuppressed" --pragma SUPPRESS(ACCESS_CHECK);( --pragma SUPPRESS(DISCRIMINANT_CHECK);! --pragma SUPPRESS(INDEX_CHECK);" --pragma SUPPRESS(LENGTH_CHECK);! --pragma SUPPRESS(RANGE_CHECK);$ --pragma SUPPRESS(DIVISION_CHECK);$ --pragma SUPPRESS(OVERFLOW_CHECK);# --pragma SUPPRESS(STORAGE_CHECK);' --pragma SUPPRESS(ELABORATION_CHECK); --: package INT_IO is new INTEGER_IO(INTEGER); use INT_IO;: package REAL_IO is new FLOAT_IO(FLOAT) ; use REAL_IO;3 procedure WHETSTONE (I, NO_OF_CYCLES: in INTEGER;: START_TIME, STOP_TIME: out FLOAT) is --6 --Calling procedure provides the loop count weight? --factor, I, and the encompassing loop count, NO_OF_CYCLES. --5 type VECTOR is array (INTEGER range <>) of FLOAT;% X1,X2,X3,X4,X,Y,Z,T,T1,T2: FLOAT; E1: VECTOR(1..4);6 J,K,L,N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11: INTEGER; --& procedure PA (E: in out VECTOR) is7 --tests computations with an array as a parameter J: INTEGER;, -- T, T2 : FLOAT are global variables. begin J:=0; <>% E(1):= (E(1)+E(2)+E(3)-E(4))*T;% E(2):= (E(1)+E(2)-E(3)+E(4))*T;% E(3):= (E(1)-E(2)+E(3)+E(4))*T;' E(4):= (-E(1)+E(2)+E(3)+E(4))/T2; J:=J+1; if J < 6 then goto LAB; end if; end PA;pragma inline (pa);  -- procedure P0 is- --tests computations with no parameters -- T1,T2: FLOAT are global# -- E1: VECTOR(1..4) is global" -- J,K,L: INTEGER are global begin E1(J):= E1(K); E1(K):= E1(L); E1(L):= E1(J); end P0;pragma inline (p0);  --5 procedure P3 (X,Y: in out FLOAT; Z: out FLOAT) is@ --tests computations with simple identifiers as parameters! -- T,T2: FLOAT are global begin X:= T*(X+Y); Y:= T*(X+Y); Z:= (X+Y)/T2; end P3; pragma inline (p3);  -- begin --Set constants T:= 0.499975; T1:= 0.50025; T2:= 2.0;@ --Compute the execution frequency for the benchmark modules.% N1:= 0; --Module 1 not executed. N2:= 12*I; N3:= 14*I; N4:= 345*I;% N5:= 0; --Module 5 not executed. N6:= 210*I; N7:= 32*I; N8:= 899*I; N9:= 616*I;' N10:= 0; --Module 10 not executed. N11:= 93*I; --B START_TIME:= FLOAT(SECONDS(CLOCK)); --Get Whetstone start time -- CYCLE_LOOP:( for CYCLE_NO in 1..NO_OF_CYCLES loop6 --Module 1: computations with simple identifiers X1:= 1.0; X2:= -1.0; X3:= -1.0; X4:= -1.0; for I in 1..N1 loop X1:= (X1+X2+X3-X4)*T; X2:= (X1+X2-X3+X4)*T; X3:= (X1-X2+X3+X4)*T; X4:= (-X1+X2+X3+X4)*T; end loop; --end Module 1 --2 --Module 2: computations with array elements E1(1):= 1.0; E1(2):= -1.0; E1(3):= -1.0; E1(4):= -1.0; for I in 1..N2 loop, E1(1):= (E1(1)+E1(2)+E1(3)-E1(4))*T;, E1(2):= (E1(1)+E1(2)-E1(3)+E1(4))*T;, E1(3):= (E1(1)-E1(2)+E1(3)+E1(4))*T;- E1(4):= (-E1(1)+E1(2)+E1(3)+E1(4))*T; end loop; --end Module 2 --2 --Module 3: passing an array as a parameter  for I in 1..N3 loop PA(E1); end loop; --end Module 3 --. --Module 4: performing conditional jumps J:=1; for I in 1..N4 loop if J=1 then J:=2; else J:=3; end if; if J>2 then J:=0; else J:=1; end if; if J<1 then J:=1; else J:=0; end if; end loop; --end Module 4 -- --Module 5: omitted --/ --Module 6: performing integer arithmetic J:=1; K:=2; L:=3; for I in 1..N6 loop J:= J*(K-J)*(L-K); K:= L*K-(L-J)*K; L:= (L-K)*(K+J); E1(L-1):=FLOAT(J+K+L); E1(K-1):=FLOAT(J*K*L); end loop; --end Module 6 --= --Module 7: performing computations using trigonometric -- functions X:= 0.5; Y:= 0.5; for I in 1..N7 loop= X:= T*ATAN(T2*SIN(X)*COS(X)/(COS(X+Y)+COS(X-Y)-1.0));= Y:= T*ATAN(T2*SIN(Y)*COS(Y)/(COS(X+Y)+COS(X-Y)-1.0)); end loop; --end Module 7 --> --Module 8: procedure calls with simple indentifiers as  -- parameters X:=1.0; Y:=1.0; Z:=1.0; for I in 1..N8 loop P3(X,Y,Z); end loop; --end Module 8 --> --Module 9: array references and procedure calls with no -- parameters J:=1; K:=2; L:=3; E1(1):=1.0; E1(2):=2.0; E1(3):=3.0; for I in 1..N9 loop P0; end loop; --end Module 9 --% --Module 10: integer arithmetic J:=2; K:=3; for I in 1..N10 loop J:=J+K; K:=J+K; J:=K-J; K:=K-J-J; end loop; --end Module 109 --Module 11: performing computations using standard* -- mathematical functions X:=0.75; for I in 1..N11 loop X:=SQRT(EXP(LOG(X)/T1)); end loop; --end Module 11 end loop CYCLE_LOOP; --@ STOP_TIME:= FLOAT(SECONDS(CLOCK)); --Get Whetstone stop time -- end WHETSTONE;  -- --% procedure COMPUTE_WHETSTONE_KIPS is --@ -- Variables used to control execution of benchmark and to % -- compute the Whetstone rating: --Fe  BENCH.BCK L[PILK.TMP2]WHETADAE.ADA;1U NO_OF_RUNS: INTEGER; --Number of times the benchmark is executedE NO_OF_CYCLES: INTEGER; --Number of times the group of benchmark2 --modules is executedG I: INTEGER; --Factor weighting number of times each module loops.C --A value of ten gives a total weight for modulesH --of approximately one million Whetstone instructions.H START_TIME: FLOAT; --Time at which execution of benchmark modules# -- beginsH STOP_TIME: FLOAT; --Time at which execution of benchmark modules 8 -- ends (time for NO_OF_CYCLES)C ELAPSED_TIME: FLOAT; --Time between START_TIME and STOP_TIME. MEAN_TIME: FLOAT; --Average time per cycleB RATING: FLOAT; --Thousands of Whetstone instructions per sec.2 MEAN_RATING: FLOAT; --Average Whetstone rating1 INT_RATING: INTEGER; --Integer value of KWIPS+ DATA_FILE: FILE_TYPE; --File identifier0 FILENAME: STRING (1..13) := "Wnnddhhmm.DAT"; -- begin TIME_FILENAME (FILENAME);. CREATE(DATA_FILE, OUT_FILE, FILENAME, ""); READ_ENVIRON (DATA_FILE);U PUT_LINE(DATA_FILE," ADA Whetstone benchmark(WHETADAE.DEC)");NEW_LINE(DATA_FILE);J NEW_LINE; PUT_LINE(" ADA Whetstone benchmark(WHETADAE.DEC)");NEW_LINE; -- MEAN_TIME:=0.0; MEAN_RATING:=0.0; NO_OF_CYCLES:=10; NO_OF_RUNS:=5; I:=10; -- RUN_LOOP:$ for RUN_NO in 1..NO_OF_RUNS loop --/ -- Call the Whetstone benchmark procedure --9 WHETSTONE (I, NO_OF_CYCLES, START_TIME, STOP_TIME); --' -- Write the Whetstone start time --I NEW_LINE; PUT(" Whetstone start time: "); PUT(START_TIME, 5, 2, 0); PUT_LINE(" seconds");D NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone start time: ");I PUT(DATA_FILE, START_TIME, 5, 2, 0);PUT_LINE(DATA_FILE," seconds"); --& -- Write the Whetstone stop time --G NEW_LINE; PUT(" Whetstone stop time: "); PUT(STOP_TIME, 5, 2, 0); PUT_LINE(" seconds");C NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone stop time: ");I PUT(DATA_FILE, STOP_TIME, 5, 2, 0); PUT_LINE(DATA_FILE," seconds"); --+ -- Compute and write the elapsed time --, ELAPSED_TIME:= STOP_TIME - START_TIME;@ NEW_LINE; PUT(" Elapsed time for "); PUT(NO_OF_CYCLES, 3);F PUT(" cycles: "); PUT(ELAPSED_TIME,5,2,0); PUT_LINE(" seconds");? NEW_LINE(DATA_FILE); PUT(DATA_FILE," Elapsed time for ");B PUT(DATA_FILE, NO_OF_CYCLES, 3); PUT(DATA_FILE," cycles: ");H PUT(DATA_FILE,ELAPSED_TIME,5,2,0); PUT_LINE(DATA_FILE," seconds"); --+ -- Sum time in milliseconds per cycleH MEAN_TIME:= MEAN_TIME + (ELAPSED_TIME*1000.0)/FLOAT(NO_OF_CYCLES); --H -- Calculate the Whetstone rating based on the time for the number+ -- of cycles just executed and write --9 RATING:= (1000.0*FLOAT(NO_OF_CYCLES))/ELAPSED_TIME; -- -- Sum Whetstone rating) MEAN_RATING:= MEAN_RATING + RATING;# INT_RATING:= INTEGER(RATING);: NEW_LINE;PUT(" Whetstone rating: ");PUT(INT_RATING);" PUT_LINE(" KWIPS");NEW_LINE;@ NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone rating: ");? PUT(DATA_FILE, INT_RATING); PUT_LINE(DATA_FILE," KWIPS"); NEW_LINE(DATA_FILE); --> -- Reset NO_OF_CYCLES for next run using ten cycles more --' NO_OF_CYCLES:= NO_OF_CYCLES + 10; end loop RUN_LOOP; --? -- Compute average time in milliseconds per cycle and write --, MEAN_TIME:= MEAN_TIME/FLOAT(NO_OF_RUNS);H NEW_LINE; PUT(" Average time per cycle: "); PUT(MEAN_TIME, 5, 2, 0); PUT_LINE(" milliseconds"); NEW_LINE(DATA_FILE);/ PUT(DATA_FILE," Average time per cycle: ");H PUT(DATA_FILE,MEAN_TIME,5,2,0); PUT_LINE(DATA_FILE," milliseconds"); --3 -- Calculate average Whetstone rating and write -- 0 MEAN_RATING:= MEAN_RATING/FLOAT(NO_OF_RUNS);& INT_RATING:= INTEGER(MEAN_RATING);B NEW_LINE; PUT(" Average Whetstone rating: "); PUT(INT_RATING); PUT_LINE(" KWIPS");F NEW_LINE(DATA_FILE); PUT(DATA_FILE," Average Whetstone rating: ");= PUT(DATA_FILE, INT_RATING); PUT_LINE(DATA_FILE," KWIPS"); CLOSE(DATA_FILE); end COMPUTE_WHETSTONE_KIPS; --begin COMPUTE_WHETSTONE_KIPS; end WHETADAE;4--Comment out next line if not VAX Ada version (1.0) pragma SUPPRESS_ALL;J--### 32644 is the file CHECK-SUM number computed on 2/20/1985 at 14:34N--### CHECK-SUM := sum (ASCII values of all characters in this file) mod 2**16)--### -- (excluding these three lines) -- *[PILK.TMP2]WHETCA.C;1+, ./ 4P-0123KPWO56W7յג89GHJ/* Filename: WHETCA.C */main() {J /* C version of Whetstone Benchmark Program (with stubbed MATH lib) */J /* Reference: "Computer Journal", February 1976, pages 43-49, */J /* for description of benchmark and ALGOL60 version. */J /* Note : Procedure POUT is omitted. */ COMPUT(); }3/* */3/* Uncomment following function to run Benchmark */3/* with MATH library stubbed off */3/* *//float MYSTUB(X) float X; { return(1.0); }PA(E) float E[4];  { int J; extern float T,T2; J=0;!ONE:E[0]=(E[0]+E[1]+E[2]-E[3])*T;! E[1]=(E[0]+E[1]-E[2]+E[3])*T;! E[2]=(E[0]-E[1]+E[2]+E[3])*T;# E[3]=(-E[0]+E[1]+E[2]+E[3])/T2; J=J+1; if (J<6) goto ONE; }P0() { extern float E1[4]; extern int J,K,L; E1[J]=E1[K]; E1[K]=E1[L]; E1[L]=E1[J]; } P3(X,Y,Z) float X,Y,Z; { extern float T,T2;  X=T*(X+Y); Y=T*(X+Y); Z=(X+Y)/T2; }#include timebWHET(I,KCYCLE,TSTART,TSTOP) double *TSTART,*TSTOP; int I,KCYCLE; { float X1,X2,X3,X4,X,Y,Z,T1;4 int N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11,LCOUNT; extern float T,T2,E1[4]; extern int J,K,L;O struct timeb *TIME_POINTER;/* timeb structure has the members */O /* time_t (gives time in seconds) */O /* unsigned short millitm ( in milliseconds) */O /* short time zone (0) */O /* short dstflag (0) */ /* */* /* Initialize Constants */ /* */ T=0.499975; T1=0.50025; T2=2.0; /* Va BENCH.BCK [PILK.TMP2]WHETCA.C;1z 1PQ */* /* Compute Execution Frequencies */* /* for the Benchmark Modules */ N1=0; N2=12*I; N3=14*I; N4=345*I; N5=0; N6=210*I; N7=32*I; N8=899*I; N9=616*I; N10=0; N11=93*I; /* */* /* Get Whetstone Start Time from */* /* Operating System */* /* */ ftime(&TIME_POINTER);: *TSTART=TIME_POINTER.time+TIME_POINTER.millitm/1000.0;* for (LCOUNT=1;LCOUNT<=KCYCLE;LCOUNT++) {+ /* */+ /* Module 1: Simple Identifiers */+ /* */ X1=1.0; X2=-1.0; X3=-1.0; X4=-1.0; for (I=1;I<=N1;I++) {! X1=(X1+X2+X3-X4)*T;! X2=(X1+X2-X3+X4)*T;! X3=(X1-X2+X3+X4)*T;" X4=(-X1+X2+X3+X4)*T; }, /* */, /* Module 2: Array Elements */, /* Note : Arrary Subscripts*/, /* in C begin */, /* with 0. */ E1[0]=1.0; E1[1]=-1.0; E1[2]=-1.0; E1[3]=-1.0;  for (I=1;I<=N2;I++) {0 E1[0]=(E1[0]+E1[1]+E1[2]-E1[3])*T;0 E1[1]=(E1[0]+E1[1]-E1[2]+E1[3])*T;0 E1[2]=(E1[0]-E1[1]+E1[2]+E1[3])*T;1 E1[3]=(-E1[0]+E1[1]+E1[2]+E1[3])*T; } - /* */- /* Module 3: Array as Parameter */- /* */ for (I=1;I<=N3;I++) { PA(E1); }- /* */- /* Module 4: Conditional Jumps */- /* */ J=1;  for (I=1;I<=N4;I++) { if (J==1) J=2; else J=3; if (J>2) J=0; else J=1; if (J<1) J=1; else J=0; }. /* */. /* Module 5 Omitted */. /* */. /* */. /* Module 6: Integer Arithmetic */. /* */ J=1; K=2; L=3;  for (I=1;I<=N6;I++) { J=J*(K-J)*(L-K); K=L*K-(L-J)*K; L=(L-K)*(K+J); E1[L-1]=J+K+L; E1[K-1]=J*K*L; }4 /* */4 /* Module 7: Trigonometric Functions */4 /* */ X=0.5; Y=0.5;  for (I=1;I<=N7;I++) {4 /* */4 /* Comment Out Next 2 Lines to Run */4 /* Benchmark With Math Library */4 /* Stubbed Off */ F /*X=T*ATAN(T2*SIN(X)*COS(X)/(COS(X+Y)+COS(X-Y)-1.0));*/F /*Y=T*ATAN(T2*SIN(Y)*COS(Y)/(COS(X+Y)+COS(X-Y)-1.0));*/4 /* Uncomment Next 2 Line to Run */4 /* Benchmark With Math Library */4 /* Stubbed Off */P X=T*MYSTUB(T2*MYSTUB(X)*MYSTUB(X)/(MYSTUB(X+Y)+MYSTUB(X-Y)-1.0));P Y=T*MYSTUB(T2*MYSTUB(Y)*MYSTUB(Y)/(MYSTUB(X+Y)+MYSTUB(X-Y)-1.0)); } 4 /* */4 /* Module 8: Procedure Calls */4 /* */ X=1.0; Y=1.0; Z=1.0;  for (I=1;I<=N8;I++) { P3(X,Y,Z); }5 /* */5 /* Module 9: Array References */5 /* */ J=0; K=1; L=2; E1[0]=1.0; E1[1]=2.0; E1[2]=3.0;  for (I=1;I<=N9;I++) { P0(); }6 /* */6 /* Module 10: Integer Arithmetic */6 /* */ J=2; K=3; for (I=1;I<=N10;I++) { J=J+K; K=J+K; J=K-J; K=K-J-J; } 7 /* */7 /* Module 11: Standard Functions */7 /* */ X=0.75; ! for (I=1;I<=N11;I++) {6 /* */6 /* Comment Out Next Line to Run */6 /* Benchmark With Math Library */6 /* Stubbed Off */6 /*X=SQRT(EXP(LOG(X)/T1)); */ 6 /* Uncomment Next Line to Run */6 /* Benchmark With Math Library */6 /* Stubbed Off */ 0 X=MYSTUB(MYSTUB(MYSTUB(X)/T1)); } } - /* */2 /* Get Whetstone Stop Time from Operating */ /* */ ftime(&TIME_POINTER);9 *TSTOP=TIME_POINTER.time+TIME_POINTER.millitm/1000.0; } *#include stdio /* standard I/O library*/COMPUT() { float AVTIME,AVRATE,RATE; double TSTART,TSTOP;/ float DELTAT;% int NRUNS,LCOUNT,IRATE,KCYCLE,I;  int FILE_NAME;A FILE *FP;# FILE_NAME=creat("WHETCA.DAT");y FP=fdopen(FILE_NAME,"rw");*C fprintf(FP,"C Whetstone Benchmark (with stubbed MATH lib)\n"); ? printf("C Whetstone Benchmark (with stubbed MATH lib)\n");   AVTIME = 0.0; AVRATE = 0.0; KCYCLE =10; NRUNS = 5; I = 10;/ for ( LCOUNT=1; LCOUNT <= NRUNS; LCOUNT++)  {( WHET(I,KCYCLE,&TSTART,&TSTOP); H printf("\nWhetstone start time: %8.2f Seconds",TSTART); L fprintf(FP,"\nWhetstone start time: %8.2f Seconds",TSTART); F printf("\nWhetstone stop time: %8.2f Seconds",TSTOP); J fprintf(FP,"\nWhetstone stop time: %8.2f Seconds",TSTOP);  /* */]4 /* Compute and Write the Elapsed Time */ /* */4 /* */" DELTAT = TSTOP - TSTART;N printf("\nElapsed time for %3d cycles %8.2f seconds",KCYCLE,DELTAT);J fprintf(FP,"\nElapsed time for %3d cycles %8.2f seconds",KCYCLE, DELTAT); 3 /* Sum Time in Milliseconds per Cycle */R/ AVTIME=AVTIME+(DELTAT*1000.0)/KCYCLE;, /* */ 4 /* Calculate Whetstone Rating Based on */4 /* Time for Number of Cycles Just */" /* Executed */( & BENCH.BCK [PILK.TMP2]WHETCA.C;1DA;1Phw RATE = (1000.0*KCYCLE)/DELTAT;4 /* Sum Whetstone Rating */! AVRATE = AVRATE + RATE;  IRATE = RATE; : printf("\nWhetstone rating: %5d KWIPS\n",IRATE);> fprintf(FP,"\nWhetstone rating: %5d KWIPS\n",IRATE); KCYCLE=KCYCLE+10;f }  /* */5 /* Compute Average Time in Milliseconds */ 5 /* Per Cycle and Write */05 /* */* AVTIME = AVTIME/NRUNS; C printf("\nAverage Time Per Cycle: %8.2f Milliseconds",AVTIME); G fprintf(FP,"\nAverage Time Per Cycle: %8.2f Milliseconds",AVTIME);7 ; /* */8 /* Calculate Average Whetstone Rating and Write */ /* */  AVRATE = AVRATE/NRUNS;  IRATE = AVRATE; ; printf("\nAverage Whetstone rating: %5d KWIPS",IRATE);M? fprintf(FP,"\nAverage Whetstone rating: %5d KWIPS",IRATE);m fclose(FP); O } U*[PILK.TMP2]WHETCB.C;1+, ./ 4T-0123KPWO56@W7@Lյג89GHJ/* Filename: WHETCB.C */main() {E /* C version of Whetstone Benchmark Program (with MATH lib) */E /* Reference: "Computer Journal", February 1976, pages 43-49, */E /* for description of benchmark and ALGOL60 version.*/E /* Note : Procedure POUT is omitted. */ COMPUT(); }3/* */3/* Uncomment following function to run Benchmark */3/* with MATH library stubbed off */3/* */=/*float MYSTUB(X) */ 3/*float X; */3/* { */3/* return(1.0); */5/* } */ PA(E) float E[4];  { int J; extern float T,T2; J=0;!ONE:E[0]=(E[0]+E[1]+E[2]-E[3])*T;! E[1]=(E[0]+E[1]-E[2]+E[3])*T;! E[2]=(E[0]-E[1]+E[2]+E[3])*T;# E[3]=(-E[0]+E[1]+E[2]+E[3])/T2; J=J+1; if (J<6) goto ONE; }P0() { extern float E1[4]; extern int J,K,L; E1[J]=E1[K]; E1[K]=E1[L]; E1[L]=E1[J]; } P3(X,Y,Z) float X,Y,Z; { extern float T,T2;  X=T*(X+Y); Y=T*(X+Y); Z=(X+Y)/T2; }#include timebWHET(I,KCYCLE,TSTART,TSTOP) double *TSTART,*TSTOP; int I,KCYCLE; { float X1,X2,X3,X4,X,Y,Z,T1;4 int N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11,LCOUNT; extern float T,T2,E1[4]; extern int J,K,L;O struct timeb *TIME_POINTER;/* timeb structure has the members */O /* time_t (gives time in seconds) */O /* unsigned short millitm ( in milliseconds) */O /* short time zone (0) */O /* short dstflag (0) */ /* */* /* Initialize Constants */ /* */ T=0.499975; T1=0.50025; T2=2.0; /* */* /* Compute Execution Frequencies */* /* for the Benchmark Modules */ N1=0; N2=12*I; N3=14*I; N4=345*I; N5=0; N6=210*I; N7=32*I; N8=899*I; N9=616*I; N10=0; N11=93*I; /* */* /* Get Whetstone Start Time from */* /* Operating System */* /* */ ftime(&TIME_POINTER);: *TSTART=TIME_POINTER.time+TIME_POINTER.millitm/1000.0;* for (LCOUNT=1;LCOUNT<=KCYCLE;LCOUNT++) {+ /* */+ /* Module 1: Simple Identifiers */+ /* */ X1=1.0; X2=-1.0; X3=-1.0; X4=-1.0; for (I=1;I<=N1;I++) {! X1=(X1+X2+X3-X4)*T;! X2=(X1+X2-X3+X4)*T;! X3=(X1-X2+X3+X4)*T;" X4=(-X1+X2+X3+X4)*T; }, /* */, /* Module 2: Array Elements */, /* Note : Arrary Subscripts*/, /* in C begin */, /* with 0. */ E1[0]=1.0; E1[1]=-1.0; E1[2]=-1.0; E1[3]=-1.0;  for (I=1;I<=N2;I++) {0 E1[0]=(E1[0]+E1[1]+E1[2]-E1[3])*T;0 E1[1]=(E1[0]+E1[1]-E1[2]+E1[3])*T;0 E1[2]=(E1[0]-E1[1]+E1[2]+E1[3])*T;1 E1[3]=(-E1[0]+E1[1]+E1[2]+E1[3])*T; } - /* */- /* Module 3: Array as Parameter */- /* */ for (I=1;I<=N3;I++) { PA(E1); }- /* */- /* Module 4: Conditional Jumps */- /* */ J=1;  for (I=1;I<=N4;I++) { if (J==1) J=2; else J=3; if (J>2) J=0; else J=1; if (J<1) J=1; else J=0; }. /* */. /* Module 5 Omitted */. /* */. /* */. /* Module 6: Integer Arithmetic */. /* */ J=1; K=2; L=3;  for (I=1;I<=N6;I++) { J=J*(K-J)*(L-K); K=L*K-(L-J)*K; L=(L-K)*(K+J); E1[L-1]=J+K+L; E1[K-1]=J*K*L; }4 /* */4 /* Module 7: Trigonometric Functions */4 /* */ X=0.5; Y=0.5;  for (I=1;I<=N7;I++) {4 /* */4 /* Comment Out Next 2 Lines to Run */4 /* Benchmark With Math Library */4 /* Stubbed Off */ B X=T*ATAN(T2*SIN(X)*COS(X)/(COS(X+Y)+COS<1e BENCH.BCK [PILK.TMP2]WHETCB.C;1DA;1TgX (X-Y)-1.0));B Y=T*ATAN(T2*SIN(Y)*COS(Y)/(COS(X+Y)+COS(X-Y)-1.0));4 /* Uncomment Next 2 Line to Run */4 /* Benchmark With Math Library */4 /* Stubbed Off */T /*X=T*MYSTUB(T2*MYSTUB(X)*MYSTUB(X)/(MYSTUB(X+Y)+MYSTUB(X-Y)-1.0));*/T /*Y=T*MYSTUB(T2*MYSTUB(Y)*MYSTUB(Y)/(MYSTUB(X+Y)+MYSTUB(X-Y)-1.0));*/ } 4 /* */4 /* Module 8: Procedure Calls */4 /* */ X=1.0; Y=1.0; Z=1.0;  for (I=1;I<=N8;I++) { P3(X,Y,Z); }5 /* */5 /* Module 9: Array References */5 /* */ J=0; K=1; L=2; E1[0]=1.0; E1[1]=2.0; E1[2]=3.0;  for (I=1;I<=N9;I++) { P0(); }6 /* */6 /* Module 10: Integer Arithmetic */6 /* */ J=2; K=3; for (I=1;I<=N10;I++) { J=J+K; K=J+K; J=K-J; K=K-J-J; } 7 /* */7 /* Module 11: Standard Functions */7 /* */ X=0.75; ! for (I=1;I<=N11;I++) {6 /* */6 /* Comment Out Next Line to Run */6 /* Benchmark With Math Library */6 /* Stubbed Off */( X=SQRT(EXP(LOG(X)/T1)); 6 /* Uncomment Next Line to Run */6 /* Benchmark With Math Library */6 /* Stubbed Off */ 6 /*X=MYSTUB(MYSTUB(MYSTUB(X)/T1)); */ } } - /* */2 /* Get Whetstone Stop Time from Operating */ /* */ ftime(&TIME_POINTER);9 *TSTOP=TIME_POINTER.time+TIME_POINTER.millitm/1000.0;* }i *#include stdio /* standard I/O library*/COMPUT() {f float AVTIME,AVRATE,RATE; double TSTART,TSTOP; float DELTAT;% int NRUNS,LCOUNT,IRATE,KCYCLE,I;0 int FILE_NAME;t FILE *FP;# FILE_NAME=creat("WHETCB.DAT");* FP=fdopen(FILE_NAME,"rw"); ; fprintf(FP,"C Whetstone Benchmark (with MATH lib)\n");o7 printf("C Whetstone Benchmark (with MATH lib)\n");s  AVTIME = 0.0; AVRATE = 0.0; KCYCLE =10; NRUNS = 5; I = 10;/ for ( LCOUNT=1; LCOUNT <= NRUNS; LCOUNT++)  {( WHET(I,KCYCLE,&TSTART,&TSTOP); H printf("\nWhetstone start time: %8.2f Seconds",TSTART); L fprintf(FP,"\nWhetstone start time: %8.2f Seconds",TSTART); F printf("\nWhetstone stop time: %8.2f Seconds",TSTOP); J fprintf(FP,"\nWhetstone stop time: %8.2f Seconds",TSTOP);  /* */4 /* Compute and Write the Elapsed Time */ /* */4 /* */" DELTAT = TSTOP - TSTART;N printf("\nElapsed time for %3d cycles %8.2f seconds",KCYCLE,DELTAT);J fprintf(FP,"\nElapsed time for %3d cycles %8.2f seconds",KCYCLE, DELTAT); 3 /* Sum Time in Milliseconds per Cycle */T/ AVTIME=AVTIME+(DELTAT*1000.0)/KCYCLE;; /* */34 /* Calculate Whetstone Rating Based on */4 /* Time for Number of Cycles Just */" /* Executed */( RATE = (1000.0*KCYCLE)/DELTAT;4 /* Sum Whetstone Rating */! AVRATE = AVRATE + RATE;  IRATE = RATE; : printf("\nWhetstone rating: %5d KWIPS\n",IRATE);> fprintf(FP,"\nWhetstone rating: %5d KWIPS\n",IRATE); KCYCLE=KCYCLE+10;  }  /* */5 /* Compute Average Time in Milliseconds */t5 /* Per Cycle and Write */=5 /* */  AVTIME = AVTIME/NRUNS;eC printf("\nAverage Time Per Cycle: %8.2f Milliseconds",AVTIME);/G fprintf(FP,"\nAverage Time Per Cycle: %8.2f Milliseconds",AVTIME);  /* */8 /* Calculate Average Whetstone Rating and Write */ /* */  AVRATE = AVRATE/NRUNS;o IRATE = AVRATE; ; printf("\nAverage Whetstone rating: %5d KWIPS",IRATE); ? fprintf(FP,"\nAverage Whetstone rating: %5d KWIPS",IRATE);t fclose(FP); m }  *[PILK.TMP2]WHET_LONG_FLOAT.ADA;1+, ./ 4Ub-0123KPWO56T|e7ྗյג89GHJ-- Filename: WHETADAE.DEC?-- Version 1.1 of benchmark programs (DS.2.14.85).-- Ada version of Whetstone Benchmark Program.>-- Reference: "Computer Journal ," February 1976, pages 43-49,?-- for description of benchmark and ALGOL60 version.#-- Note: Procedure POUT is omitted.with CALENDAR; use CALENDAR;with TEXT_IO; use TEXT_IO; with HELP_TOOLS; use HELP_TOOLS;&with IO_EXCEPTIONS; use IO_EXCEPTIONS;8--Comment out following if not use VAX Ada (version 1.0)1with LONG_FLOAT_MATH_LIB;use LONG_FLOAT_MATH_LIB;" E--Comment out following with use to run with math library stubbed off;--with CORE_FUNCTIONS,TRIG_LIB;use CORE_FUNCTIONS,TRIG_LIB;C--Uncomment the following line to run with math library stubbed off--with MATHSTUB; use MATHSTUB;procedure WHET_long_float is=--Comment out following pragma suppresses to run unsuppressed" --pragma SUPPRESS(ACCESS_CHECK);( --pragma SUPPRESS(DISCRIMINANT_CHECK);! --pragma SUPPRESS(INDEX_CHECK);" --pragma SUPPRESS(LENGTH_CHECK);! --pragma SUPPRESS(RANGE_CHECK);$ --pragma SUPPRESS(DIVISION_CHECK);$ --pragma SUPPRESS(OVERFLOW_CHECK);# --pragma SUPPRESS(STORAGE_CHECK);' --pragma SUPPRESS(ELABORATION_CHECK); --: package INT_IO is new INTEGER_IO(INTEGER); use INT_IO;? package REAL_IO is new FLOAT_IO(Long_float) ; use REAL_IO;3 procedure WHETSTONE (I, NO_OF_CYCLES: in INTEGER;? START_TIME, STOP_TIME: out Long_float) is --6 --CaQR BENCH.BCK  [PILK.TMP2]WHET_LONG_FLOAT.ADA;1U=lling procedure provides the loop count weight? --factor, I, and the encompassing loop count, NO_OF_CYCLES. --: type VECTOR is array (INTEGER range <>) of Long_float;* X1,X2,X3,X4,X,Y,Z,T,T1,T2: Long_float; E1: VECTOR(1..4);6 J,K,L,N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11: INTEGER; --& procedure PA (E: in out VECTOR) is7 --tests computations with an array as a parameter J: INTEGER;1 -- T, T2 : Long_float are global variables. begin J:=0; <>% E(1):= (E(1)+E(2)+E(3)-E(4))*T;% E(2):= (E(1)+E(2)-E(3)+E(4))*T;% E(3):= (E(1)-E(2)+E(3)+E(4))*T;' E(4):= (-E(1)+E(2)+E(3)+E(4))/T2; J:=J+1; if J < 6 then goto LAB; end if; end PA;pragma inline (pa);  -- procedure P0 is- --tests computations with no parameters% -- T1,T2: Long_float are global# -- E1: VECTOR(1..4) is global" -- J,K,L: INTEGER are global begin E1(J):= E1(K); E1(K):= E1(L); E1(L):= E1(J); end P0;pragma inline (p0);  --? procedure P3 (X,Y: in out Long_float; Z: out Long_float) is@ --tests computations with simple identifiers as parameters& -- T,T2: Long_float are global begin X:= T*(X+Y); Y:= T*(X+Y); Z:= (X+Y)/T2; end P3; pragma inline (p3);  -- begin --Set constants T:= 0.499975; T1:= 0.50025; T2:= 2.0;@ --Compute the execution frequency for the benchmark modules.% N1:= 0; --Module 1 not executed. N2:= 12*I; N3:= 14*I; N4:= 345*I;% N5:= 0; --Module 5 not executed. N6:= 210*I; N7:= 32*I; N8:= 899*I; N9:= 616*I;' N10:= 0; --Module 10 not executed. N11:= 93*I; --G START_TIME:= Long_float(SECONDS(CLOCK)); --Get Whetstone start time -- CYCLE_LOOP:( for CYCLE_NO in 1..NO_OF_CYCLES loop6 --Module 1: computations with simple identifiers X1:= 1.0; X2:= -1.0; X3:= -1.0; X4:= -1.0; for I in 1..N1 loop X1:= (X1+X2+X3-X4)*T; X2:= (X1+X2-X3+X4)*T; X3:= (X1-X2+X3+X4)*T; X4:= (-X1+X2+X3+X4)*T; end loop; --end Module 1 --2 --Module 2: computations with array elements E1(1):= 1.0; E1(2):= -1.0; E1(3):= -1.0; E1(4):= -1.0; for I in 1..N2 loop, E1(1):= (E1(1)+E1(2)+E1(3)-E1(4))*T;, E1(2):= (E1(1)+E1(2)-E1(3)+E1(4))*T;, E1(3):= (E1(1)-E1(2)+E1(3)+E1(4))*T;- E1(4):= (-E1(1)+E1(2)+E1(3)+E1(4))*T; end loop; --end Module 2 --2 --Module 3: passing an array as a parameter  for I in 1..N3 loop PA(E1); end loop; --end Module 3 --. --Module 4: performing conditional jumps J:=1; for I in 1..N4 loop if J=1 then J:=2; else J:=3; end if; if J>2 then J:=0; else J:=1; end if; if J<1 then J:=1; else J:=0; end if; end loop; --end Module 4 -- --Module 5: omitted --/ --Module 6: performing integer arithmetic J:=1; K:=2; L:=3; for I in 1..N6 loop J:= J*(K-J)*(L-K); K:= L*K-(L-J)*K; L:= (L-K)*(K+J);# E1(L-1):=Long_float(J+K+L);# E1(K-1):=Long_float(J*K*L); end loop; --end Module 6 --= --Module 7: performing computations using trigonometric -- functions X:= 0.5; Y:= 0.5; for I in 1..N7 loop= X:= T*ATAN(T2*SIN(X)*COS(X)/(COS(X+Y)+COS(X-Y)-1.0));= Y:= T*ATAN(T2*SIN(Y)*COS(Y)/(COS(X+Y)+COS(X-Y)-1.0)); end loop; --end Module 7 --> --Module 8: procedure calls with simple indentifiers as  -- parameters X:=1.0; Y:=1.0; Z:=1.0; for I in 1..N8 loop P3(X,Y,Z); end loop; --end Module 8 --> --Module 9: array references and procedure calls with no -- parameters J:=1; K:=2; L:=3; E1(1):=1.0; E1(2):=2.0; E1(3):=3.0; for I in 1..N9 loop P0; end loop; --end Module 9 --% --Module 10: integer arithmetic J:=2; K:=3; for I in 1..N10 loop J:=J+K; K:=J+K; J:=K-J; K:=K-J-J; end loop; --end Module 109 --Module 11: performing computations using standard* -- mathematical functions X:=0.75; for I in 1..N11 loop X:=SQRT(EXP(LOG(X)/T1)); end loop; --end Module 11 end loop CYCLE_LOOP; --E STOP_TIME:= Long_float(SECONDS(CLOCK)); --Get Whetstone stop time -- end WHETSTONE;  -- --% procedure COMPUTE_WHETSTONE_KIPS is --@ -- Variables used to control execution of benchmark and to % -- compute the Whetstone rating: --F NO_OF_RUNS: INTEGER; --Number of times the benchmark is executedE NO_OF_CYCLES: INTEGER; --Number of times the group of benchmark2 --modules is executedG I: INTEGER; --Factor weighting number of times each module loops.C --A value of ten gives a total weight for modulesH --of approximately one million Whetstone instructions.M START_TIME: Long_float; --Time at which execution of benchmark modules# -- beginsM STOP_TIME: Long_float; --Time at which execution of benchmark modules 8 -- ends (time for NO_OF_CYCLES)H ELAPSED_TIME: Long_float; --Time between START_TIME and STOP_TIME3 MEAN_TIME: Long_float; --Average time per cycleG RATING: Long_float; --Thousands of Whetstone instructions per sec.7 MEAN_RATING: Long_float; --Average Whetstone rating1 INT_RATING: INTEGER; --Integer value of KWIPS+ DATA_FILE: FILE_TYPE; --File identifier0 FILENAME: STRING (1..13) := "Wnnddhhmm.DAT"; -- begin TIME_FILENAME (FILENAME);. CREATE(DATA_FILE, OUT_FILE, FILENAME, ""); READ_ENVIRON (DATA_FILE);U PUT_LINE(DATA_FILE," ADA Whetstone benchmark(WHETADAE.DEC)");NEW_LINE(DATA_FILE);J NEW_LINE; PUT_LINE(" ADA Whetstone benchmark(WHETADAE.DEC)");NEW_LINE; -- MEAN_TIME:=0.0; MEAN_RATING:=0.0; NO_OF_CYCLES:=10; NO_OF_RUNS:=5; I:=10; -- RUN_LOOP:$ for RUN_NO in 1..NO_OF_RUNS loop --/ -- Call the Whetstone benchmark procedure --9 WHETSTONE (I, NO_OF_CYCLES, START_TIME, STOP_TIME); --' -- Write the Whetstone start time --I NEW_LINE; PUT(" Whetstone start time: "); PUT(START_TIME, 5, 2, 0); PUT_LINE(" seconds");D NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone start time: ");I PUT(DATA_FILE, START_TIME, 5, 2, 0);PUT_LINE(DATA_FILE," seconds"); --& -- Write the Whetstone stop time --G NEW_LINE; PUT(" Whetstone stop time: "); PUT(STOP_TIME, 5, 2, 0); PUT_LINE(" seconds");C NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone stop time: ");I PUT(DATA_FILE, STOP_TIME, 5, 2, 0); PUT_LINE(DATA_FILE," seconds"); --+ -- Compute and write the elapsed time --, ELAPSED_TIME:= STOP_TIME - START_TIME;@ NEW_LINE; PUT(" Elapsed W BENCH.BCK  [PILK.TMP2]WHET_LONG_FLOAT.ADA;1Ub time for "); PUT(NO_OF_CYCLES, 3);F PUT(" cycles: "); PUT(ELAPSED_TIME,5,2,0); PUT_LINE(" seconds");? NEW_LINE(DATA_FILE); PUT(DATA_FILE," Elapsed time for ");rB PUT(DATA_FILE, NO_OF_CYCLES, 3); PUT(DATA_FILE," cycles: ");H PUT(DATA_FILE,ELAPSED_TIME,5,2,0); PUT_LINE(DATA_FILE," seconds"); --+ -- Sum time in milliseconds per cycle;M MEAN_TIME:= MEAN_TIME + (ELAPSED_TIME*1000.0)/Long_float(NO_OF_CYCLES);- --H -- Calculate the Whetstone rating based on the time for the number+ -- of cycles just executed and write  --> RATING:= (1000.0*Long_float(NO_OF_CYCLES))/ELAPSED_TIME; -- -- Sum Whetstone ratingB) MEAN_RATING:= MEAN_RATING + RATING; # INT_RATING:= INTEGER(RATING);i: NEW_LINE;PUT(" Whetstone rating: ");PUT(INT_RATING);" PUT_LINE(" KWIPS");NEW_LINE;@ NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone rating: ");? PUT(DATA_FILE, INT_RATING); PUT_LINE(DATA_FILE," KWIPS");  NEW_LINE(DATA_FILE); --> -- Reset NO_OF_CYCLES for next run using ten cycles more --' NO_OF_CYCLES:= NO_OF_CYCLES + 10;a end loop RUN_LOOP; --? -- Compute average time in milliseconds per cycle and write_ --1 MEAN_TIME:= MEAN_TIME/Long_float(NO_OF_RUNS);)H NEW_LINE; PUT(" Average time per cycle: "); PUT(MEAN_TIME, 5, 2, 0); PUT_LINE(" milliseconds"); NEW_LINE(DATA_FILE);/ PUT(DATA_FILE," Average time per cycle: ");oH PUT(DATA_FILE,MEAN_TIME,5,2,0); PUT_LINE(DATA_FILE," milliseconds"); --3 -- Calculate average Whetstone rating and writeO -- S5 MEAN_RATING:= MEAN_RATING/Long_float(NO_OF_RUNS); & INT_RATING:= INTEGER(MEAN_RATING);B NEW_LINE; PUT(" Average Whetstone rating: "); PUT(INT_RATING); PUT_LINE(" KWIPS");EF NEW_LINE(DATA_FILE); PUT(DATA_FILE," Average Whetstone rating: ");= PUT(DATA_FILE, INT_RATING); PUT_LINE(DATA_FILE," KWIPS");  CLOSE(DATA_FILE);  end COMPUTE_WHETSTONE_KIPS;i --begin0 COMPUTE_WHETSTONE_KIPS;(end WHET_long_float ;44--Comment out next line if not VAX Ada version (1.0) pragma SUPPRESS_ALL;J--### 32644 is the file CHECK-SUM number computed on 2/20/1985 at 14:34N--### CHECK-SUM := sum (ASCII values of all characters in this file) mod 2**16)--### -- (excluding these three lines) --t %*[PILK.TMP2]WHET_LONG_LONG_FLOAT.ADA;1+, ./ 4U-0123KPWO56 oo}e7յג89GHJ-- Filename: WHETADAE.DEC?-- Version 1.1 of benchmark programs (DS.2.14.85).-- Ada version of Whetstone Benchmark Program.>-- Reference: "Computer Journal ," February 1976, pages 43-49,?-- for description of benchmark and ALGOL60 version.#-- Note: Procedure POUT is omitted.with CALENDAR; use CALENDAR;with TEXT_IO; use TEXT_IO; with HELP_TOOLS; use HELP_TOOLS;&with IO_EXCEPTIONS; use IO_EXCEPTIONS;8--Comment out following if not use VAX Ada (version 1.0);with LONG_LONG_FLOAT_MATH_LIB;use LONG_LONG_FLOAT_MATH_LIB;" E--Comment out following with use to run with math library stubbed off;--with CORE_FUNCTIONS,TRIG_LIB;use CORE_FUNCTIONS,TRIG_LIB;C--Uncomment the following line to run with math library stubbed off--with MATHSTUB; use MATHSTUB;!procedure WHET_long_long_float is=--Comment out following pragma suppresses to run unsuppressed" --pragma SUPPRESS(ACCESS_CHECK);( --pragma SUPPRESS(DISCRIMINANT_CHECK);! --pragma SUPPRESS(INDEX_CHECK);" --pragma SUPPRESS(LENGTH_CHECK);! --pragma SUPPRESS(RANGE_CHECK);$ --pragma SUPPRESS(DIVISION_CHECK);$ --pragma SUPPRESS(OVERFLOW_CHECK);# --pragma SUPPRESS(STORAGE_CHECK);' --pragma SUPPRESS(ELABORATION_CHECK); --: package INT_IO is new INTEGER_IO(INTEGER); use INT_IO;D package REAL_IO is new FLOAT_IO(Long_long_float) ; use REAL_IO;3 procedure WHETSTONE (I, NO_OF_CYCLES: in INTEGER;D START_TIME, STOP_TIME: out Long_long_float) is --6 --Calling procedure provides the loop count weight? --factor, I, and the encompassing loop count, NO_OF_CYCLES. --? type VECTOR is array (INTEGER range <>) of Long_long_float;/ X1,X2,X3,X4,X,Y,Z,T,T1,T2: Long_long_float; E1: VECTOR(1..4);6 J,K,L,N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11: INTEGER; --& procedure PA (E: in out VECTOR) is7 --tests computations with an array as a parameter J: INTEGER;6 -- T, T2 : Long_long_float are global variables. begin J:=0; <>% E(1):= (E(1)+E(2)+E(3)-E(4))*T;% E(2):= (E(1)+E(2)-E(3)+E(4))*T;% E(3):= (E(1)-E(2)+E(3)+E(4))*T;' E(4):= (-E(1)+E(2)+E(3)+E(4))/T2; J:=J+1; if J < 6 then goto LAB; end if; end PA;pragma inline (pa);  -- procedure P0 is- --tests computations with no parameters* -- T1,T2: Long_long_float are global# -- E1: VECTOR(1..4) is global" -- J,K,L: INTEGER are global begin E1(J):= E1(K); E1(K):= E1(L); E1(L):= E1(J); end P0;pragma inline (p0);  --I procedure P3 (X,Y: in out Long_long_float; Z: out Long_long_float) is@ --tests computations with simple identifiers as parameters+ -- T,T2: Long_long_float are global begin X:= T*(X+Y); Y:= T*(X+Y); Z:= (X+Y)/T2; end P3; pragma inline (p3);  -- begin --Set constants T:= 0.499975; T1:= 0.50025; T2:= 2.0;@ --Compute the execution frequency for the benchmark modules.% N1:= 0; --Module 1 not executed. N2:= 12*I; N3:= 14*I; N4:= 345*I;% N5:= 0; --Module 5 not executed. N6:= 210*I; N7:= 32*I; N8:= 899*I; N9:= 616*I;' N10:= 0; --Module 10 not executed. N11:= 93*I; --L START_TIME:= Long_long_float(SECONDS(CLOCK)); --Get Whetstone start time -- CYCLE_LOOP:( for CYCLE_NO in 1..NO_OF_CYCLES loop6 --Module 1: computations with simple identifiers X1:= 1.0; X2:= -1.0; X3:= -1.0; X4:= -1.0; for I in 1..N1 loop X1:= (X1+X2+X3-X4)*T; X2:= (X1+X2-X3+X4)*T; X3:= (X1-X2+X3+X4)*T; X4:= (-X1+X2+X3+X4)*T; end loop; --end Module 1 --2 --Module 2: computations with array elements E1(1):= 1.0; E1(2):= -1.0; E1(3):= -1.0; E1(4):= -1.0; for I in 1..N2 loop, E1(1):= (E1(1)+E1(2)+E1(3)-E1(4))*T;, E1(2):= (E1(1)+E1(2)-E1(3)+E1(4))*T;, E1(3):= (E1(1)-E1(2)+E1(3)+E1(4))*T;- E1(4):= (-E1(1)+E1(2)+E1(3)+E1(4))*T; end loop; --end Module 2 --2 --Module 3: passing an array as a parameter  for I in 1..N3 loop PA(E1); end loop; --end Module 3 --. --Module 4: performing conditional jumps J:=1; for I in 1..N4 loop if J=1 then J:=2; else  BENCH.BCK %[PILK.TMP2]WHET_LONG_LONG_FLOAT.ADA;1U J:=3; end if; if J>2 then J:=0; else J:=1; end if; if J<1 then J:=1; else J:=0; end if; end loop; --end Module 4 -- --Module 5: omitted --/ --Module 6: performing integer arithmetic J:=1; K:=2; L:=3; for I in 1..N6 loop J:= J*(K-J)*(L-K); K:= L*K-(L-J)*K; L:= (L-K)*(K+J);( E1(L-1):=Long_long_float(J+K+L);( E1(K-1):=Long_long_float(J*K*L); end loop; --end Module 6 --= --Module 7: performing computations using trigonometric -- functions X:= 0.5; Y:= 0.5; for I in 1..N7 loop= X:= T*ATAN(T2*SIN(X)*COS(X)/(COS(X+Y)+COS(X-Y)-1.0));= Y:= T*ATAN(T2*SIN(Y)*COS(Y)/(COS(X+Y)+COS(X-Y)-1.0)); end loop; --end Module 7 --> --Module 8: procedure calls with simple indentifiers as  -- parameters X:=1.0; Y:=1.0; Z:=1.0; for I in 1..N8 loop P3(X,Y,Z); end loop; --end Module 8 --> --Module 9: array references and procedure calls with no -- parameters J:=1; K:=2; L:=3; E1(1):=1.0; E1(2):=2.0; E1(3):=3.0; for I in 1..N9 loop P0; end loop; --end Module 9 --% --Module 10: integer arithmetic J:=2; K:=3; for I in 1..N10 loop J:=J+K; K:=J+K; J:=K-J; K:=K-J-J; end loop; --end Module 109 --Module 11: performing computations using standard* -- mathematical functions X:=0.75; for I in 1..N11 loop X:=SQRT(EXP(LOG(X)/T1)); end loop; --end Module 11 end loop CYCLE_LOOP; --J STOP_TIME:= Long_long_float(SECONDS(CLOCK)); --Get Whetstone stop time -- end WHETSTONE;  -- --% procedure COMPUTE_WHETSTONE_KIPS is --@ -- Variables used to control execution of benchmark and to % -- compute the Whetstone rating: --F NO_OF_RUNS: INTEGER; --Number of times the benchmark is executedE NO_OF_CYCLES: INTEGER; --Number of times the group of benchmark2 --modules is executedG I: INTEGER; --Factor weighting number of times each module loops.C --A value of ten gives a total weight for modulesH --of approximately one million Whetstone instructions.R START_TIME: Long_long_float; --Time at which execution of benchmark modules# -- beginsR STOP_TIME: Long_long_float; --Time at which execution of benchmark modules 8 -- ends (time for NO_OF_CYCLES)M ELAPSED_TIME: Long_long_float; --Time between START_TIME and STOP_TIME8 MEAN_TIME: Long_long_float; --Average time per cycleL RATING: Long_long_float; --Thousands of Whetstone instructions per sec.< MEAN_RATING: Long_long_float; --Average Whetstone rating1 INT_RATING: INTEGER; --Integer value of KWIPS+ DATA_FILE: FILE_TYPE; --File identifier0 FILENAME: STRING (1..13) := "Wnnddhhmm.DAT"; -- begin TIME_FILENAME (FILENAME);. CREATE(DATA_FILE, OUT_FILE, FILENAME, ""); READ_ENVIRON (DATA_FILE);U PUT_LINE(DATA_FILE," ADA Whetstone benchmark(WHETADAE.DEC)");NEW_LINE(DATA_FILE);J NEW_LINE; PUT_LINE(" ADA Whetstone benchmark(WHETADAE.DEC)");NEW_LINE; -- MEAN_TIME:=0.0; MEAN_RATING:=0.0; NO_OF_CYCLES:=10; NO_OF_RUNS:=5; I:=10; -- RUN_LOOP:$ for RUN_NO in 1..NO_OF_RUNS loop --/ -- Call the Whetstone benchmark procedure --9 WHETSTONE (I, NO_OF_CYCLES, START_TIME, STOP_TIME); --' -- Write the Whetstone start time --I NEW_LINE; PUT(" Whetstone start time: "); PUT(START_TIME, 5, 2, 0); PUT_LINE(" seconds");D NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone start time: ");I PUT(DATA_FILE, START_TIME, 5, 2, 0);PUT_LINE(DATA_FILE," seconds"); --& -- Write the Whetstone stop time --G NEW_LINE; PUT(" Whetstone stop time: "); PUT(STOP_TIME, 5, 2, 0); PUT_LINE(" seconds");C NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone stop time: ");I PUT(DATA_FILE, STOP_TIME, 5, 2, 0); PUT_LINE(DATA_FILE," seconds"); --+ -- Compute and write the elapsed timee --, ELAPSED_TIME:= STOP_TIME - START_TIME;@ NEW_LINE; PUT(" Elapsed time for "); PUT(NO_OF_CYCLES, 3);F PUT(" cycles: "); PUT(ELAPSED_TIME,5,2,0); PUT_LINE(" seconds");? NEW_LINE(DATA_FILE); PUT(DATA_FILE," Elapsed time for ");B PUT(DATA_FILE, NO_OF_CYCLES, 3); PUT(DATA_FILE," cycles: ");H PUT(DATA_FILE,ELAPSED_TIME,5,2,0); PUT_LINE(DATA_FILE," seconds"); --+ -- Sum time in milliseconds per cycle R MEAN_TIME:= MEAN_TIME + (ELAPSED_TIME*1000.0)/Long_long_float(NO_OF_CYCLES); --H -- Calculate the Whetstone rating based on the time for the number+ -- of cycles just executed and writeR --C RATING:= (1000.0*Long_long_float(NO_OF_CYCLES))/ELAPSED_TIME;i -- -- Sum Whetstone rating) MEAN_RATING:= MEAN_RATING + RATING; # INT_RATING:= INTEGER(RATING);u: NEW_LINE;PUT(" Whetstone rating: ");PUT(INT_RATING);" PUT_LINE(" KWIPS");NEW_LINE;@ NEW_LINE(DATA_FILE); PUT(DATA_FILE," Whetstone rating: ");? PUT(DATA_FILE, INT_RATING); PUT_LINE(DATA_FILE," KWIPS");_ NEW_LINE(DATA_FILE); --> -- Reset NO_OF_CYCLES for next run using ten cycles more --' NO_OF_CYCLES:= NO_OF_CYCLES + 10;O end loop RUN_LOOP; --? -- Compute average time in milliseconds per cycle and writes --6 MEAN_TIME:= MEAN_TIME/Long_long_float(NO_OF_RUNS);H NEW_LINE; PUT(" Average time per cycle: "); PUT(MEAN_TIME, 5, 2, 0); PUT_LINE(" milliseconds"); NEW_LINE(DATA_FILE);/ PUT(DATA_FILE," Average time per cycle: ");aH PUT(DATA_FILE,MEAN_TIME,5,2,0); PUT_LINE(DATA_FILE," milliseconds"); --3 -- Calculate average Whetstone rating and write  -- X: MEAN_RATING:= MEAN_RATING/Long_long_float(NO_OF_RUNS);& INT_RATING:= INTEGER(MEAN_RATING);B NEW_LINE; PUT(" Average Whetstone rating: "); PUT(INT_RATING); PUT_LINE(" KWIPS");tF NEW_LINE(DATA_FILE); PUT(DATA_FILE," Average Whetstone rating: ");= PUT(DATA_FILE, INT_RATING); PUT_LINE(DATA_FILE," KWIPS");  CLOSE(DATA_FILE);( end COMPUTE_WHETSTONE_KIPS;  --beginE COMPUTE_WHETSTONE_KIPS;(end WHET_long_long_float ;4--Comment out next line if not VAX Ada version (1.0) pragma SUPPRESS_ALL;J--### 32644 is the file CHECK-SUM number computed on 2/20/1985 at 14:34N--### CHECK-SUM := sum (ASCII values of all characters in this file) mod 2**16)--### -- (excluding these three lines) --  $ T0a |nIJ4MnFLOAT.ADA;1Ќ}_7Y&ks\E/ln':p2~Fv5G$6 ir-XE+euqhtQV;N%HXhvm \v9]$OW=/uo! I_IOUO&%=m@Aovg*g0rNRwY|Q5j(?1,8t.31- ~` u,I`~-9LxziZ^&-/ax9WIRoA$h""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