Skip to content

Conversation

SeverinLeonhardt
Copy link
Contributor

The LZCNT instruction produced by __lzcnt on Windows is not available
on many CPUs in use today. BSR is a safe replacement requiring only
minimal additional work.

The LZCNT instruction produced by __lzcnt on Windows is not available
on many CPUs in use today. BSR is a safe replacement requiring only
minimal additional work.
@datastax-bot
Copy link

Hi @SeverinLeonhardt, thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes.

Sincerely,
DataStax Bot.

@datastax-bot
Copy link

Thank you @SeverinLeonhardt for signing the Contribution License Agreement.

Cheers,
DataStax Bot.

@mpenick
Copy link
Contributor

mpenick commented Oct 5, 2015

@SeverinLeonhardt Thanks for researching and getting a pull request together. I just had one issue compiling on Windows, otherwise, LGTM.

Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't be const because it's reused for the next BSR.

@mpenick
Copy link
Contributor

mpenick commented Oct 5, 2015

I noticed another issue too that's unrelated to the changes you made. For GCC-based compilers __builtin_clzll(0) is undefined so the code needs to check the value x for 0 (and return 0).

__builtin_clzll is undefined for 0 so this case must be handled
separately.
@SeverinLeonhardt
Copy link
Contributor Author

Updated the pull request as you've suggested.

@mpenick
Copy link
Contributor

mpenick commented Oct 6, 2015

Thanks for updating. Looks good.

mpenick added a commit that referenced this pull request Oct 6, 2015
Replace LZCNT with BSR instruction in hdr_histogram
@mpenick mpenick merged commit 6915dea into datastax:master Oct 6, 2015
@SeverinLeonhardt SeverinLeonhardt deleted the replace_lzcnt branch October 9, 2015 11:53
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.

3 participants