util: use faster zlib's CRC32 implementaion
authorGrazvydas Ignotas <notasas@gmail.com>
Fri, 29 Dec 2017 00:05:05 +0000 (02:05 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 14 Jan 2018 17:10:33 +0000 (19:10 +0200)
commit6acf22a17991e3e98c35596f0b1cedfaebed6ec3
treef4b25b6f62b76d4649122e4b908239fef4399b63
parent87f723408b3f4c088dcb819e88922918ae064d72
util: use faster zlib's CRC32 implementaion

zlib provides a faster slice-by-4 CRC32 implementation than the
traditional single byte lookup one used by mesa. As most supported
platforms now link zlib unconditionally, we can easily use it.

Improvement for a 1MB buffer (avg MB/s, n=100, zlib 1.2.8):

  i5-6600K                    C2D E4500
mesa zlib                    mesa zlib
 443 1443 225% +/- 2.1%       403 1175 191% +/- 0.9%

It has been verified the calculation results stay the same after this
change.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/util/crc32.c