Subject: Re: FPU Performance on DECstation 5000/125
To: Karl Maftoum <k.maftoum@student.canberra.edu.au>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-pmax
Date: 08/27/1997 04:40:10
The following triival program works for me, and takes almost exaclty
one second to execute on either a 500/240 runing Ultrix, or a 5000/240
running NetBSD 1.2G.  (You could wind up the count of flops, but there
seems little point.)

I examined the assembler output (and doubled the loop count) to be
sure the code is doing what I think it's doing. IT is.

I conclude there's absolutely nothing wrong with the kerenl FPU
handling, per se.

The performance of FP Libraries, and of handling FP denorm exceptions,
are completely separate issues. It would be a SMOP to change the
following to add a million denorms :) and redo the comparsion.


>BTW there is a BIG difference .. about 6 times on a float  multiply,

But the following code shows there' sno difference in FP multiply and
FP add. Try the following code yourself. Are you getting denorms or NaNs?

>how good is the maths library?

I have no idea.  It sounds like you have an Ultrix box to compare;
why don't you run the Ultrix-compiled binaries on NetBSD and compare?

Also, are you using the same compilers on NetBSD and Ultrix?
The MipsCo compiler can do a lot better than GCC, esp. if you turn on
interprocedural analysis. I'd expect no more than 1.5x-2x, though.

---------

double
fp_loser(double a)
{
	double c;
	register int i;
	
	c = 1.0;
	for (i = 0; i < 10000000; i++) {
		c += c * a;
	}
	return c;
}

double
use_value(double *d)
{
}


void
main()
{
	double d;
	d = fp_loser (1.0);
	use_value(&d);
}