Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / lzo / asm / i386 / src / lzo1c_d.ash
blob56622ab583ae6e299012941baaa7180de0318a7b
1 /* lzo1c_d.ash -- assembler implementation of the LZO1C decompression algorithm
3    This file is part of the LZO real-time data compression library.
5    Copyright (C) 2011 Markus Franz Xaver Johannes Oberhumer
6    Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
7    Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
8    Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
9    Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
10    Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
11    Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
12    Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
13    Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
14    Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
15    Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
16    Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
17    Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
18    Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
19    Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
20    Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
21    All Rights Reserved.
23    The LZO library is free software; you can redistribute it and/or
24    modify it under the terms of the GNU General Public License as
25    published by the Free Software Foundation; either version 2 of
26    the License, or (at your option) any later version.
28    The LZO library is distributed in the hope that it will be useful,
29    but WITHOUT ANY WARRANTY; without even the implied warranty of
30    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
31    GNU General Public License for more details.
33    You should have received a copy of the GNU General Public License
34    along with the LZO library; see the file COPYING.
35    If not, write to the Free Software Foundation, Inc.,
36    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
38    Markus F.X.J. Oberhumer
39    <markus@oberhumer.com>
40    http://www.oberhumer.com/opensource/lzo/
41  */
44 /***********************************************************************
46 ************************************************************************/
48         ALIGN3
49 .L1:
50         xorl    %eax,%eax
51         movb    (%esi),%al
52         incl    %esi
53         cmpb    $32,%al
54         jnb     .LMATCH
56         orb     %al,%al
57         jz      .L12
58         movl    %eax,%ecx
59 .LIT:
60         TEST_OP((%edi,%ecx),%ebx)
61         TEST_IP((%esi,%ecx),%ebx)
62         rep
63         movsb
64 .LM1:
65         movb    (%esi),%al
66         incl    %esi
68         cmpb    $32,%al
69         jb      .LM2
70 .LMATCH:
71         cmpb    $64,%al
72         jb      .LN3
74         movl    %eax,%ecx
75         andb    $31,%al
76         leal    -1(%edi),%edx
77         shrl    $5,%ecx
78         subl    %eax,%edx
79         movb    (%esi),%al
80         incl    %esi
82         shll    $5,%eax
83         subl    %eax,%edx
84         incl    %ecx
85         xchgl   %esi,%edx
86         TEST_LOOKBEHIND(%esi)
87         TEST_OP((%edi,%ecx),%ebx)
88         rep
89         movsb
90         movl    %edx,%esi
91         jmp     .L1
93         ALIGN3
94 .L12:
95         LODSB
96         leal    32(%eax),%ecx
97         cmpb    $248,%al
98         jb      .LIT
100         movl    $280,%ecx
101         subb    $248,%al
102         jz      .L11
103         xchgl   %eax,%ecx
104         xorb    %al,%al
105         shll    %cl,%eax
106         xchgl   %eax,%ecx
107 .L11:
108         TEST_OP((%edi,%ecx),%ebx)
109         TEST_IP((%esi,%ecx),%ebx)
110         rep
111         movsb
112         jmp     .L1
114         ALIGN3
115 .LM2:
116         leal    -1(%edi),%edx
117         subl    %eax,%edx
118         LODSB
119         shll    $5,%eax
120         subl    %eax,%edx
121         xchgl   %esi,%edx
122         TEST_LOOKBEHIND(%esi)
123         TEST_OP(4(%edi),%ebx)
124         movsb
125         movsb
126         movsb
127         movl    %edx,%esi
128         movsb
129         xorl    %eax,%eax
130         jmp     .LM1
131 .LN3:
132         andb    $31,%al
133         movl    %eax,%ecx
134         jnz     .LN6
135         movb    $31,%cl
136 .LN4:
137         LODSB
138         orb     %al,%al
139         jnz     .LN5
140         addl    N_255,%ecx
141         jmp     .LN4
143         ALIGN3
144 .LN5:
145         addl    %eax,%ecx
146 .LN6:
147         movb    (%esi),%al
148         incl    %esi
150         movl    %eax,%ebx
151         andb    $63,%al
152         movl    %edi,%edx
153         subl    %eax,%edx
155         movb    (%esi),%al
156         incl    %esi
158         shll    $6,%eax
159         subl    %eax,%edx
160         cmpl    %edi,%edx
161         jz      .LEOF
163         xchgl   %edx,%esi
164         leal    3(%ecx),%ecx
165         TEST_LOOKBEHIND(%esi)
166         TEST_OP((%edi,%ecx),%eax)
167         rep
168         movsb
170         movl    %edx,%esi
171         xorl    %eax,%eax
172         shrl    $6,%ebx
173         movl    %ebx,%ecx
174         jnz     .LIT
175         jmp     .L1
177 .LEOF:
178 /****   xorl    %eax,%eax          eax=0 from above */
180         cmpl    $1,%ecx         /* ecx must be 1 */
181         setnz   %al
185 vi:ts=4