Re: Why is using single-precision slower than using double-precision

kenneta@hubcap.clemson.edu (Ken Adams)
Wed, 23 Nov 1994 22:25:12 GMT

          From comp.compilers

Related articles
[5 earlier articles]
Re: Why is using single-precision slower than using double-precision koppel@omega.ee.lsu.edu (1994-11-23)
Re: Why is using single-precision slower than using double-precision bevan@cs.man.ac.uk (1994-11-23)
Re: Why is using single-precision slower than using double-precision luigi@paris.CS.Berkeley.EDU (1994-11-23)
Re: Why is using single-precision slower than using double-precision davidm@Rational.COM (1994-11-23)
Re: Why is using single-precision slower than using double-precision dsmentek@hpfcla.fc.hp.com (1994-11-23)
Re: Why is using single-precision slower than using double-precision trobey@taos.arc.unm.edu (1994-11-23)
Re: Why is using single-precision slower than using double-precision kenneta@hubcap.clemson.edu (1994-11-23)
Re: Why is using single-precision slower than using double-precision dik@cwi.nl (1994-11-24)
Re: Why is using single-precision slower than using double-precision davidc@panix.com (David B. Chorlian) (1994-11-24)
Re: Why is using single-precision slower than using double-precision roedy@BIX.com (1994-11-30)
Re: Why is using single-precision slower than using double-precision tgl@netcom.com (1994-11-30)
Re: Why is using single-precision slower than using double-precision hebert@prism.uvsq.fr (1994-11-24)
Re: Why is using single-precision slower than using double-precision dekker@dutiag.twi.tudelft.nl (Rene Dekker) (1994-11-30)
[1 later articles]
| List of all articles for this month |

Newsgroups: comp.parallel,comp.arch,comp.compilers
From: kenneta@hubcap.clemson.edu (Ken Adams)
Status: RO
Followup-To: comp.parallel,comp.arch,comp.compilers
Originator: rmuise@dragon.acadiau.ca
Organization: Clemson University
X-Newsreader: TIN [version 1.2 PL2]
References: <3aqv5k$e27@monalisa.usc.edu>
Date: Wed, 23 Nov 1994 22:25:12 GMT

Zhiwei Xu wrote:
: Can any one explain why a C program using single precision (float) is slower
: that the same code using double precision (double)? Please try the following
: code for computing pi. I have tried it on IBM RS6000/250, IBM SP2, Sun4, and
: Sun SS20, and got the same strange timing.


: On the RS6000 (using PowerPC 601) and AIX, I tried different compiler options,
: such as
: cc -O3 -qarch=ppc


: On the Sun workstations, I tried
: cc -O4 (with or without -fsingle)


: The same thing!


: However, on SP2, reasonable timing is seen after using the -qarch=pwr2 option.


: Many thanks


: Zhiwei Xu, zxu@aloha.usc.edu


: ------------------- C code for computing pi ---------------------
{code deletia}


      I don't know about the others but in particular the POWER architecture
is set up specifically to do double precision at a high rate. In effect
it has to dumb itself down to do single precision.
      Excertped from p. 58 of Weiss and Smith's "POWER and PowerPC" ...


      "...all floating point arithmetic is done in double-precision format.
...programs that use single-precision data are often slower than the
double precision versions because frsp instructions are inserted by the
compiler to convert results to single precision."


      I am not familiar with all of the compiler settings you describe...
I assume that the other architectures approach it the same way (maybe?)
      Thanks for asking a question that I was studying anyway!!!


      BTW if anyone is interested in an OS/2 PM executable for visualizing
instruction flow through the POWER1 pipelines.. I will (hopefully!) have
one done by the end of November (grad arch project).


      Ken Adams
      Clemson University
      Computer Science
      adamsk@cs.clemson.edu









Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.