From 4b45beff4fc382643454f297f966693057c8e19c Mon Sep 17 00:00:00 2001 From: Roy Oursler Date: Thu, 8 Feb 2018 14:59:36 -0700 Subject: [PATCH] igzip: Avoid some nested multibinary calls in deflate_body Change-Id: I2b433f63664ffa27fc125a6a859a1b8053212d7f Signed-off-by: Roy Oursler --- igzip/igzip_base_aliases.c | 12 ++++++------ igzip/igzip_icf_body.c | 35 +++-------------------------------- igzip/igzip_multibinary.asm | 15 +++++---------- 3 files changed, 14 insertions(+), 48 deletions(-) diff --git a/igzip/igzip_base_aliases.c b/igzip/igzip_base_aliases.c index daf918a..1afead8 100644 --- a/igzip/igzip_base_aliases.c +++ b/igzip/igzip_base_aliases.c @@ -34,9 +34,9 @@ void isal_deflate_body_base(struct isal_zstream *stream); void isal_deflate_finish_base(struct isal_zstream *stream); -void isal_deflate_icf_body_base(struct isal_zstream *stream); void isal_deflate_icf_body_hash8k_base(struct isal_zstream *stream); void isal_deflate_icf_body_hash_hist_base(struct isal_zstream *stream); +void icf_body_hash1_fillgreedy_lazy(struct isal_zstream *stream); void isal_deflate_icf_finish_hash8k_base(struct isal_zstream *stream); void isal_deflate_icf_finish_hash_hist_base(struct isal_zstream *stream); void isal_deflate_icf_finish_hash_map_base(struct isal_zstream *stream); @@ -66,11 +66,6 @@ void isal_deflate_finish(struct isal_zstream *stream) isal_deflate_finish_base(stream); } -void isal_deflate_icf_body(struct isal_zstream *stream) -{ - isal_deflate_icf_body_base(stream); -} - void isal_deflate_icf_body_lvl1(struct isal_zstream *stream) { isal_deflate_icf_body_hash8k_base(stream); @@ -81,6 +76,11 @@ void isal_deflate_icf_body_lvl2(struct isal_zstream *stream) isal_deflate_icf_body_hash_hist_base(stream); } +void isal_deflate_icf_body_lvl3(struct isal_zstream *stream) +{ + icf_body_hash1_fillgreedy_lazy(stream); +} + void isal_deflate_icf_finish_lvl1(struct isal_zstream *stream) { isal_deflate_icf_finish_hash8k_base(stream); diff --git a/igzip/igzip_icf_body.c b/igzip/igzip_icf_body.c index c77696c..733c963 100644 --- a/igzip/igzip_icf_body.c +++ b/igzip/igzip_icf_body.c @@ -7,6 +7,7 @@ extern void gen_icf_map_lh1(struct isal_zstream *, struct deflate_icf *, uint32_ extern void set_long_icf_fg(uint8_t *, uint8_t *, struct deflate_icf *, struct level_buf *); extern void isal_deflate_icf_body_lvl1(struct isal_zstream *); extern void isal_deflate_icf_body_lvl2(struct isal_zstream *); +extern void isal_deflate_icf_body_lvl3(struct isal_zstream *); /* ************************************************************* * Helper functions @@ -318,41 +319,11 @@ void icf_body_lazyhash1_fillgreedy_greedy(struct isal_zstream *stream) icf_body_next_state(stream); } -void isal_deflate_icf_body_base(struct isal_zstream *stream) +void isal_deflate_icf_body(struct isal_zstream *stream) { switch (stream->level) { case 3: - icf_body_hash1_fillgreedy_lazy(stream); - break; - case 2: - isal_deflate_icf_body_lvl2(stream); - break; - case 1: - default: - isal_deflate_icf_body_lvl1(stream); - } -} - -void isal_deflate_icf_body_04(struct isal_zstream *stream) -{ - switch (stream->level) { - case 3: - icf_body_lazyhash1_fillgreedy_greedy(stream); - break; - case 2: - isal_deflate_icf_body_lvl2(stream); - break; - case 1: - default: - isal_deflate_icf_body_lvl1(stream); - } -} - -void isal_deflate_icf_body_06(struct isal_zstream *stream) -{ - switch (stream->level) { - case 3: - icf_body_lazyhash1_fillgreedy_greedy(stream); + isal_deflate_icf_body_lvl3(stream); break; case 2: isal_deflate_icf_body_lvl2(stream); diff --git a/igzip/igzip_multibinary.asm b/igzip/igzip_multibinary.asm index 271b35f..738e5af 100644 --- a/igzip/igzip_multibinary.asm +++ b/igzip/igzip_multibinary.asm @@ -86,9 +86,8 @@ extern isal_deflate_hash_crc_01 extern isal_deflate_hash_mad_base -extern isal_deflate_icf_body_base -extern isal_deflate_icf_body_04 -extern isal_deflate_icf_body_06 +extern icf_body_hash1_fillgreedy_lazy +extern icf_body_lazyhash1_fillgreedy_greedy section .text @@ -105,6 +104,9 @@ mbin_dispatch_init5 isal_deflate_icf_body_lvl1, isal_deflate_icf_body_hash8k_bas mbin_interface isal_deflate_icf_body_lvl2 mbin_dispatch_init5 isal_deflate_icf_body_lvl2, isal_deflate_icf_body_hash_hist_base, isal_deflate_icf_body_hash_hist_01, isal_deflate_icf_body_hash_hist_02, isal_deflate_icf_body_hash_hist_04 +mbin_interface isal_deflate_icf_body_lvl3 +mbin_dispatch_init5 isal_deflate_icf_body_lvl3, icf_body_hash1_fillgreedy_lazy, icf_body_hash1_fillgreedy_lazy, icf_body_hash1_fillgreedy_lazy, icf_body_lazyhash1_fillgreedy_greedy + mbin_interface isal_deflate_icf_finish_lvl1 mbin_dispatch_init5 isal_deflate_icf_finish_lvl1, isal_deflate_icf_finish_hash8k_base, isal_deflate_icf_finish_hash8k_01, isal_deflate_icf_finish_hash8k_01, isal_deflate_icf_finish_hash8k_01 @@ -155,10 +157,3 @@ mbin_dispatch_init5 isal_deflate_hash_lvl2, isal_deflate_hash_base, isal_deflate mbin_interface isal_deflate_hash_lvl3 mbin_dispatch_init5 isal_deflate_hash_lvl3, isal_deflate_hash_base, isal_deflate_hash_base, isal_deflate_hash_base, isal_deflate_hash_mad_base -%ifdef HAVE_AS_KNOWS_AVX512 -mbin_interface isal_deflate_icf_body -mbin_dispatch_init6 isal_deflate_icf_body, isal_deflate_icf_body_base, isal_deflate_icf_body_base, isal_deflate_icf_body_base, isal_deflate_icf_body_04, isal_deflate_icf_body_06 -%else -mbin_interface isal_deflate_icf_body -mbin_dispatch_init5 isal_deflate_icf_body, isal_deflate_icf_body_base, isal_deflate_icf_body_base, isal_deflate_icf_body_base, isal_deflate_icf_body_04 -%endif