# HG changeset patch # User Pascal Bellard # Date 1620399624 0 # Node ID 7a5d5860f3ead20778b2b63054a5a9696160cb00 # Parent aacd5b54d01080abbbda1141ef30c9cfd104c075 memtest,plop: tune lzma compression (again) diff -r aacd5b54d010 -r 7a5d5860f3ea memtest/stuff/pack --- a/memtest/stuff/pack Thu May 06 12:57:42 2021 +0000 +++ b/memtest/stuff/pack Fri May 07 15:00:24 2021 +0000 @@ -38,9 +38,14 @@ done | xargs echo -en | dd conv=notrunc bs=1 of=$2 seek=$3 } +bits() +{ + sed "/^.define PROP_$1/"'!'"d;s|.*_$1.||" unlzma.S +} + compress() { - xz -z -e --format=raw --lzma1=mf=bt2,nice=132 --stdout + xz -z -e --format=raw --lzma1=mf=bt2,lc=$(bits LC),lp=$(bits LP),pb=$(bits PB),nice=127 --stdout } main() diff -r aacd5b54d010 -r 7a5d5860f3ea memtest/stuff/unlzma.S --- a/memtest/stuff/unlzma.S Thu May 06 12:57:42 2021 +0000 +++ b/memtest/stuff/unlzma.S Fri May 07 15:00:24 2021 +0000 @@ -18,7 +18,7 @@ * Compression with : lzma e src dst -eos -pb2 -lp0 -lc3 */ -#define PROP_PB 2 +#define PROP_PB 3 #define PROP_LP 0 #define PROP_LC 3 #define PROPS (PROP_LC+(PROP_LP*9)+(PROP_PB*45)) @@ -195,17 +195,21 @@ # else shrb $8-PROP_LC, %bl # endif +#else + xor %bx,%bx #endif #if PROP_LP != 0 movb posState2(BP), %dl -# ifdef ONLY8086 +# if PROP_LC != 0 +# ifdef ONLY8086 movb $PROP_LC, %cl shl %cl, DX -# else +# else shl $PROP_LC, DX +# endif + movb $0, %bh # endif - movb $0, %bh add BX, DX #endif diff -r aacd5b54d010 -r 7a5d5860f3ea plop/stuff/pack --- a/plop/stuff/pack Thu May 06 12:57:42 2021 +0000 +++ b/plop/stuff/pack Fri May 07 15:00:24 2021 +0000 @@ -49,7 +49,7 @@ compress() { - xz -z -e --format=raw --lzma1=mf=bt2,lc=$(bits LC),lp=$(bits LP),pb=$(bits BP),nice=84 --stdout + xz -z -e --format=raw --lzma1=mf=bt2,lc=$(bits LC),lp=$(bits LP),pb=$(bits PB),nice=84 --stdout } main() diff -r aacd5b54d010 -r 7a5d5860f3ea plop/stuff/unlzma.S --- a/plop/stuff/unlzma.S Thu May 06 12:57:42 2021 +0000 +++ b/plop/stuff/unlzma.S Fri May 07 15:00:24 2021 +0000 @@ -197,17 +197,21 @@ # else shrb $8-PROP_LC, %bl # endif +#else + xor %bx,%bx #endif #if PROP_LP != 0 movb posState2(BP), %dl -# ifdef ONLY8086 +# if PROP_LC != 0 +# ifdef ONLY8086 movb $PROP_LC, %cl shl %cl, DX -# else +# else shl $PROP_LC, DX +# endif + movb $0, %bh # endif - movb $0, %bh add BX, DX #endif