|
From: Stas B. <sta...@gm...> - 2026-04-19 21:18:08
|
(let ((code (try-fastrem-algorithm (integer-length max-x) y)))
(when code
(erase-node-type node t 0)
code))
seems to be working.
On Sun, Apr 19, 2026 at 11:52 PM Douglas Katzman <do...@go...> wrote:
>
> The attached patch is a better way of doing this but I need help about inserting an ERASE-NODE-TYPE on the result, I think.
>
> The division-to-multiplication transform wants to return something like (VALUES 0 (SB-VM::FASTREM-32 SB-C::X 613566757 7))
> which instantly fails in arith.pure e.g.
> (defun f (x)
> (declare (optimize (speed 3) (space 1) (compilation-speed 0)) (type (integer 10000 10100) x))
> (mod x 7))
> Because 0 is not a valid primary result of TRUNCATE given the constraint on X it compiles to an error
>
> ; 5F: L0: CC1D INT3 29 ; OBJECT-NOT-TYPE-ERROR
>
> ; 61: 08 BYTE #X08 ; RDX(d)
>
> ; 62: 13 BYTE #X13 ; '(INTEGER 10000 10100)
>
> ; Origin #xB800A99063 (segment 2 of 2) ; F
>
> ; 63: L1: CC2B INT3 43 ; UNREACHABLE-ERROR
>
>
|