GNU bug report logs - #42147
28.0.50; pure vs side-effect-free, missing optimizations?

Previous Next

Package: emacs;

Reported by: Andrea Corallo <andrea_corallo <at> yahoo.it>

Date: Tue, 30 Jun 2020 22:28:02 UTC

Severity: normal

Found in version 28.0.50

Done: Mattias EngdegÄrd <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


Message #140 received at 42147 <at> debbugs.gnu.org (full text, mbox):

From: Pip Cet <pipcet <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: mattiase <at> acm.org, Paul Eggert <eggert <at> cs.ucla.edu>, andrea_corallo <at> yahoo.it,
 42147 <at> debbugs.gnu.org
Subject: Re: bug#42147: 28.0.50;
 pure vs side-effect-free, missing optimizations?
Date: Sat, 4 Jul 2020 22:25:55 +0000
On Sat, Jul 4, 2020 at 9:05 PM Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
> > So it's a GCC bug? Wouldn't it be better to fix that?
>
> Not really, no: the x87 hardware makes it difficult to get the exact
> behavior of 64bit floats, so either you live with "almost" the right
> behavior or you don't use the x87 hardware (which on pre-SSE2 hardware
> implies a massive slow down on floating point operations).

Precisely. Those are the two options GCC should offer, instead of (or
in addition to) three degrees of wrongness. This is obsolete hardware
which does not, apparently, provide any support for adding two IEEE
754 64-bit floats. Pretending it does is not helpful and, at the very
least, a bug in the documentation.

> >> Several GNU/Linux distributions have already dropped support for x86-only
> >> hardware like the circa-2001 Intel Mobile Pentium III-M in your laptop. On the
> >> distributions that still support i686, you can still build and run Emacs on your
> >> laptop (which has SSE but not SSE2) by configuring with CFLAGS='-msse
> >> -mfpmath=sse -fexcess-precision=standard'; this should avoid some (but not all)
> >> of the rounding problems.

FWIW, that doesn't seem to have any effect here, it just uses x87 instructions.

> If I need to change the flags, then I'm much more likely to just use the
> "normal" compilation option: I actually couldn't care less about the
> potential differences in rounding.
>
> I'm actually not completely sure why we care about those minor
> rounding differences.

Neither am I. If the idea is to standardize Emacs on a single
floating-point representation, let's at least use the 61-bit floats
Paul suggested a while back? (Incidentally, I believe those can be
implemented somewhat more efficiently on x87 hardware). Or we could go
with bignum ratios or GMP floats.




This bug report was last modified 4 years and 282 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.