Skip to content

Commit

Permalink
update the lzma lib to 2409
Browse files Browse the repository at this point in the history
  • Loading branch information
stefankueng committed Dec 7, 2024
1 parent d4d6f4f commit 404172d
Show file tree
Hide file tree
Showing 169 changed files with 7,285 additions and 2,782 deletions.
11 changes: 11 additions & 0 deletions lzma/7Zip.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,12 @@
<ClCompile Include="CPP\7zip\Compress\ZstdDecoder.cpp" />
<ClCompile Include="CPP\Common\CksumReg.cpp" />
<ClCompile Include="CPP\Common\LzFindPrepare.cpp" />
<ClCompile Include="CPP\Common\Md5Reg.cpp" />
<ClCompile Include="CPP\Common\Sha1Prepare.cpp" />
<ClCompile Include="CPP\Common\Sha256Prepare.cpp" />
<ClCompile Include="CPP\Common\Sha3Reg.cpp" />
<ClCompile Include="CPP\Common\Sha512Prepare.cpp" />
<ClCompile Include="CPP\Common\Sha512Reg.cpp" />
<ClCompile Include="CPP\Common\Xxh64Reg.cpp" />
<ClCompile Include="CPP\Windows\PropVariantConv.cpp" />
<ClCompile Include="C\7zBuf2.c" />
Expand Down Expand Up @@ -356,6 +360,7 @@
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
</ClCompile>
<ClCompile Include="C\Md5.c" />
<ClCompile Include="C\MtCoder.c">
</ClCompile>
<ClCompile Include="C\MtDec.c">
Expand Down Expand Up @@ -398,6 +403,9 @@
</ClCompile>
<ClCompile Include="C\Sha256Opt.c">
</ClCompile>
<ClCompile Include="C\Sha3.c" />
<ClCompile Include="C\Sha512.c" />
<ClCompile Include="C\Sha512Opt.c" />
<ClCompile Include="C\Sort.c">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
Expand Down Expand Up @@ -812,6 +820,7 @@
<ClInclude Include="C\Lzma2Enc.h" />
<ClInclude Include="C\LzmaDec.h" />
<ClInclude Include="C\LzmaEnc.h" />
<ClInclude Include="C\Md5.h" />
<ClInclude Include="C\MtCoder.h" />
<ClInclude Include="C\MtDec.h" />
<ClInclude Include="C\Ppmd.h" />
Expand All @@ -821,6 +830,8 @@
<ClInclude Include="C\RotateDefs.h" />
<ClInclude Include="C\Sha1.h" />
<ClInclude Include="C\Sha256.h" />
<ClInclude Include="C\Sha3.h" />
<ClInclude Include="C\Sha512.h" />
<ClInclude Include="C\Sort.h" />
<ClInclude Include="CPP\7zip\Bundles\Format7zF\StdAfx.h" />
<ClInclude Include="C\SwapBytes.h" />
Expand Down
33 changes: 33 additions & 0 deletions lzma/7Zip.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,30 @@
<ClCompile Include="CPP\7zip\Common\FileStreams.cpp">
<Filter>7zip Common</Filter>
</ClCompile>
<ClCompile Include="C\Sha3.c">
<Filter>C</Filter>
</ClCompile>
<ClCompile Include="C\Sha512.c">
<Filter>C</Filter>
</ClCompile>
<ClCompile Include="C\Sha512Opt.c">
<Filter>C</Filter>
</ClCompile>
<ClCompile Include="C\Md5.c">
<Filter>C</Filter>
</ClCompile>
<ClCompile Include="CPP\Common\Md5Reg.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="CPP\Common\Sha3Reg.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="CPP\Common\Sha512Prepare.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="CPP\Common\Sha512Reg.cpp">
<Filter>Common</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="CPP\7zip\Bundles\Format7zF\resource.rc" />
Expand Down Expand Up @@ -1755,6 +1779,15 @@
<ClInclude Include="CPP\7zip\Common\FileStreams.h">
<Filter>7zip Common</Filter>
</ClInclude>
<ClInclude Include="C\Sha3.h">
<Filter>C</Filter>
</ClInclude>
<ClInclude Include="C\Sha512.h">
<Filter>C</Filter>
</ClInclude>
<ClInclude Include="C\Md5.h">
<Filter>C</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="CPP\7zip\Archive\Archive2.def">
Expand Down
31 changes: 29 additions & 2 deletions lzma/Asm/x86/LzFindOpt.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; LzFindOpt.asm -- ASM version of GetMatchesSpecN_2() function
; 2021-07-21: Igor Pavlov : Public domain
; 2024-06-18: Igor Pavlov : Public domain
;

ifndef x64
Expand All @@ -11,10 +11,31 @@ include 7zAsm.asm

MY_ASM_START

_TEXT$LZFINDOPT SEGMENT ALIGN(64) 'CODE'
ifndef Z7_LZ_FIND_OPT_ASM_USE_SEGMENT
if (IS_LINUX gt 0)
Z7_LZ_FIND_OPT_ASM_USE_SEGMENT equ 1
else
Z7_LZ_FIND_OPT_ASM_USE_SEGMENT equ 1
endif
endif

ifdef Z7_LZ_FIND_OPT_ASM_USE_SEGMENT
_TEXT$LZFINDOPT SEGMENT ALIGN(64) 'CODE'
MY_ALIGN macro num:req
align num
; align 16
endm
else
MY_ALIGN macro num:req
; We expect that ".text" is aligned for 16-bytes.
; So we don't need large alignment inside our function.
align 16
endm
endif


MY_ALIGN_16 macro
MY_ALIGN 16
endm

MY_ALIGN_32 macro
Expand Down Expand Up @@ -136,7 +157,11 @@ COPY_VAR_64 macro dest_var, src_var
endm


ifdef Z7_LZ_FIND_OPT_ASM_USE_SEGMENT
; MY_ALIGN_64
else
MY_ALIGN_16
endif
MY_PROC GetMatchesSpecN_2, 13
MY_PUSH_PRESERVED_ABI_REGS
mov r0, RSP
Expand Down Expand Up @@ -508,6 +533,8 @@ fin:
MY_POP_PRESERVED_ABI_REGS
MY_ENDP

ifdef Z7_LZ_FIND_OPT_ASM_USE_SEGMENT
_TEXT$LZFINDOPT ENDS
endif

end
40 changes: 38 additions & 2 deletions lzma/Asm/x86/LzmaDecOpt.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; LzmaDecOpt.asm -- ASM version of LzmaDec_DecodeReal_3() function
; 2021-02-23: Igor Pavlov : Public domain
; 2024-06-18: Igor Pavlov : Public domain
;
; 3 - is the code compatibility version of LzmaDec_DecodeReal_*()
; function for check at link time.
Expand All @@ -17,11 +17,41 @@ include 7zAsm.asm

MY_ASM_START

_TEXT$LZMADECOPT SEGMENT ALIGN(64) 'CODE'
; if Z7_LZMA_DEC_OPT_ASM_USE_SEGMENT is defined, we use additional SEGMENT with 64-byte alignment.
; if Z7_LZMA_DEC_OPT_ASM_USE_SEGMENT is not defined, we use default SEGMENT (where default 16-byte alignment of segment is expected).
; The performance is almost identical in our tests.
; But the performance can depend from position of lzmadec code inside instruction cache
; or micro-op cache line (depending from low address bits in 32-byte/64-byte cache lines).
; And 64-byte alignment provides a more consistent speed regardless
; of the code's position in the executable.
; But also it's possible that code without Z7_LZMA_DEC_OPT_ASM_USE_SEGMENT can be
; slightly faster than 64-bytes aligned code in some cases, if offset of lzmadec
; code in 64-byte block after compilation provides better speed by some reason.
; Note that Z7_LZMA_DEC_OPT_ASM_USE_SEGMENT adds an extra section to the ELF file.
; If you don't want to get that extra section, do not define Z7_LZMA_DEC_OPT_ASM_USE_SEGMENT.

ifndef Z7_LZMA_DEC_OPT_ASM_USE_SEGMENT
if (IS_LINUX gt 0)
Z7_LZMA_DEC_OPT_ASM_USE_SEGMENT equ 1
else
Z7_LZMA_DEC_OPT_ASM_USE_SEGMENT equ 1
endif
endif

ifdef Z7_LZMA_DEC_OPT_ASM_USE_SEGMENT
_TEXT$LZMADECOPT SEGMENT ALIGN(64) 'CODE'
MY_ALIGN macro num:req
align num
; align 16
endm
else
MY_ALIGN macro num:req
; We expect that ".text" is aligned for 16-bytes.
; So we don't need large alignment inside out function.
align 16
endm
endif


MY_ALIGN_16 macro
MY_ALIGN 16
Expand Down Expand Up @@ -610,7 +640,11 @@ PARAM_lzma equ REG_ABI_PARAM_0
PARAM_limit equ REG_ABI_PARAM_1
PARAM_bufLimit equ REG_ABI_PARAM_2

ifdef Z7_LZMA_DEC_OPT_ASM_USE_SEGMENT
; MY_ALIGN_64
else
MY_ALIGN_16
endif
MY_PROC LzmaDec_DecodeReal_3, 3
MY_PUSH_PRESERVED_ABI_REGS

Expand Down Expand Up @@ -1298,6 +1332,8 @@ fin:
MY_POP_PRESERVED_ABI_REGS
MY_ENDP

ifdef Z7_LZMA_DEC_OPT_ASM_USE_SEGMENT
_TEXT$LZMADECOPT ENDS
endif

end
4 changes: 2 additions & 2 deletions lzma/Asm/x86/Sha1Opt.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; Sha1Opt.asm -- SHA-1 optimized code for SHA-1 x86 hardware instructions
; 2021-03-10 : Igor Pavlov : Public domain
; 2024-06-16 : Igor Pavlov : Public domain

include 7zAsm.asm

Expand All @@ -20,7 +20,7 @@ MY_ASM_START



CONST SEGMENT
CONST SEGMENT READONLY

align 16
Reverse_Endian_Mask db 15,14,13,12, 11,10,9,8, 7,6,5,4, 3,2,1,0
Expand Down
4 changes: 2 additions & 2 deletions lzma/Asm/x86/Sha256Opt.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; Sha256Opt.asm -- SHA-256 optimized code for SHA-256 x86 hardware instructions
; 2022-04-17 : Igor Pavlov : Public domain
; 2024-06-16 : Igor Pavlov : Public domain

include 7zAsm.asm

Expand All @@ -20,7 +20,7 @@ endif
EXTRN K_CONST:xmmword
@

CONST SEGMENT
CONST SEGMENT READONLY

align 16
Reverse_Endian_Mask db 3,2,1,0, 7,6,5,4, 11,10,9,8, 15,14,13,12
Expand Down
5 changes: 3 additions & 2 deletions lzma/C/7zDec.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* 7zDec.c -- Decoding from 7z folder
2024-03-01 : Igor Pavlov : Public domain */
: Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -312,8 +312,9 @@ static BoolInt IS_MAIN_METHOD(UInt32 m)
case k_PPMD:
#endif
return True;
default:
return False;
}
return False;
}

static BoolInt IS_SUPPORTED_CODER(const CSzCoderInfo *c)
Expand Down
6 changes: 3 additions & 3 deletions lzma/C/7zVersion.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define MY_VER_MAJOR 24
#define MY_VER_MINOR 06
#define MY_VER_MINOR 9
#define MY_VER_BUILD 0
#define MY_VERSION_NUMBERS "24.06"
#define MY_VERSION_NUMBERS "24.09"
#define MY_VERSION MY_VERSION_NUMBERS

#ifdef MY_CPU_NAME
Expand All @@ -10,7 +10,7 @@
#define MY_VERSION_CPU MY_VERSION
#endif

#define MY_DATE "2024-05-26"
#define MY_DATE "2024-11-29"
#undef MY_COPYRIGHT
#undef MY_VERSION_COPYRIGHT_DATE
#define MY_AUTHOR_NAME "Igor Pavlov"
Expand Down
Loading

0 comments on commit 404172d

Please sign in to comment.