diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-03-23 12:57:39 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2018-03-23 12:59:18 -0700 |
commit | 42e7e267e5487f60f4d72e1b5c5cba001ba4d704 (patch) | |
tree | 8c44c5c43eb779d4478b45b66095e94000b78032 /lisp/emacs-lisp/float-sup.el | |
parent | d0881374734310eb77526823c0acad1fe556f41b (diff) | |
download | emacs-42e7e267e5487f60f4d72e1b5c5cba001ba4d704.tar.gz emacs-42e7e267e5487f60f4d72e1b5c5cba001ba4d704.tar.bz2 emacs-42e7e267e5487f60f4d72e1b5c5cba001ba4d704.zip |
Avoid Fortran-style floating-point optimization
When optimizing arithmetic operations, avoid optimizations that
are valid for mathematical numbers but invalid for floating-point.
For example, do not optimize (+ 1 v 0.5) to (+ v 1.5), as they may
not be the same due to rounding errors. In general,
floating-point numbers cannot be constant-folded, since that would
make .elc files platform-dependent.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-associative-math):
Do not optimize floats.
(byte-optimize-nonassociative-math, byte-optimize-approx-equal)
(byte-optimize-delay-constants-math, byte-compile-butlast)
(byte-optimize-logmumble):
Remove; no longer used.
(byte-optimize-minus): Do not optimize (- 0 x) to (- x).
(byte-optimize-multiply): Do not optimize (* -1 x) to (- x).
(byte-optimize-divide): Do not optimize (/ x -1) to (- x).
(logand, logior, logxor): Optimize with byte-optimize-predicate
instead of with byte-optimize-logmumble.
* test/lisp/emacs-lisp/bytecomp-tests.el:
(byte-opt-testsuite-arith-data): Add a couple of test cases.
Diffstat (limited to 'lisp/emacs-lisp/float-sup.el')
0 files changed, 0 insertions, 0 deletions