]> git.proxmox.com Git - ceph.git/blob - ceph/src/isa-l/igzip/inflate_data_structs.asm
update sources to v12.1.1
[ceph.git] / ceph / src / isa-l / igzip / inflate_data_structs.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 ;; inflate huff code
55
56 ;; name size align
57 FIELD _short_code_lookup_large, 2 * (1 << (ISAL_DECODE_LONG_BITS)), 2
58 FIELD _long_code_lookup_large, 2 * MAX_LONG_CODE_LARGE, 2
59
60 %assign _inflate_huff_code_large_size _FIELD_OFFSET
61 %assign _inflate_huff_code_large_align _STRUCT_ALIGN
62
63 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
64 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
65 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
66
67 START_FIELDS ;; inflate huff code
68
69 ;; name size align
70 FIELD _short_code_lookup_small, 2 * (1 << (ISAL_DECODE_SHORT_BITS)), 2
71 FIELD _long_code_lookup_small, 2 * MAX_LONG_CODE_SMALL, 2
72
73 %assign _inflate_huff_code_small_size _FIELD_OFFSET
74 %assign _inflate_huff_code_small_align _STRUCT_ALIGN
75 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
76 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
77 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
78
79 START_FIELDS ;; inflate state
80
81 ;; name size align
82 FIELD _next_out, 8, 8
83 FIELD _avail_out, 4, 4
84 FIELD _total_out, 4, 4
85 FIELD _next_in, 8, 8
86 FIELD _read_in, 8, 8
87 FIELD _avail_in, 4, 4
88 FIELD _read_in_length,4, 4
89 FIELD _lit_huff_code, _inflate_huff_code_large_size, _inflate_huff_code_large_align
90 FIELD _dist_huff_code,_inflate_huff_code_small_size, _inflate_huff_code_small_align
91 FIELD _block_state, 4, 4
92 FIELD _bfinal, 4, 4
93 FIELD _crc_flag, 4, 4
94 FIELD _crc, 4, 4
95 FIELD _type0_block_len, 4, 4
96 FIELD _copy_overflow_len, 4, 4
97 FIELD _copy_overflow_dist, 4, 4
98
99 %assign _inflate_state_size _FIELD_OFFSET
100 %assign _inflate_state_align _STRUCT_ALIGN
101
102 _lit_huff_code_short_code_lookup equ _lit_huff_code+_short_code_lookup_large
103 _lit_huff_code_long_code_lookup equ _lit_huff_code+_long_code_lookup_large
104
105 _dist_huff_code_short_code_lookup equ _dist_huff_code+_short_code_lookup_small
106 _dist_huff_code_long_code_lookup equ _dist_huff_code+_long_code_lookup_small
107
108 ISAL_BLOCK_NEW_HDR equ 0
109 ISAL_BLOCK_HDR equ 1
110 ISAL_BLOCK_TYPE0 equ 2
111 ISAL_BLOCK_CODED equ 3
112 ISAL_BLOCK_END equ 4
113 ISAL_BLOCK_FINISH equ 5
114 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
115 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
116 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
117