TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: MIKE PHILLIPS
from: NIELS JONKER
date: 1997-03-23 23:40:00
subject: Re: MHZ VS MFLOPS

 SW> The program I am making will take input, like mhz, and output the
 SW> converted speed in mflops.  I am hoping to create a real time function
 SW> of this somehow. 
 MP> Pick a floating point operation and see how many of them you can do
 MP> per second.  You can do a table based method for Intel processors by
 MP> getting the data books for the 486DX, Pentium, and Pentium Pro,
 MP> picking a representative floating point instruction (something in the
 MP> middle like fadd, fsub, fmul, fdiv, not something quick like fstp or
 MP> something slow like fsin), see how many clock cycles it takes (this
 MP> will be different for each processor), and divide the MHz by this
 MP> number.  Floating point operations never pair, so don't worry about
 MP> pipelines.
If you're working with a Pentium processor this isn't exactly right
True, almost all floating point instructions do not pair ( you can only pair
FXCH with stuff like FADD,FSUB,FMUL etc.. ) but instructions can overlap,
this means that the next instruction can be started while the first is
still being executed.
example :
	FADD ST(1),ST(0) cycle 1-3
	FADD ST(2),ST(0) cycle 2-4
	FADD ST(3),ST(0) cycle 3-5
	FADD ST(4),ST(0) cycle 4-6
Ofcourse to get the most out of this your code must follow a few rules,( the
second instruction does not overlap if it needs the result of the first, a
FMUL can't start the clockcycle after another FMUL, etc... )
This means the number of FLOPS (for the Pentium processor) depends a lot on
how you write your code / the intelligence of your compiler
and so to simply divide the Mhz by the number of clockcycles of a single
floating point instruction takes, will you not give you a very meaningfull
result.
Niels...
 
... Would it save time if I just went mad now?
--- GEcho 1.11+
---------------
* Origin: Free sex on Softwareboard 0224-218587 {+} Reg.Only (2:280/112)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.