Skip to content

faster crc32 of last <8 bytes on aarch64#9

Merged
vkrasnov merged 2 commits intocloudflare:gcc.amd64from
landfillbaby:patch-1
Mar 18, 2018
Merged

faster crc32 of last <8 bytes on aarch64#9
vkrasnov merged 2 commits intocloudflare:gcc.amd64from
landfillbaby:patch-1

Conversation

@landfillbaby
Copy link
Copy Markdown

instead of up to 7 individual bytes, process it as a word, a halfword, and a byte, and don't bother modifying the length counter

crc32.c Outdated
crc = __crc32h(crc, *buf);
buf += 2;
}
if (len & 1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer a curly brace even on single line if :)

crc = __crc32b(crc, *buf);
len--;
buf++;
if (len & 4) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now see that I used > in the loop, do you mind changing that to >= while you are at it?

@vkrasnov vkrasnov merged commit 9465261 into cloudflare:gcc.amd64 Mar 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants