From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.devel Subject: Re: bignum branch Date: Wed, 18 Jul 2018 12:10:19 +0100 Message-ID: References: <87o9fbbw1t.fsf@tromey.com> <86in5jdj49.fsf@gmail.com> <83wotxaiwi.fsf@gnu.org> <86k1pxmvmx.fsf@gmail.com> <83efg4a6ie.fsf@gnu.org> <41221ccf-0c1a-c7e6-2204-e3f9056f7eb5@cs.ucla.edu> <838t6c9wx5.fsf@gnu.org> <53ba128d-7888-e15a-c4a2-1d7a65f51345@cs.ucla.edu> <83wotu7fcj.fsf@gnu.org> <83k1pt7q1e.fsf@gnu.org> <83h8kx7oeu.fsf@gnu.org> <83fu0h7nr6.fsf@gnu.org> <83d0vl7kg2.fsf@gnu.org> <4bc2a6ba-bc73-c4a9-f7a6-20303955bc7f@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1531912113 8637 195.159.176.226 (18 Jul 2018 11:08:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 18 Jul 2018 11:08:33 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 18 13:08:29 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 1ffkJo-00028A-Oi for ged-emacs-devel@m.gmane.org; Wed, 18 Jul 2018 13:08:28 +0200 Original-Received: from localhost ([::1]:35931 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffkLv-0001wv-6I for ged-emacs-devel@m.gmane.org; Wed, 18 Jul 2018 07:10:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffkLp-0001wo-3K for emacs-devel@gnu.org; Wed, 18 Jul 2018 07:10:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ffkLl-000749-Ua for emacs-devel@gnu.org; Wed, 18 Jul 2018 07:10:33 -0400 Original-Received: from [195.159.176.226] (port=55555 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ffkLl-00073g-NE for emacs-devel@gnu.org; Wed, 18 Jul 2018 07:10:29 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1ffkJa-0001yV-Lx for emacs-devel@gnu.org; Wed, 18 Jul 2018 13:08:14 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 29 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:IH0v3/ZTNmg0k5XldcVFxEYVyF4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:227534 Archived-At: On Tue 17 Jul 2018, Paul Eggert wrote: > Eli Zaretskii wrote: >> But that problem will affect all platforms, wouldn't it? Because GMP >> can only work with 'long', and I guess we don't want to rely on stuff >> like 'prtdiff_t' and 'intmax_t' being no wider than 'long'? We'd need >> to convert the other types explicitly. > > Yes, of course. However, the more of these types are wider than a GMP limb, > the more problems we'll have. The size of a GMP limb is irrelevant - it is the API for getting native integer types into mpz_t values that cannot handle interger types wider than long. Wider mp_limb_t types improve efficiency, but do nothing about correctness on LLP64 systems. > There's another thing about debugging. This stuff is still uncertain. That is, > there are no doubt bugs in the bignum branch in this area, and we don't know > yet how significant these correctness problems will be. With that in mind, it > would be useful to have avoid-libgmp options with our own GMP replacement that > uses uintmax_t limbs (or 'unsigned int' limbs, for that matter) for debugging > purposes, to help us debug the inevitable glitches that will arise due to > libgmp's limbs being wrong for some types. Again, this is unrelated to the API problem. AndyM