From: pmontgom@euphemia.math.ucla.edu (Peter Montgomery)
Newsgroups: comp.benchmarks
Subject: Re: How are Floating Point operations counted?
Date: 1 Jun 92 20:34:54 GMT
Organization: UCLA Mathematics Department
Status: RO

In article <1992Jun1.175743.11513@news.eng.convex.com> 
patrick@convex.COM (Patrick F. McGehearty) writes:
>In article <1992May29.150530.13028@murdoch.acc.Virginia.EDU> 
>clc5q@hemlock.cs.Virginia.EDU (Clark L. Coleman) writes:

     ...

>>Real FP Operations                Normalized FP operations
>>------------------                ------------------------
>>ADD,SUB,COMPARE,MULT                         1
>>DIVIDE,SQRT                                  4
>>EXP,SIN,COS,TAN,....                         8
>>
>
>Sounds reasonable to me.  If we (all readers of this note) all agree to use
>this method, does that make it a standard? :-) :-)

	I do extensive multiple-precision arithmetic.  I consider
my programs to be "number crunching", but they rate very low
on this scale because the list omits many operations.  We should also count

        a)      Conversions: integer to floating,
                floating to integer, conversion between
                different floating precisions (perhaps one FP each).

        b)      Truncating or rounding floating to integer
                while retaining floating point form;
                (FORTRAN AINT and ANINT, for example)
                (perhaps two FP operations each).

        c)      Simple operations like the Fortran
                ABS, DIM, MAX, MIN, and SIGN functions
                (perhaps one FP operation each, with two for SIGN).

	d)	Integer multiplies not used for subscript
		computations and where neither operand is
		a compile-time constant (one FP each).

        e)      Integer division when denominator is
		not a power of 2 or negative thereof
                should count the same as an FP divide
                if only one of the quotient, remainder is used;
                if both are used, count an additional FP.

In all cases no FP operations should be counted if all
operands are compile time constants, such as 2.5 * 6.7 + ABS(-7.8).

	The list also fails to specify how much operations like X**10
or pow(X, 10.0) (exponentiation) count.  One vendor may compile this using
four multiplies, while another uses logarithm and exponential.
Does it matter if the 10 or 10.0 is an execution-time value rather than
compile-time constant?
--
        Peter L. Montgomery              Internet: pmontgom@math.ucla.edu
        Department of Mathematics, UCLA, Los Angeles, CA  90024-1555  USA

-- 
Olivier Schreiber  schreiber@sgi.com (415)390 5353  Fax:(415) 964-8671 MS/9L580
Silicon Graphics Inc.,  2011 North Shoreline Blvd. Mountain View, Ca 94039-7311


---------------------------
From: earl@fuji.idtinc.COM (Earl Killian)
Message-Id: <9211111615.AA22511@fuji.qedinc.com>
To: hblim@iti.gov.sg (Hock-Beng Lim)
Subject: Counting number of MFLOPS
Status: RO

The pixie/pixstats programs on MIPS systems count FLOPs.


---------------------------
From: Larry Meadows <lfm@pgroup.com>
Message-Id: <199211120431.AA04770@libby.pgroup.com>
To: hblim@iti.gov.sg
Subject: Re: Counting number of MFLOPS
Newsgroups: comp.benchmarks
Organization: The Portland Group, Portland, OR
Cc: 
Status: RO


pixie on a mips will tell you how many f.p. ops were executed (exactly
I believe).

lfm

-- 
Larry Meadows		The Portland Group
lfm@pgroup.com


---------------------------
From: earl@fuji.idtinc.COM (Earl Killian)
Message-Id: <9211122242.AA23731@fuji.qedinc.com>
To: hblim@iti.gov.sg
Subject: Counting number of MFLOPS
Status: RO

Pixie is a object-code instrumentation program.  It adds intructions
to a binary to count basic blocks and optionally to generate
instruction and data address traces.  The non-tracing usage is quite
simple:

pixie foo			# reads foo, produces new executable foo.pixie
				# (also produces foo.Addrs)
				# (takes 2-3 seconds)
foo.pixie fooargs < fooinput > foooutput
				# run new executable in the normal way
				# writes foo.Counts on exit
				# (takes 2-3x longer than running foo)
pixstats foo > foo.stats	# reads foo, foo.Addrs, and foo.Counts
				# and generates statistics, including
				# opcode frequencies
				# (takes <1 second)

>From the SPEC benchmark pixstats outputs I have lying around I
selected the lines that would let you count floating point operations
(to compute FLOPs as the supercomputer folks do, use
fadd+fsub+...+fmul+fdiv*4+fsqrt*8).  The complete outputs are a little
large to mail.

013.spice2g6:
    fmul  330562977    2.10%
    fsub  222139265    1.41%
    fadd  203333823    1.29%
    fdiv   78994140    0.50%
    c.lt   62909949    0.40%
    fabs   52376825    0.33%
    fmov   22202904    0.14%
    c.le   19064771    0.12%
    c.eq   12807281    0.08%
   fcvtd   11471709    0.07%
    fneg   11089840    0.07%
   fcvtw    5138333    0.03%
   c.ole    5138308    0.03%
   c.ult    3325350    0.02%
   fcvts    1977914    0.01%
   c.olt    1555423    0.01%
   c.ule    1555373    0.01%
   fsqrt    1132405    0.01%
    c.un          1    0.00%

015.doduc:
    fmul  122995914   11.86%
    fadd   89962441    8.67%
    fsub   37023197    3.57%
    c.le   28173005    2.72%
    fdiv   23850719    2.30%
   fcvtd   14394593    1.39%
    c.lt   11241927    1.08%
    fmov    8652077    0.83%
   fcvts    3378554    0.33%
    c.eq    3355800    0.32%
    fneg    2796032    0.27%
    fabs    2738844    0.26%
   fcvtw    1279710    0.12%
   c.ole     838950    0.08%
   fsqrt     507377    0.05%
    c.un     456765    0.04%
   c.ult       5514    0.00%

020.nasa7:
    fmul 1027731023   18.52%
    fsub  600896167   10.83%
    fadd  456774097    8.23%
    fmov   44444306    0.80%
    fdiv   19186849    0.35%
   fcvtd    6549652    0.12%
   c.ult    6159939    0.11%
    fabs    4424521    0.08%
    c.lt    2220883    0.04%
   fsqrt    2060200    0.04%
   c.olt    1293562    0.02%
   fcvtw    1030288    0.02%
    fneg     809244    0.01%
    c.le     516000    0.01%
   c.ole     515000    0.01%
   c.ule     263082    0.00%
    c.eq      51010    0.00%
   fcvts      46108    0.00%

030.matrix300:
    fadd  216000300   31.65%
    fmul  216000000   31.65%
    fmov          3    0.00%
    c.eq          3    0.00%
    fabs          2    0.00%
    fsub          1    0.00%
    fdiv          1    0.00%

042.fpppp:
    fmul  306318594   23.42%
    fadd  260531821   19.92%
    fsub    7504774    0.57%
    fmov    3922913    0.30%
    fneg    3677499    0.28%
    c.lt    1685380    0.13%
    fdiv    1303147    0.10%
    fabs    1109268    0.08%
    c.le     682180    0.05%
   fcvtd     495142    0.04%
   fsqrt     377621    0.03%
   fcvts     248187    0.02%
   fcvtw     223627    0.02%
   c.ole     200322    0.02%
    c.eq      61467    0.00%
    c.un      23306    0.00%

047.tomcatv:
    fmul  156167870   17.01%
    fsub  113846282   12.40%
    fadd  110607782   12.04%
    fabs   26010198    2.83%
    c.lt   13005198    1.42%
    fdiv    6502758    0.71%
    fneg    6502500    0.71%
    fmov      47120    0.01%
    c.eq        400    0.00%
   fcvts        257    0.00%
   fcvtd        257    0.00%

-- 
-----------------------------------------------------------------------------
Hock-Beng Lim                                   | hblim@csrd.uiuc.edu
Center for Supercomputing R&D, UIUC. (on leave) | hblim@iti.gov.sg 
Information Technology Institute, Singapore.    | tel : (65)772-7205,772-7273
Newsgroups: comp.benchmarks,comp.arch.storage