Removed trailing whitespaces in dhrystone code

This commit is contained in:
Clifford Wolf 2015-07-02 10:50:54 +02:00
parent c48a3b2434
commit b6e8c15901
4 changed files with 61 additions and 61 deletions

View File

@ -3,9 +3,9 @@
* *
* "DHRYSTONE" Benchmark Program * "DHRYSTONE" Benchmark Program
* ----------------------------- * -----------------------------
* *
* Version: C, Version 2.1 * Version: C, Version 2.1
* *
* File: dhry.h (part 1 of 3) * File: dhry.h (part 1 of 3)
* *
* Date: May 25, 1988 * Date: May 25, 1988
@ -33,12 +33,12 @@
* *
* Collection of Results: * Collection of Results:
* Reinhold Weicker (address see above) and * Reinhold Weicker (address see above) and
* *
* Rick Richardson * Rick Richardson
* PC Research. Inc. * PC Research. Inc.
* 94 Apple Orchard Drive * 94 Apple Orchard Drive
* Tinton Falls, NJ 07724 * Tinton Falls, NJ 07724
* Phone: (201) 389-8963 (9-17 EST) * Phone: (201) 389-8963 (9-17 EST)
* Usenet: ...!uunet!pcrat!rick * Usenet: ...!uunet!pcrat!rick
* *
* Please send results to Rick Richardson and/or Reinhold Weicker. * Please send results to Rick Richardson and/or Reinhold Weicker.
@ -91,7 +91,7 @@
* version previously distributed by Reinhold Weicker. * version previously distributed by Reinhold Weicker.
* *
* At several places in the benchmark, code has been added, * At several places in the benchmark, code has been added,
* but within the measurement loop only in branches that * but within the measurement loop only in branches that
* are not executed. The intention is that optimizing compilers * are not executed. The intention is that optimizing compilers
* should be prevented from moving code out of the measurement * should be prevented from moving code out of the measurement
* loop, or from removing code altogether. Since the statements * loop, or from removing code altogether. Since the statements
@ -101,7 +101,7 @@
* still hold. Except for sophisticated optimizing compilers, * still hold. Except for sophisticated optimizing compilers,
* execution times for this version should be the same as * execution times for this version should be the same as
* for previous versions. * for previous versions.
* *
* Since it has proven difficult to subtract the time for the * Since it has proven difficult to subtract the time for the
* measurement loop overhead in a correct way, the loop check * measurement loop overhead in a correct way, the loop check
* has been made a part of the benchmark. This does have * has been made a part of the benchmark. This does have
@ -151,7 +151,7 @@
* -DTIME * -DTIME
* The "times" function of UNIX (returning process times) * The "times" function of UNIX (returning process times)
* or the "time" function (returning wallclock time) * or the "time" function (returning wallclock time)
* is used for measurement. * is used for measurement.
* For single user machines, "time ()" is adequate. For * For single user machines, "time ()" is adequate. For
* multi-user machines where you cannot get single-user * multi-user machines where you cannot get single-user
* access, use the "times ()" function. If you have * access, use the "times ()" function. If you have
@ -198,23 +198,23 @@
* different from the Ada version.] * different from the Ada version.]
* *
* The following program contains statements of a high level programming * The following program contains statements of a high level programming
* language (here: C) in a distribution considered representative: * language (here: C) in a distribution considered representative:
* *
* assignments 52 (51.0 %) * assignments 52 (51.0 %)
* control statements 33 (32.4 %) * control statements 33 (32.4 %)
* procedure, function calls 17 (16.7 %) * procedure, function calls 17 (16.7 %)
* *
* 103 statements are dynamically executed. The program is balanced with * 103 statements are dynamically executed. The program is balanced with
* respect to the three aspects: * respect to the three aspects:
* *
* - statement type * - statement type
* - operand type * - operand type
* - operand locality * - operand locality
* operand global, local, parameter, or constant. * operand global, local, parameter, or constant.
* *
* The combination of these three aspects is balanced only approximately. * The combination of these three aspects is balanced only approximately.
* *
* 1. Statement Type: * 1. Statement Type:
* ----------------- number * ----------------- number
* *
* V1 = V2 9 * V1 = V2 9
@ -258,9 +258,9 @@
* library procedure 1 * library procedure 1
* X = F (...) * X = F (...)
* function call 6 * function call 6
* user function 5 * user function 5
* library function 1 * library function 1
* -- * --
* 17 17 * 17 17
* --- * ---
* 103 * 103
@ -274,10 +274,10 @@
* number approximate * number approximate
* percentage * percentage
* *
* Arithmetic 32 50.8 * Arithmetic 32 50.8
* *
* + 21 33.3 * + 21 33.3
* - 7 11.1 * - 7 11.1
* * 3 4.8 * * 3 4.8
* / (int div) 1 1.6 * / (int div) 1 1.6
* *
@ -295,7 +295,7 @@
* && (AND-THEN) 1 1.6 * && (AND-THEN) 1 1.6
* | (OR) 1 1.6 * | (OR) 1 1.6
* ! (NOT) 2 3.2 * ! (NOT) 2 3.2
* *
* -- ----- * -- -----
* 63 100.1 * 63 100.1
* *
@ -315,10 +315,10 @@
* 242 100.0 % * 242 100.0 %
* *
* When there is an access path leading to the final operand (e.g. a record * When there is an access path leading to the final operand (e.g. a record
* component), only the final data type on the access path is counted. * component), only the final data type on the access path is counted.
* *
* *
* 4. Operand Locality: * 4. Operand Locality:
* ------------------- * -------------------
* number approximate * number approximate
* percentage * percentage
@ -386,7 +386,7 @@
#include <stdio.h> #include <stdio.h>
/* for strcpy, strcmp */ /* for strcpy, strcmp */
#define Null 0 #define Null 0
/* Value of a Null pointer */ /* Value of a Null pointer */
#define true 1 #define true 1
#define false 0 #define false 0
@ -399,7 +399,7 @@ typedef char Str_30 [31];
typedef int Arr_1_Dim [50]; typedef int Arr_1_Dim [50];
typedef int Arr_2_Dim [50] [50]; typedef int Arr_2_Dim [50] [50];
typedef struct record typedef struct record
{ {
struct record *Ptr_Comp; struct record *Ptr_Comp;
Enumeration Discr; Enumeration Discr;

View File

@ -3,9 +3,9 @@
* *
* "DHRYSTONE" Benchmark Program * "DHRYSTONE" Benchmark Program
* ----------------------------- * -----------------------------
* *
* Version: C, Version 2.1 * Version: C, Version 2.1
* *
* File: dhry_1.c (part 2 of 3) * File: dhry_1.c (part 2 of 3)
* *
* Date: May 25, 1988 * Date: May 25, 1988
@ -99,7 +99,7 @@ main ()
Ptr_Glob->Discr = Ident_1; Ptr_Glob->Discr = Ident_1;
Ptr_Glob->variant.var_1.Enum_Comp = Ident_3; Ptr_Glob->variant.var_1.Enum_Comp = Ident_3;
Ptr_Glob->variant.var_1.Int_Comp = 40; Ptr_Glob->variant.var_1.Int_Comp = 40;
strcpy (Ptr_Glob->variant.var_1.Str_Comp, strcpy (Ptr_Glob->variant.var_1.Str_Comp,
"DHRYSTONE PROGRAM, SOME STRING"); "DHRYSTONE PROGRAM, SOME STRING");
strcpy (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING"); strcpy (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
@ -135,7 +135,7 @@ main ()
/***************/ /***************/
/* Start timer */ /* Start timer */
/***************/ /***************/
#ifdef TIMES #ifdef TIMES
times (&time_info); times (&time_info);
Begin_Time = (long) time_info.tms_utime; Begin_Time = (long) time_info.tms_utime;
@ -196,7 +196,7 @@ main ()
/**************/ /**************/
/* Stop timer */ /* Stop timer */
/**************/ /**************/
#ifdef TIMES #ifdef TIMES
times (&time_info); times (&time_info);
End_Time = (long) time_info.tms_utime; End_Time = (long) time_info.tms_utime;
@ -293,11 +293,11 @@ main ()
else else
{ {
#ifdef TIME #ifdef TIME
Microseconds = (float) User_Time * Mic_secs_Per_Second Microseconds = (float) User_Time * Mic_secs_Per_Second
/ (float) Number_Of_Runs; / (float) Number_Of_Runs;
Dhrystones_Per_Second = (float) Number_Of_Runs / (float) User_Time; Dhrystones_Per_Second = (float) Number_Of_Runs / (float) User_Time;
#else #else
Microseconds = (float) User_Time * Mic_secs_Per_Second Microseconds = (float) User_Time * Mic_secs_Per_Second
/ ((float) HZ * ((float) Number_Of_Runs)); / ((float) HZ * ((float) Number_Of_Runs));
Dhrystones_Per_Second = ((float) HZ * (float) Number_Of_Runs) Dhrystones_Per_Second = ((float) HZ * (float) Number_Of_Runs)
/ (float) User_Time; / (float) User_Time;
@ -309,7 +309,7 @@ main ()
printf ("\n"); printf ("\n");
} }
#endif #endif
} }
@ -319,27 +319,27 @@ Proc_1 (Ptr_Val_Par)
REG Rec_Pointer Ptr_Val_Par; REG Rec_Pointer Ptr_Val_Par;
/* executed once */ /* executed once */
{ {
REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp; REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp;
/* == Ptr_Glob_Next */ /* == Ptr_Glob_Next */
/* Local variable, initialized with Ptr_Val_Par->Ptr_Comp, */ /* Local variable, initialized with Ptr_Val_Par->Ptr_Comp, */
/* corresponds to "rename" in Ada, "with" in Pascal */ /* corresponds to "rename" in Ada, "with" in Pascal */
structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob); structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
Ptr_Val_Par->variant.var_1.Int_Comp = 5; Ptr_Val_Par->variant.var_1.Int_Comp = 5;
Next_Record->variant.var_1.Int_Comp Next_Record->variant.var_1.Int_Comp
= Ptr_Val_Par->variant.var_1.Int_Comp; = Ptr_Val_Par->variant.var_1.Int_Comp;
Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp; Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp;
Proc_3 (&Next_Record->Ptr_Comp); Proc_3 (&Next_Record->Ptr_Comp);
/* Ptr_Val_Par->Ptr_Comp->Ptr_Comp /* Ptr_Val_Par->Ptr_Comp->Ptr_Comp
== Ptr_Glob->Ptr_Comp */ == Ptr_Glob->Ptr_Comp */
if (Next_Record->Discr == Ident_1) if (Next_Record->Discr == Ident_1)
/* then, executed */ /* then, executed */
{ {
Next_Record->variant.var_1.Int_Comp = 6; Next_Record->variant.var_1.Int_Comp = 6;
Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp, Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp,
&Next_Record->variant.var_1.Enum_Comp); &Next_Record->variant.var_1.Enum_Comp);
Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp; Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp;
Proc_7 (Next_Record->variant.var_1.Int_Comp, 10, Proc_7 (Next_Record->variant.var_1.Int_Comp, 10,
&Next_Record->variant.var_1.Int_Comp); &Next_Record->variant.var_1.Int_Comp);
} }
else /* not executed */ else /* not executed */
@ -354,7 +354,7 @@ Proc_2 (Int_Par_Ref)
One_Fifty *Int_Par_Ref; One_Fifty *Int_Par_Ref;
{ {
One_Fifty Int_Loc; One_Fifty Int_Loc;
Enumeration Enum_Loc; Enumeration Enum_Loc;
Int_Loc = *Int_Par_Ref + 10; Int_Loc = *Int_Par_Ref + 10;

View File

@ -3,9 +3,9 @@
* *
* "DHRYSTONE" Benchmark Program * "DHRYSTONE" Benchmark Program
* ----------------------------- * -----------------------------
* *
* Version: C, Version 2.1 * Version: C, Version 2.1
* *
* File: dhry_1.c (part 2 of 3) * File: dhry_1.c (part 2 of 3)
* *
* Date: May 25, 1988 * Date: May 25, 1988
@ -91,7 +91,7 @@ main ()
Ptr_Glob->Discr = Ident_1; Ptr_Glob->Discr = Ident_1;
Ptr_Glob->variant.var_1.Enum_Comp = Ident_3; Ptr_Glob->variant.var_1.Enum_Comp = Ident_3;
Ptr_Glob->variant.var_1.Int_Comp = 40; Ptr_Glob->variant.var_1.Int_Comp = 40;
strcpy (Ptr_Glob->variant.var_1.Str_Comp, strcpy (Ptr_Glob->variant.var_1.Str_Comp,
"DHRYSTONE PROGRAM, SOME STRING"); "DHRYSTONE PROGRAM, SOME STRING");
strcpy (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING"); strcpy (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
@ -127,7 +127,7 @@ main ()
/***************/ /***************/
/* Start timer */ /* Start timer */
/***************/ /***************/
#ifdef TIMES #ifdef TIMES
times (&time_info); times (&time_info);
Begin_Time = (long) time_info.tms_utime; Begin_Time = (long) time_info.tms_utime;
@ -185,7 +185,7 @@ main ()
/**************/ /**************/
/* Stop timer */ /* Stop timer */
/**************/ /**************/
#ifdef TIMES #ifdef TIMES
times (&time_info); times (&time_info);
End_Time = (long) time_info.tms_utime; End_Time = (long) time_info.tms_utime;
@ -258,11 +258,11 @@ main ()
else else
{ {
#ifdef TIME #ifdef TIME
Microseconds = (float) User_Time * Mic_secs_Per_Second Microseconds = (float) User_Time * Mic_secs_Per_Second
/ (float) Number_Of_Runs; / (float) Number_Of_Runs;
Dhrystones_Per_Second = (float) Number_Of_Runs / (float) User_Time; Dhrystones_Per_Second = (float) Number_Of_Runs / (float) User_Time;
#else #else
Microseconds = (float) User_Time * Mic_secs_Per_Second Microseconds = (float) User_Time * Mic_secs_Per_Second
/ ((float) HZ * ((float) Number_Of_Runs)); / ((float) HZ * ((float) Number_Of_Runs));
Dhrystones_Per_Second = ((float) HZ * (float) Number_Of_Runs) Dhrystones_Per_Second = ((float) HZ * (float) Number_Of_Runs)
/ (float) User_Time; / (float) User_Time;
@ -273,7 +273,7 @@ main ()
printf ("%6.1f \n", Dhrystones_Per_Second); printf ("%6.1f \n", Dhrystones_Per_Second);
printf ("\n"); printf ("\n");
} }
} }
@ -283,27 +283,27 @@ Proc_1 (Ptr_Val_Par)
REG Rec_Pointer Ptr_Val_Par; REG Rec_Pointer Ptr_Val_Par;
/* executed once */ /* executed once */
{ {
REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp; REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp;
/* == Ptr_Glob_Next */ /* == Ptr_Glob_Next */
/* Local variable, initialized with Ptr_Val_Par->Ptr_Comp, */ /* Local variable, initialized with Ptr_Val_Par->Ptr_Comp, */
/* corresponds to "rename" in Ada, "with" in Pascal */ /* corresponds to "rename" in Ada, "with" in Pascal */
structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob); structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
Ptr_Val_Par->variant.var_1.Int_Comp = 5; Ptr_Val_Par->variant.var_1.Int_Comp = 5;
Next_Record->variant.var_1.Int_Comp Next_Record->variant.var_1.Int_Comp
= Ptr_Val_Par->variant.var_1.Int_Comp; = Ptr_Val_Par->variant.var_1.Int_Comp;
Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp; Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp;
Proc_3 (&Next_Record->Ptr_Comp); Proc_3 (&Next_Record->Ptr_Comp);
/* Ptr_Val_Par->Ptr_Comp->Ptr_Comp /* Ptr_Val_Par->Ptr_Comp->Ptr_Comp
== Ptr_Glob->Ptr_Comp */ == Ptr_Glob->Ptr_Comp */
if (Next_Record->Discr == Ident_1) if (Next_Record->Discr == Ident_1)
/* then, executed */ /* then, executed */
{ {
Next_Record->variant.var_1.Int_Comp = 6; Next_Record->variant.var_1.Int_Comp = 6;
Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp, Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp,
&Next_Record->variant.var_1.Enum_Comp); &Next_Record->variant.var_1.Enum_Comp);
Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp; Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp;
Proc_7 (Next_Record->variant.var_1.Int_Comp, 10, Proc_7 (Next_Record->variant.var_1.Int_Comp, 10,
&Next_Record->variant.var_1.Int_Comp); &Next_Record->variant.var_1.Int_Comp);
} }
else /* not executed */ else /* not executed */
@ -318,7 +318,7 @@ Proc_2 (Int_Par_Ref)
One_Fifty *Int_Par_Ref; One_Fifty *Int_Par_Ref;
{ {
One_Fifty Int_Loc; One_Fifty Int_Loc;
Enumeration Enum_Loc; Enumeration Enum_Loc;
Int_Loc = *Int_Par_Ref + 10; Int_Loc = *Int_Par_Ref + 10;

View File

@ -3,9 +3,9 @@
* *
* "DHRYSTONE" Benchmark Program * "DHRYSTONE" Benchmark Program
* ----------------------------- * -----------------------------
* *
* Version: C, Version 2.1 * Version: C, Version 2.1
* *
* File: dhry_2.c (part 3 of 3) * File: dhry_2.c (part 3 of 3)
* *
* Date: May 25, 1988 * Date: May 25, 1988
@ -41,10 +41,10 @@ Enumeration *Enum_Ref_Par;
*Enum_Ref_Par = Ident_4; *Enum_Ref_Par = Ident_4;
switch (Enum_Val_Par) switch (Enum_Val_Par)
{ {
case Ident_1: case Ident_1:
*Enum_Ref_Par = Ident_1; *Enum_Ref_Par = Ident_1;
break; break;
case Ident_2: case Ident_2:
if (Int_Glob > 100) if (Int_Glob > 100)
/* then */ /* then */
*Enum_Ref_Par = Ident_1; *Enum_Ref_Par = Ident_1;
@ -54,7 +54,7 @@ Enumeration *Enum_Ref_Par;
*Enum_Ref_Par = Ident_2; *Enum_Ref_Par = Ident_2;
break; break;
case Ident_4: break; case Ident_4: break;
case Ident_5: case Ident_5:
*Enum_Ref_Par = Ident_3; *Enum_Ref_Par = Ident_3;
break; break;
} /* switch */ } /* switch */
@ -63,7 +63,7 @@ Enumeration *Enum_Ref_Par;
Proc_7 (Int_1_Par_Val, Int_2_Par_Val, Int_Par_Ref) Proc_7 (Int_1_Par_Val, Int_2_Par_Val, Int_Par_Ref)
/**********************************************/ /**********************************************/
/* executed three times */ /* executed three times */
/* first call: Int_1_Par_Val == 2, Int_2_Par_Val == 3, */ /* first call: Int_1_Par_Val == 2, Int_2_Par_Val == 3, */
/* Int_Par_Ref becomes 7 */ /* Int_Par_Ref becomes 7 */
/* second call: Int_1_Par_Val == 10, Int_2_Par_Val == 5, */ /* second call: Int_1_Par_Val == 10, Int_2_Par_Val == 5, */