1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

dos/exe: enable optimized code paths.

This commit is contained in:
Markus F.X.J. Oberhumer 2007-03-06 18:14:32 +01:00
parent d704694272
commit c18ebc63a6
3 changed files with 1877 additions and 1855 deletions

File diff suppressed because it is too large Load Diff

View File

@ -189,7 +189,6 @@ L1:
// umul32: dx:ax = dx:ax * 0x0600 // umul32: dx:ax = dx:ax * 0x0600
.macro M_U4M_dxax_0x0600 .macro M_U4M_dxax_0x0600
// FIXME: compute clocks and optimize this
#if 0 #if 0
// code size: 18 bytes // code size: 18 bytes
// i086: > 140 clocks (mul needs 70 clocks) // i086: > 140 clocks (mul needs 70 clocks)
@ -198,7 +197,7 @@ L1:
M_U4M_dxax_00bx M_U4M_dxax_00bx
shl ax shl ax
rcl dx rcl dx
#elif 1 #elif 0
// code size: 14 bytes // code size: 14 bytes
// i086: > 140 clocks (mul needs 70 clocks) // i086: > 140 clocks (mul needs 70 clocks)
// i286: > 26 clocks (mul needs 13 clocks) // i286: > 26 clocks (mul needs 13 clocks)
@ -236,14 +235,19 @@ L1:
// shld: di:si <<= 8; bx and cx are free // shld: di:si <<= 8; bx and cx are free
.macro M_shld_disi_8_bxcx .macro M_shld_disi_8_bxcx
// FIXME: compute clocks and optimize this #if 0
#if 1 // code size: 9 bytes
// i086: 2 + 7*(2+2+18) + (2+2+5) == 165 clocks
// i286: 2 + 7*(2+2+10) + (2+2+4) == 108 clocks
local L1 local L1
mov cx, 8 mov cx, 8
L1: shl si L1: shl si
rcl di rcl di
loop L1 loop L1
#else #else
// code size: 16 bytes
// i086: 17 clocks
// i286: 16 clocks
mov bx, di mov bx, di
mov cx, si mov cx, si
mov bh, bl mov bh, bl
@ -258,14 +262,19 @@ L1: shl si
// shld: di:ax <<= 8; bx and cx are free // shld: di:ax <<= 8; bx and cx are free
.macro M_shld_diax_8_bxcx .macro M_shld_diax_8_bxcx
// FIXME: compute clocks and optimize this #if 0
#if 1 // code size: 9 bytes
// i086: 2 + 7*(2+2+18) + (2+2+5) == 165 clocks
// i286: 2 + 7*(2+2+10) + (2+2+4) == 108 clocks
local L1 local L1
mov cx, 8 mov cx, 8
L1: shl ax L1: shl ax
rcl di rcl di
loop L1 loop L1
#else #else
// code size: 12 bytes
// i086: 13 clocks
// i286: 12 clocks
mov bx, di mov bx, di
mov bh, bl mov bh, bl
mov bl, ah mov bl, ah

View File

@ -73,27 +73,27 @@ Idx Name Size VMA LMA File off Algn Flags
68 NRV2EEX9 00000004 00000000 00000000 00000336 2**0 CONTENTS, READONLY 68 NRV2EEX9 00000004 00000000 00000000 00000336 2**0 CONTENTS, READONLY
69 LZMA_DEC00 00000033 00000000 00000000 0000033a 2**0 CONTENTS, RELOC, READONLY 69 LZMA_DEC00 00000033 00000000 00000000 0000033a 2**0 CONTENTS, RELOC, READONLY
70 ignore_reloc_overflow 00000008 00000000 00000000 0000036d 2**0 CONTENTS, RELOC, READONLY 70 ignore_reloc_overflow 00000008 00000000 00000000 0000036d 2**0 CONTENTS, RELOC, READONLY
71 LZMA_DEC10 0000119f 00000000 00000000 00000375 2**0 CONTENTS, READONLY 71 LZMA_DEC10 00001207 00000000 00000000 00000375 2**0 CONTENTS, READONLY
72 LZMA_DEC20 00001237 00000000 00000000 00001514 2**0 CONTENTS, READONLY 72 LZMA_DEC20 0000129f 00000000 00000000 0000157c 2**0 CONTENTS, READONLY
73 LZMA_DEC30 00000001 00000000 00000000 0000274b 2**0 CONTENTS, READONLY 73 LZMA_DEC30 00000001 00000000 00000000 0000281b 2**0 CONTENTS, READONLY
74 LZMA_DEC31 0000000c 00000000 00000000 0000274c 2**0 CONTENTS, RELOC, READONLY 74 LZMA_DEC31 0000000c 00000000 00000000 0000281c 2**0 CONTENTS, RELOC, READONLY
75 LZMA_DEC32 00000005 00000000 00000000 00002758 2**0 CONTENTS, RELOC, READONLY 75 LZMA_DEC32 00000005 00000000 00000000 00002828 2**0 CONTENTS, RELOC, READONLY
76 LZMA_DEC33 00000007 00000000 00000000 0000275d 2**0 CONTENTS, RELOC, READONLY 76 LZMA_DEC33 00000007 00000000 00000000 0000282d 2**0 CONTENTS, RELOC, READONLY
77 EXEMAIN5 00000001 00000000 00000000 00002764 2**0 CONTENTS, READONLY 77 EXEMAIN5 00000001 00000000 00000000 00002834 2**0 CONTENTS, READONLY
78 EXEADJUS 00000007 00000000 00000000 00002765 2**0 CONTENTS, READONLY 78 EXEADJUS 00000007 00000000 00000000 00002835 2**0 CONTENTS, READONLY
79 EXENOADJ 00000002 00000000 00000000 0000276c 2**0 CONTENTS, READONLY 79 EXENOADJ 00000002 00000000 00000000 0000283c 2**0 CONTENTS, READONLY
80 EXERELO1 0000001e 00000000 00000000 0000276e 2**0 CONTENTS, RELOC, READONLY 80 EXERELO1 0000001e 00000000 00000000 0000283e 2**0 CONTENTS, RELOC, READONLY
81 EXEREL9A 00000012 00000000 00000000 0000278c 2**0 CONTENTS, RELOC, READONLY 81 EXEREL9A 00000012 00000000 00000000 0000285c 2**0 CONTENTS, RELOC, READONLY
82 EXERELO2 00000004 00000000 00000000 0000279e 2**0 CONTENTS, READONLY 82 EXERELO2 00000004 00000000 00000000 0000286e 2**0 CONTENTS, READONLY
83 EXEREBIG 00000002 00000000 00000000 000027a2 2**0 CONTENTS, RELOC, READONLY 83 EXEREBIG 00000002 00000000 00000000 00002872 2**0 CONTENTS, RELOC, READONLY
84 EXERELO3 00000002 00000000 00000000 000027a4 2**0 CONTENTS, RELOC, READONLY 84 EXERELO3 00000002 00000000 00000000 00002874 2**0 CONTENTS, RELOC, READONLY
85 EXEMAIN8 00000003 00000000 00000000 000027a6 2**0 CONTENTS, READONLY 85 EXEMAIN8 00000003 00000000 00000000 00002876 2**0 CONTENTS, READONLY
86 DEVICEEND 00000013 00000000 00000000 000027a9 2**0 CONTENTS, READONLY 86 DEVICEEND 00000013 00000000 00000000 00002879 2**0 CONTENTS, READONLY
87 EXESTACK 00000006 00000000 00000000 000027bc 2**0 CONTENTS, RELOC, READONLY 87 EXESTACK 00000006 00000000 00000000 0000288c 2**0 CONTENTS, RELOC, READONLY
88 EXESTASP 00000003 00000000 00000000 000027c2 2**0 CONTENTS, RELOC, READONLY 88 EXESTASP 00000003 00000000 00000000 00002892 2**0 CONTENTS, RELOC, READONLY
89 EXEJUMPF 00000005 00000000 00000000 000027c5 2**0 CONTENTS, RELOC, READONLY 89 EXEJUMPF 00000005 00000000 00000000 00002895 2**0 CONTENTS, RELOC, READONLY
90 EXERCSPO 00000004 00000000 00000000 000027ca 2**0 CONTENTS, RELOC, READONLY 90 EXERCSPO 00000004 00000000 00000000 0000289a 2**0 CONTENTS, RELOC, READONLY
91 EXERETIP 00000006 00000000 00000000 000027ce 2**0 CONTENTS, RELOC, READONLY 91 EXERETIP 00000006 00000000 00000000 0000289e 2**0 CONTENTS, RELOC, READONLY
SYMBOL TABLE: SYMBOL TABLE:
00000000 l d DEVICEENTRY 00000000 DEVICEENTRY 00000000 l d DEVICEENTRY 00000000 DEVICEENTRY
00000000 l d COMPRESSED_LZMA_START 00000000 COMPRESSED_LZMA_START 00000000 l d COMPRESSED_LZMA_START 00000000 COMPRESSED_LZMA_START