On 8/8/23 17:31, Andrew Pinski wrote:
On Tue, Aug 8, 2023 at 4:17 PM Jeff Law via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:



On 8/8/23 10:38, Alexander Monakov wrote:

On Tue, 8 Aug 2023, Jeff Law wrote:

That was my thinking at one time.  Then we started looking at the distros and
found enough crc implementations in there to change my mind about the overall
utility.

The ones I'm familiar with are all table-based and look impossible to
pattern-match (and hence already fairly efficient comparable to bitwise
loop in Coremark).
We found dozens that were the usual looking loops and, IIRC ~200 table
lookups after analyzing about half of the packages in Fedora.

I will make a note we do handle table lookups to detect count leading
zeros, see check_ctz_array in tree-ssa-forwprop.cc for that detection.
(that was done to improve a SPEC benchmark even).
So if the tables are statically defined at compile time, there is
already an example of how it can be detected too.
Detecting CRC is a bit more complex than ctz/popcount and friends because of the field polynomial's impact on the table.

But there is some value in detecting a table version, then converting it to clmul. I don't remember the data offhand, but clmul was noticeably better than a table.

Jeff

Reply via email to