Skip to content

Commit b4806a7

Browse files
committed
Delta update to 7-Zip 24.06
1 parent 74555cb commit b4806a7

12 files changed

Lines changed: 85 additions & 29 deletions

File tree

7z-Src/C/7zVersion.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#define MY_VER_MAJOR 24
2-
#define MY_VER_MINOR 05
2+
#define MY_VER_MINOR 06
33
#define MY_VER_BUILD 0
4-
#define MY_VERSION_NUMBERS "24.05"
4+
#define MY_VERSION_NUMBERS "24.06"
55
#define MY_VERSION MY_VERSION_NUMBERS
66

77
#ifdef MY_CPU_NAME
@@ -10,7 +10,7 @@
1010
#define MY_VERSION_CPU MY_VERSION
1111
#endif
1212

13-
#define MY_DATE "2024-05-14"
13+
#define MY_DATE "2024-05-26"
1414
#undef MY_COPYRIGHT
1515
#undef MY_VERSION_COPYRIGHT_DATE
1616
#define MY_AUTHOR_NAME "Igor Pavlov"

7z-Src/C/Blake2s.c

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Blake2s.c -- BLAKE2sp Hash
2-
2024-01-29 : Igor Pavlov : Public domain
2+
2024-05-18 : Igor Pavlov : Public domain
33
2015-2019 : Samuel Neves : original code : CC0 1.0 Universal (CC0 1.0). */
44

55
#include "Precomp.h"
@@ -12,6 +12,17 @@
1212
#include "Compiler.h"
1313
#include "CpuArch.h"
1414

15+
/*
16+
if defined(__AVX512F__) && defined(__AVX512VL__)
17+
{
18+
we define Z7_BLAKE2S_USE_AVX512_ALWAYS,
19+
but the compiler can use avx512 for any code.
20+
}
21+
else if defined(Z7_BLAKE2S_USE_AVX512_ALWAYS)
22+
{ we use avx512 only for sse* and avx* branches of code. }
23+
*/
24+
// #define Z7_BLAKE2S_USE_AVX512_ALWAYS // for debug
25+
1526
#if defined(__SSE2__)
1627
#define Z7_BLAKE2S_USE_VECTORS
1728
#elif defined(MY_CPU_X86_OR_AMD64)
@@ -59,6 +70,9 @@
5970
#endif // SSSE3
6071

6172
#if defined(__GNUC__) || defined(__clang__)
73+
#if defined(Z7_BLAKE2S_USE_AVX512_ALWAYS) && !(defined(__AVX512F__) && defined(__AVX512VL__))
74+
#define BLAKE2S_ATTRIB_128BIT __attribute__((__target__("avx512vl,avx512f")))
75+
#else
6276
#if defined(Z7_BLAKE2S_USE_SSE41)
6377
#define BLAKE2S_ATTRIB_128BIT __attribute__((__target__("sse4.1")))
6478
#elif defined(Z7_BLAKE2S_USE_SSSE3)
@@ -67,6 +81,7 @@
6781
#define BLAKE2S_ATTRIB_128BIT __attribute__((__target__("sse2")))
6882
#endif
6983
#endif
84+
#endif
7085

7186

7287
#if defined(__AVX2__)
@@ -77,7 +92,11 @@
7792
|| defined(Z7_LLVM_CLANG_VERSION) && (Z7_LLVM_CLANG_VERSION >= 30100)
7893
#define Z7_BLAKE2S_USE_AVX2
7994
#ifdef Z7_BLAKE2S_USE_AVX2
95+
#if defined(Z7_BLAKE2S_USE_AVX512_ALWAYS) && !(defined(__AVX512F__) && defined(__AVX512VL__))
96+
#define BLAKE2S_ATTRIB_AVX2 __attribute__((__target__("avx512vl,avx512f")))
97+
#else
8098
#define BLAKE2S_ATTRIB_AVX2 __attribute__((__target__("avx2")))
99+
#endif
81100
#endif
82101
#elif defined(Z7_MSC_VER_ORIGINAL) && (Z7_MSC_VER_ORIGINAL >= 1800) \
83102
|| defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1400)
@@ -107,7 +126,9 @@
107126

108127
#if defined(__AVX512F__) && defined(__AVX512VL__)
109128
// && defined(Z7_MSC_VER_ORIGINAL) && (Z7_MSC_VER_ORIGINAL > 1930)
129+
#ifndef Z7_BLAKE2S_USE_AVX512_ALWAYS
110130
#define Z7_BLAKE2S_USE_AVX512_ALWAYS
131+
#endif
111132
// #pragma message ("=== Blake2s AVX512")
112133
#endif
113134

@@ -1164,7 +1185,9 @@ Blake2sp_Final_V128_Fast(UInt32 *states)
11641185
#if 1 && defined(Z7_BLAKE2S_USE_AVX512_ALWAYS)
11651186
#define MM256_ROR_EPI32 _mm256_ror_epi32
11661187
#define Z7_MM256_ROR_EPI32_IS_SUPPORTED
1188+
#ifdef Z7_BLAKE2S_USE_AVX2_WAY2
11671189
#define LOAD_ROTATE_CONSTS_256
1190+
#endif
11681191
#else
11691192
#ifdef Z7_BLAKE2S_USE_AVX2_WAY_SLOW
11701193
#ifdef Z7_BLAKE2S_USE_AVX2_WAY2
@@ -2549,9 +2572,11 @@ void z7_Black2sp_Prepare(void)
25492572

25502573
#if defined(MY_CPU_X86_OR_AMD64)
25512574
#if defined(Z7_BLAKE2S_USE_AVX512_ALWAYS)
2575+
// optional check
2576+
#if 0 || !(defined(__AVX512F__) && defined(__AVX512VL__))
25522577
if (CPU_IsSupported_AVX512F_AVX512VL())
2553-
#endif
2554-
#if defined(Z7_BLAKE2S_USE_SSE41)
2578+
#endif
2579+
#elif defined(Z7_BLAKE2S_USE_SSE41)
25552580
if (CPU_IsSupported_SSE41())
25562581
#elif defined(Z7_BLAKE2S_USE_SSSE3)
25572582
if (CPU_IsSupported_SSSE3())
@@ -2584,12 +2609,14 @@ void z7_Black2sp_Prepare(void)
25842609

25852610
#ifdef Z7_BLAKE2S_USE_AVX2
25862611
#if defined(MY_CPU_X86_OR_AMD64)
2587-
if (
2588-
#if 0 && defined(Z7_BLAKE2S_USE_AVX512_ALWAYS)
2589-
CPU_IsSupported_AVX512F_AVX512VL() &&
2612+
2613+
#if defined(Z7_BLAKE2S_USE_AVX512_ALWAYS)
2614+
#if 0
2615+
if (CPU_IsSupported_AVX512F_AVX512VL())
2616+
#endif
2617+
#else
2618+
if (CPU_IsSupported_AVX2())
25902619
#endif
2591-
CPU_IsSupported_AVX2()
2592-
)
25932620
#endif
25942621
{
25952622
// #pragma message ("=== Blake2s AVX2")

7z-Src/C/CpuArch.c

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* CpuArch.c -- CPU specific code
2-
2024-03-02 : Igor Pavlov : Public domain */
2+
2024-05-18 : Igor Pavlov : Public domain */
33

44
#include "Precomp.h"
55

@@ -638,7 +638,7 @@ BoolInt CPU_IsSupported_AVX(void)
638638

639639
{
640640
const UInt32 bm = (UInt32)x86_xgetbv_0(MY_XCR_XFEATURE_ENABLED_MASK);
641-
// printf("\n=== XGetBV=%d\n", bm);
641+
// printf("\n=== XGetBV=0x%x\n", bm);
642642
return 1
643643
& (BoolInt)(bm >> 1) // SSE state is supported (set by OS) for storing/restoring
644644
& (BoolInt)(bm >> 2); // AVX state is supported (set by OS) for storing/restoring
@@ -662,8 +662,7 @@ BoolInt CPU_IsSupported_AVX2(void)
662662
}
663663
}
664664

665-
/*
666-
// fix it:
665+
#if 0
667666
BoolInt CPU_IsSupported_AVX512F_AVX512VL(void)
668667
{
669668
if (!CPU_IsSupported_AVX())
@@ -672,14 +671,25 @@ BoolInt CPU_IsSupported_AVX512F_AVX512VL(void)
672671
return False;
673672
{
674673
UInt32 d[4];
674+
BoolInt v;
675675
z7_x86_cpuid(d, 7);
676676
// printf("\ncpuid(7): ebx=%8x ecx=%8x\n", d[1], d[2]);
677+
v = 1
678+
& (BoolInt)(d[1] >> 16) // avx512f
679+
& (BoolInt)(d[1] >> 31); // avx512vl
680+
if (!v)
681+
return False;
682+
}
683+
{
684+
const UInt32 bm = (UInt32)x86_xgetbv_0(MY_XCR_XFEATURE_ENABLED_MASK);
685+
// printf("\n=== XGetBV=0x%x\n", bm);
677686
return 1
678-
& (BoolInt)(d[1] >> 16) // avx512-f
679-
& (BoolInt)(d[1] >> 31); // avx512-Vl
687+
& (BoolInt)(bm >> 5) // OPMASK
688+
& (BoolInt)(bm >> 6) // ZMM upper 256-bit
689+
& (BoolInt)(bm >> 7); // ZMM16 ... ZMM31
680690
}
681691
}
682-
*/
692+
#endif
683693

684694
BoolInt CPU_IsSupported_VAES_AVX2(void)
685695
{

7z-Src/C/CpuArch.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* CpuArch.h -- CPU specific code
2-
2024-05-13 : Igor Pavlov : Public domain */
2+
2024-05-18 : Igor Pavlov : Public domain */
33

44
#ifndef ZIP7_INC_CPU_ARCH_H
55
#define ZIP7_INC_CPU_ARCH_H
@@ -370,12 +370,12 @@ MY_CPU_64BIT means that processor can work with 64-bit registers.
370370
#define Z7_CPU_FAST_BSWAP_SUPPORTED
371371

372372
/* GCC can generate slow code that calls function for __builtin_bswap32() for:
373-
- GCC for RISCV, if Zbb extension is not used.
373+
- GCC for RISCV, if Zbb/XTHeadBb extension is not used.
374374
- GCC for SPARC.
375375
The code from CLANG for SPARC also is not fastest.
376376
So we don't define Z7_CPU_FAST_BSWAP_SUPPORTED in some cases.
377377
*/
378-
#elif (!defined(MY_CPU_RISCV) || defined (__riscv_zbb)) \
378+
#elif (!defined(MY_CPU_RISCV) || defined (__riscv_zbb) || defined(__riscv_xtheadbb)) \
379379
&& !defined(MY_CPU_SPARC) \
380380
&& ( \
381381
(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) \
@@ -607,7 +607,7 @@ UInt32 Z7_FASTCALL z7_x86_cpuid_GetMaxFunc(void);
607607
BoolInt CPU_IsSupported_AES(void);
608608
BoolInt CPU_IsSupported_AVX(void);
609609
BoolInt CPU_IsSupported_AVX2(void);
610-
// BoolInt CPU_IsSupported_AVX512F_AVX512VL(void);
610+
BoolInt CPU_IsSupported_AVX512F_AVX512VL(void);
611611
BoolInt CPU_IsSupported_VAES_AVX2(void);
612612
BoolInt CPU_IsSupported_CMOV(void);
613613
BoolInt CPU_IsSupported_SSE(void);

7z-Src/C/ZstdDec.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ZstdDec.c -- Zstd Decoder
2-
2024-01-21 : the code was developed by Igor Pavlov, using Zstandard format
2+
2024-05-26 : the code was developed by Igor Pavlov, using Zstandard format
33
specification and original zstd decoder code as reference code.
44
original zstd decoder code: Copyright (c) Facebook, Inc. All rights reserved.
55
This source code is licensed under BSD 3-Clause License.
@@ -2507,6 +2507,7 @@ SRes ZstdDec1_DecodeBlock(CZstdDec1 *p,
25072507
if (vars.numSeqs == 0)
25082508
{
25092509
p->winPos += numLits;
2510+
UPDATE_TOTAL_OUT(p, numLits)
25102511
return SZ_OK;
25112512
}
25122513
}
@@ -3310,11 +3311,11 @@ static SRes ZstdDec_DecodeBlock(CZstdDec * const p, CZstdDecState * const ds,
33103311
{
33113312
const SizeT xxh64_winPos = p->decoder.winPos - ZstdDec_GET_UNPROCESSED_XXH64_SIZE(p);
33123313
p->decoder.winPos += outCur;
3314+
UPDATE_TOTAL_OUT(&p->decoder, outCur)
33133315
p->contentProcessed += outCur;
33143316
ZstdDec_Update_XXH(p, xxh64_winPos);
33153317
}
33163318
// ds->winPos = p->decoder.winPos; // the caller does it instead. for debug:
3317-
UPDATE_TOTAL_OUT(&p->decoder, outCur)
33183319
ds->outProcessed += outCur;
33193320
if (p->blockSize -= (UInt32)outCur)
33203321
{

7z-Src/CPP/7zip/Compress/DllExports2Compress.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88

99
#include "../Common/RegisterCodec.h"
1010

11+
extern "C"
12+
BOOL WINAPI DllMain(
13+
#ifdef UNDER_CE
14+
HANDLE
15+
#else
16+
HINSTANCE
17+
#endif
18+
/* hInstance */, DWORD /* dwReason */, LPVOID /*lpReserved*/);
19+
1120
extern "C"
1221
BOOL WINAPI DllMain(
1322
#ifdef UNDER_CE
@@ -22,6 +31,7 @@ BOOL WINAPI DllMain(
2231

2332
STDAPI CreateCoder(const GUID *clsid, const GUID *iid, void **outObject);
2433

34+
STDAPI CreateObject(const GUID *clsid, const GUID *iid, void **outObject);
2535
STDAPI CreateObject(const GUID *clsid, const GUID *iid, void **outObject)
2636
{
2737
return CreateCoder(clsid, iid, outObject);

7z-Src/CPP/7zip/UI/Console/MainAr.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ static inline bool CheckIsa()
7070
{
7171
// some compilers (e2k) support SSE/AVX, but cpuid() can be unavailable or return lower isa support
7272
#ifdef MY_CPU_X86_OR_AMD64
73-
#if defined(__AVX2__)
73+
#if 0 && (defined(__AVX512F__) && defined(__AVX512VL__))
74+
if (!CPU_IsSupported_AVX512F_AVX512VL())
75+
return false;
76+
#elif defined(__AVX2__)
7477
if (!CPU_IsSupported_AVX2())
7578
return false;
7679
#elif defined(__AVX__)

7z-Src/DOC/7zip.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22

33
<?define VerMajor = "24" ?>
4-
<?define VerMinor = "05" ?>
4+
<?define VerMinor = "06" ?>
55
<?define VerBuild = "00" ?>
66
<?define MmVer = "$(var.VerMajor).$(var.VerMinor)" ?>
77
<?define MmHex = "$(var.VerMajor)$(var.VerMinor)" ?>

7z-Src/DOC/lzma.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
LZMA compression
22
----------------
3-
Version: 24.05
3+
Version: 24.06
44

55
This file describes LZMA encoding and decoding functions written in C language.
66

7z-Src/DOC/readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
7-Zip 24.05 Sources
1+
7-Zip 24.06 Sources
22
-------------------
33

44
7-Zip is a file archiver for Windows.

0 commit comments

Comments
 (0)