From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!.POSTED!not-for-mail
From: Tom Tromey <tom@tromey.com>
Newsgroups: gmane.emacs.devel
Subject: Re: bignum branch
Date: Sat, 04 Aug 2018 10:39:45 -0600
Message-ID: <87ftzum6ge.fsf@tromey.com>
References: <87o9fbbw1t.fsf@tromey.com> <vz1o9fb2os4.fsf@gmail.com>
	<vz11sc7qhkq.fsf@gmail.com> <86in5jdj49.fsf@gmail.com>
	<83wotxaiwi.fsf@gnu.org> <86k1pxmvmx.fsf@gmail.com>
	<87efg4a9xc.fsf@tromey.com> <87a7qr8cz7.fsf@tromey.com>
	<86tvoy3je9.fsf@gmail.com> <86bmb0vbxf.fsf@gmail.com>
	<87k1pnfcg1.fsf@tromey.com> <86sh4b1833.fsf@gmail.com>
	<861sbgz3dm.fsf@gmail.com>
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: blaine.gmane.org 1533400710 19635 195.159.176.226 (4 Aug 2018 16:38:30 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 4 Aug 2018 16:38:30 +0000 (UTC)
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux)
Cc: emacs-devel@gnu.org
To: Andy Moreton <andrewjmoreton@gmail.com>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 04 18:38:26 2018
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>
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 <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>)
	id 1flzZQ-0004zC-MS
	for ged-emacs-devel@m.gmane.org; Sat, 04 Aug 2018 18:38:25 +0200
Original-Received: from localhost ([::1]:55646 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>)
	id 1flzbV-0006dY-Hr
	for ged-emacs-devel@m.gmane.org; Sat, 04 Aug 2018 12:40:33 -0400
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40014)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <tom@tromey.com>) id 1flzap-0006dI-Ra
	for emacs-devel@gnu.org; Sat, 04 Aug 2018 12:39:53 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <tom@tromey.com>) id 1flzam-0002XP-Ki
	for emacs-devel@gnu.org; Sat, 04 Aug 2018 12:39:51 -0400
Original-Received: from gateway20.websitewelcome.com ([192.185.68.24]:44094)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <tom@tromey.com>) id 1flzam-0002XA-Bg
	for emacs-devel@gnu.org; Sat, 04 Aug 2018 12:39:48 -0400
Original-Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6])
	by gateway20.websitewelcome.com (Postfix) with ESMTP id 12688400CD68B
	for <emacs-devel@gnu.org>; Sat,  4 Aug 2018 11:39:47 -0500 (CDT)
Original-Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP
	id lzakfQIuJ79N3lzakfjNia; Sat, 04 Aug 2018 11:39:47 -0500
X-Authority-Reason: nr=8
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; 
	s=default;
	h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
	References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
	Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
	Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
	List-Subscribe:List-Post:List-Owner:List-Archive;
	bh=kKbRXv3E1zRzOxr1Wxp572g5dTeDR9shnx70xI25RKs=;
	b=K/1lgowoT4yO63cNBUuj3Syb/w
	Es5DwJSnH8B4iw4zhez0A+3PwBYWaolIXFOCvkL7x+8Umx3arJYfSI1IG/SyRRYveAjKIV1k91ZN2
	tbrS0Wra+r07TPV8TnqxN5EnG;
Original-Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:43176 helo=bapiya)
	by box5379.bluehost.com with esmtpsa
	(TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91)
	(envelope-from <tom@tromey.com>)
	id 1flzak-001aJM-GS; Sat, 04 Aug 2018 11:39:46 -0500
X-Attribution: Tom
In-Reply-To: <861sbgz3dm.fsf@gmail.com> (Andy Moreton's message of "Fri, 03
	Aug 2018 01:43:17 +0100")
X-AntiAbuse: This header was added to track abuse,
	please include it with any abuse report
X-AntiAbuse: Primary Hostname - box5379.bluehost.com
X-AntiAbuse: Original Domain - gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - tromey.com
X-BWhitelist: no
X-Source-IP: 75.166.85.72
X-Source-L: No
X-Exim-ID: 1flzak-001aJM-GS
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Source-Sender: 75-166-85-72.hlrn.qwest.net (bapiya) [75.166.85.72]:43176
X-Source-Auth: tom+tromey.com
X-Email-Count: 4
X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20=
X-Local-Domain: yes
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 192.185.68.24
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: "Emacs development discussions." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
	<mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/emacs-devel/>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
	<mailto:emacs-devel-request@gnu.org?subject=subscribe>
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org
Original-Sender: "Emacs-devel" <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>
Xref: news.gmane.org gmane.emacs.devel:228169
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/228169>

>>>>> "Andy" == Andy Moreton <andrewjmoreton@gmail.com> writes:

Andy> The patch has been tested with the attached ccl-tests.el ERT tests to
Andy> check that ash/lsh shifts behave properly, and that the CCL machinery
Andy> uses its 28bit codewords correctly in a bignum build.

Andy> Please check this works for you, and feel free to commit it to the
Andy> bignum branch.

I've applied the patch but the new test fails for me.
I've appended the log.

I'm still going to push your patch to the branch in a minute, because I
read through it and I agree with all the changes.  Thanks again for
doing this.

I fixed a couple of trivial formatting issues in your patch, and I also
added a comment by ccl-fixnum, but otherwise it's what you wrote.

Tom


Running 7 tests (2018-08-04 10:37:28-0600, selector `(not (tag :unstable))')
   passed  1/7  ccl-compile-midi (0.000601 sec)
   passed  2/7  ccl-compile-pgg (0.000303 sec)
Test ccl-dump-midi backtrace:
  signal(ert-test-failed (((should (equal (buffer-string) prog-midi-du
  ert-fail(((should (equal (buffer-string) prog-midi-dump)) :form (equ
  (if (unwind-protect (setq value-92 (apply fn-90 args-91)) (setq form
  (let (form-description-94) (if (unwind-protect (setq value-92 (apply
  (let ((value-92 'ert-form-evaluation-aborted-93)) (let (form-descrip
  (let* ((fn-90 #'equal) (args-91 (condition-case err (let ((signal-ho
  (progn (ccl-dump prog-midi-code) (let* ((fn-90 #'equal) (args-91 (co
  (unwind-protect (progn (ccl-dump prog-midi-code) (let* ((fn-90 #'equ
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-b
  (lambda nil (let ((temp-buffer (generate-new-buffer " *temp*"))) (sa
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name ccl-dump-midi :documentation nil :bod
  ert-run-or-rerun-test(#s(ert--stats :selector (not (tag :unstable)) 
  ert-run-tests((not (tag :unstable)) #f(compiled-function (event-type
  ert-run-tests-batch((not (tag :unstable)))
  ert-run-tests-batch-and-exit((not (tag :unstable)))
  eval((ert-run-tests-batch-and-exit '(not (tag :unstable))))
  command-line-1(("-L" ":." "-l" "ert" "-l" "lisp/international/ccl-te
  command-line()
  normal-top-level()
Test ccl-dump-midi condition:
    (ert-test-failed
     ((should
       (equal
	(buffer-string)
	prog-midi-dump))
      :form
      (equal "Out-buffer must be 2 times bigger than in-buffer.
Main-body:
    2:[read-jump-cond-expr-const] read r0, if !(r0 < 128), jump to 22(+20)
    5:[branch] jump to array[r3] of length 4
	11 12 15 18 22 
   11:[jump] jump to 2(-9)
   12:[set-register] r1 = r0
   13:[set-register] r0 = r4
   14:[jump] jump to 41(+27)
   15:[set-register] r1 = r0
   16:[set-short-const] r3 = 3
   17:[jump] jump to 2(-15)
   18:[set-register] r2 = r0
   19:[set-short-const] r3 = 2
   20:[set-register] r0 = r4
   21:[jump] jump to 41(+20)
   22:[jump-cond-expr-const] if !(r0 >= 248), jump to 26(+4)
   25:[jump] jump to 41(+16)
   26:[jump-cond-expr-const] if !(r0 < 240), jump to 39(+13)
   29:[set-register] r4 = r0
   30:[set-expr-const] r7 = r0 & 224
   32:[jump-cond-expr-const] if !(r7 == 192), jump to 37(+5)
   35:[set-short-const] r3 = 1
   36:[jump] jump to 38(+2)
   37:[set-short-const] r3 = 2
   38:[jump] jump to 2(-36)
   39:[set-short-const] r3 = 0
   40:[jump] jump to 2(-38)
   41:[set-expr-const] r7 = r0 & 240
   43:[jump-cond-expr-const] if !(r7 == 144), jump to 59(+16)
   46:[jump-cond-expr-const] if !(r2 == 0), jump to 52(+6)
   49:[set-assign-expr-const] r0 -= 16
   51:[jump] jump to 59(+8)
   52:[set-assign-expr-const] r0 &= 15
   54:[write-const-string] write char \".\"
   55:[write-register] write r0 (2 remaining)
   56:[write-register] write r1 (1 remaining)
   57:[write-register] write r2 (0 remaining)
   58:[jump] jump to 2(-56)
   59:[set-expr-const] r7 = r0 & 240
   61:[jump-cond-expr-const] if !(r7 == 128), jump to 71(+10)
   64:[set-assign-expr-const] r0 &= 15
   66:[write-const-string] write char \".\"
   67:[write-register] write r0 (2 remaining)
   68:[write-register] write r1 (1 remaining)
   69:[write-register] write r2 (0 remaining)
   70:[jump] jump to 2(-68)
   71:[jump] jump to 2(-69)
At EOF:
   72:[end] end
" "Out-buffer must be 2 times bigger than in-buffer.
Main-body:
    2:[read-jump-cond-expr-const] read r0, if !(r0 < 128), jump to 22(+20)
    5:[branch] jump to array[r3] of length 4
	11 12 15 18 22
   11:[jump] jump to 2(-9)
   12:[set-register] r1 = r0
   13:[set-register] r0 = r4
   14:[jump] jump to 41(+27)
   15:[set-register] r1 = r0
   16:[set-short-const] r3 = 3
   17:[jump] jump to 2(-15)
   18:[set-register] r2 = r0
   19:[set-short-const] r3 = 2
   20:[set-register] r0 = r4
   21:[jump] jump to 41(+20)
   22:[jump-cond-expr-const] if !(r0 >= 248), jump to 26(+4)
   25:[jump] jump to 41(+16)
   26:[jump-cond-expr-const] if !(r0 < 240), jump to 39(+13)
   29:[set-register] r4 = r0
   30:[set-expr-const] r7 = r0 & 224
   32:[jump-cond-expr-const] if !(r7 == 192), jump to 37(+5)
   35:[set-short-const] r3 = 1
   36:[jump] jump to 38(+2)
   37:[set-short-const] r3 = 2
   38:[jump] jump to 2(-36)
   39:[set-short-const] r3 = 0
   40:[jump] jump to 2(-38)
   41:[set-expr-const] r7 = r0 & 240
   43:[jump-cond-expr-const] if !(r7 == 144), jump to 59(+16)
   46:[jump-cond-expr-const] if !(r2 == 0), jump to 52(+6)
   49:[set-assign-expr-const] r0 -= 16
   51:[jump] jump to 59(+8)
   52:[set-assign-expr-const] r0 &= 15
   54:[write-const-string] write char \".\"
   55:[write-register] write r0 (2 remaining)
   56:[write-register] write r1 (1 remaining)
   57:[write-register] write r2 (0 remaining)
   58:[jump] jump to 2(-56)
   59:[set-expr-const] r7 = r0 & 240
   61:[jump-cond-expr-const] if !(r7 == 128), jump to 71(+10)
   64:[set-assign-expr-const] r0 &= 15
   66:[write-const-string] write char \".\"
   67:[write-register] write r0 (2 remaining)
   68:[write-register] write r1 (1 remaining)
   69:[write-register] write r2 (0 remaining)
   70:[jump] jump to 2(-68)
   71:[jump] jump to 2(-69)
At EOF:
   72:[end] end
")
      :value nil :explanation
      (arrays-of-different-length 1843 1842 "Out-buffer must be 2 times bigger than in-buffer.
Main-body:
    2:[read-jump-cond-expr-const] read r0, if !(r0 < 128), jump to 22(+20)
    5:[branch] jump to array[r3] of length 4
	11 12 15 18 22 
   11:[jump] jump to 2(-9)
   12:[set-register] r1 = r0
   13:[set-register] r0 = r4
   14:[jump] jump to 41(+27)
   15:[set-register] r1 = r0
   16:[set-short-const] r3 = 3
   17:[jump] jump to 2(-15)
   18:[set-register] r2 = r0
   19:[set-short-const] r3 = 2
   20:[set-register] r0 = r4
   21:[jump] jump to 41(+20)
   22:[jump-cond-expr-const] if !(r0 >= 248), jump to 26(+4)
   25:[jump] jump to 41(+16)
   26:[jump-cond-expr-const] if !(r0 < 240), jump to 39(+13)
   29:[set-register] r4 = r0
   30:[set-expr-const] r7 = r0 & 224
   32:[jump-cond-expr-const] if !(r7 == 192), jump to 37(+5)
   35:[set-short-const] r3 = 1
   36:[jump] jump to 38(+2)
   37:[set-short-const] r3 = 2
   38:[jump] jump to 2(-36)
   39:[set-short-const] r3 = 0
   40:[jump] jump to 2(-38)
   41:[set-expr-const] r7 = r0 & 240
   43:[jump-cond-expr-const] if !(r7 == 144), jump to 59(+16)
   46:[jump-cond-expr-const] if !(r2 == 0), jump to 52(+6)
   49:[set-assign-expr-const] r0 -= 16
   51:[jump] jump to 59(+8)
   52:[set-assign-expr-const] r0 &= 15
   54:[write-const-string] write char \".\"
   55:[write-register] write r0 (2 remaining)
   56:[write-register] write r1 (1 remaining)
   57:[write-register] write r2 (0 remaining)
   58:[jump] jump to 2(-56)
   59:[set-expr-const] r7 = r0 & 240
   61:[jump-cond-expr-const] if !(r7 == 128), jump to 71(+10)
   64:[set-assign-expr-const] r0 &= 15
   66:[write-const-string] write char \".\"
   67:[write-register] write r0 (2 remaining)
   68:[write-register] write r1 (1 remaining)
   69:[write-register] write r2 (0 remaining)
   70:[jump] jump to 2(-68)
   71:[jump] jump to 2(-69)
At EOF:
   72:[end] end
" "Out-buffer must be 2 times bigger than in-buffer.
Main-body:
    2:[read-jump-cond-expr-const] read r0, if !(r0 < 128), jump to 22(+20)
    5:[branch] jump to array[r3] of length 4
	11 12 15 18 22
   11:[jump] jump to 2(-9)
   12:[set-register] r1 = r0
   13:[set-register] r0 = r4
   14:[jump] jump to 41(+27)
   15:[set-register] r1 = r0
   16:[set-short-const] r3 = 3
   17:[jump] jump to 2(-15)
   18:[set-register] r2 = r0
   19:[set-short-const] r3 = 2
   20:[set-register] r0 = r4
   21:[jump] jump to 41(+20)
   22:[jump-cond-expr-const] if !(r0 >= 248), jump to 26(+4)
   25:[jump] jump to 41(+16)
   26:[jump-cond-expr-const] if !(r0 < 240), jump to 39(+13)
   29:[set-register] r4 = r0
   30:[set-expr-const] r7 = r0 & 224
   32:[jump-cond-expr-const] if !(r7 == 192), jump to 37(+5)
   35:[set-short-const] r3 = 1
   36:[jump] jump to 38(+2)
   37:[set-short-const] r3 = 2
   38:[jump] jump to 2(-36)
   39:[set-short-const] r3 = 0
   40:[jump] jump to 2(-38)
   41:[set-expr-const] r7 = r0 & 240
   43:[jump-cond-expr-const] if !(r7 == 144), jump to 59(+16)
   46:[jump-cond-expr-const] if !(r2 == 0), jump to 52(+6)
   49:[set-assign-expr-const] r0 -= 16
   51:[jump] jump to 59(+8)
   52:[set-assign-expr-const] r0 &= 15
   54:[write-const-string] write char \".\"
   55:[write-register] write r0 (2 remaining)
   56:[write-register] write r1 (1 remaining)
   57:[write-register] write r2 (0 remaining)
   58:[jump] jump to 2(-56)
   59:[set-expr-const] r7 = r0 & 240
   61:[jump-cond-expr-const] if !(r7 == 128), jump to 71(+10)
   64:[set-assign-expr-const] r0 &= 15
   66:[write-const-string] write char \".\"
   67:[write-register] write r0 (2 remaining)
   68:[write-register] write r1 (1 remaining)
   69:[write-register] write r2 (0 remaining)
   70:[jump] jump to 2(-68)
   71:[jump] jump to 2(-69)
At EOF:
   72:[end] end
" first-mismatch-at 196)))
   FAILED  3/7  ccl-dump-midi (0.001107 sec)
   passed  4/7  ccl-dump-pgg (0.000431 sec)
   passed  5/7  pgg-parse-crc24 (0.009028 sec)
   passed  6/7  pgg-parse-crc24-dump (0.000449 sec)
   passed  7/7  shift (0.000209 sec)

Ran 7 tests, 6 results as expected, 1 unexpected (2018-08-04 10:37:28-0600, 0.093933 sec)

1 unexpected results:
   FAILED  ccl-dump-midi