[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Floating-point constant folding in Emacs byte compiler

From: Pip Cet
Subject: Re: Floating-point constant folding in Emacs byte compiler
Date: Mon, 2 Apr 2018 11:42:59 +0000

I'm trying to make bytecode reproducible for my code, which uses
SpiderMonkey's JS::Value type, and in which two same-value floats are
always equal (because their bit representations are), and standard
Emacs on a standard GNU/Linux machine, where, as I've just learned,
two same-value floats are never eq (I'd previously thought that was
undefined, and actually unpredictable in practice).

Finding subtle problems in C code that assumes floats are never EQ
would be one reason why I'm doing this, to understand and hopefully
one day find bugs in the Emacs code base.

Again, this is the first time I hear that "two floats are never EQ" is
actually intentional behavior that some code might rely on, rather
than a mere accident of the current float implementation. Do you
happen to have any examples at hand for code that relies on this?

In the case of byte code, what I've seen so far is that the code
generated is actually suboptimal, and runs fine without duplicated
float constants in the constants vector.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]