summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/trace.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-03-23 12:57:39 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2018-03-23 12:59:18 -0700
commit42e7e267e5487f60f4d72e1b5c5cba001ba4d704 (patch)
tree8c44c5c43eb779d4478b45b66095e94000b78032 /lisp/emacs-lisp/trace.el
parentd0881374734310eb77526823c0acad1fe556f41b (diff)
downloademacs-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/trace.el')
0 files changed, 0 insertions, 0 deletions