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: Sat, 24 Mar 2018 09:25:36 +0300 Message-ID: <83vadmgfbz.fsf@gnu.org> References: <2ce39e5c-cd1b-65d6-b125-719caad67932@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1521872655 7165 195.159.176.226 (24 Mar 2018 06:24:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 24 Mar 2018 06:24:15 +0000 (UTC) Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 24 07:24:11 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 1ezcb4-0001m3-68 for ged-emacs-devel@m.gmane.org; Sat, 24 Mar 2018 07:24:10 +0100 Original-Received: from localhost ([::1]:41398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezcd7-0004NS-Fa for ged-emacs-devel@m.gmane.org; Sat, 24 Mar 2018 02:26:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezccS-0004NH-UA for emacs-devel@gnu.org; Sat, 24 Mar 2018 02:25:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezccP-0008IE-RG for emacs-devel@gnu.org; Sat, 24 Mar 2018 02:25:36 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezccP-0008Hn-N6; Sat, 24 Mar 2018 02:25:33 -0400 Original-Received: from [176.228.60.248] (port=3519 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ezccO-0005fs-Rx; Sat, 24 Mar 2018 02:25:33 -0400 In-reply-to: (message from Pip Cet on Fri, 23 Mar 2018 20:52:52 +0000) 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:223979 Archived-At: > From: Pip Cet > Date: Fri, 23 Mar 2018 20:52:52 +0000 > Cc: Emacs development discussions > > Is this really specific to floating-point expressions, though? > > (byte-compile (lambda (x) (* #x10000 #x10000 #x10000 #x10000))) > #[(x) "À\207" [0] 1] > > (at least on this somewhat oudated version of Emacs). Note the 0 in > the constant vector, which hardcodes the <65-bit-ness of fixnums. > > I imagine that on a 32-bit version of emacs, (byte-compile (lambda (x) > (* #x10000 #x10000))) similarly produces a constant-zero function, The result depends on whether Emacs was build --with-wide-int. If it was, the result is #[(x) "\300\207" [4294967296] 1], if it wasn't, I get #[(x) "\300\207" [0] 1].