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

bevan@cs.man.ac.uk (Stephen J Bevan)
Wed, 23 Nov 1994 22:08:55 GMT

          From comp.compilers

Related articles
Why is using single-precision slower than using double-precision zxu@monalisa.usc.edu (1994-11-23)
Re: Why is using single-precision slower than using double-precision weaver@weitek.COM (1994-11-23)
Re: Why is using single-precision slower than using double-precision meissner@osf.org (1994-11-23)
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)
[6 later articles]
| List of all articles for this month |

Newsgroups: comp.parallel,comp.arch,comp.compilers
From: bevan@cs.man.ac.uk (Stephen J Bevan)
In-Reply-To: zxu@monalisa.usc.edu's message of Wed, 23 Nov 1994 00:38:40 GMT
Status: RO
Originator: rmuise@dragon.acadiau.ca
Organization: Department of Computer Science; University of Manchester
References: <3aqv5k$e27@monalisa.usc.edu>
Date: Wed, 23 Nov 1994 22:08:55 GMT

In article <3aqv5k$e27@monalisa.usc.edu> zxu@monalisa.usc.edu (Zhiwei Xu) writes:
      Can any one explain why a C program using single precision (float) is slower
      that the same code using double precision (double)?
      [ program deleted ]


Using gcc (2.5.8) on a SPARC most of the arithmetic in the critical
loop appears to be done in double precision independent of whether you
declare the variables as float or double. Declaring the variables as
float means that a bunch of extra single-to-double and
double-to-single instructions are inserted which obviously slows down
the loop. If you add -fshort-double to the compiler options, it
appears to do the arithmetic in single precision.







Post a followup to this message

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