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 10:28:36 +0100 Message-ID: <86pnzkx58b.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> <878t69g2cg.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1531906022 11362 195.159.176.226 (18 Jul 2018 09:27:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 18 Jul 2018 09:27:02 +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 11:26:58 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 1ffijW-0002jE-9j for ged-emacs-devel@m.gmane.org; Wed, 18 Jul 2018 11:26:54 +0200 Original-Received: from localhost ([::1]:35557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffilb-0000vr-M9 for ged-emacs-devel@m.gmane.org; Wed, 18 Jul 2018 05:29:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ffilU-0000vg-5c for emacs-devel@gnu.org; Wed, 18 Jul 2018 05:28:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ffilP-00032L-9x for emacs-devel@gnu.org; Wed, 18 Jul 2018 05:28:56 -0400 Original-Received: from [195.159.176.226] (port=43301 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ffilP-00031Y-16 for emacs-devel@gnu.org; Wed, 18 Jul 2018 05:28:51 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1ffijB-0002Jj-Co for emacs-devel@gnu.org; Wed, 18 Jul 2018 11:26:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 100 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:fObowRrZ9RdKY8icfPmzIVcnU8Q= 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:227532 Archived-At: On Tue 17 Jul 2018, Robert Pluim wrote: > 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: I tried something similar, by truncating the resulting CCL codewords to 28bits. That fixes compiling the CCL program, but fails in the interpreter. You can check by running some simple tests: master (64bit mingw64 MSYS2): ELISP> (require 'pgg) pgg ELISP> (seq-map (lambda (x) (format "#x%x" x)) pgg-parse-crc24) ("#x1" "#x1e" "#xe" "#x1c038" "#x1c057" "#x0" "#xa1" "#x20037" "#x1" "#x242f9" "#xf" "#x140f7" "#x1" "#x738" "#x20057" "#x1" "#x63b" "#x5" "#x100" "#x1c037" "#x186" "#x1c057" "#x4cfb" "#x5bb" "#x10" "#x7" "#xb7" "#x1" "#x3fffffffffffea04" "#x3fffffffffffe404" "#x16") ELISP> (ccl-dump pgg-parse-crc24) nil ELISP> Out-buffer must be as large as in-buffer. Main-body: 2:[read-register] read r0 (0 remaining) 3:[set-assign-expr-register] r1 ^= r0 4:[set-assign-expr-const] r2 ^= 0 6:[set-short-const] r5 = 0 7:[set-assign-expr-const] r1 <<= 1 9:[set-expr-const] r7 = r2 >> 15 11:[set-assign-expr-const] r7 &= 1 13:[set-assign-expr-register] r1 += r7 14:[set-assign-expr-const] r2 <<= 1 16:[jump-cond-expr-const] if !(r1 & 256), jump to 23(+7) 19:[set-assign-expr-const] r1 ^= 390 21:[set-assign-expr-const] r2 ^= 19707 23:[jump-cond-expr-const] if !(r5 < 7), jump to 29(+6) 26:[set-assign-expr-const] r5 += 1 28:[jump] jump to 7(-21) 29:[jump] jump to 2(-27) At EOF: 30:[end] end ELISP> (dolist (s '("foo" "bar" "baz")) (let ((crc (pgg-parse-crc24-string s))) (insert "\n" s " --> " (mapconcat (lambda (b) (format "%02x" b)) crc "")))) nil ELISP> foo --> 4fc255 bar --> 51d953 baz --> f0586a bignum (64bit mingw64 MSYS2) with patch for `ash': ELISP> (require 'pgg) pgg ELISP> (seq-map (lambda (x) (format "#x%x" x)) pgg-parse-crc24) ("#x1" "#x1f" "#xe" "#x1c038" "#x1c057" "#x0" "#xa2" "#x0" "#x20037" "#x1" "#x242f9" "#xf" "#x140f7" "#x1" "#x738" "#x20057" "#x1" "#x63b" "#x5" "#x100" "#x1c037" "#x186" "#x1c057" "#x4cfb" "#x5bb" "#x10" "#x7" "#xb7" "#x1" "#xfffea04" "#xfffe304" "#x16") ELISP> (ccl-dump pgg-parse-crc24) nil ELISP> Out-buffer must be as large as in-buffer. Main-body: 2:[read-register] read r0 (0 remaining) 3:[set-assign-expr-register] r1 ^= r0 4:[set-assign-expr-const] r2 ^= 0 6:[set-const] r5 = 0 8:[set-assign-expr-const] r1 <<= 1 10:[set-expr-const] r7 = r2 >> 15 12:[set-assign-expr-const] r7 &= 1 14:[set-assign-expr-register] r1 += r7 15:[set-assign-expr-const] r2 <<= 1 17:[jump-cond-expr-const] if !(r1 & 256), jump to 24(+7) 20:[set-assign-expr-const] r1 ^= 390 22:[set-assign-expr-const] r2 ^= 19707 24:[jump-cond-expr-const] if !(r5 < 7), jump to 30(+6) 27:[set-assign-expr-const] r5 += 1 29:[jump] jump to 1048584(+1048555) 30:[jump] jump to 1048578(+1048548) At EOF: 31:[end] end ELISP> (dolist (s '("foo" "bar" "baz")) (let ((crc (pgg-parse-crc24-string s))) (insert "\n" s " --> " (mapconcat (lambda (b) (format "%02x" b)) crc "")))) *** Eval error *** Error in CCL program at 30th code > Someone who know ccl should take a look (or we punt and remove pgg, > since itʼs obsolete anyway). If pgg is removed, the CCL interpreter and ccl.el should also be removed. AndyM