Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X86: Fast CRC32 computation using PCLMULQDQ instruction #6018

Closed
wants to merge 1 commit into from

Conversation

frankdjx
Copy link
Contributor

@frankdjx frankdjx commented Aug 19, 2020

Based on:
"Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction"
V. Gopal, E. Ozturk, et al., 2009, http://intel.ly/2ySEwL0

Benchmarking with below synthetic code, the time improve to 0.002s from 0.088s on i7-8700.

function simple_crc32() {
  $a = "foo";
  for ($i = 0; $i < 10000; $i++) {
    crc32($a);
    $a .= "o";
  }
}

Signed-off-by: Frank Du [email protected]

@frankdjx
Copy link
Contributor Author

The batch size of SIMD FOLD operation is 16(128 bit) and 64(4 fold), the new added test case cover "16, 16+3, 32, 32+3, 48, 48+3, 64, 64+3, 80, 80+3, 128, 128+3, 144, 144+3" size.

@frankdjx
Copy link
Contributor Author

Ping @cmb69

Can someone help to review this? I don't know who are the right reviewer. This is my first commit to PHP, kindly let me know if I miss any steps.

@cmb69
Copy link
Member

cmb69 commented Aug 28, 2020

Everything fine from your side. Not sure who'd be best for reviewing; maybe @laruence?

Copy link
Contributor

@weltling weltling left a comment

Choose a reason for hiding this comment

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

It's a great functional improvement. I'd just suggest to clean up a bit so the code is explicitly generated only on a supported platform.

Thanks.

@weltling weltling self-requested a review August 30, 2020 10:42
@frankdjx
Copy link
Contributor Author

frankdjx commented Sep 2, 2020

Can we merge this or more actions need? Thanks.

@Girgias
Copy link
Member

Girgias commented Sep 2, 2020

Can we merge this or more actions need? Thanks.

Could you squash and rebase? Makes life easier when trying to merge for us. :)

Based on:
"Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction"
V. Gopal, E. Ozturk, et al., 2009, http://intel.ly/2ySEwL0

Signed-off-by: Frank Du <[email protected]>
@frankdjx
Copy link
Contributor Author

frankdjx commented Sep 2, 2020

Can we merge this or more actions need? Thanks.

Could you squash and rebase? Makes life easier when trying to merge for us. :)

Done. And CI is green also.

@php-pulls php-pulls closed this in c3299d7 Sep 2, 2020
@frankdjx frankdjx deleted the crc_x86 branch September 3, 2020 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants