]> git.proxmox.com Git - ceph.git/blob - ceph/src/isa-l/igzip/data_struct2.asm
update sources to v12.1.1
[ceph.git] / ceph / src / isa-l / igzip / data_struct2.asm
1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ; Copyright(c) 2011-2016 Intel Corporation All rights reserved.
3 ;
4 ; Redistribution and use in source and binary forms, with or without
5 ; modification, are permitted provided that the following conditions
6 ; are met:
7 ; * Redistributions of source code must retain the above copyright
8 ; notice, this list of conditions and the following disclaimer.
9 ; * Redistributions in binary form must reproduce the above copyright
10 ; notice, this list of conditions and the following disclaimer in
11 ; the documentation and/or other materials provided with the
12 ; distribution.
13 ; * Neither the name of Intel Corporation nor the names of its
14 ; contributors may be used to endorse or promote products derived
15 ; from this software without specific prior written permission.
16 ;
17 ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 ; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 ; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 ; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 ; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 ; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 ; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 ; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
29
30 ;; START_FIELDS
31 %macro START_FIELDS 0
32 %assign _FIELD_OFFSET 0
33 %assign _STRUCT_ALIGN 0
34 %endm
35
36 ;; FIELD name size align
37 %macro FIELD 3
38 %define %%name %1
39 %define %%size %2
40 %define %%align %3
41
42 %assign _FIELD_OFFSET (_FIELD_OFFSET + (%%align) - 1) & (~ ((%%align)-1))
43 %%name equ _FIELD_OFFSET
44 %assign _FIELD_OFFSET _FIELD_OFFSET + (%%size)
45 %if (%%align > _STRUCT_ALIGN)
46 %assign _STRUCT_ALIGN %%align
47 %endif
48 %endm
49
50 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
51 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
52 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
53
54 START_FIELDS ;; BitBuf2
55
56 ;; name size align
57 FIELD _m_bits, 8, 8
58 FIELD _m_bit_count, 4, 4
59 FIELD _m_out_buf, 8, 8
60 FIELD _m_out_end, 8, 8
61 FIELD _m_out_start, 8, 8
62
63 %assign _BitBuf2_size _FIELD_OFFSET
64 %assign _BitBuf2_align _STRUCT_ALIGN
65
66 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
67 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
68 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
69 %define HIST_ELEM_SIZE 4
70
71 START_FIELDS ;; isal_mod_hist
72
73 ;; name size align
74 FIELD _d_hist, 30*HIST_ELEM_SIZE, HIST_ELEM_SIZE
75 FIELD _ll_hist, 513*HIST_ELEM_SIZE, HIST_ELEM_SIZE
76
77 %assign _isal_mod_hist_size _FIELD_OFFSET
78 %assign _isal_mod_hist_align _STRUCT_ALIGN
79
80 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
81 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
82 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
83
84 %define HUFF_CODE_SIZE 4
85
86 START_FIELDS ;; hufftables_icf
87
88 ;; name size align
89 FIELD _dist_table, 31 * HUFF_CODE_SIZE, HUFF_CODE_SIZE
90 FIELD _lit_len_table, 513 * HUFF_CODE_SIZE, HUFF_CODE_SIZE
91
92 %assign _hufftables_icf_size _FIELD_OFFSET
93 %assign _hufftables_icf_align _STRUCT_ALIGN
94
95 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
96 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
97 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
98
99 %define DEF_MAX_HDR_SIZE 328
100 START_FIELDS ;; level_2_buf
101
102 ;; name size align
103 FIELD _encode_tables, _hufftables_icf_size, _hufftables_icf_align
104 FIELD _deflate_hdr_buf_used, 8, 8
105 FIELD _deflate_hdr_buf, DEF_MAX_HDR_SIZE, 1
106 FIELD _icf_buf_next, 8, 8
107 FIELD _icf_buf_avail_out, 8, 8
108 FIELD _icf_buf_start, 0, 0
109
110 %assign _level_2_buf_size _FIELD_OFFSET
111 %assign _level_2_buf_align _STRUCT_ALIGN
112
113 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
114 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
115 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
116
117 START_FIELDS ;; isal_zstate
118
119 ;; name size align
120 FIELD _b_bytes_valid, 4, 4
121 FIELD _b_bytes_processed, 4, 4
122 FIELD _file_start, 8, 8
123 FIELD _crc, 4, 4
124 FIELD _bitbuf, _BitBuf2_size, _BitBuf2_align
125 FIELD _state, 4, 4
126 FIELD _count, 4, 4
127 FIELD _tmp_out_buff, 16, 1
128 FIELD _tmp_out_start, 4, 4
129 FIELD _tmp_out_end, 4, 4
130 FIELD _has_eob, 4, 4
131 FIELD _has_eob_hdr, 4, 4
132 FIELD _has_hist, 4, 4
133 FIELD _hist, _isal_mod_hist_size, _isal_mod_hist_align
134 FIELD _buffer, BSIZE, 32
135 FIELD _head, IGZIP_HASH_SIZE*2, 16
136
137 %assign _isal_zstate_size _FIELD_OFFSET
138 %assign _isal_zstate_align _STRUCT_ALIGN
139
140 _bitbuf_m_bits equ _bitbuf+_m_bits
141 _bitbuf_m_bit_count equ _bitbuf+_m_bit_count
142 _bitbuf_m_out_buf equ _bitbuf+_m_out_buf
143 _bitbuf_m_out_end equ _bitbuf+_m_out_end
144 _bitbuf_m_out_start equ _bitbuf+_m_out_start
145
146 _hist_lit_len equ _hist+_ll_hist
147 _hist_dist equ _hist+_d_hist
148 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
149 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
150 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
151
152 START_FIELDS ;; isal_zstream
153
154 ;; name size align
155 FIELD _next_in, 8, 8
156 FIELD _avail_in, 4, 4
157 FIELD _total_in, 4, 4
158 FIELD _next_out, 8, 8
159 FIELD _avail_out, 4, 4
160 FIELD _total_out, 4, 4
161 FIELD _hufftables, 8, 8
162 FIELD _level, 4, 4
163 FIELD _level_buf_size, 4, 4
164 FIELD _level_buf, 8, 8
165 FIELD _end_of_stream, 4, 4
166 FIELD _flush, 4, 4
167 FIELD _gzip_flag, 4, 4
168 FIELD _internal_state, _isal_zstate_size, _isal_zstate_align
169
170 %assign _isal_zstream_size _FIELD_OFFSET
171 %assign _isal_zstream_align _STRUCT_ALIGN
172
173 _internal_state_b_bytes_valid equ _internal_state+_b_bytes_valid
174 _internal_state_b_bytes_processed equ _internal_state+_b_bytes_processed
175 _internal_state_file_start equ _internal_state+_file_start
176 _internal_state_crc equ _internal_state+_crc
177 _internal_state_bitbuf equ _internal_state+_bitbuf
178 _internal_state_state equ _internal_state+_state
179 _internal_state_count equ _internal_state+_count
180 _internal_state_tmp_out_buff equ _internal_state+_tmp_out_buff
181 _internal_state_tmp_out_start equ _internal_state+_tmp_out_start
182 _internal_state_tmp_out_end equ _internal_state+_tmp_out_end
183 _internal_state_has_eob equ _internal_state+_has_eob
184 _internal_state_has_eob_hdr equ _internal_state+_has_eob_hdr
185 _internal_state_has_hist equ _internal_state+_has_hist
186 _internal_state_buffer equ _internal_state+_buffer
187 _internal_state_head equ _internal_state+_head
188 _internal_state_bitbuf_m_bits equ _internal_state+_bitbuf_m_bits
189 _internal_state_bitbuf_m_bit_count equ _internal_state+_bitbuf_m_bit_count
190 _internal_state_bitbuf_m_out_buf equ _internal_state+_bitbuf_m_out_buf
191 _internal_state_bitbuf_m_out_end equ _internal_state+_bitbuf_m_out_end
192 _internal_state_bitbuf_m_out_start equ _internal_state+_bitbuf_m_out_start
193 _internal_state_hist_lit_len equ _internal_state+_hist_lit_len
194 _internal_state_hist_dist equ _internal_state+_hist_dist
195
196 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
197 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
198 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
199 ;; Internal States
200 ZSTATE_NEW_HDR equ 0
201 ZSTATE_HDR equ (ZSTATE_NEW_HDR + 1)
202 ZSTATE_CREATE_HDR equ (ZSTATE_HDR + 1)
203 ZSTATE_BODY equ (ZSTATE_CREATE_HDR + 1)
204 ZSTATE_FLUSH_READ_BUFFER equ (ZSTATE_BODY + 1)
205 ZSTATE_FLUSH_ICF_BUFFER equ (ZSTATE_FLUSH_READ_BUFFER + 1)
206 ZSTATE_SYNC_FLUSH equ (ZSTATE_FLUSH_ICF_BUFFER + 1)
207 ZSTATE_FLUSH_WRITE_BUFFER equ (ZSTATE_SYNC_FLUSH + 1)
208 ZSTATE_TRL equ (ZSTATE_FLUSH_WRITE_BUFFER + 1)
209
210 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
211 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
212 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
213 _NO_FLUSH equ 0
214 _SYNC_FLUSH equ 1
215 _FULL_FLUSH equ 2
216 _STORED_BLK equ 0
217 %assign _STORED_BLK_END 65535
218 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
219 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
220 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
221