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 10:56:25 +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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1522666512 7385 195.159.176.226 (2 Apr 2018 10:55:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 2 Apr 2018 10:55:12 +0000 (UTC) Cc: Robert Pluim , emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 02 12:55:07 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 1f2x7D-0001m7-5u for ged-emacs-devel@m.gmane.org; Mon, 02 Apr 2018 12:55:07 +0200 Original-Received: from localhost ([::1]:52544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2x9G-0002ma-Tg for ged-emacs-devel@m.gmane.org; Mon, 02 Apr 2018 06:57:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2x9A-0002m3-FE for emacs-devel@gnu.org; Mon, 02 Apr 2018 06:57:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f2x99-0000tL-Km for emacs-devel@gnu.org; Mon, 02 Apr 2018 06:57:08 -0400 Original-Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:56172) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f2x99-0000rl-EA for emacs-devel@gnu.org; Mon, 02 Apr 2018 06:57:07 -0400 Original-Received: by mail-wm0-x230.google.com with SMTP id b127so23781012wmf.5 for ; Mon, 02 Apr 2018 03:57:06 -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=wkUaUKTVGLIZ2TlF9FKFWVDf4GfYd4Hxtxm2UfJDXyQ=; b=KYJufJfSweEaodOFlpMKpnqSTKnvwSK5fBC4b7s+OqV5mA2GfjZV5BtmvpiYUmFxWH 9J/Ua6TiXecvzAToS1WjCp4zcGPqaKbTIzPUI82FJwcw9xLJFOtYB2JvKYCHfe1ukA+n 3DA8WSaOndBsPv8yw8GOyaM/NQuV0L7G7hBy2qonWc1N1GPGW1AGjiF/qpH6oQmIww9p T/r4B/oRnjSCft/bPWSY+n09lgnbWsxEUEeSt6IuR91CO0vk82NjdsjgXf5RQCn1hoMF QSpth1cvpSh02jrgvDKBpr1Pnj5mXNhAk0AeOfLbPzA8eMarYlp0l0GwdTKfb05sJrci AI7A== 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=wkUaUKTVGLIZ2TlF9FKFWVDf4GfYd4Hxtxm2UfJDXyQ=; b=fFLyOaMnbpOO0M2IQ9ZdQXsKnYnM3AYMH2+pNJYICI9I3gcymtIS7MO8CSOBjs2heh QOM+aMbrXbDx+8IKonUp9d0Wwzdshig3j4edmJXf7mXmrGm6DOBqQI/SUYiwIEMxqLkK eLlRuz1c95E/xbQrb8j7OXmotLDUx3pLEkk9baC0xvrj3vzUrH1XrYdfCVrJbXguE37o SzLZyZmq0HFOa72H7afixJf1QEsJ/1SMPBd8s+M+Lv8KfbwaZkkbdiQkrgb5WZIL5bqx 9H+wJH90Drwo+DoUAIK3RvfKjsW5eAl4GAVh6jNQbT9EllC5HfDOVwV2+jp4k9rMOv+5 CA0g== X-Gm-Message-State: AElRT7H+qI63li4INf4y0z5FW4s8XugVtdXqZdtn4A0Kcws/LGpUcOnd J3WyGzAjVZRkSU6QvFU9lVZlXD8t6nfpdMqTK4Y= X-Google-Smtp-Source: AIpwx492x7ebEvNcNJ7+0FgK04QJq0cImmVkXcZ7wL/cHMt6F+x8yePxKFvYH88K42rU5RvS2JROmvBGy/1v3Wpv5Gs= X-Received: by 10.80.151.151 with SMTP id e23mr12166224edb.51.1522666625905; Mon, 02 Apr 2018 03:57:05 -0700 (PDT) Original-Received: by 10.80.129.230 with HTTP; Mon, 2 Apr 2018 03:56:25 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::230 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:224233 Archived-At: I believe the currently-documented behavior is that it's undefined; however, merely leaving it undefined doesn't make bytecode compilation reproducible. To do that, right now, I redefine EQ to be true for same-value floats. I'd prefer the byte compiler to be fixed (unfortunately, flet-binding eq around the invocation of the byte compiler isn't an option since byte-compiled code won't let you redefine eq), but there appear to be several places where the assumption is built into it, and I haven't found them all. The half-fixed compiler generates obviously-suboptimal bytecode sequences like "const X; const X;". I think it makes sense to say that bytecode should be portable but not necessarily identical between implementations, provided there's also a way to canonicalize bytecode generation so the result is actually target-independent (in the sense that if there are still bytecode differences between targets, that's a bug in the Lisp code); I hope redefining EQ is sufficient for that.