FLOPS benchmark code

The FLOPS floating-point benchmark in Forth

Benchmark results

The URL http://hpwww.epfl.ch/bench/bench.FAQ.html contains interesting benchmark source code pointers. I ported the "C" FLOPS mark by Al Aburto (aburto@nosc.mil) to Forth, and intend to have a go at some of the other benchmarks mentioned there.
| Flops.c is a 'c' program which attempts to estimate your systems
| floating-point 'MFLOPS' rating for the FADD, FSUB, FMUL, and FDIV
| operations based on specific 'instruction mixes' (discussed below).
| The program provides an estimate of PEAK MFLOPS performance by making
| maximal use of register variables with minimal interaction with main
| memory. The execution loops are all small so that they will fit in
| any cache. Flops.c can be used along with Linpack and the Livermore
| kernels (which exersize memory much more extensively) to gain further
| insight into the limits of system performance. The flops.c execution
| modules also include various percent weightings of FDIV's (from 0% to
| 25% FDIV's) so that the range of performance can be obtained when
| using FDIV's. FDIV's, being computationally more intensive than
| FADD's or FMUL's, can impact performance considerably on some systems.
There are no obvious 'holes' in this code that Forth could exploit (none I can find at least :-) The Forth FLOPS benchmark shows the quality of your compiler's FPU code as compared to what an optimizing "C" compiler would give you. Results for a large number of C compilers on a variety of systems are available in the .tbl files.

Intel Pentium P54C 166 MHz, 48 MB, iForth 1.11, NT 4.0

FORTH> main
   FLOPS Forth Program (Double Precision), V2.0 14 Jan 2001

  Module     Error        RunTime      MFLOPS
                           (usec)
    1      5.6843E-13      0.5685     24.6262
    2     -7.7639E-14      0.3992     17.5329
    3     -9.5260E-15      0.4090     41.5648
    4      3.9895E-14      0.3430     43.7318
    5      2.4366E-14      0.8352     34.7201
    6     -3.4120E-15      0.6158     47.0970
    7     -5.1273E-11      1.0180     11.7878
    8      3.0031E-14      0.6170     48.6224

   Iterations      =    4001600
   NullTime (usec) =     0.0362
   MFLOPS(1)       =    21.6194
   MFLOPS(2)       =    22.2109
   MFLOPS(3)       =    33.1329
   MFLOPS(4)       =    45.8496
The MFLOPS(1) figure puts iForth in the following company (flops_1.tbl):

    System           OS, Compiler           CPU/FPU    FPU  MFLOPS(1)  REF
                                                      (MHz)
### ---------------- -------------------- ----------- ----- --------- ----
113 HP 9000/705      HP-UX 9.03           PA-RISC7000    35   23.7545   79
114 SGI Indigo2      Irix 4.0.5           R4000/R4010   100   23.7409   61
115 SGI Indy PC      Irix 5.1.1           R4000/R4010   100   23.7053   60
116 HP 9000/705      HP-UX 9.05           PA-RISC7000    35   23.6565   81
117 IBM RS/6000 370  AIX 3.2.3            Power RISC     62   23.5727   37
118 Pentium P5-133   Windows 95           Pentium P5    133   23.5111  129
119 HP 9000/720      HP-UX 9.01           PA-RISC        50   22.898    46
120 IBM RS/6000 980  -------------------- Power RISC     62   22.6487   14
121 DEC 3000/400 AXP OpenVMS V1.5         DEC 21064     133   22.3026   52
122 HP 9000/735      HP-UX 9.01           PA-RISC7100    99   22.1247   73
--------------------------------------------------------------------------
                     NT 4.0, iForth 1.11  Pentium P5    166   21.6194   xx
--------------------------------------------------------------------------
123 DEC 3000/500 AXP OSF/1 T1.3           DEC 21064     150   21.3285   38
124 Pentium P5-133   MS DOS 6.22          Pentium P5    133   21.1732  128
125 Pentium P5-133   MS DOS 6.22          Pentium P5    133   21.1221  128
126 DEC 3000/500     Digital UNIX V3.2D   DEC 21064     150   21.1088  110
127 Pentium P5-120   Windows 95           Pentium P5    120   21.0953  125
128 HP 9000/720      HP-UX 8.07           PA-RISC        50   20.1258   30
129 DEC 3000/500 AXP OSF/1 T1.2-2 (R5)    DEC 21064     150   20.0218   25
130 HP 9000/720      HP-UX 8.0.5          PA-RISC        50   19.7063   28
142 PowerMac 8100/80 PAIX                 PowerPC 601    80   17.51     75

free counter Valid HTML 3.0