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

[bmi2] Add lzcnt and bmi target attributes #2888

Merged
merged 1 commit into from
Dec 1, 2021

Conversation

terrelln
Copy link
Contributor

@terrelln terrelln commented Dec 1, 2021

  • When dynamic dispatching to bmi2 add lzcnt and bmi to the
    TARGET_ATTRIBUTE.
  • Centralize the bmi2 TARGET_ATTRIBUTE definition to
    BMI2_TARGET_ATTRIBUTE so we can change it in the future.
  • Only enable bmi2 when both bmi1 & bmi2 are supported. There shouldn't
    be any cases where bmi2 is supported but bmi1 isn't. But, since we are
    using the instruction we should check bmi1 as well.

I measure +3-4% performance on gcc-11.1.0 on my Intel i9-9900k, and neutral with clang-13.0.0. But, I'm pretty sure thats just noise. I measure neutral performance on my devserver with our internal gcc and clang builds.

Fixes Issue #2814.

* When dynamic dispatching to bmi2 add lzcnt and bmi to the
  TARGET_ATTRIBUTE.
* Centralize the bmi2 TARGET_ATTRIBUTE definition to
  BMI2_TARGET_ATTRIBUTE so we can change it in the future.
* Only enable bmi2 when both bmi1 & bmi2 are supported. There shouldn't
  be any cases where bmi2 is supported but bmi1 isn't. But, since we are
  using the instruction we should check bmi1 as well.
@terrelln terrelln merged commit 8f9f644 into facebook:dev Dec 1, 2021
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.

3 participants