Skip to content

Commit bbcc440

Browse files
authored
Merge 'mainline' (26.00) (pull request #468)
2 parents 83b0441 + f4efd0f commit bbcc440

58 files changed

Lines changed: 1746 additions & 967 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/do-release.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ REM Build some release of 7-Zip ZS
44
SET COPYCMD=/Y /B
55
SET COPTS=-m0=lzma -mx9 -ms=on -mf=bcj2
66
SET URL=https://www.7-zip.org/a/7z2501.exe
7-
SET VERSION=25.01
7+
SET VERSION=26.00
88
SET SZIP="C:\Program Files\7-Zip\7z.exe"
99
SET LURL=https://raw.githubusercontent.com/mcmilk/7-Zip-zstd/master/CPP/7zip/Bundles
1010

C/7zVersion.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#define MY_VER_MAJOR 25
2-
#define MY_VER_MINOR 01
3-
#define MY_VER_BUILD 04
4-
#define MY_VERSION_NUMBERS "25.01 ZS v1.5.7 R4"
1+
#define MY_VER_MAJOR 26
2+
#define MY_VER_MINOR 0
3+
#define MY_VER_BUILD 0
4+
#define MY_VERSION_NUMBERS "26.00 ZS v1.5.7 R1"
55
#define MY_VERSION MY_VERSION_NUMBERS
66

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

13-
#define MY_DATE "2026-01-10"
13+
#define MY_DATE "2026-02-12"
1414
#undef MY_COPYRIGHT
1515
#undef MY_VERSION_COPYRIGHT_DATE
1616
#define MY_AUTHOR_NAME "Igor Pavlov, Tino Reichardt, Sergey G. Brester"
1717
#define MY_COPYRIGHT_PD "Igor Pavlov : Public domain"
18-
#define MY_COPYRIGHT_CR "Copyright (c) 1999-2025 Igor Pavlov, 2016-2026 Tino Reichardt, 2022-2026 Sergey G. Brester"
18+
#define MY_COPYRIGHT_CR "Copyright (c) 1999- Igor Pavlov, 2016- Tino Reichardt, 2022- Sergey G. Brester"
1919

2020
#ifdef USE_COPYRIGHT_CR
2121
#define MY_COPYRIGHT MY_COPYRIGHT_CR

C/7zWindows.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
/* 7zWindows.h -- StdAfx
2-
2023-04-02 : Igor Pavlov : Public domain */
1+
/* 7zWindows.h -- Windows.h and related code
2+
Igor Pavlov : Public domain */
33

44
#ifndef ZIP7_INC_7Z_WINDOWS_H
55
#define ZIP7_INC_7Z_WINDOWS_H
66

77
#ifdef _WIN32
88

9+
#if defined(_MSC_VER) && _MSC_VER >= 1950 && !defined(__clang__) // VS2026
10+
// <Windows.h> and some another windows files need that option
11+
// VS2026: wtypesbase.h: warning C4865: 'tagCLSCTX': the underlying type will change from 'int' to 'unsigned int' when '/Zc:enumTypes' is specified on the command line
12+
#pragma warning(disable : 4865)
13+
#endif
14+
915
#if defined(__clang__)
1016
# pragma clang diagnostic push
1117
#endif

C/7zip_gcc_c.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ DEL_OBJ_EXE = -$(RM) $(O)\*.o $(O)\$(PROG).exe $(O)\$(PROG).dll
106106
endif
107107

108108

109-
LIB2 = -lOle32 -loleaut32 -luuid -ladvapi32 -lUser32 -lShell32
109+
LIB2 = -lole32 -loleaut32 -luuid -ladvapi32 -luser32 -lshell32
110110

111111
CFLAGS_EXTRA = -DUNICODE -D_UNICODE
112112
# -Wno-delete-non-virtual-dtor

C/CpuArch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYPTO_SUPPORT_VAL; }
859859

860860
#if defined(__GLIBC__) && (__GLIBC__ * 100 + __GLIBC_MINOR__ >= 216)
861861
#define Z7_GETAUXV_AVAILABLE
862-
#else
862+
#elif !defined(__QNXNTO__)
863863
// #pragma message("=== is not NEW GLIBC === ")
864864
#if defined __has_include
865865
#if __has_include (<sys/auxv.h>)
@@ -877,7 +877,7 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYPTO_SUPPORT_VAL; }
877877

878878
#ifdef USE_HWCAP
879879

880-
#if defined(__FreeBSD__)
880+
#if defined(__FreeBSD__) || defined(__OpenBSD__)
881881
static unsigned long MY_getauxval(int aux)
882882
{
883883
unsigned long val;

C/CpuArch.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ MY_CPU_64BIT means that processor can work with 64-bit registers.
3131
#define MY_CPU_NAME "x32"
3232
#define MY_CPU_SIZEOF_POINTER 4
3333
#else
34-
#define MY_CPU_NAME "x64"
34+
#if defined(__APX_EGPR__) || defined(__EGPR__)
35+
#define MY_CPU_NAME "x64-apx"
36+
#define MY_CPU_AMD64_APX
37+
#else
38+
#define MY_CPU_NAME "x64"
39+
#endif
3540
#define MY_CPU_SIZEOF_POINTER 8
3641
#endif
3742
#define MY_CPU_64BIT
@@ -596,8 +601,20 @@ problem-4 : performace:
596601
#define SetBe32a(p, v) { *(UInt32 *)(void *)(p) = (v); }
597602
#define SetBe16a(p, v) { *(UInt16 *)(void *)(p) = (v); }
598603

604+
// gcc and clang for powerpc can transform load byte access to load reverse word access.
605+
// sp we can use byte access instead of word access. Z7_BSWAP64 cab be slow
606+
#if 1 && defined(Z7_CPU_FAST_BSWAP_SUPPORTED) && defined(MY_CPU_64BIT)
607+
#define GetUi64a(p) Z7_BSWAP64 (*(const UInt64 *)(const void *)(p))
608+
#else
599609
#define GetUi64a(p) GetUi64(p)
610+
#endif
611+
612+
#if 1 && defined(Z7_CPU_FAST_BSWAP_SUPPORTED)
613+
#define GetUi32a(p) Z7_BSWAP32 (*(const UInt32 *)(const void *)(p))
614+
#else
600615
#define GetUi32a(p) GetUi32(p)
616+
#endif
617+
601618
#define GetUi16a(p) GetUi16(p)
602619
#define SetUi32a(p, v) SetUi32(p, v)
603620
#define SetUi16a(p, v) SetUi16(p, v)

C/HuffEnc.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Igor Pavlov : Public domain */
1313
#define NUM_BITS 10
1414
#define MASK ((1u << NUM_BITS) - 1)
1515
#define FREQ_MASK (~(UInt32)MASK)
16-
#define NUM_COUNTERS (48 * 2)
16+
#define NUM_COUNTERS (104 * 2) // (80 * 2) or (128 * 2) : ((prime_number + 1) * 2) for smaller code.
1717

1818
#if 1 && (defined(MY_CPU_LE) || defined(MY_CPU_BE))
1919
#if defined(MY_CPU_LE)
@@ -95,9 +95,10 @@ void Huffman_Generate(const UInt32 *freqs, UInt32 *p, Byte *lens, unsigned numSy
9595
counters[1] = 0;
9696
for (i = 2; i != NUM_COUNTERS; i += 2)
9797
{
98-
unsigned c;
99-
c = (counters )[i]; (counters )[i] = num; num += c;
100-
c = (counters + 1)[i]; (counters + 1)[i] = num; num += c;
98+
const unsigned c0 = (counters )[i];
99+
const unsigned c1 = (counters + 1)[i];
100+
(counters )[i] = num; num += c0;
101+
(counters + 1)[i] = num; num += c1;
101102
}
102103
counters[0] = num; // we want to write (freq==0) symbols to the end of (p) array
103104
{

C/HuffEnc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ EXTERN_C_BEGIN
1616
1 <= maxLen <= 16 = Z7_HUFFMAN_LEN_MAX
1717
Num_Items(p) >= HUFFMAN_TEMP_SIZE(num)
1818
*/
19-
void Huffman_Generate(const UInt32 *freqs, UInt32 *p, Byte *lens, UInt32 num, UInt32 maxLen);
19+
void Huffman_Generate(const UInt32 *freqs, UInt32 *p, Byte *lens, unsigned num, unsigned maxLen);
2020

2121
EXTERN_C_END
2222

C/Xxh64.c

Lines changed: 80 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Xxh64.c -- XXH64 hash calculation
22
original code: Copyright (c) Yann Collet.
3-
2023-08-18 : modified by Igor Pavlov.
3+
modified by Igor Pavlov.
44
This source code is licensed under BSD 2-Clause License.
55
*/
66

@@ -27,6 +27,14 @@ void Xxh64State_Init(CXxh64State *p)
2727

2828
#if !defined(MY_CPU_64BIT) && defined(MY_CPU_X86) && defined(_MSC_VER)
2929
#define Z7_XXH64_USE_ASM
30+
#elif !defined(MY_CPU_LE_UNALIGN_64) // && defined (MY_CPU_LE)
31+
#define Z7_XXH64_USE_ALIGNED
32+
#endif
33+
34+
#ifdef Z7_XXH64_USE_ALIGNED
35+
#define Xxh64State_UpdateBlocks_Unaligned_Select Xxh64State_UpdateBlocks_Unaligned
36+
#else
37+
#define Xxh64State_UpdateBlocks_Unaligned_Select Xxh64State_UpdateBlocks
3038
#endif
3139

3240
#if !defined(MY_CPU_64BIT) && defined(MY_CPU_X86) \
@@ -188,32 +196,76 @@ Xxh64State_UpdateBlocks(CXxh64State *p, const void *data, const void *end)
188196

189197
#else
190198

199+
#ifdef Z7_XXH64_USE_ALIGNED
200+
static
201+
#endif
191202
void
192203
Z7_NO_INLINE
193204
Z7_FASTCALL
194-
Xxh64State_UpdateBlocks(CXxh64State *p, const void *_data, const void *end)
205+
Xxh64State_UpdateBlocks_Unaligned_Select(CXxh64State *p, const void *_data, const void *end)
195206
{
196207
const Byte *data = (const Byte *)_data;
197-
UInt64 v[4];
198-
v[0] = p->v[0];
199-
v[1] = p->v[1];
200-
v[2] = p->v[2];
201-
v[3] = p->v[3];
208+
UInt64 v0, v1, v2, v3;
209+
v0 = p->v[0];
210+
v1 = p->v[1];
211+
v2 = p->v[2];
212+
v3 = p->v[3];
202213
do
203214
{
204-
v[0] = Xxh64_Round(v[0], GetUi64(data)); data += 8;
205-
v[1] = Xxh64_Round(v[1], GetUi64(data)); data += 8;
206-
v[2] = Xxh64_Round(v[2], GetUi64(data)); data += 8;
207-
v[3] = Xxh64_Round(v[3], GetUi64(data)); data += 8;
215+
v0 = Xxh64_Round(v0, GetUi64(data)); data += 8;
216+
v1 = Xxh64_Round(v1, GetUi64(data)); data += 8;
217+
v2 = Xxh64_Round(v2, GetUi64(data)); data += 8;
218+
v3 = Xxh64_Round(v3, GetUi64(data)); data += 8;
208219
}
209220
while (data != end);
210-
p->v[0] = v[0];
211-
p->v[1] = v[1];
212-
p->v[2] = v[2];
213-
p->v[3] = v[3];
221+
p->v[0] = v0;
222+
p->v[1] = v1;
223+
p->v[2] = v2;
224+
p->v[3] = v3;
214225
}
215226

216-
#endif
227+
228+
#ifdef Z7_XXH64_USE_ALIGNED
229+
230+
static
231+
void
232+
Z7_NO_INLINE
233+
Z7_FASTCALL
234+
Xxh64State_UpdateBlocks_Aligned(CXxh64State *p, const void *_data, const void *end)
235+
{
236+
const Byte *data = (const Byte *)_data;
237+
UInt64 v0, v1, v2, v3;
238+
v0 = p->v[0];
239+
v1 = p->v[1];
240+
v2 = p->v[2];
241+
v3 = p->v[3];
242+
do
243+
{
244+
v0 = Xxh64_Round(v0, GetUi64a(data)); data += 8;
245+
v1 = Xxh64_Round(v1, GetUi64a(data)); data += 8;
246+
v2 = Xxh64_Round(v2, GetUi64a(data)); data += 8;
247+
v3 = Xxh64_Round(v3, GetUi64a(data)); data += 8;
248+
}
249+
while (data != end);
250+
p->v[0] = v0;
251+
p->v[1] = v1;
252+
p->v[2] = v2;
253+
p->v[3] = v3;
254+
}
255+
256+
void
257+
Z7_NO_INLINE
258+
Z7_FASTCALL
259+
Xxh64State_UpdateBlocks(CXxh64State *p, const void *data, const void *end)
260+
{
261+
if (((unsigned)(ptrdiff_t)data & 7) == 0)
262+
Xxh64State_UpdateBlocks_Aligned(p, data, end);
263+
else
264+
Xxh64State_UpdateBlocks_Unaligned(p, data, end);
265+
}
266+
267+
#endif // Z7_XXH64_USE_ALIGNED
268+
#endif // Z7_XXH64_USE_ASM
217269

218270
UInt64 Xxh64State_Digest(const CXxh64State *p, const void *_data, UInt64 count)
219271
{
@@ -306,12 +358,22 @@ void Xxh64_Update(CXxh64 *p, const void *_data, size_t size)
306358
while (--rem);
307359
if (cnt != 32)
308360
return;
309-
Xxh64State_UpdateBlocks(&p->state, p->buf64, &p->buf64[4]);
361+
#ifdef Z7_XXH64_USE_ALIGNED
362+
Xxh64State_UpdateBlocks_Aligned
363+
#else
364+
Xxh64State_UpdateBlocks_Unaligned_Select
365+
#endif
366+
(&p->state, p->buf64, &p->buf64[4]);
310367
}
311368

312369
if (size &= ~(size_t)31)
313370
{
314-
Xxh64State_UpdateBlocks(&p->state, data, data + size);
371+
#ifdef Z7_XXH64_USE_ALIGNED
372+
if (((unsigned)(ptrdiff_t)data & 7) == 0)
373+
Xxh64State_UpdateBlocks_Aligned(&p->state, data, data + size);
374+
else
375+
#endif
376+
Xxh64State_UpdateBlocks_Unaligned_Select(&p->state, data, data + size);
315377
data += size;
316378
}
317379

CPP/7zip/7zip_gcc.mak

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ MY_MKDIR=mkdir
142142
DEL_OBJ_EXE = -$(RM) $(O)\*.o $(O)\$(PROG).exe $(O)\$(PROG).dll
143143
endif
144144

145-
LIB2_GUI = -lOle32 -lGdi32 -lComctl32 -lComdlg32 -lShell32 $(LIB_HTMLHELP)
146-
LIB2 = -loleaut32 -luuid -ladvapi32 -lUser32 $(LIB2_GUI)
145+
LIB2_GUI = -lole32 -lgdi32 -lcomctl32 -lcomdlg32 -lshell32 $(LIB_HTMLHELP)
146+
LIB2 = -loleaut32 -luuid -ladvapi32 -luser32 $(LIB2_GUI)
147147

148148
# v24.00: -DUNICODE and -D_UNICODE are defined in precompilation header files
149149
# CXXFLAGS_EXTRA = -DUNICODE -D_UNICODE

0 commit comments

Comments
 (0)