🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.powerpc
Article #2742

Re: Debate: PowerMac "trounces" Pentium....???

#2742
From: Bernd "Bernie" Meyer
Date: Thu, 11 Jan 1996 21:58
41 lines
1765 bytes
Robert Salasidis <salasidis@medcor.mcgill.ca> wrote:
: All games that are worth anything use absolutely zero floating point in critical 
: areas. Floating point is too inefficient, and integers are used exclusively 
: (this is for all games that require real time action).

Sure? You know that some compiler optimize code by using the FPU for integer
calculations? How about the following code?

----------------
#include <stdio.h>

#define COUNT 101


main()
{
   double a=0;
   unsigned int i,j;
   double b[COUNT];

   for (i=0;i<COUNT;i++)
      b[i]=i;

   for (j=0;j<4000000;j++) {
      for (i=0;i<COUNT-1;i++)
	 a+=b[i]*b[i+1];
   }
   printf("%d: %d\n",j,a);
}
--------------------------------

On a Pentium, changing a and b to be "int" rather than "double" slows it
down. And that is despite "int" being 32 bits while "double" is 64 bits.
Change the "*" to "/", and using the FPU is _still_ faster.

Bernie

-- 
==============================================================================
I'm using an experimental version of "nn" to read news. So if anything seems
strange about the headers of this mail or post, please inform me. Thanks!
Technical Details
Message-ID: <DL1EDn.z0@wombat.hanse.de>
Path: arc1-ca.pugleaf.net!wombat.hanse.de!root
References: <4cu3om$157i@seminole.gate.net> <30F35518.4209@medcor.mcgill.ca> <4d2id2$8po@nnrp1.news.primenet.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.powerpc,comp.os.linux.advocacy,comp.sys.mac.advocacy,comp.os.os2.advocacy,comp.sys.amiga.advocacy,comp.sys.intel,alt.2600
Path: arc1-ca.pugleaf.net!wombat.hanse.de!root
From: root@wombat.hanse.de (Bernd "Bernie" Meyer)
Subject: Re: Debate: PowerMac "trounces" Pentium....???
Organization: Private uucp site lost in the voids of the black hole Germany is in the Internet
Message-ID: <DL1EDn.z0@wombat.hanse.de>
References: <4cu3om$157i@seminole.gate.net> <30F35518.4209@medcor.mcgill.ca> <4d2id2$8po@nnrp1.news.primenet.com>
Date: Thu, 11 Jan 1996 21:58:35 GMT