xref: /openbmc/linux/lib/dhry.h (revision 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e)
1*d5528cc1SGeert Uytterhoeven /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
2*d5528cc1SGeert Uytterhoeven /*
3*d5528cc1SGeert Uytterhoeven  ****************************************************************************
4*d5528cc1SGeert Uytterhoeven  *
5*d5528cc1SGeert Uytterhoeven  *                   "DHRYSTONE" Benchmark Program
6*d5528cc1SGeert Uytterhoeven  *                   -----------------------------
7*d5528cc1SGeert Uytterhoeven  *
8*d5528cc1SGeert Uytterhoeven  *  Version:    C, Version 2.1
9*d5528cc1SGeert Uytterhoeven  *
10*d5528cc1SGeert Uytterhoeven  *  File:       dhry.h (part 1 of 3)
11*d5528cc1SGeert Uytterhoeven  *
12*d5528cc1SGeert Uytterhoeven  *  Date:       May 25, 1988
13*d5528cc1SGeert Uytterhoeven  *
14*d5528cc1SGeert Uytterhoeven  *  Author:     Reinhold P. Weicker
15*d5528cc1SGeert Uytterhoeven  *                      Siemens AG, AUT E 51
16*d5528cc1SGeert Uytterhoeven  *                      Postfach 3220
17*d5528cc1SGeert Uytterhoeven  *                      8520 Erlangen
18*d5528cc1SGeert Uytterhoeven  *                      Germany (West)
19*d5528cc1SGeert Uytterhoeven  *                              Phone:  [+49]-9131-7-20330
20*d5528cc1SGeert Uytterhoeven  *                                      (8-17 Central European Time)
21*d5528cc1SGeert Uytterhoeven  *                              Usenet: ..!mcsun!unido!estevax!weicker
22*d5528cc1SGeert Uytterhoeven  *
23*d5528cc1SGeert Uytterhoeven  *              Original Version (in Ada) published in
24*d5528cc1SGeert Uytterhoeven  *              "Communications of the ACM" vol. 27., no. 10 (Oct. 1984),
25*d5528cc1SGeert Uytterhoeven  *              pp. 1013 - 1030, together with the statistics
26*d5528cc1SGeert Uytterhoeven  *              on which the distribution of statements etc. is based.
27*d5528cc1SGeert Uytterhoeven  *
28*d5528cc1SGeert Uytterhoeven  *              In this C version, the following C library functions are used:
29*d5528cc1SGeert Uytterhoeven  *              - strcpy, strcmp (inside the measurement loop)
30*d5528cc1SGeert Uytterhoeven  *              - printf, scanf (outside the measurement loop)
31*d5528cc1SGeert Uytterhoeven  *              In addition, Berkeley UNIX system calls "times ()" or "time ()"
32*d5528cc1SGeert Uytterhoeven  *              are used for execution time measurement. For measurements
33*d5528cc1SGeert Uytterhoeven  *              on other systems, these calls have to be changed.
34*d5528cc1SGeert Uytterhoeven  *
35*d5528cc1SGeert Uytterhoeven  *  Collection of Results:
36*d5528cc1SGeert Uytterhoeven  *              Reinhold Weicker (address see above) and
37*d5528cc1SGeert Uytterhoeven  *
38*d5528cc1SGeert Uytterhoeven  *              Rick Richardson
39*d5528cc1SGeert Uytterhoeven  *              PC Research. Inc.
40*d5528cc1SGeert Uytterhoeven  *              94 Apple Orchard Drive
41*d5528cc1SGeert Uytterhoeven  *              Tinton Falls, NJ 07724
42*d5528cc1SGeert Uytterhoeven  *                      Phone:  (201) 389-8963 (9-17 EST)
43*d5528cc1SGeert Uytterhoeven  *                      Usenet: ...!uunet!pcrat!rick
44*d5528cc1SGeert Uytterhoeven  *
45*d5528cc1SGeert Uytterhoeven  *      Please send results to Rick Richardson and/or Reinhold Weicker.
46*d5528cc1SGeert Uytterhoeven  *      Complete information should be given on hardware and software used.
47*d5528cc1SGeert Uytterhoeven  *      Hardware information includes: Machine type, CPU, type and size
48*d5528cc1SGeert Uytterhoeven  *      of caches; for microprocessors: clock frequency, memory speed
49*d5528cc1SGeert Uytterhoeven  *      (number of wait states).
50*d5528cc1SGeert Uytterhoeven  *      Software information includes: Compiler (and runtime library)
51*d5528cc1SGeert Uytterhoeven  *      manufacturer and version, compilation switches, OS version.
52*d5528cc1SGeert Uytterhoeven  *      The Operating System version may give an indication about the
53*d5528cc1SGeert Uytterhoeven  *      compiler; Dhrystone itself performs no OS calls in the measurement loop.
54*d5528cc1SGeert Uytterhoeven  *
55*d5528cc1SGeert Uytterhoeven  *      The complete output generated by the program should be mailed
56*d5528cc1SGeert Uytterhoeven  *      such that at least some checks for correctness can be made.
57*d5528cc1SGeert Uytterhoeven  *
58*d5528cc1SGeert Uytterhoeven  ***************************************************************************
59*d5528cc1SGeert Uytterhoeven  *
60*d5528cc1SGeert Uytterhoeven  *  History:    This version C/2.1 has been made for two reasons:
61*d5528cc1SGeert Uytterhoeven  *
62*d5528cc1SGeert Uytterhoeven  *              1) There is an obvious need for a common C version of
63*d5528cc1SGeert Uytterhoeven  *              Dhrystone, since C is at present the most popular system
64*d5528cc1SGeert Uytterhoeven  *              programming language for the class of processors
65*d5528cc1SGeert Uytterhoeven  *              (microcomputers, minicomputers) where Dhrystone is used most.
66*d5528cc1SGeert Uytterhoeven  *              There should be, as far as possible, only one C version of
67*d5528cc1SGeert Uytterhoeven  *              Dhrystone such that results can be compared without
68*d5528cc1SGeert Uytterhoeven  *              restrictions. In the past, the C versions distributed
69*d5528cc1SGeert Uytterhoeven  *              by Rick Richardson (Version 1.1) and by Reinhold Weicker
70*d5528cc1SGeert Uytterhoeven  *              had small (though not significant) differences.
71*d5528cc1SGeert Uytterhoeven  *
72*d5528cc1SGeert Uytterhoeven  *              2) As far as it is possible without changes to the Dhrystone
73*d5528cc1SGeert Uytterhoeven  *              statistics, optimizing compilers should be prevented from
74*d5528cc1SGeert Uytterhoeven  *              removing significant statements.
75*d5528cc1SGeert Uytterhoeven  *
76*d5528cc1SGeert Uytterhoeven  *              This C version has been developed in cooperation with
77*d5528cc1SGeert Uytterhoeven  *              Rick Richardson (Tinton Falls, NJ), it incorporates many
78*d5528cc1SGeert Uytterhoeven  *              ideas from the "Version 1.1" distributed previously by
79*d5528cc1SGeert Uytterhoeven  *              him over the UNIX network Usenet.
80*d5528cc1SGeert Uytterhoeven  *              I also thank Chaim Benedelac (National Semiconductor),
81*d5528cc1SGeert Uytterhoeven  *              David Ditzel (SUN), Earl Killian and John Mashey (MIPS),
82*d5528cc1SGeert Uytterhoeven  *              Alan Smith and Rafael Saavedra-Barrera (UC at Berkeley)
83*d5528cc1SGeert Uytterhoeven  *              for their help with comments on earlier versions of the
84*d5528cc1SGeert Uytterhoeven  *              benchmark.
85*d5528cc1SGeert Uytterhoeven  *
86*d5528cc1SGeert Uytterhoeven  *  Changes:    In the initialization part, this version follows mostly
87*d5528cc1SGeert Uytterhoeven  *              Rick Richardson's version distributed via Usenet, not the
88*d5528cc1SGeert Uytterhoeven  *              version distributed earlier via floppy disk by Reinhold Weicker.
89*d5528cc1SGeert Uytterhoeven  *              As a concession to older compilers, names have been made
90*d5528cc1SGeert Uytterhoeven  *              unique within the first 8 characters.
91*d5528cc1SGeert Uytterhoeven  *              Inside the measurement loop, this version follows the
92*d5528cc1SGeert Uytterhoeven  *              version previously distributed by Reinhold Weicker.
93*d5528cc1SGeert Uytterhoeven  *
94*d5528cc1SGeert Uytterhoeven  *              At several places in the benchmark, code has been added,
95*d5528cc1SGeert Uytterhoeven  *              but within the measurement loop only in branches that
96*d5528cc1SGeert Uytterhoeven  *              are not executed. The intention is that optimizing compilers
97*d5528cc1SGeert Uytterhoeven  *              should be prevented from moving code out of the measurement
98*d5528cc1SGeert Uytterhoeven  *              loop, or from removing code altogether. Since the statements
99*d5528cc1SGeert Uytterhoeven  *              that are executed within the measurement loop have NOT been
100*d5528cc1SGeert Uytterhoeven  *              changed, the numbers defining the "Dhrystone distribution"
101*d5528cc1SGeert Uytterhoeven  *              (distribution of statements, operand types and locality)
102*d5528cc1SGeert Uytterhoeven  *              still hold. Except for sophisticated optimizing compilers,
103*d5528cc1SGeert Uytterhoeven  *              execution times for this version should be the same as
104*d5528cc1SGeert Uytterhoeven  *              for previous versions.
105*d5528cc1SGeert Uytterhoeven  *
106*d5528cc1SGeert Uytterhoeven  *              Since it has proven difficult to subtract the time for the
107*d5528cc1SGeert Uytterhoeven  *              measurement loop overhead in a correct way, the loop check
108*d5528cc1SGeert Uytterhoeven  *              has been made a part of the benchmark. This does have
109*d5528cc1SGeert Uytterhoeven  *              an impact - though a very minor one - on the distribution
110*d5528cc1SGeert Uytterhoeven  *              statistics which have been updated for this version.
111*d5528cc1SGeert Uytterhoeven  *
112*d5528cc1SGeert Uytterhoeven  *              All changes within the measurement loop are described
113*d5528cc1SGeert Uytterhoeven  *              and discussed in the companion paper "Rationale for
114*d5528cc1SGeert Uytterhoeven  *              Dhrystone version 2".
115*d5528cc1SGeert Uytterhoeven  *
116*d5528cc1SGeert Uytterhoeven  *              Because of the self-imposed limitation that the order and
117*d5528cc1SGeert Uytterhoeven  *              distribution of the executed statements should not be
118*d5528cc1SGeert Uytterhoeven  *              changed, there are still cases where optimizing compilers
119*d5528cc1SGeert Uytterhoeven  *              may not generate code for some statements. To a certain
120*d5528cc1SGeert Uytterhoeven  *              degree, this is unavoidable for small synthetic benchmarks.
121*d5528cc1SGeert Uytterhoeven  *              Users of the benchmark are advised to check code listings
122*d5528cc1SGeert Uytterhoeven  *              whether code is generated for all statements of Dhrystone.
123*d5528cc1SGeert Uytterhoeven  *
124*d5528cc1SGeert Uytterhoeven  *              Version 2.1 is identical to version 2.0 distributed via
125*d5528cc1SGeert Uytterhoeven  *              the UNIX network Usenet in March 1988 except that it corrects
126*d5528cc1SGeert Uytterhoeven  *              some minor deficiencies that were found by users of version 2.0.
127*d5528cc1SGeert Uytterhoeven  *              The only change within the measurement loop is that a
128*d5528cc1SGeert Uytterhoeven  *              non-executed "else" part was added to the "if" statement in
129*d5528cc1SGeert Uytterhoeven  *              Func_3, and a non-executed "else" part removed from Proc_3.
130*d5528cc1SGeert Uytterhoeven  *
131*d5528cc1SGeert Uytterhoeven  ***************************************************************************
132*d5528cc1SGeert Uytterhoeven  *
133*d5528cc1SGeert Uytterhoeven  *  Compilation model and measurement (IMPORTANT):
134*d5528cc1SGeert Uytterhoeven  *
135*d5528cc1SGeert Uytterhoeven  *  This C version of Dhrystone consists of three files:
136*d5528cc1SGeert Uytterhoeven  *  - dhry.h (this file, containing global definitions and comments)
137*d5528cc1SGeert Uytterhoeven  *  - dhry_1.c (containing the code corresponding to Ada package Pack_1)
138*d5528cc1SGeert Uytterhoeven  *  - dhry_2.c (containing the code corresponding to Ada package Pack_2)
139*d5528cc1SGeert Uytterhoeven  *
140*d5528cc1SGeert Uytterhoeven  *  The following "ground rules" apply for measurements:
141*d5528cc1SGeert Uytterhoeven  *  - Separate compilation
142*d5528cc1SGeert Uytterhoeven  *  - No procedure merging
143*d5528cc1SGeert Uytterhoeven  *  - Otherwise, compiler optimizations are allowed but should be indicated
144*d5528cc1SGeert Uytterhoeven  *  - Default results are those without register declarations
145*d5528cc1SGeert Uytterhoeven  *  See the companion paper "Rationale for Dhrystone Version 2" for a more
146*d5528cc1SGeert Uytterhoeven  *  detailed discussion of these ground rules.
147*d5528cc1SGeert Uytterhoeven  *
148*d5528cc1SGeert Uytterhoeven  *  For 16-Bit processors (e.g. 80186, 80286), times for all compilation
149*d5528cc1SGeert Uytterhoeven  *  models ("small", "medium", "large" etc.) should be given if possible,
150*d5528cc1SGeert Uytterhoeven  *  together with a definition of these models for the compiler system used.
151*d5528cc1SGeert Uytterhoeven  *
152*d5528cc1SGeert Uytterhoeven  **************************************************************************
153*d5528cc1SGeert Uytterhoeven  *
154*d5528cc1SGeert Uytterhoeven  *  Dhrystone (C version) statistics:
155*d5528cc1SGeert Uytterhoeven  *
156*d5528cc1SGeert Uytterhoeven  *  [Comment from the first distribution, updated for version 2.
157*d5528cc1SGeert Uytterhoeven  *   Note that because of language differences, the numbers are slightly
158*d5528cc1SGeert Uytterhoeven  *   different from the Ada version.]
159*d5528cc1SGeert Uytterhoeven  *
160*d5528cc1SGeert Uytterhoeven  *  The following program contains statements of a high level programming
161*d5528cc1SGeert Uytterhoeven  *  language (here: C) in a distribution considered representative:
162*d5528cc1SGeert Uytterhoeven  *
163*d5528cc1SGeert Uytterhoeven  *    assignments                  52 (51.0 %)
164*d5528cc1SGeert Uytterhoeven  *    control statements           33 (32.4 %)
165*d5528cc1SGeert Uytterhoeven  *    procedure, function calls    17 (16.7 %)
166*d5528cc1SGeert Uytterhoeven  *
167*d5528cc1SGeert Uytterhoeven  *  103 statements are dynamically executed. The program is balanced with
168*d5528cc1SGeert Uytterhoeven  *  respect to the three aspects:
169*d5528cc1SGeert Uytterhoeven  *
170*d5528cc1SGeert Uytterhoeven  *    - statement type
171*d5528cc1SGeert Uytterhoeven  *    - operand type
172*d5528cc1SGeert Uytterhoeven  *    - operand locality
173*d5528cc1SGeert Uytterhoeven  *         operand global, local, parameter, or constant.
174*d5528cc1SGeert Uytterhoeven  *
175*d5528cc1SGeert Uytterhoeven  *  The combination of these three aspects is balanced only approximately.
176*d5528cc1SGeert Uytterhoeven  *
177*d5528cc1SGeert Uytterhoeven  *  1. Statement Type:
178*d5528cc1SGeert Uytterhoeven  *  -----------------             number
179*d5528cc1SGeert Uytterhoeven  *
180*d5528cc1SGeert Uytterhoeven  *     V1 = V2                     9
181*d5528cc1SGeert Uytterhoeven  *       (incl. V1 = F(..)
182*d5528cc1SGeert Uytterhoeven  *     V = Constant               12
183*d5528cc1SGeert Uytterhoeven  *     Assignment,                 7
184*d5528cc1SGeert Uytterhoeven  *       with array element
185*d5528cc1SGeert Uytterhoeven  *     Assignment,                 6
186*d5528cc1SGeert Uytterhoeven  *       with record component
187*d5528cc1SGeert Uytterhoeven  *                                --
188*d5528cc1SGeert Uytterhoeven  *                                34       34
189*d5528cc1SGeert Uytterhoeven  *
190*d5528cc1SGeert Uytterhoeven  *     X = Y +|-|"&&"|"|" Z        5
191*d5528cc1SGeert Uytterhoeven  *     X = Y +|-|"==" Constant     6
192*d5528cc1SGeert Uytterhoeven  *     X = X +|- 1                 3
193*d5528cc1SGeert Uytterhoeven  *     X = Y *|/ Z                 2
194*d5528cc1SGeert Uytterhoeven  *     X = Expression,             1
195*d5528cc1SGeert Uytterhoeven  *           two operators
196*d5528cc1SGeert Uytterhoeven  *     X = Expression,             1
197*d5528cc1SGeert Uytterhoeven  *           three operators
198*d5528cc1SGeert Uytterhoeven  *                                --
199*d5528cc1SGeert Uytterhoeven  *                                18       18
200*d5528cc1SGeert Uytterhoeven  *
201*d5528cc1SGeert Uytterhoeven  *     if ....                    14
202*d5528cc1SGeert Uytterhoeven  *       with "else"      7
203*d5528cc1SGeert Uytterhoeven  *       without "else"   7
204*d5528cc1SGeert Uytterhoeven  *           executed        3
205*d5528cc1SGeert Uytterhoeven  *           not executed    4
206*d5528cc1SGeert Uytterhoeven  *     for ...                     7  |  counted every time
207*d5528cc1SGeert Uytterhoeven  *     while ...                   4  |  the loop condition
208*d5528cc1SGeert Uytterhoeven  *     do ... while                1  |  is evaluated
209*d5528cc1SGeert Uytterhoeven  *     switch ...                  1
210*d5528cc1SGeert Uytterhoeven  *     break                       1
211*d5528cc1SGeert Uytterhoeven  *     declaration with            1
212*d5528cc1SGeert Uytterhoeven  *       initialization
213*d5528cc1SGeert Uytterhoeven  *                                --
214*d5528cc1SGeert Uytterhoeven  *                                34       34
215*d5528cc1SGeert Uytterhoeven  *
216*d5528cc1SGeert Uytterhoeven  *     P (...)  procedure call    11
217*d5528cc1SGeert Uytterhoeven  *       user procedure      10
218*d5528cc1SGeert Uytterhoeven  *       library procedure    1
219*d5528cc1SGeert Uytterhoeven  *     X = F (...)
220*d5528cc1SGeert Uytterhoeven  *             function  call      6
221*d5528cc1SGeert Uytterhoeven  *       user function        5
222*d5528cc1SGeert Uytterhoeven  *       library function     1
223*d5528cc1SGeert Uytterhoeven  *                                --
224*d5528cc1SGeert Uytterhoeven  *                                17       17
225*d5528cc1SGeert Uytterhoeven  *                                        ---
226*d5528cc1SGeert Uytterhoeven  *                                        103
227*d5528cc1SGeert Uytterhoeven  *
228*d5528cc1SGeert Uytterhoeven  *    The average number of parameters in procedure or function calls
229*d5528cc1SGeert Uytterhoeven  *    is 1.82 (not counting the function values as implicit parameters).
230*d5528cc1SGeert Uytterhoeven  *
231*d5528cc1SGeert Uytterhoeven  *
232*d5528cc1SGeert Uytterhoeven  *  2. Operators
233*d5528cc1SGeert Uytterhoeven  *  ------------
234*d5528cc1SGeert Uytterhoeven  *                          number    approximate
235*d5528cc1SGeert Uytterhoeven  *                                    percentage
236*d5528cc1SGeert Uytterhoeven  *
237*d5528cc1SGeert Uytterhoeven  *    Arithmetic             32          50.8
238*d5528cc1SGeert Uytterhoeven  *
239*d5528cc1SGeert Uytterhoeven  *       +                     21          33.3
240*d5528cc1SGeert Uytterhoeven  *       -                      7          11.1
241*d5528cc1SGeert Uytterhoeven  *       *                      3           4.8
242*d5528cc1SGeert Uytterhoeven  *       / (int div)            1           1.6
243*d5528cc1SGeert Uytterhoeven  *
244*d5528cc1SGeert Uytterhoeven  *    Comparison             27           42.8
245*d5528cc1SGeert Uytterhoeven  *
246*d5528cc1SGeert Uytterhoeven  *       ==                     9           14.3
247*d5528cc1SGeert Uytterhoeven  *       /=                     4            6.3
248*d5528cc1SGeert Uytterhoeven  *       >                      1            1.6
249*d5528cc1SGeert Uytterhoeven  *       <                      3            4.8
250*d5528cc1SGeert Uytterhoeven  *       >=                     1            1.6
251*d5528cc1SGeert Uytterhoeven  *       <=                     9           14.3
252*d5528cc1SGeert Uytterhoeven  *
253*d5528cc1SGeert Uytterhoeven  *    Logic                   4            6.3
254*d5528cc1SGeert Uytterhoeven  *
255*d5528cc1SGeert Uytterhoeven  *       && (AND-THEN)          1            1.6
256*d5528cc1SGeert Uytterhoeven  *       |  (OR)                1            1.6
257*d5528cc1SGeert Uytterhoeven  *       !  (NOT)               2            3.2
258*d5528cc1SGeert Uytterhoeven  *
259*d5528cc1SGeert Uytterhoeven  *                           --          -----
260*d5528cc1SGeert Uytterhoeven  *                           63          100.1
261*d5528cc1SGeert Uytterhoeven  *
262*d5528cc1SGeert Uytterhoeven  *
263*d5528cc1SGeert Uytterhoeven  *  3. Operand Type (counted once per operand reference):
264*d5528cc1SGeert Uytterhoeven  *  ---------------
265*d5528cc1SGeert Uytterhoeven  *                          number    approximate
266*d5528cc1SGeert Uytterhoeven  *                                    percentage
267*d5528cc1SGeert Uytterhoeven  *
268*d5528cc1SGeert Uytterhoeven  *     Integer               175        72.3 %
269*d5528cc1SGeert Uytterhoeven  *     Character              45        18.6 %
270*d5528cc1SGeert Uytterhoeven  *     Pointer                12         5.0 %
271*d5528cc1SGeert Uytterhoeven  *     String30                6         2.5 %
272*d5528cc1SGeert Uytterhoeven  *     Array                   2         0.8 %
273*d5528cc1SGeert Uytterhoeven  *     Record                  2         0.8 %
274*d5528cc1SGeert Uytterhoeven  *                           ---       -------
275*d5528cc1SGeert Uytterhoeven  *                           242       100.0 %
276*d5528cc1SGeert Uytterhoeven  *
277*d5528cc1SGeert Uytterhoeven  *  When there is an access path leading to the final operand (e.g. a record
278*d5528cc1SGeert Uytterhoeven  *  component), only the final data type on the access path is counted.
279*d5528cc1SGeert Uytterhoeven  *
280*d5528cc1SGeert Uytterhoeven  *
281*d5528cc1SGeert Uytterhoeven  *  4. Operand Locality:
282*d5528cc1SGeert Uytterhoeven  *  -------------------
283*d5528cc1SGeert Uytterhoeven  *                                number    approximate
284*d5528cc1SGeert Uytterhoeven  *                                          percentage
285*d5528cc1SGeert Uytterhoeven  *
286*d5528cc1SGeert Uytterhoeven  *     local variable              114        47.1 %
287*d5528cc1SGeert Uytterhoeven  *     global variable              22         9.1 %
288*d5528cc1SGeert Uytterhoeven  *     parameter                    45        18.6 %
289*d5528cc1SGeert Uytterhoeven  *        value                        23         9.5 %
290*d5528cc1SGeert Uytterhoeven  *        reference                    22         9.1 %
291*d5528cc1SGeert Uytterhoeven  *     function result               6         2.5 %
292*d5528cc1SGeert Uytterhoeven  *     constant                     55        22.7 %
293*d5528cc1SGeert Uytterhoeven  *                                 ---       -------
294*d5528cc1SGeert Uytterhoeven  *                                 242       100.0 %
295*d5528cc1SGeert Uytterhoeven  *
296*d5528cc1SGeert Uytterhoeven  *
297*d5528cc1SGeert Uytterhoeven  *  The program does not compute anything meaningful, but it is syntactically
298*d5528cc1SGeert Uytterhoeven  *  and semantically correct. All variables have a value assigned to them
299*d5528cc1SGeert Uytterhoeven  *  before they are used as a source operand.
300*d5528cc1SGeert Uytterhoeven  *
301*d5528cc1SGeert Uytterhoeven  *  There has been no explicit effort to account for the effects of a
302*d5528cc1SGeert Uytterhoeven  *  cache, or to balance the use of long or short displacements for code or
303*d5528cc1SGeert Uytterhoeven  *  data.
304*d5528cc1SGeert Uytterhoeven  *
305*d5528cc1SGeert Uytterhoeven  ***************************************************************************
306*d5528cc1SGeert Uytterhoeven  */
307*d5528cc1SGeert Uytterhoeven 
308*d5528cc1SGeert Uytterhoeven typedef enum {
309*d5528cc1SGeert Uytterhoeven 	Ident_1,
310*d5528cc1SGeert Uytterhoeven 	Ident_2,
311*d5528cc1SGeert Uytterhoeven 	Ident_3,
312*d5528cc1SGeert Uytterhoeven 	Ident_4,
313*d5528cc1SGeert Uytterhoeven 	Ident_5
314*d5528cc1SGeert Uytterhoeven } Enumeration;	/* for boolean and enumeration types in Ada, Pascal */
315*d5528cc1SGeert Uytterhoeven 
316*d5528cc1SGeert Uytterhoeven /* General definitions: */
317*d5528cc1SGeert Uytterhoeven 
318*d5528cc1SGeert Uytterhoeven typedef int One_Thirty;
319*d5528cc1SGeert Uytterhoeven typedef int One_Fifty;
320*d5528cc1SGeert Uytterhoeven typedef char Capital_Letter;
321*d5528cc1SGeert Uytterhoeven typedef int Boolean;
322*d5528cc1SGeert Uytterhoeven typedef char Str_30[31];
323*d5528cc1SGeert Uytterhoeven typedef int Arr_1_Dim[50];
324*d5528cc1SGeert Uytterhoeven typedef int Arr_2_Dim[50][50];
325*d5528cc1SGeert Uytterhoeven 
326*d5528cc1SGeert Uytterhoeven typedef struct record {
327*d5528cc1SGeert Uytterhoeven 	struct record *Ptr_Comp;
328*d5528cc1SGeert Uytterhoeven 	Enumeration    Discr;
329*d5528cc1SGeert Uytterhoeven 	union {
330*d5528cc1SGeert Uytterhoeven 		struct {
331*d5528cc1SGeert Uytterhoeven 			Enumeration Enum_Comp;
332*d5528cc1SGeert Uytterhoeven 			int Int_Comp;
333*d5528cc1SGeert Uytterhoeven 			char Str_Comp[31];
334*d5528cc1SGeert Uytterhoeven 		} var_1;
335*d5528cc1SGeert Uytterhoeven 		struct {
336*d5528cc1SGeert Uytterhoeven 			Enumeration E_Comp_2;
337*d5528cc1SGeert Uytterhoeven 			char Str_2_Comp[31];
338*d5528cc1SGeert Uytterhoeven 		} var_2;
339*d5528cc1SGeert Uytterhoeven 		struct {
340*d5528cc1SGeert Uytterhoeven 			char Ch_1_Comp;
341*d5528cc1SGeert Uytterhoeven 			char Ch_2_Comp;
342*d5528cc1SGeert Uytterhoeven 		} var_3;
343*d5528cc1SGeert Uytterhoeven 	} variant;
344*d5528cc1SGeert Uytterhoeven } Rec_Type, *Rec_Pointer;
345*d5528cc1SGeert Uytterhoeven 
346*d5528cc1SGeert Uytterhoeven 
347*d5528cc1SGeert Uytterhoeven extern int Int_Glob;
348*d5528cc1SGeert Uytterhoeven extern char Ch_1_Glob;
349*d5528cc1SGeert Uytterhoeven 
350*d5528cc1SGeert Uytterhoeven void Proc_6(Enumeration  Enum_Val_Par, Enumeration *Enum_Ref_Par);
351*d5528cc1SGeert Uytterhoeven void Proc_7(One_Fifty Int_1_Par_Val, One_Fifty Int_2_Par_Val,
352*d5528cc1SGeert Uytterhoeven 	    One_Fifty *Int_Par_Ref);
353*d5528cc1SGeert Uytterhoeven void Proc_8(Arr_1_Dim Arr_1_Par_Ref, Arr_2_Dim Arr_2_Par_Ref,
354*d5528cc1SGeert Uytterhoeven 	    int Int_1_Par_Val, int Int_2_Par_Val);
355*d5528cc1SGeert Uytterhoeven Enumeration Func_1(Capital_Letter Ch_1_Par_Val, Capital_Letter Ch_2_Par_Val);
356*d5528cc1SGeert Uytterhoeven Boolean Func_2(Str_30 Str_1_Par_Ref, Str_30 Str_2_Par_Ref);
357*d5528cc1SGeert Uytterhoeven 
358*d5528cc1SGeert Uytterhoeven int dhry(int n);
359