From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: bignum branch Date: Tue, 17 Jul 2018 20:10:39 +0200 Message-ID: <878t69g2cg.fsf@gmail.com> References: <87o9fbbw1t.fsf@tromey.com> <87bmbbmslt.fsf@gmail.com> <877elzmpjk.fsf@gmail.com> <83va9jcpfk.fsf@gnu.org> <83sh4ncoye.fsf@gnu.org> <87601j5lx2.fsf@gmail.com> <83o9fbckik.fsf@gnu.org> <86muuscvj8.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1531850935 7761 195.159.176.226 (17 Jul 2018 18:08:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 17 Jul 2018 18:08:55 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andy Moreton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 17 20:08:51 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 1ffUP4-0001sn-3S for ged-emacs-devel@m.gmane.org; Tue, 17 Jul 2018 20:08:50 +0200 Original-Received: from localhost ([::1]:60792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffUR9-0001cV-8V for ged-emacs-devel@m.gmane.org; Tue, 17 Jul 2018 14:10:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffUQw-0001bY-En for emacs-devel@gnu.org; Tue, 17 Jul 2018 14:10:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ffUQs-0004Sb-BF for emacs-devel@gnu.org; Tue, 17 Jul 2018 14:10:46 -0400 Original-Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:46624) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ffUQs-0004S6-3h for emacs-devel@gnu.org; Tue, 17 Jul 2018 14:10:42 -0400 Original-Received: by mail-wr1-x435.google.com with SMTP id s11-v6so2114845wra.13 for ; Tue, 17 Jul 2018 11:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-followup-to:mail-copies-to :gmane-reply-to-list:date:message-id:mime-version :content-transfer-encoding; bh=RIxQw3909tyh5g9QzC9OhESshr5I8m4ASOLlWftpqVY=; b=VGeLkHrINfK/wAVt17xxNmd4Ptp5EurC5WCXsdxpNf9rhJr+o4OaxyFasJoWg3vXbA 5RsJ+zBLZAZsXmYuak4vGN8sDe75xWYwkM/rhKWCulcNpbcMuSvGuQKkzMV4an/GdfbY brm1HghrcHKjtV60KfnH0lEu1N9LtU4E1vwQi1ePuFMAk7uYhHAzjdBbmLOCtpOWYKou jWQZWxeFcUdaeCgTSM3+K14RkmfxhXWXdd4uZGGYBTay0ZkIGMq0UNLy/QuWsyUNW8nZ PXctao2IWW94QhjMxsKU3Zjy7kzNydvExPuQhPZHbXQAlHSW/G78pSSp/KQ7M6lwxhW5 2tPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-followup-to :mail-copies-to:gmane-reply-to-list:date:message-id:mime-version :content-transfer-encoding; bh=RIxQw3909tyh5g9QzC9OhESshr5I8m4ASOLlWftpqVY=; b=ftf/FbpwNAFKAw8iOchi5CsXTGjYDnlPEjcHSOn25D2I6d7m6Pw9TnsvJQI/Ku5a9f g6+IsxRXtSfVtPjGBMFQ6dos0ovu5XZK9DY64nRBrGvsWMJM/1QZL05/FgtYVq9hVhTq l5aItXPvY0MX2l2QdmdWI45TGtVKc2ZUVAai5nf6OabntnGFWi3mAQElxtHCdcxBHUCN 5NEkaqkuSmhGXxYW+UfFLF/tyjgy/gB+G08FDrIpnagn+UCS/Ph4ixOC32lPxenWryG6 MIPowlEqNrgd3JF5vZ+e7FrpYo8dsLK5P+eSxOZ3OkN7X/WHeo5R9+ehrt6UCnJy4Xp6 MWmg== X-Gm-Message-State: AOUpUlFAzkyr4uRTqZMhC16IVl2B8Ll9/BdItU51SUGDu4FYny9C621z j8cuDod/2GRxbmOm5jrEJww/UJCA X-Google-Smtp-Source: AAOMgpeKjn6PNQXxB3pr8PWJ40R9JE+L/gf8LedWqSofS0yHBTN8QUEl/rggDab2aPNEmfSdG550rA== X-Received: by 2002:adf:e687:: with SMTP id r7-v6mr2284777wrm.35.1531851040667; Tue, 17 Jul 2018 11:10:40 -0700 (PDT) Original-Received: from rpluim (vav06-1-78-207-202-134.fbx.proxad.net. [78.207.202.134]) by smtp.gmail.com with ESMTPSA id b198-v6sm320476wme.11.2018.07.17.11.10.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Jul 2018 11:10:39 -0700 (PDT) Mail-Followup-To: emacs-devel@gnu.org Mail-Copies-To: never Gmane-Reply-To-List: yes X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::435 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:227512 Archived-At: Andy Moreton writes: > On Fri 13 Jul 2018, Eli Zaretskii wrote: > >>> From: Robert Pluim >>> Cc: emacs-devel@gnu.org >>> Date: Fri, 13 Jul 2018 15:02:01 +0200 >>>=20 >>> emacs -Q >>> (require 'pgg) >>>=20 >>> =E2=87=92 >>>=20 >>> Debugger entered--Lisp error: (error "Error in CCL program") >>> register-ccl-program(pgg-parse-crc24 [1 30 14 114744 114775 0 161 131= 127 1 >>> 148217 15 82167 1 1848 131159 1 1595 5 256 114743 390 114775 19707 1467= 16 7 >>> 183 1 4611686018427382276 4611686018427380740 22]) >> >> Thanks. >> >> I guess the operations in pgg-parse-crc24 give birth to these numbers, >> so ccl.c should be fixed to avoid that, for backward compatibility >> with existing CCL programs. (I'm guessing that ccl.c relies on >> integer wrap-around, and bignums violate that.) > > If I bootstrap a 32bit build from the bignum branch, this error does not > occur and the build completes successfully. However if I bootstrap a > 64bit build and then build a 32bit emacs from the same source tree, I > see this error. > > This suggests that the problem is (at least partly) in the compiler for > CCL programs in ccl.el, rather than the interpreter in ccl.c. The interpreter is fine. ccl.el assumes that 'ash' will truncate its result, which is no longer true when using bignums. Truncating all ash operations to 28 bits in ccl.el fixes this particular error for me, but the resulting CCL programs are not identical: emacs-master: [1 30 14 114744 114775 0 161 131127 1 148217 15 82167 1 1848 131159 1 1595 5 256 114743 390 114775 19707 1467 16 7 183 1 -5628 -7164 22] emacs-bignum: [1 31 14 114744 114775 0 162 0 131127 1 148217 15 82167 1 1848 131159 1 1595 5 256 114743 390 114775 19707 1467 16 7 183 1 268429828 268428036 22] Someone who know ccl should take a look (or we punt and remove pgg, since it=CA=BCs obsolete anyway). Robert