Skip to content

Commit c0e99ed

Browse files
committed
7zip plugin
Pyinstaller plugin
0 parents  commit c0e99ed

File tree

1,196 files changed

+292943
-0
lines changed

Some content is hidden

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

1,196 files changed

+292943
-0
lines changed

Asm/arm/7zCrcOpt.asm

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
CODE32
2+
3+
EXPORT |CrcUpdateT4@16|
4+
5+
AREA |.text|, CODE, ARM
6+
7+
MACRO
8+
CRC32_STEP_1
9+
10+
ldrb r4, [r1], #1
11+
subs r2, r2, #1
12+
eor r4, r4, r0
13+
and r4, r4, #0xFF
14+
ldr r4, [r3, +r4, lsl #2]
15+
eor r0, r4, r0, lsr #8
16+
17+
MEND
18+
19+
20+
MACRO
21+
CRC32_STEP_4 $STREAM_WORD
22+
23+
eor r7, r7, r8
24+
eor r7, r7, r9
25+
eor r0, r0, r7
26+
eor r0, r0, $STREAM_WORD
27+
ldr $STREAM_WORD, [r1], #4
28+
29+
and r7, r0, #0xFF
30+
and r8, r0, #0xFF00
31+
and r9, r0, #0xFF0000
32+
and r0, r0, #0xFF000000
33+
34+
ldr r7, [r6, +r7, lsl #2]
35+
ldr r8, [r5, +r8, lsr #6]
36+
ldr r9, [r4, +r9, lsr #14]
37+
ldr r0, [r3, +r0, lsr #22]
38+
39+
MEND
40+
41+
42+
|CrcUpdateT4@16| PROC
43+
44+
stmdb sp!, {r4-r11, lr}
45+
cmp r2, #0
46+
beq |$fin|
47+
48+
|$v1|
49+
tst r1, #7
50+
beq |$v2|
51+
CRC32_STEP_1
52+
bne |$v1|
53+
54+
|$v2|
55+
cmp r2, #16
56+
blo |$v3|
57+
58+
ldr r10, [r1], #4
59+
ldr r11, [r1], #4
60+
61+
add r4, r3, #0x400
62+
add r5, r3, #0x800
63+
add r6, r3, #0xC00
64+
65+
mov r7, #0
66+
mov r8, #0
67+
mov r9, #0
68+
69+
sub r2, r2, #16
70+
71+
|$loop|
72+
; pld [r1, #0x40]
73+
74+
CRC32_STEP_4 r10
75+
CRC32_STEP_4 r11
76+
77+
subs r2, r2, #8
78+
bhs |$loop|
79+
80+
sub r1, r1, #8
81+
add r2, r2, #16
82+
83+
eor r7, r7, r8
84+
eor r7, r7, r9
85+
eor r0, r0, r7
86+
87+
|$v3|
88+
cmp r2, #0
89+
beq |$fin|
90+
91+
|$v4|
92+
CRC32_STEP_1
93+
bne |$v4|
94+
95+
|$fin|
96+
ldmia sp!, {r4-r11, pc}
97+
98+
|CrcUpdateT4@16| ENDP
99+
100+
END

Asm/x86/7zAsm.asm

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
; 7zAsm.asm -- ASM macros
2+
; 2018-02-03 : Igor Pavlov : Public domain
3+
4+
MY_ASM_START macro
5+
ifdef x64
6+
.code
7+
else
8+
.386
9+
.model flat
10+
_TEXT$00 SEGMENT PARA PUBLIC 'CODE'
11+
endif
12+
endm
13+
14+
MY_PROC macro name:req, numParams:req
15+
align 16
16+
proc_numParams = numParams
17+
ifdef x64
18+
proc_name equ name
19+
else
20+
proc_name equ @CatStr(@,name,@, %numParams * 4)
21+
endif
22+
proc_name PROC
23+
endm
24+
25+
MY_ENDP macro
26+
ifdef x64
27+
ret
28+
else
29+
if proc_numParams LT 3
30+
ret
31+
else
32+
ret (proc_numParams - 2) * 4
33+
endif
34+
endif
35+
proc_name ENDP
36+
endm
37+
38+
ifdef x64
39+
REG_SIZE equ 8
40+
REG_LOGAR_SIZE equ 3
41+
else
42+
REG_SIZE equ 4
43+
REG_LOGAR_SIZE equ 2
44+
endif
45+
46+
x0 equ EAX
47+
x1 equ ECX
48+
x2 equ EDX
49+
x3 equ EBX
50+
x4 equ ESP
51+
x5 equ EBP
52+
x6 equ ESI
53+
x7 equ EDI
54+
55+
x0_W equ AX
56+
x1_W equ CX
57+
x2_W equ DX
58+
x3_W equ BX
59+
60+
x5_W equ BP
61+
x6_W equ SI
62+
x7_W equ DI
63+
64+
x0_L equ AL
65+
x1_L equ CL
66+
x2_L equ DL
67+
x3_L equ BL
68+
69+
x0_H equ AH
70+
x1_H equ CH
71+
x2_H equ DH
72+
x3_H equ BH
73+
74+
ifdef x64
75+
x5_L equ BPL
76+
x6_L equ SIL
77+
x7_L equ DIL
78+
79+
r0 equ RAX
80+
r1 equ RCX
81+
r2 equ RDX
82+
r3 equ RBX
83+
r4 equ RSP
84+
r5 equ RBP
85+
r6 equ RSI
86+
r7 equ RDI
87+
x8 equ r8d
88+
x9 equ r9d
89+
x10 equ r10d
90+
x11 equ r11d
91+
x12 equ r12d
92+
x13 equ r13d
93+
x14 equ r14d
94+
x15 equ r15d
95+
else
96+
r0 equ x0
97+
r1 equ x1
98+
r2 equ x2
99+
r3 equ x3
100+
r4 equ x4
101+
r5 equ x5
102+
r6 equ x6
103+
r7 equ x7
104+
endif
105+
106+
MY_PUSH_4_REGS macro
107+
push r3
108+
push r5
109+
push r6
110+
push r7
111+
endm
112+
113+
MY_POP_4_REGS macro
114+
pop r7
115+
pop r6
116+
pop r5
117+
pop r3
118+
endm
119+
120+
121+
ifdef x64
122+
123+
; for WIN64-x64 ABI:
124+
125+
REG_PARAM_0 equ r1
126+
REG_PARAM_1 equ r2
127+
REG_PARAM_2 equ r8
128+
REG_PARAM_3 equ r9
129+
130+
MY_PUSH_PRESERVED_REGS macro
131+
MY_PUSH_4_REGS
132+
push r12
133+
push r13
134+
push r14
135+
push r15
136+
endm
137+
138+
139+
MY_POP_PRESERVED_REGS macro
140+
pop r15
141+
pop r14
142+
pop r13
143+
pop r12
144+
MY_POP_4_REGS
145+
endm
146+
147+
endif

Asm/x86/7zCrcOpt.asm

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
; 7zCrcOpt.asm -- CRC32 calculation : optimized version
2+
; 2009-12-12 : Igor Pavlov : Public domain
3+
4+
include 7zAsm.asm
5+
6+
MY_ASM_START
7+
8+
rD equ r2
9+
rN equ r7
10+
11+
ifdef x64
12+
num_VAR equ r8
13+
table_VAR equ r9
14+
else
15+
data_size equ (REG_SIZE * 5)
16+
crc_table equ (REG_SIZE + data_size)
17+
num_VAR equ [r4 + data_size]
18+
table_VAR equ [r4 + crc_table]
19+
endif
20+
21+
SRCDAT equ rN + rD + 4 *
22+
23+
CRC macro op:req, dest:req, src:req, t:req
24+
op dest, DWORD PTR [r5 + src * 4 + 0400h * t]
25+
endm
26+
27+
CRC_XOR macro dest:req, src:req, t:req
28+
CRC xor, dest, src, t
29+
endm
30+
31+
CRC_MOV macro dest:req, src:req, t:req
32+
CRC mov, dest, src, t
33+
endm
34+
35+
CRC1b macro
36+
movzx x6, BYTE PTR [rD]
37+
inc rD
38+
movzx x3, x0_L
39+
xor x6, x3
40+
shr x0, 8
41+
CRC xor, x0, r6, 0
42+
dec rN
43+
endm
44+
45+
MY_PROLOG macro crc_end:req
46+
MY_PUSH_4_REGS
47+
48+
mov x0, x1
49+
mov rN, num_VAR
50+
mov r5, table_VAR
51+
test rN, rN
52+
jz crc_end
53+
@@:
54+
test rD, 7
55+
jz @F
56+
CRC1b
57+
jnz @B
58+
@@:
59+
cmp rN, 16
60+
jb crc_end
61+
add rN, rD
62+
mov num_VAR, rN
63+
sub rN, 8
64+
and rN, NOT 7
65+
sub rD, rN
66+
xor x0, [SRCDAT 0]
67+
endm
68+
69+
MY_EPILOG macro crc_end:req
70+
xor x0, [SRCDAT 0]
71+
mov rD, rN
72+
mov rN, num_VAR
73+
sub rN, rD
74+
crc_end:
75+
test rN, rN
76+
jz @F
77+
CRC1b
78+
jmp crc_end
79+
@@:
80+
MY_POP_4_REGS
81+
endm
82+
83+
MY_PROC CrcUpdateT8, 4
84+
MY_PROLOG crc_end_8
85+
mov x1, [SRCDAT 1]
86+
align 16
87+
main_loop_8:
88+
mov x6, [SRCDAT 2]
89+
movzx x3, x1_L
90+
CRC_XOR x6, r3, 3
91+
movzx x3, x1_H
92+
CRC_XOR x6, r3, 2
93+
shr x1, 16
94+
movzx x3, x1_L
95+
movzx x1, x1_H
96+
CRC_XOR x6, r3, 1
97+
movzx x3, x0_L
98+
CRC_XOR x6, r1, 0
99+
100+
mov x1, [SRCDAT 3]
101+
CRC_XOR x6, r3, 7
102+
movzx x3, x0_H
103+
shr x0, 16
104+
CRC_XOR x6, r3, 6
105+
movzx x3, x0_L
106+
CRC_XOR x6, r3, 5
107+
movzx x3, x0_H
108+
CRC_MOV x0, r3, 4
109+
xor x0, x6
110+
add rD, 8
111+
jnz main_loop_8
112+
113+
MY_EPILOG crc_end_8
114+
MY_ENDP
115+
116+
MY_PROC CrcUpdateT4, 4
117+
MY_PROLOG crc_end_4
118+
align 16
119+
main_loop_4:
120+
movzx x1, x0_L
121+
movzx x3, x0_H
122+
shr x0, 16
123+
movzx x6, x0_H
124+
and x0, 0FFh
125+
CRC_MOV x1, r1, 3
126+
xor x1, [SRCDAT 1]
127+
CRC_XOR x1, r3, 2
128+
CRC_XOR x1, r6, 0
129+
CRC_XOR x1, r0, 1
130+
131+
movzx x0, x1_L
132+
movzx x3, x1_H
133+
shr x1, 16
134+
movzx x6, x1_H
135+
and x1, 0FFh
136+
CRC_MOV x0, r0, 3
137+
xor x0, [SRCDAT 2]
138+
CRC_XOR x0, r3, 2
139+
CRC_XOR x0, r6, 0
140+
CRC_XOR x0, r1, 1
141+
add rD, 8
142+
jnz main_loop_4
143+
144+
MY_EPILOG crc_end_4
145+
MY_ENDP
146+
147+
end

0 commit comments

Comments
 (0)