mirror of
https://github.com/emmanuel-marty/lzsa.git
synced 2025-01-03 04:33:15 +00:00
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:
parent
31d5dc2419
commit
ecb6bc5106
@ -28,10 +28,8 @@ decompress_lzsa1 equ lz1token
|
|||||||
lz1bigof lda ,x+ ; O set: load MSB 16-bit (negative, signed) offest
|
lz1bigof lda ,x+ ; O set: load MSB 16-bit (negative, signed) offest
|
||||||
lz1gotof leau d,y ; put backreference start address in U (dst+offset)
|
lz1gotof 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
|
addb #$03 ; add MIN_MATCH_SIZE
|
||||||
cmpb #$12 ; MATCH_RUN_LEN?
|
cmpb #$12 ; MATCH_RUN_LEN?
|
||||||
bne lz1gotln ; no, we have the full match length, go copy
|
bne lz1gotln ; no, we have the full match length, go copy
|
||||||
|
@ -34,10 +34,9 @@ lz1gotof nega ; reverse sign of offset in D
|
|||||||
sbca #0
|
sbca #0
|
||||||
leau d,y ; put backreference start address in U (dst+offset)
|
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
|
addb #$03 ; add MIN_MATCH_SIZE
|
||||||
cmpb #$12 ; MATCH_RUN_LEN?
|
cmpb #$12 ; MATCH_RUN_LEN?
|
||||||
bne lz1gotln ; no, we have the full match length, go copy
|
bne lz1gotln ; no, we have the full match length, go copy
|
||||||
|
@ -49,8 +49,8 @@ lz2token ldb ,x+ ; load next token into B: XYZ|LL|MMM
|
|||||||
lz2declt lsrb ; shift literals count into place
|
lz2declt lsrb ; shift literals count into place
|
||||||
lsrb
|
lsrb
|
||||||
lsrb
|
lsrb
|
||||||
|
|
||||||
lz2gotla clra ; clear A (high part of literals count)
|
lz2gotla clra ; clear A (high part of literals count)
|
||||||
|
|
||||||
lz2gotlt leau ,x
|
lz2gotlt leau ,x
|
||||||
tfr d,x ; transfer 16-bit count into X
|
tfr d,x ; transfer 16-bit count into X
|
||||||
lz2cpylt lda ,u+ ; copy literal byte
|
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
|
lz2gotof std <lz2repof+2,pcr ; store match offset
|
||||||
lz2repof leau $aaaa,y ; put backreference start address in U (dst+offset)
|
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
|
addb #$02 ; add MIN_MATCH_SIZE_V2
|
||||||
cmpb #$09 ; MIN_MATCH_SIZE_V2 + MATCH_RUN_LEN_V2?
|
cmpb #$09 ; MIN_MATCH_SIZE_V2 + MATCH_RUN_LEN_V2?
|
||||||
bne lz2gotln ; no, we have the full match length, go copy
|
bne lz2gotln ; no, we have the full match length, go copy
|
||||||
|
@ -122,10 +122,9 @@ lz2gotof nega ; reverse sign of offset in D
|
|||||||
|
|
||||||
lz2repof leau $aaaa,y ; put backreference start address in U (dst+offset)
|
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
|
addb #$02 ; add MIN_MATCH_SIZE_V2
|
||||||
cmpb #$09 ; MIN_MATCH_SIZE_V2 + MATCH_RUN_LEN_V2?
|
cmpb #$09 ; MIN_MATCH_SIZE_V2 + MATCH_RUN_LEN_V2?
|
||||||
bne lz2gotln ; no, we have the full match length, go copy
|
bne lz2gotln ; no, we have the full match length, go copy
|
||||||
|
Loading…
Reference in New Issue
Block a user