Tiny speed improvement to 6809 LZSA depackers

Same space used but improved match length code by 1 cycle for M6809. On H6309 the clock cycles are the same.
This commit is contained in:
Doug Masten 2020-07-03 01:29:02 -05:00
parent 31d5dc2419
commit ecb6bc5106
4 changed files with 9 additions and 15 deletions

View File

@ -28,10 +28,8 @@ decompress_lzsa1 equ lz1token
lz1bigof lda ,x+ ; O set: load MSB 16-bit (negative, signed) offest
lz1gotof leau d,y ; put backreference start address in U (dst+offset)
puls b ; restore token
clra ; clear A (high part of match length)
andb #$0F ; isolate MMMM (embedded match length)
ldd #$000f ; clear MSB match length and set mask for MMMM
andb ,s+ ; isolate MMMM (embedded match length) in token
addb #$03 ; add MIN_MATCH_SIZE
cmpb #$12 ; MATCH_RUN_LEN?
bne lz1gotln ; no, we have the full match length, go copy

View File

@ -34,10 +34,9 @@ lz1gotof nega ; reverse sign of offset in D
sbca #0
leau d,y ; put backreference start address in U (dst+offset)
puls b ; restore token
ldd #$000f ; clear MSB match length and set mask for MMMM
andb ,s+ ; isolate MMMM (embedded match length) in token
clra ; clear A (high part of match length)
andb #$0F ; isolate MMMM (embedded match length)
addb #$03 ; add MIN_MATCH_SIZE
cmpb #$12 ; MATCH_RUN_LEN?
bne lz1gotln ; no, we have the full match length, go copy

View File

@ -49,8 +49,8 @@ lz2token ldb ,x+ ; load next token into B: XYZ|LL|MMM
lz2declt lsrb ; shift literals count into place
lsrb
lsrb
lz2gotla clra ; clear A (high part of literals count)
lz2gotlt leau ,x
tfr d,x ; transfer 16-bit count into X
lz2cpylt lda ,u+ ; copy literal byte
@ -116,10 +116,8 @@ lz2rep16 bmi lz2repof ; if token's Z flag bit is set, rep match
lz2gotof std <lz2repof+2,pcr ; store match offset
lz2repof leau $aaaa,y ; put backreference start address in U (dst+offset)
puls b ; restore token
clra ; clear A (high part of match length)
andb #$07 ; isolate MMM (embedded match length)
ldd #$0007 ; clear MSB match length and set mask for MMM
andb ,s+ ; isolate MMM (embedded match length) in token
addb #$02 ; add MIN_MATCH_SIZE_V2
cmpb #$09 ; MIN_MATCH_SIZE_V2 + MATCH_RUN_LEN_V2?
bne lz2gotln ; no, we have the full match length, go copy

View File

@ -122,10 +122,9 @@ lz2gotof nega ; reverse sign of offset in D
lz2repof leau $aaaa,y ; put backreference start address in U (dst+offset)
puls b ; restore token
ldd #$0007 ; clear MSB match length and set mask for MMM
andb ,s+ ; isolate MMM (embedded match length) in token
clra ; clear A (high part of match length)
andb #$07 ; isolate MMM (embedded match length)
addb #$02 ; add MIN_MATCH_SIZE_V2
cmpb #$09 ; MIN_MATCH_SIZE_V2 + MATCH_RUN_LEN_V2?
bne lz2gotln ; no, we have the full match length, go copy