From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Change module interface to no longer use GMP objects directly. Date: Mon, 09 Dec 2019 05:26:56 +0200 Message-ID: <83wob6ch6n.fsf@gnu.org> References: <20191117183828.82379-1-phst@google.com> <089f3d06-e227-27da-c8fe-afcbbbbc934a@cs.ucla.edu> <10cefdff-38ce-438b-881d-15d2fe816a8b@cs.ucla.edu> <3d727645-911e-fc71-1f86-364aa82d06ba@cs.ucla.edu> <287b5f71-75eb-bae2-4f6e-01cce6f07b02@cs.ucla.edu> <87sgmdmxn9.fsf@hase.home> <3479c610-17b7-579c-8109-f7f5d237dcc2@cs.ucla.edu> <83k17aj0je.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="227058"; mail-complaints-to="usenet@blaine.gmane.org" Cc: phst@google.com, eggert@cs.ucla.edu, schwab@linux-m68k.org, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 09 04:27:22 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ie9hh-000wxM-Ml for ged-emacs-devel@m.gmane.org; Mon, 09 Dec 2019 04:27:21 +0100 Original-Received: from localhost ([::1]:35526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ie9hg-0005dV-HY for ged-emacs-devel@m.gmane.org; Sun, 08 Dec 2019 22:27:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48021) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ie9ha-0005dL-G9 for emacs-devel@gnu.org; Sun, 08 Dec 2019 22:27:15 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ie9hZ-0004xv-9V; Sun, 08 Dec 2019 22:27:13 -0500 Original-Received: from [176.228.60.248] (port=1563 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ie9hY-0005Z1-6A; Sun, 08 Dec 2019 22:27:12 -0500 In-reply-to: (message from Philipp Stephani on Sun, 8 Dec 2019 21:28:12 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:243251 Archived-At: > From: Philipp Stephani > Date: Sun, 8 Dec 2019 21:28:12 +0100 > Cc: Paul Eggert , Philipp Stephani , > Andreas Schwab , Stefan Monnier , > Emacs developers > > Am Do., 5. Dez. 2019 um 15:43 Uhr schrieb Eli Zaretskii : > > > > However, this: > > > > #if ULONG_MAX == 0xFFFFFFFF > > typedef unsigned long long emacs_limb_t; > > # define EMACS_LIMB_MAX ULLONG_MAX > > #else > > typedef unsigned long emacs_limb_t; > > # define EMACS_LIMB_MAX ULONG_MAX > > #endif > > > > seems to punish every 32-bit build of Emacs (and on MS-Windows even > > the 64-bit builds, AFAIU). Is there a reason for doing this? Testing > > for the native size of an 'unsigned long' data type is not > > significantly more complicated than the above, and GMP goes with that > > when it determines the type of mp_limb_t, AFAIK. > > Not quite sure I understand. In what way does this selection punish > 32-bit builds? It makes emacs_limb_t be a 64-bit type, whereas mp_limb_t is a 32-bit type in that case, and that makes the interface less efficient, because GMP is optimized for the case where they match. > Also the code already effectively tests the native size of unsigned > long, so I'm not sure what you'd like to change here. I'd like to make emacs_limb_t be an unsigned long in 32-bit builds, to match mp_limb_t.