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 14:54:10 +0000 Message-ID: References: <83vadmgfbz.fsf@gnu.org> <83h8p2g99p.fsf@gnu.org> <87370m3k4y.fsf@gmail.com> <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 1522680814 7575 195.159.176.226 (2 Apr 2018 14:53:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 2 Apr 2018 14:53:34 +0000 (UTC) Cc: Eli Zaretskii , eggert@cs.ucla.edu, emacs-devel@gnu.org, Noam Postavsky , rpluim@gmail.com To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 02 16:53:30 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 1f30pt-0001ry-HG for ged-emacs-devel@m.gmane.org; Mon, 02 Apr 2018 16:53:29 +0200 Original-Received: from localhost ([::1]:40642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f30rx-0000yL-51 for ged-emacs-devel@m.gmane.org; Mon, 02 Apr 2018 10:55:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f30rG-0000wP-Tl for emacs-devel@gnu.org; Mon, 02 Apr 2018 10:54:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f30rG-0006Bv-1c for emacs-devel@gnu.org; Mon, 02 Apr 2018 10:54:54 -0400 Original-Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:35859) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f30rE-00069b-DH; Mon, 02 Apr 2018 10:54:52 -0400 Original-Received: by mail-wm0-x22a.google.com with SMTP id x82so27686220wmg.1; Mon, 02 Apr 2018 07:54:52 -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=zvaF0GTGfPMeZeGEMNceugHttyXGkQwDZf7TQ1K4+ys=; b=AXpzTLa5gFlVx/dYvZGxt1ZvGwYKPWRvUxIWIQ1XX2Rv1r0Sac1ZwKvtzJsxDCGfNc qMWyUXp9j0BwC/jnD+TZsNnto5R6nYkiz7/5hx1VreJ2FDYMKsv50UXtmBUSueXn1wNn P3YmjSyqCXF6654c5+NnRh7njlr5wtduJS4zEPsivrJ1bqT6lXOneLNhGMyh3rYsINdJ a0wvW9+Du9rTbnvRIZkLuITHcg2u6PD/BB9M9vJrxgQ4WDbCX6WeWDPOLTtbX39zziJ9 gUhEmdIdzgmFAiAQnX9FBpb4s1MczZCFSfGAyeg+OsOyiFIK5Vi6wJVRG3YKNlsY04rO RYxg== 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=zvaF0GTGfPMeZeGEMNceugHttyXGkQwDZf7TQ1K4+ys=; b=F2JI8r12Nxai2Qe7kpG2SG5SkslxkLXLSkykoNwBOR1l3m5JCpejtfTpNHkdT07tm+ wKsmsDvjAa8CS6VJQ6W6g6EpGNA2IdZng+lok4GwszJPHYzeV3FiEEUd3a1nagwbGKJq XmAk9+oyPMUCXNIDmmRvjyD3FO/Z9U5M3dhrKtooEfx2DtBHKz88Loxd+Hr/S7RaZVNt ZkLHAE/Qi+zLLzcwpQCW1RANeHVgBK4N+7idAEAhLARdRG6hpf54xqOY6F/ITUNN7/0T PyASp+NgPuh7rrBNsLzvWm7mQe5YvADw/GXT1WjGP2KbUpXhmwgWSQgOK3aEGtRWQ0Ba 6zKw== X-Gm-Message-State: AElRT7E7y159aqVJlfhKyQRfgQccx1PUv28oxkFVPSbb3gbgtWKy8iMq yGqox3UmzpuUZUrp/HK3w1+V1fcXmw1Mx4vglEw= X-Google-Smtp-Source: AIpwx48RSOq9RkCdoQ+P5foIISMTJqX72R9R3HNdlpkSOHBCofvGlHH6tHRBn/ujHOpEsX8I0D7qd/X+nGe/+AMNFS8= X-Received: by 10.80.215.195 with SMTP id m3mr12892437edj.296.1522680891235; Mon, 02 Apr 2018 07:54:51 -0700 (PDT) Original-Received: by 10.80.129.230 with HTTP; Mon, 2 Apr 2018 07:54:10 -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::22a 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:224246 Archived-At: On Mon, Apr 2, 2018 at 1:37 PM, Drew Adams wrote: > Would it be possible for a user or Lisp code to be > able to specify that it does not want the byte compiler > to perform such floating-point optimization, in order > to provide more platform-independence? I think it's slightly different: I think it should be possible to instruct the compiler, in special cases (when building byte code that is to be run on several different machines/Emacs implementations), to perform the optimizations, which result in code that is very slightly more efficient and less platform-dependent (but might break certain long-standing assumptions about independently constructed floats never being eq). It's the unoptimized code that makes it easy to rely on platform-dependent features, and that depends on implementation details in ways that the optimized code does not. > Many uses of Emacs Lisp and C code don't really need > such optimization, I would think. Couldn't the byte > compiler be made to respect a user (or Lisp-code) > choice here? If I understand Eli correctly, there's no way to enable the new option by default, because old code might break in subtle ways; that also makes it questionable whether it's worth it to include the new option at all.