From: lidl@sura.net (Kurt J. Lidl)
Newsgroups: rec.games.xtank.programmer
Subject: Re: Tactical support for HARM's in next version.
Date: 8 Apr 92 16:53:21 GMT
Article-I.D.: sura.1992Apr8.165321.20225
Organization: SURAnet -- 8400 Baltimore Blvd, College Park, MD 20740

In article <1992Apr8.142131.12633@qualcomm.com> bwoodall@bilbo.qualcomm.com (Bill Woodall) writes:
>Maybe make it do the index/benchmark/whatever at start-up.

That's about the only time that you can do it -- certainly not at compile
time :-), when you have, for example different models of the sun4 machine,
that range from a lowly 4/110 (like we've got), up to a Sun 690/MP, which
can really crank out those cycles...

>There is still some code in xtank/Src/Fixed-Point that does some eval,
>could something like be used (like speed.c)??

Probably just about what we need to do -- perhaps as part of the
initialization code will might place this in the game, so you can get
it as a lowlib call.

I've updated the following table -- anyone want to post for other platforms?
(If you do, please make sure that include all the info below, so we can
do real comparisons on the speeds of these puppies.  Thanks.)

Here are how things were compiled on these platforms:
-----------------------------------------------------

SS2   (Sparc 2)     : cc -O4 -o speed speed.c -lm
IPC   (Sparc IPC)   : cc -O4 -o speed speed.c -lm
4/110 (Sun 4/110)   : cc -O4 -o speed speed.c -lm
4/110+(Sun 4/100)   : cc -O4 -o speed speed.c /usr/lib/libm.il -lm
OKI   (Okidata 7330): /usr/ucb/cc -O -o speed speed.c -lm
D25   (DEC 5000/25) : cc -O4 speed.c -o speed -lm (DECstation 5000/25)

Num Operation   SS2    IPC   4/110  4/110+  OKI   D25
--- ---------  -----  -----  -----  ------  ----  ----
 1. int +       0.02   0.04   0.07   0.08   0.03  0.00
 2. int >>      0.03   0.04   0.07   0.07   0.03  0.00
 3. int *       1.64   2.80   5.56   5.49   0.23  0.49
 4. int /       0.58   1.00   2.20   2.18   2.15  1.42
 5. float +     0.05   0.16   0.15   0.15   0.03  0.17
 6. float *     0.05   0.16   0.15   0.15   0.03  0.25
 7. float /     0.46   1.58   1.24   1.24   0.56  0.85
 8. double +    0.05   0.16   0.15   0.16   0.03  0.00
 9. double *    0.10   0.28   0.22   0.23   0.02  0.08
10. double /    0.72   2.70   1.61   1.63   0.91  0.65
11. sqrt        1.15   2.52   4.95   4.85   0.57  5.15
12. sin         3.65   7.72  12.55  12.25   4.07  3.43
13. atan2       3.05  29.62  43.25  41.55   8.07  6.64
14. dist        8.35  21.22  25.65   5.15   0.77  5.89
15. fsqrt       5.95  28.37  54.75  54.70  13.37  9.92
16. fsin        0.42   0.69   1.27   1.27   0.48  0.53
17. fatan2      3.17   5.07   9.73   9.72   2.99  2.16
18. fdist       0.25   0.41   0.75   0.74   0.76  0.59
19. subroutine  0.15   0.24   0.46   0.45   0.31  0.00
20. f2float     0.25   0.82   0.85   0.85   0.37  0.35
21. float2f     1.35   4.02   4.15   4.15   0.67  0.15

I'm a bit sceptical about the DECstation figures -- I'd guess that
the clock available for timing things is too coarse for doing good
benchmarks...  (After all, everything takes *some* amount of time!)
The GCC v2.1 results for the DECstation and the i860 were pretty
close in all cases -- a couple of things got marginally faster, and
a couple a little slower...

							-Kurt

Also -- I wasn't able to replicate Bill's results for the SS2 -- I
always got significantly slower speeds for several of the operations.

-- 
/* Kurt J. Lidl (lidl@sura.net)       | Unix is the answer, but only if you */
/* X.500: Power Tools for Power Fools | phrase the question very carefully. */