(lz) Faster encoding

This commit is contained in:
neauoire 2023-11-19 11:22:48 -08:00
parent cd51f8e559
commit 6a3ca87e97
1 changed files with 5 additions and 6 deletions

View File

@ -10,7 +10,6 @@
@dst $30
@match-len $2
@output-ptr $2
@match-ctl $2
@dict-best $2
@combine $2
@dict-data $2
@ -119,14 +118,14 @@
@op-cpy ( in* -- )
( | More numeric range: treat 0 as 4, 1 as 5, etc. )
.match-len LDZ2 #0004 SUB2 .match-ctl STZ2
.match-len LDZ2 #0004 SUB2
( | CPY2 )
.match-ctl LDZ2 #003f GTH2 ?&cpy2
DUP2 #003f GTH2 ?&cpy2
( | *output_ptr++ = match_ctl | 0x80; )
.match-ctl LDZ2 NIP #80 ORA <append-byte>
NIP #80 ORA <append-byte>
!&cpy-resume
&cpy2 ( -- )
.match-ctl LDZ2 SWP #c0 ORA <append-byte>
&cpy2 ( match-ctl* -- )
SWP #c0 ORA <append-byte>
<append-byte>
&cpy-resume ( -- )
( | *output_ptr++ = in - dict_best - 1; )