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

scott@cs.arizona.edu (Scott E Gilbert)
Wed, 23 Nov 1994 21:57:36 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)
[9 later articles]
| List of all articles for this month |
Newsgroups: comp.parallel,comp.arch,comp.compilers
From: scott@cs.arizona.edu (Scott E Gilbert)
Status: R
Originator: rmuise@dragon.acadiau.ca
Organization: University of Arizona CS Department, Tucson AZ
References: <3aqv5k$e27@monalisa.usc.edu>
Date: Wed, 23 Nov 1994 21:57:36 GMT

In article <3aqv5k$e27@monalisa.usc.edu>,
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.
>


Without looking too closely at your code, I'll say that in "many" platforms
floats are stored as single precision but are converted to doubles when the
actual operations are performed. Thus there are extra steps involved
converting the float to a double and back before and after operations. You
could probably look at the assembly generated and see if this is what is
really happening.


--
Scott Gilbert ( scott@cs.arizona.edu )







Post a followup to this message

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