1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ; Copyright(c) 2011-2018 Intel Corporation All rights reserved.
4 ; Redistribution and use in source and binary forms, with or without
5 ; modification, are permitted provided that the following conditions
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
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.
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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
30 %include "options.asm"
31 %include "lz0a_const.asm"
32 %include "data_struct2.asm"
33 %include "huffman.asm"
34 %include "reg_sizes.asm"
37 %define DICT_END_SLOP 4
39 %ifidn __OUTPUT_FORMAT__, win64
46 %define stack_size 3 * 8
48 %define arg(x) [rsp + stack_size + PS*x]
58 %define hash_table arg1
60 %define hash_mask arg2
64 %define dict_offset arg4
81 %ifidn __OUTPUT_FORMAT__, win64
92 %ifidn __OUTPUT_FORMAT__, win64
101 global isal_deflate_hash_crc_01
102 isal_deflate_hash_crc_01:
110 sub f_i_end, DICT_SLOP
115 lea f_i_tmp, [f_i + 2]
118 crc32 hash %+ d, dword [f_i + dict_offset]
121 crc32 hash2 %+ d, dword [f_i + dict_offset + 1]
124 crc32 hash3 %+ d, dword [f_i_tmp + dict_offset]
127 crc32 hash4 %+ d, dword [f_i_tmp + dict_offset + 1]
134 mov [hash_table + 2 * hash], f_i %+ w
137 mov [hash_table + 2 * hash2], f_i %+ w
140 mov [hash_table + 2 * hash3], f_i_tmp %+ w
143 mov [hash_table + 2 * hash4], f_i_tmp %+ w
149 add f_i_end, DICT_SLOP - DICT_END_SLOP
155 crc32 hash %+ d, dword [f_i + dict_offset]
158 mov [hash_table + 2 * hash], f_i %+ w