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

Simd #133

Merged
merged 2 commits into from
Aug 30, 2021
Merged

Simd #133

merged 2 commits into from
Aug 30, 2021

Conversation

JunHe77
Copy link
Contributor

@JunHe77 JunHe77 commented Jul 22, 2021

No description provided.

@google-cla
Copy link

google-cla bot commented Jul 22, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Jul 22, 2021
@JunHe77
Copy link
Contributor Author

JunHe77 commented Jul 22, 2021

@googlebot I signed it!

@google-cla
Copy link

google-cla bot commented Jul 22, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@JunHe77
Copy link
Contributor Author

JunHe77 commented Jul 22, 2021

@googlebot I signed it!

@JunHe77
Copy link
Contributor Author

JunHe77 commented Aug 10, 2021

Rebased to resolve conflict in snappy-internal.h

@JunHe77
Copy link
Contributor Author

JunHe77 commented Aug 10, 2021

@atdt , would you pls help to review? Thanks.

Copy link
Member

@pwnall pwnall left a comment

Choose a reason for hiding this comment

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

@JunHe77 thank you very much for this contribution!

Would you like to address the feedback below, or would you prefer that I take care of it while going through our merge process?

@@ -36,13 +36,44 @@
namespace snappy {
namespace internal {

#if !defined(SNAPPY_HAVE_BMI2)
Copy link
Member

Choose a reason for hiding this comment

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

Thank you for realizing we need these #defines and #includes in the header, for the V128 type alias.

Can you please move this block outside namespaces?

I think that #including C system headers in a C++ namespace is undefined behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing this out, will update.

using V128 = uint8x16_t;
#endif

#if SNAPPY_HAVE_BMI2
inline uint32_t zero_highbits_u32(uint32_t v, int n) {
Copy link
Member

Choose a reason for hiding this comment

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

Could you please explain the benefit of wrapping _bzhi_u32 with this function?

Until I learn more, I'm inclined to suggest that we remove the abstraction. It's currently used in exactly one place, and it's only defined when SNAPPY_HAVE_BMI2. So, it's effectively a less-known alias for the _bzhi_u32 intrinsic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well received, will update.

After SHUFFLE code blocks are refactored, "tmmintrin.h"
is missed, and bmi2 code part will have build failure
as type conflicts.

Signed-off-by: Jun He <jun.he@arm.com>
Change-Id: I7800cd7e050f4d349e5a227206b14b9c566e547f
Signed-off-by: Jun He <jun.he@arm.com>
Change-Id: I3fade568ff92b4303387705f843d0051d5e88349
@JunHe77
Copy link
Contributor Author

JunHe77 commented Aug 12, 2021

Updated. @pwnall , @atdt , would you pls help to review? Thanks a lot.

@pwnall
Copy link
Member

pwnall commented Aug 12, 2021

@JunHe77 Thank you very much for the revisions!

I'll get this PR through the merge process in our internal repository. When the process completes, the PR will be merged.

@pwnall pwnall merged commit 7062d7f into google:master Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants