This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Do CRC 4 bits at a time


On 04/26/2017 04:52 AM, Richard Biener wrote:
On Tue, Apr 25, 2017 at 6:47 PM, Nathan Sidwell <nathan@acm.org> wrote:

Please use 'inline' rather than 'static inline'.

Oh, ok (must have been misled by some exiting static inline somewhere)

Did you test the patch produces the same CRCs than before?  Did you do
any performance measurements?

Yes.
1) applied both to a random incoming checksum and random value. A billion iterations showed no differences.

2) 100 million iterations show the new version slightly more than twice as fast.

Otherwise looks ok to me.  I wonder why we have this "copy" at all rather
than using libiberties xcrc32?

Hm, not entirely sure, I originally introduced crc32_string back in 2003, which could have used libiberty's (unless perhaps at that time things were out of sync, so we didn't have it there?) For some reason I chose not to.

But now, we commonly get the CRC of individual byte values or unsigneds, which the xcrc32 interface doesn't do well. David Li broke it apart to make that useful in 2011.

ok with the static inline fix?

nathan

--
Nathan Sidwell


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]