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 x86 SIMD Extension Handling #6384

Merged
merged 9 commits into from
Oct 28, 2024

Conversation

BMagnu
Copy link
Member

@BMagnu BMagnu commented Oct 6, 2024

This fixes a few things in our build handling related to SIMD instructions:

  1. Fix detection of AVX2 capabilities
  2. Include a check for OS-support on top of CPU-support for the extensions
  3. Prevent MSVC from changing the extension set level in some circumstances. If the requested extension set is unavailable, just don't compile.
  4. Actually consider the detected / set instruction set extensions on gcc / clang.

This means that the current behaviour is basically as follows:

  1. On default settings, compile with march=native
  2. This can be toggled off, in which case the compiler will only use the base x86_64 instructions + whatever was detected on the host system out of SSE/SSE2/AVX/AVX2
  3. An instruction set can be forced, overriding any native CPU detection and capabilities.

Additionally, this PR will expose the availability of instruction sets to the code as defines, which I intend to make use of in the future.

Should probably be merged after #6375

@BMagnu BMagnu added fix A fix for bugs, not-a-bugs, and/or regressions. build An issue related to the build systems ci A feature or issue related to the continous integration tools Waiting for Stable Marks a pull request that is to be merged after the next stable release, due to a release cycle labels Oct 6, 2024
@Goober5000 Goober5000 removed the Waiting for Stable Marks a pull request that is to be merged after the next stable release, due to a release cycle label Oct 28, 2024
@BMagnu BMagnu merged commit 95fef2a into scp-fs2open:master Oct 28, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build An issue related to the build systems ci A feature or issue related to the continous integration tools fix A fix for bugs, not-a-bugs, and/or regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants