1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ; Copyright(c) 2011-2017 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 ;;; uint64_t rolling_hash2_run_until_04(uint32_t *idx, uint32_t max_idx, uint64_t *t1,
31 ;;; uint64_t *t2, uint8_t *b1, uint8_t *b2, uint64_t h, uint64_t mask,
34 %include "reg_sizes.asm"
36 %ifidn __OUTPUT_FORMAT__, elf64
46 %define arg8 r12 ; must be saved and loaded
47 %define tmp1 rbp ; must be saved and loaded
48 %define tmp2 rbx ; must be saved and loaded
49 %define tmp3 r13 ; must be saved and loaded
50 %define tmp4 r14 ; must be saved and loaded
51 %define tmp5 r15 ; must be saved and loaded
54 %define frame_size 6*8
55 %define arg(x) [rsp + frame_size + PS + PS*x]
79 %ifidn __OUTPUT_FORMAT__, win64
84 %define arg4 r12 ; must be saved and loaded
85 %define arg5 r13 ; must be saved and loaded
86 %define arg6 r14 ; must be saved and loaded
87 %define arg7 r15 ; must be saved and loaded
88 %define arg8 rbx ; must be saved and loaded
91 %define tmp3 rdi ; must be saved and loaded
92 %define tmp4 rsi ; must be saved and loaded
93 %define tmp5 rbp ; must be saved and loaded
96 %define frame_size 8*8
97 %define arg(x) [rsp + frame_size + PS + PS*x]
98 %define func(x) proc_frame x
116 %macro FUNC_RESTORE 0
151 mk_global rolling_hash2_run_until_04, function
152 func(rolling_hash2_run_until_04)
155 mov pos.w, dword [idx]
156 pext trigger, trigger, mask
161 .loop2: rorx hash, hash, 0x3f
162 movzx x, byte [b1 + pos]
163 movzx a, byte [b1 + pos + 1]
164 movzx y, byte [b2 + pos]
165 movzx h, byte [b2 + pos + 1]
173 rorx hash, hash, 0x3f
189 rorx hash, hash, 0x3f
190 movzx x, byte [b1 + pos]
191 movzx y, byte [b2 + pos]
196 .ret_0: mov dword [idx], pos.w