From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: Floating-point constant folding in Emacs byte compiler Date: Mon, 2 Apr 2018 11:42:59 +0000 Message-ID: References: <2ce39e5c-cd1b-65d6-b125-719caad67932@cs.ucla.edu> <83vadmgfbz.fsf@gnu.org> <87d0zr2n1u.fsf@gmail.com> <83h8p2g99p.fsf@gnu.org> <87370m3k4y.fsf@gmail.com> <838taeg6z5.fsf@gnu.org> <7a49cbdf-f2c3-0803-2ee8-3d9f55e405a5@cs.ucla.edu> <7a4f10ec-c1b9-953d-7a95-b2f1ff762735@cs.ucla.edu> <83370d7szw.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1522669349 8911 195.159.176.226 (2 Apr 2018 11:42:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 2 Apr 2018 11:42:29 +0000 (UTC) Cc: rpluim@gmail.com, eggert@cs.ucla.edu, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 02 13:42:25 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2xqy-0002CW-7d for ged-emacs-devel@m.gmane.org; Mon, 02 Apr 2018 13:42:24 +0200 Original-Received: from localhost ([::1]:55840 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2xt2-0002Ey-1X for ged-emacs-devel@m.gmane.org; Mon, 02 Apr 2018 07:44:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2xsG-0002DA-2k for emacs-devel@gnu.org; Mon, 02 Apr 2018 07:43:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f2xsF-0000bA-CO for emacs-devel@gnu.org; Mon, 02 Apr 2018 07:43:44 -0400 Original-Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:53444) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f2xsD-0000Zd-Tf; Mon, 02 Apr 2018 07:43:42 -0400 Original-Received: by mail-wm0-x244.google.com with SMTP id p9so24730985wmc.3; Mon, 02 Apr 2018 04:43:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=oYpnKDxSWft6u28wc2zeJ6YVxInTwgJernSk9SxY6Ts=; b=aBiDCxxCO5fP4p9IxTm40QIh5lr9gVt1Kn65tVLzYrO+ZB/CBAR49R18t7tm9Is8+W vtS32bMvjmtFEEOuflAn6AWgygchCGSCFTCBQpSXbzewd0ns5agEkUpZ/BXILHR+0I73 2SraYyeAxiHcmz3cT8ujQtEdZ2IINdGQ/MPnI8le9cvlr3r/geOjXDN46HIKuXE+nzeU p9azeRuDCYBnrGn9e0MX42WQYQhJXqvoSLsXE5hOibLZmajbnoLQUty2BoQRCoxxoZXz K9kusjh7bkdGJ4XephJYJwMF+a45dDdkgwOf4kYhlEDEHPCPmRqC7+ha+Hf7r/3/8q8X GRKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=oYpnKDxSWft6u28wc2zeJ6YVxInTwgJernSk9SxY6Ts=; b=Hj+KO0+4uUHMFN4HQAP5OOwqhjz7y05y073yiKSSd/qWmK1pcHVJL2lmr6tqLXEkVt 6twGZMyazV5osM+RiqzX7p3WqRfwMdfEbIpzcxlEu53kAIgMuT3krJ4bmD7vsJK/VaTB ehPrMgKoMgbi8TqHqM1BS+6Ce5D3tw+adEFBleX6BDWtgjiVVXbO3Cc+yuyBzjtfs4yv mwnkZhU1FEEqL72RrxdXCqShzmB2RHHw1ehlQTCK2JmdBoLN3iUNzV0CwAIBJ/fZqylF 9EIpNdhrq8H11aeOXoH7C0N/oBBYc+osVxiPVF9KRhUXkhP3lM2z3ifLbBDmpDI6AgwA q21Q== X-Gm-Message-State: AElRT7FI9R+yzV70suogrRXjiFXlZks2TMQjbLXRqpxgU6qynU6B4drT DKHuvfTHA7C8d6L8zVWjfk4pkVSscWL63Ydp6w4= X-Google-Smtp-Source: AIpwx4/xnOWCBvH6pONJPB6kvoPsgfQlPj7eZpeejxrIkRn7FQYIWRhZMWwMmvUMCW5ICvXAH+issJggxkc90bcLHbk= X-Received: by 10.80.215.195 with SMTP id m3mr12368343edj.296.1522669420378; Mon, 02 Apr 2018 04:43:40 -0700 (PDT) Original-Received: by 10.80.129.230 with HTTP; Mon, 2 Apr 2018 04:42:59 -0700 (PDT) In-Reply-To: <83370d7szw.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:224235 Archived-At: 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.