From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Floating-point constant folding in Emacs byte compiler Date: Fri, 23 Mar 2018 11:24:35 +0300 Message-ID: <83h8p7i4ho.fsf@gnu.org> References: <2ce39e5c-cd1b-65d6-b125-719caad67932@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1521793388 14931 195.159.176.226 (23 Mar 2018 08:23:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 23 Mar 2018 08:23:08 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 23 09:23:04 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 1ezHyY-0003mK-Pv for ged-emacs-devel@m.gmane.org; Fri, 23 Mar 2018 09:23:02 +0100 Original-Received: from localhost ([::1]:36544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezI0c-0004KQ-7D for ged-emacs-devel@m.gmane.org; Fri, 23 Mar 2018 04:25:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezI05-0004KE-Cb for emacs-devel@gnu.org; Fri, 23 Mar 2018 04:24:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezI02-0000rJ-63 for emacs-devel@gnu.org; Fri, 23 Mar 2018 04:24:37 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38171) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezI02-0000rF-24; Fri, 23 Mar 2018 04:24:34 -0400 Original-Received: from [176.228.60.248] (port=1540 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ezI01-0003uQ-De; Fri, 23 Mar 2018 04:24:33 -0400 In-reply-to: (message from Paul Eggert on Thu, 22 Mar 2018 22:22:25 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:223941 Archived-At: > From: Paul Eggert > Date: Thu, 22 Mar 2018 22:22:25 -0700 > > Nowadays Emacs hosts almost invariably use IEEE floating point, and I suppose we > could hardwire that assumption into Emacs. Even so, IEEE floating-point is not > bit-for-bit identical on all platforms, so if we're constant-folding > floating-point expressions surely we should at least document that we're doing > so, so that programmers know that they can't rely on constant expressions > yielding a different value than what run-time evaluation would deliver. I think we should strive to leave the byte code platform-independent. If nothing else, it will make sure the *.elc files in a release tarball can be used on all supported platforms with identical results. Otherwise, we will need to byte-compile files at build time, something that will make the build much longer than it should be.