Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #1011

Re: Compiler optimization and floating point operations

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news.misty.com!news.iecc.com!.POSTED!nerds-end
From glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups comp.compilers
Subject Re: Compiler optimization and floating point operations
Date Thu, 24 Oct 2013 02:56:06 +0000 (UTC)
Organization Aioe.org NNTP Server
Lines 36
Sender johnl@iecc.com
Approved comp.compilers@iecc.com
Message-ID <13-10-028@comp.compilers> (permalink)
References <13-10-026@comp.compilers>
NNTP-Posting-Host news.iecc.com
X-Trace leila.iecc.com 1382619369 51459 64.57.183.58 (24 Oct 2013 12:56:09 GMT)
X-Complaints-To abuse@iecc.com
NNTP-Posting-Date Thu, 24 Oct 2013 12:56:09 +0000 (UTC)
Keywords arithmetic, optimize
Posted-Date 24 Oct 2013 08:56:09 EDT
X-submission-address compilers@iecc.com
X-moderator-address compilers-request@iecc.com
X-FAQ-and-archives http://compilers.iecc.com
Xref csiph.com comp.compilers:1011

Show key headers only | View raw


Abid <abidmuslim@gmail.com> wrote:

(snip)
> Does back end compiler optimizations affect the floating point
> accuracy? Is there any research work in this area?

As far as I know, the biggest cause of problems with optimization
is the extended precision of the registers in the Intel x87.

The original design of the 8087 was for a virtual stack that would
spill on overflow, and (what is the opposite of spill?) on underflow.

Not until the hardware was ready did anyone try to write the interrupt
routine to handle it, and it turned out not to be possible.  The
required state information was either not available, could not be
restored, or both.

Compilers could write temporary intermediates to memory in temporary
real format, but that is rare.

Next comes the complication of optimization. Common subexpression
elimination between statements, or in general keeping values in
registers, means that some values will retain extra precision, but you
(the programmer) don't know which ones. Even if you assign to a
variable and reload, the optimizer might keep it in a register.  (Many
compilers have an option to force the store, but that can slow things
down.)

I don't know about the research that might be done. The x87 has an
eight element stack. Research won't change that, though the use of SSE
avoids the problem (and advantage) of extended precision.

The technology for doing optimization is reasonably well understood.
Knowing which ones you should do it a different problem.

-- glen

Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Compiler optimization and floating point operations Abid <abidmuslim@gmail.com> - 2013-10-23 13:47 -0700
  Re: Compiler optimization and floating point operations Cameron McInally <cameron.mcinally@nyu.edu> - 2013-10-23 22:55 -0400
  Re: Compiler optimization and floating point operations glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-10-24 02:56 +0000
  Re: Compiler optimization and floating point operations George Neuner <gneuner2@comcast.net> - 2013-10-24 07:41 -0400
    Re: Compiler optimization and floating point operations Jean-Marc Bourguet <jm@bourguet.org> - 2013-10-24 15:51 +0200
    Re: Compiler optimization and floating point operations "Steven G. Kargl" <sgk@troutmask.apl.washington.edu> - 2013-10-24 16:38 +0000
      Re: Compiler optimization and floating point operations christian.bau@cbau.wanadoo.co.uk - 2013-10-28 15:54 -0700
    Re: Compiler optimization and floating point operations George Neuner <gneuner2@comcast.net> - 2013-10-24 15:51 -0400
    Re: Compiler optimization and floating point operations glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-10-24 20:21 +0000
    Re: Compiler optimization and floating point operations christian.bau@cbau.wanadoo.co.uk - 2013-10-28 15:50 -0700
      Re: Compiler optimization and floating point operations Cameron McInally <cameron.mcinally@nyu.edu> - 2013-10-28 20:41 -0400

csiph-web