emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bignum branch


From: Robert Pluim
Subject: Re: bignum branch
Date: Tue, 17 Jul 2018 20:10:39 +0200

Andy Moreton <address@hidden> writes:

> On Fri 13 Jul 2018, Eli Zaretskii wrote:
>
>>> From: Robert Pluim <address@hidden>
>>> Cc: address@hidden
>>> Date: Fri, 13 Jul 2018 15:02:01 +0200
>>> 
>>> emacs -Q
>>> (require 'pgg)
>>> 
>>> ⇒
>>> 
>>> Debugger entered--Lisp error: (error "Error in CCL program")
>>>   register-ccl-program(pgg-parse-crc24 [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 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ʼs obsolete anyway).

Robert



reply via email to

[Prev in Thread] Current Thread [Next in Thread]