Skip to content

cranelift-native flags detection: fix flags on SSE2-only systems.#4231

Merged
cfallin merged 1 commit into
bytecodealliance:mainfrom
cfallin:fix-x64-baseline-flags
Jun 8, 2022
Merged

cranelift-native flags detection: fix flags on SSE2-only systems.#4231
cfallin merged 1 commit into
bytecodealliance:mainfrom
cfallin:fix-x64-baseline-flags

Conversation

@cfallin
Copy link
Copy Markdown
Member

@cfallin cfallin commented Jun 6, 2022

In #4224 we saw that an SSE2-only x86-64 system somehow was still
detecting SSE3/SSSE3/SSE4.1/SSE4.2. It turns out that we enabled these
in the baseline Flags in #3816, because without that, a ton of other
things break: default flags no longer produce a compiler backend that
works with default Wasmtime settings. However the logic to set them when
detected (via CPUID-using feature-test macros) only does an "if
detected then set bit" step per feature; the bits are never cleared.
This PR fixes that.

This should be relatively temporary: once we fix #3810, then we can
remove this hack by making the default Flags state all-zeroes again,
as a compiler with default flags will again support a default Wasmtime.

@cfallin cfallin requested a review from abrown June 6, 2022 23:11
 In bytecodealliance#4224 we saw that an SSE2-only x86-64 system somehow was still
 detecting SSE3/SSSE3/SSE4.1/SSE4.2. It turns out that we enabled these
 in the baseline `Flags` in bytecodealliance#3816, because without that, a ton of other
 things break: default flags no longer produce a compiler backend that
 works with default Wasmtime settings. However the logic to set them
 when detected (via `CPUID`-using feature-test macros) only does an "if
 detected then set bit" step per feature; the bits are never *cleared*.
 This PR fixes that.
@cfallin cfallin force-pushed the fix-x64-baseline-flags branch from fee8ed4 to f050f90 Compare June 6, 2022 23:12
@github-actions github-actions Bot added the cranelift Issues related to the Cranelift code generator label Jun 6, 2022
@cfallin cfallin merged commit 5033f99 into bytecodealliance:main Jun 8, 2022
Stebalien pushed a commit to filecoin-project/wasmtime that referenced this pull request Jun 9, 2022
…ytecodealliance#4231)

In bytecodealliance#4224 we saw that an SSE2-only x86-64 system somehow was still
 detecting SSE3/SSSE3/SSE4.1/SSE4.2. It turns out that we enabled these
 in the baseline `Flags` in bytecodealliance#3816, because without that, a ton of other
 things break: default flags no longer produce a compiler backend that
 works with default Wasmtime settings. However the logic to set them
 when detected (via `CPUID`-using feature-test macros) only does an "if
 detected then set bit" step per feature; the bits are never *cleared*.
 This PR fixes that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cranelift: support vector instructions without optional ISA extensions

2 participants