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: bignum branch Date: Sun, 15 Jul 2018 18:01:55 +0300 Message-ID: <83d0voa6fw.fsf@gnu.org> References: <87o9fbbw1t.fsf@tromey.com> <86in5jdj49.fsf@gmail.com> <83wotxaiwi.fsf@gnu.org> <86k1pxmvmx.fsf@gmail.com> <87efg4a9xc.fsf@tromey.com> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1531666834 18366 195.159.176.226 (15 Jul 2018 15:00:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 15 Jul 2018 15:00:34 +0000 (UTC) Cc: andrewjmoreton@gmail.com, emacs-devel@gnu.org To: Tom Tromey Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 15 17:00: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 1feiVi-0004gi-58 for ged-emacs-devel@m.gmane.org; Sun, 15 Jul 2018 17:00:30 +0200 Original-Received: from localhost ([::1]:45847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1feiXm-00005u-7Y for ged-emacs-devel@m.gmane.org; Sun, 15 Jul 2018 11:02:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1feiX0-0008UT-0p for emacs-devel@gnu.org; Sun, 15 Jul 2018 11:01:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1feiWz-0006aN-AC for emacs-devel@gnu.org; Sun, 15 Jul 2018 11:01:50 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58014) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1feiWz-0006aA-60; Sun, 15 Jul 2018 11:01:49 -0400 Original-Received: from [176.228.60.248] (port=1083 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1feiWy-00029u-IU; Sun, 15 Jul 2018 11:01:48 -0400 In-reply-to: <87efg4a9xc.fsf@tromey.com> (message from Tom Tromey on Sun, 15 Jul 2018 07:46:39 -0600) 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:227430 Archived-At: > From: Tom Tromey > Date: Sun, 15 Jul 2018 07:46:39 -0600 > Cc: emacs-devel@gnu.org > > Andy> b) Use 64bit long long for EMACS_INT, and do extra work to pass native > Andy> values into GMP in two halves, i.e. something like: > Andy> EMACS_INT i; > Andy> mpz_t val, tmp; > Andy> mpz_init_set_si(val, (i >> 32)); > Andy> mpz_mul_2exp(val, val, 32); > Andy> mpz_init_set_si(tmp, (i & 0xffffffff); > Andy> void mpz_ior(val, val, tmp); > Andy> mpz_clear(tmp); > > I was thinking this is what I' have emacs do when > sizeof(EMACS_INT) > sizeof(long). Yes, we need such wrappers in those cases. Another use case is a 32-bit build --with-wide-int. Thanks.