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: Making 'eq' == 'eql' in bignum branch Date: Fri, 10 Aug 2018 11:12:43 +0000 Message-ID: References: <29f933ac-a6bf-8742-66a7-0a9d6d3e5a88@disroot.org> <8e0320d9-e0d0-2b57-57cc-2df4399f133c@cs.ucla.edu> <87lgaio7xd.fsf@tromey.com> <877em1cb0i.fsf@tromey.com> <765767b2-d2e5-a9a6-f724-d58ecf4847bb@cs.ucla.edu> <76081b5d-8c10-0a37-2c97-d4864c0faa80@cs.ucla.edu> <09153aed-361d-4f82-d9ac-b502314769ae@cs.ucla.edu> <83600yt8ih.fsf@gnu.org> <83h8kgpnir.fsf@gnu.org> <7dd71d44-69bc-3adf-576b-8b9e31184a24@cs.ucla.edu> <83d0v4p1si.fsf@gnu.org> <827beb76-3adf-f2f9-33b1-1baee55680cd@cs.ucla.edu> <83wotbo04h.fsf@gnu.org> <77d5f8b0-2277-b28e-8565-d3e00c411795@cs.ucla.edu> <83ftzyocry.fsf@gnu.org> <837elao4bo.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 1533899486 27976 195.159.176.226 (10 Aug 2018 11:11:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 10 Aug 2018 11:11:26 +0000 (UTC) Cc: eliz@gnu.org, Stefan Monnier , emacs-devel@gnu.org To: eggert@cs.ucla.edu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 10 13:11:22 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 1fo5KD-0007AN-TF for ged-emacs-devel@m.gmane.org; Fri, 10 Aug 2018 13:11:22 +0200 Original-Received: from localhost ([::1]:55488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fo5MK-00052G-GH for ged-emacs-devel@m.gmane.org; Fri, 10 Aug 2018 07:13:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fo5MD-000524-Ou for emacs-devel@gnu.org; Fri, 10 Aug 2018 07:13:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fo5MC-0000Z2-Rl for emacs-devel@gnu.org; Fri, 10 Aug 2018 07:13:25 -0400 Original-Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]:42775) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fo5MB-0000Vu-89; Fri, 10 Aug 2018 07:13:23 -0400 Original-Received: by mail-lj1-x231.google.com with SMTP id f1-v6so6863942ljc.9; Fri, 10 Aug 2018 04:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7oeh5Eb11WSb3iHe34x3RVRGRsnv3edrbTefYnc6PqE=; b=Yeel3dTY0dlQgxQWq0rVnGTOPDlbr9iRuvR3Y5oC3XXOBgCzz7v00AexJJw4feuG1r MOT0QgugXozUY35qIFkA21J4rJ3k7DRejwTC47d6umZvD+vd3xLQY0/4CNCVOWYnmAOt MXeo6My2O87QdNZQGwsr5lohcY/soTTVS5mZlup0zUhDgzGiVuV9fnZHziMrs3xiARY1 PU5MrkelprsLacZ5ozY4Zxv9WDRd3wM8ANDiiXBw0BnVD8COHv2+qL+l+YABW2goXu1+ JnY/BEmmrrTEfu0AMB6C21nyb8D4qofMkVovW+coXs2iRQYQgdBla2zZMZ0A/5rsODE7 L2vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7oeh5Eb11WSb3iHe34x3RVRGRsnv3edrbTefYnc6PqE=; b=G26E04Va9dWv6lIzNG/mWCvT/e+v4CQMK3EzVGs01yLC3bQt9L3duy9bX9BCMFKLJ5 kMxeMwEYZlKG/5NTrhbQgH9XMD3SXkzTLiwWO4xAmTsAdtVGqXztcZX2/uhhF6eFFMo5 y8WFY8IwY9dAEH+wsHlIBh5y8sva1ArjIcB3xrd5oIZ+1odZ+hNLvMVCCeXGKFY3408Z np7qIT5vOQgbSKruM7IRLWEBpHqnRldVP5bl0uhQ4ouzzeGtvoHlRReb57vnOUOr2+9a kg5E3gPxPZdWm5A2pY43Umkxd73nmdsUXMRHzAEk5BfmKzQ+oSMRWTPZe1Ltbo04lMeC gPRQ== X-Gm-Message-State: AOUpUlExNJPwd3I8bsgrFzVSe6Ms09M9ROF7KA1Zthp9sNsoV9IKBAzg ABA3RoDiCSzWJRHLxYIWtTDzKZG06TT5AjgMsNk= X-Google-Smtp-Source: AA+uWPy42ndo5I+JuU1GPCHhHjVMx7ClRppFSUC440m9nAnHuhCXxCIhxqyO7owf4HVOpnMcFcQ7SzwliJrHouYyZ9I= X-Received: by 2002:a2e:259:: with SMTP id 86-v6mr4700867ljc.107.1533899601625; Fri, 10 Aug 2018 04:13:21 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::231 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:228360 Archived-At: That sounds promising! However, I wonder whether NaN-boxing isn't the right thing to do once we have bignums (on platforms that support it, by limiting pointers to 48 bits like x86-64 does). I'm doing that in my experimental code, and the only real disadvantage is Qnil is no longer an all-zeroes pattern. I believe that's true for 61-bit float "immediates" as well, though, because they need the all-zero tag bits. (My current code is limited to 32-bit integers, which causes some other problems, but hopefully those will go away once bignum support is merged in.) I also wonder how many of the non-immediate floats are infinities, or other numbers that have all low-order mantissa bits set. We could catch that by using two tags for floats, one for the all-zero case and one for the all-ones case. Note that NaN-boxing doesn't necessarily mean we treat integers as floating-point values; integers get NaN-boxed, too, so floatp remains meaningful for those places in our codebase that treat their fixnum arguments differently from floats.