igzip: Move COMPARE_TYPES usage

Change-Id: I87d88618b6f86c1f9618ba9cea132153a8ef2fa5
Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
This commit is contained in:
Roy Oursler 2018-06-06 12:54:47 -07:00 committed by Greg Tucker
parent 21e78d5aa3
commit d389b8d6f8
4 changed files with 41 additions and 61 deletions

View File

@ -508,31 +508,17 @@ isal_deflate_body_ %+ ARCH %+ :
PINSRD xhash, tmp2 %+ d, 1
PAND xhash, xhash, xmask
lea tmp2, [tmp1 + dist - 1]
%if (COMPARE_TYPE == 1)
compare250 tmp1, tmp2, len, tmp3
%elif (COMPARE_TYPE == 2)
compare250_x tmp1, tmp2, len, tmp3, xtmp0, xtmp1
%elif (COMPARE_TYPE == 3)
compare250_y tmp1, tmp2, len, tmp3, ytmp0, ytmp1
%else
%error Unknown Compare type COMPARE_TYPE
% error
%endif
compare250 tmp1, tmp2, len, tmp3, ytmp0, ytmp1
jmp .len_dist_huffman
.compare_loop2:
lea tmp2, [tmp1 + dist2]
add tmp1, 1
%if (COMPARE_TYPE == 1)
compare250 tmp1, tmp2, len2, tmp3
%elif (COMPARE_TYPE == 2)
compare250_x tmp1, tmp2, len2, tmp3, xtmp0, xtmp1
%elif (COMPARE_TYPE == 3)
compare250_y tmp1, tmp2, len2, tmp3, ytmp0, ytmp1
%else
%error Unknown Compare type COMPARE_TYPE
% error
%endif
compare250 tmp1, tmp2, len2, tmp3, ytmp0, ytmp1
and curr_data, 0xff
get_lit_code curr_data, code3, code_len3, hufftables
jmp .len_dist_lit_huffman

View File

@ -83,7 +83,7 @@
;; compare 258 bytes = 8 * 32 + 2
;; tmp16 is a 16-bit version of tmp
;; compare258 src1, src2, result, tmp
%macro compare250 4
%macro compare250_r 4
%define %%src1 %1
%define %%src2 %2
%define %%result %3
@ -372,6 +372,29 @@
%%end:
%endm
%macro compare250 6
%define %%src1 %1
%define %%src2 %2
%define %%result %3
%define %%tmp %4
%define %%xtmp0 %5x
%define %%xtmp1 %6x
%define %%ytmp0 %5
%define %%ytmp1 %6
%if (COMPARE_TYPE == 1)
compare250_r %%src1, %%src2, %%result, %%tmp
%elif (COMPARE_TYPE == 2)
compare250_x %%src1, %%src2, %%result, %%tmp, %%xtmp0, %%xtmp1
%elif (COMPARE_TYPE == 3)
compare250_y %%src1, %%src2, %%result, %%tmp, %%ytmp0, %%ytmp1
%else
%error Unknown Compare type COMPARE_TYPE
% error
%endif
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -470,31 +470,17 @@ isal_deflate_icf_body_ %+ METHOD %+ _ %+ ARCH %+ :
.compare_loop:
lea tmp2, [tmp1 + dist - 1]
%if (COMPARE_TYPE == 1)
compare250 tmp1, tmp2, len, tmp3
%elif (COMPARE_TYPE == 2)
compare250_x tmp1, tmp2, len, tmp3, xtmp0, xtmp1
%elif (COMPARE_TYPE == 3)
compare250_y tmp1, tmp2, len, tmp3, ytmp0, ytmp1
%else
%error Unknown Compare type COMPARE_TYPE
% error
%endif
compare250 tmp1, tmp2, len, tmp3, ytmp0, ytmp1
jmp .len_dist_huffman
.compare_loop2:
lea tmp2, [tmp1 + dist2]
add tmp1, 1
%if (COMPARE_TYPE == 1)
compare250 tmp1, tmp2, len2, tmp3
%elif (COMPARE_TYPE == 2)
compare250_x tmp1, tmp2, len2, tmp3, xtmp0, xtmp1
%elif (COMPARE_TYPE == 3)
compare250_y tmp1, tmp2, len2, tmp3, ytmp0, ytmp1
%else
%error Unknown Compare type COMPARE_TYPE
% error
%endif
compare250 tmp1, tmp2, len2, tmp3, ytmp0, ytmp1
movzx lit_code, curr_data %+ b
shr curr_data, 8
inc dword [lit_len_hist + HIST_ELEM_SIZE*lit_code]

View File

@ -516,16 +516,9 @@ compare_loop:
and hash %+ d, LVL0_HASH_MASK
and hash2 %+ d, LVL0_HASH_MASK
lea tmp2, [tmp1 + dist - 1]
%if (COMPARE_TYPE == 1)
compare250 tmp1, tmp2, len, tmp3
%elif (COMPARE_TYPE == 2)
compare250_x tmp1, tmp2, len, tmp3, xtmp0, xtmp1
%elif (COMPARE_TYPE == 3)
compare250_y tmp1, tmp2, len, tmp3, ytmp0, ytmp1
%else
%error Unknown Compare type COMPARE_TYPE
% error
%endif
compare250 tmp1, tmp2, len, tmp3, ytmp0, ytmp1
lea tmp3, [f_i + 1]
jmp len_dist_huffman
@ -533,16 +526,8 @@ compare_loop2:
add tmp1, 1
lea tmp2, [tmp1 + dist2 - 1]
%if (COMPARE_TYPE == 1)
compare250 tmp1, tmp2, len2, tmp3
%elif (COMPARE_TYPE == 2)
compare250_x tmp1, tmp2, len2, tmp3, xtmp0, xtmp1
%elif (COMPARE_TYPE == 3)
compare250_y tmp1, tmp2, len2, tmp3, ytmp0, ytmp1
%else
%error Unknown Compare type COMPARE_TYPE
% error
%endif
compare250 tmp1, tmp2, len2, tmp3, ytmp0, ytmp1
and curr_data, 0xff
inc qword [histogram + _lit_len_offset + 8 * curr_data]
lea tmp3, [f_i + 1]