[zlib] Re-land Introducing ANZAC++ hash

Since 2015 Chromium's zlib used a hardware accelerated hashing function
(i.e. CRC32) to insert symbols in the dictionary during compression.

As it was suggested by Noel Gordon, turns out that a portable hash can
actually outperform it, yielding an average gain of 30% to 40% faster* compression while keeping similar compression ratios**.

In these days, such gains are equivalent to more than 3 generations
of silicon.

The new hashing function is called ANZAC++ and can be technically
considered a multiplicative hash (i.e. multiply-add-shift-mask).

Aside being faster, it is also portable and doesn't depend on crypto
extensions to perform (i.e. will work on RISC-V and Armv7).

This patch will use ANZAC as default hashing, plus performs a huge cleanup.

* Average gains: m1(31.3%), RPL_e(39.7%), RPL_p(39.4%),
Cascade(39%), ICX(+38%), SPR(41.9%).

** Average compression ratio loss is 0.1% for the snappy data
corpus.

To Sheriffs: Please don't revert this CL when it breaks any test. Please disable or add failure expectation for the test and I will
fix it ASAP.

Bug: 1070655, 1381000
Change-Id: I961e3fa197181763d555659aa8368832852b037f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4906724
Reviewed-by: Russ Hamilton <behamilton@google.com>
Reviewed-by: Yoav Weiss <yoavweiss@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Alan Screen <awscreen@chromium.org>
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1205982}
NOKEYCHECK=True
GitOrigin-RevId: a44021dc678e48efca821d35df53122c4c385e92
2 files changed