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

Fix SIMD flags detection #1

Merged
merged 1 commit into from
Jul 25, 2021
Merged

Conversation

a-rose
Copy link

@a-rose a-rose commented Jul 20, 2021

  • Add checking OS support for AVX as well as CPU checks.
  • Add function pointer to make the decision once and not for every audio frame.

I can't test on Windows but the code is basically the same as Linux.
I can't test FMA detection because I don't have it.

@Ameobea
Copy link
Owner

Ameobea commented Jul 25, 2021

Wow, that's pretty arcane but it makes a lot of sense. Thanks for putting this together - I definitely don't have the experience to set it up.

Also, it seems that clang actually defines __GNUC__ so that feature detection code properly works and detects AVX2 and FMA support on my computer when compiled with clang.

Tyvm for putting this together! I plan to tweak the comments a little bit to let people know that it will work with at least clang, but everything other than that looks amazing.

@Ameobea Ameobea merged commit afa5ad5 into Ameobea:optimize Jul 25, 2021
@a-rose
Copy link
Author

a-rose commented Jul 26, 2021

I wasn't sure about clang, it's great that it works like GCC :)

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