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

dsmentek@hpfcla.fc.hp.com (Dave Smentek)
Wed, 23 Nov 1994 22:23:06 GMT

          From comp.compilers

Related articles
[3 earlier articles]
Re: Why is using single-precision slower than using double-precision scott@cs.arizona.edu (1994-11-23)
Re: Why is using single-precision slower than using double-precision joelw@convex.convex.com (1994-11-23)
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)
[3 later articles]
| List of all articles for this month |

Newsgroups: comp.parallel,comp.arch,comp.compilers
From: dsmentek@hpfcla.fc.hp.com (Dave Smentek)
Status: RO
Followup-To: comp.parallel,comp.arch,comp.compilers
Originator: rmuise@dragon.acadiau.ca
Organization: Hewlett-Packard Fort Collins Site
X-Newsreader: TIN [version 1.2 PL2]
References: <3aqv5k$e27@monalisa.usc.edu>
Date: Wed, 23 Nov 1994 22:23:06 GMT

Zhiwei Xu (zxu@monalisa.usc.edu) 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.


... lots of stuff deleted....


The C language is defined to do all floating point operations in the highest
available precision of the machine (regardless of the original data
precision). An operation on 2 single precision operands, producing a
single precision result, gets compiled as:


2 floating point converts from single to double
a double precision FLOP
a floating point convert from double to single


Double precision computations don't have the 3 converts, so they execute in
fewer cycles.


dave







Post a followup to this message

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