From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Re: Bignum performance Date: Wed, 16 Aug 2023 06:44:20 +0200 Message-ID: References: <87bkfartof.fsf@localhost> <175cf474-29c8-a482-072e-0de784ac59e8@gmail.com> <87o7jaqc31.fsf@localhost> <2d419e12-9239-de3e-47d0-38815a00025f@gmail.com> <87msyth8jh.fsf@dataswamp.org> <871qg4n7n4.fsf@yahoo.com> <87wmxwfk9r.fsf@dataswamp.org> <87leeblqly.fsf@yahoo.com> <87v8dfepil.fsf@dataswamp.org> <874jkzllqq.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="m37VyWZv44GZxDcm" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18117"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 16 06:44:58 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qW8Ow-0004Ug-8k for ged-emacs-devel@m.gmane-mx.org; Wed, 16 Aug 2023 06:44:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW8OQ-0005JD-SY; Wed, 16 Aug 2023 00:44:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qW8OP-0005J5-9y for emacs-devel@gnu.org; Wed, 16 Aug 2023 00:44:25 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qW8ON-00026l-8E for emacs-devel@gnu.org; Wed, 16 Aug 2023 00:44:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=bcSt1ixmDleO6F+AOryeII76LwugEnxTMDF8+qHGC18=; b=oxDPKRAEGYnq1iqBy22ABUUtQ5 c1WQj46+k7I4xEN4ZX+BLHUDRMwVvikFEP9Bm3op6q+CHVaL1eUnsQ5Ze/+a/SL1sY6y1OZkwJPNd K0kGL1nwDHiaIbLomLJW3ft/P7FIOQQIfRQp1mTQHBUNycPm8BxOt77BDSll+zATYC2ZSaCsN3jxt p52MU3nEvvLoultogdTj9i8XdfLhxEmy01XGMT2Fjlsd31xZBuPem8MpFQkYMZynwNiGF/nxUIODg Gfd6p7PqwaL7s3bniTPJ6aKmqxHAl+7aLwE21db/hZdUjobjNj0alyMu+SFb+mCdJS2jSmzYxbcab +eugRGzQ==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1qW8OK-0001oI-UC; Wed, 16 Aug 2023 06:44:20 +0200 Content-Disposition: inline In-Reply-To: <874jkzllqq.fsf@yahoo.com> Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:308792 Archived-At: --m37VyWZv44GZxDcm Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 16, 2023 at 11:17:01AM +0800, Po Lu wrote: > Emanuel Berg writes: >=20 > > Po Lu wrote: [...] > >> Lisp systems normally set aside several of the high or low > >> bits of a register as a tag linking a type to the > >> object represented. > > > > But here we are at the CPU architecture level (register > > length), surely Lisp don't meddle with that? > > > > No, I sense that it is, actually. So please explain, then, how > > it works. And in particular, how many bits do we (Elisp and > > CL) actually have for our fixnums? >=20 > I don't know about SBCL, but as for Emacs, refer to the definition of > VALBITS in lisp.h (maybe also the right files among m/*.h and s/*.h, but > I have no idea where they've disappeared to.) That is what I was hinting at with "tagged representation": Emacs Lisp does it, we don't know about SBCL. Typically, a good implementation has small stretches of code where the values are as-is because the compiler can prove what their type is (fixnum, whatever). But that means that fixnums are usually limited to less than the full machine word's width (e.g. 60 bits if your tag is four bits wide), because your lisp has to be able to stuff them back into such a place. Cheers --=20 t --m37VyWZv44GZxDcm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZNxUJAAKCRAFyCz1etHa RmSNAJ4jati+brH/8S3YyUuqBtu/a+gobgCeIcHSS09BPNxCCWtOZrsHpIl3zMI= =owyQ -----END PGP SIGNATURE----- --m37VyWZv44GZxDcm--