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

compiler: require ARMv8.1 #2345

Merged
merged 2 commits into from
Nov 20, 2024
Merged

compiler: require ARMv8.1 #2345

merged 2 commits into from
Nov 20, 2024

Conversation

ncruces
Copy link
Collaborator

@ncruces ncruces commented Nov 19, 2024

This checks that Large System Extensions (atomic instructions) are supported on arm64. These are included in many processors, and are part of ARMv8.1, which is required by macOS and Windows 11.

This is similar to the check that the amd64 CPUs support SSE4.1 (which is part of x86-64-v2, and available on most processors).

Biggest behavioral change is using platform.CompilerSupported() to decide whether to (not) use the compiler on wazero.NewRuntimeConfig(), but I think this makes sense.

Signed-off-by: Nuno Cruces <[email protected]>
@ncruces
Copy link
Collaborator Author

ncruces commented Nov 19, 2024

See wasilibs/go-re2#136 for an instance of this happening.

func loadCpuFeatureFlags() CpuFeatureFlags {
switch runtime.GOOS {
case "darwin", "windows":
// These OSes require ARMv8.1, which includes atomic instructions.
Copy link
Member

Choose a reason for hiding this comment

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

i get why darwin requires v8.1 by default (m series is so), but not sure about windows here. any reference or pointer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Windows 10 does not in fact require them, is it good enough to document this?
At least this change should not be a regression.

Signed-off-by: Nuno Cruces <[email protected]>
@mathetake mathetake merged commit 2c4b66b into tetratelabs:main Nov 20, 2024
50 checks passed
@mathetake
Copy link
Member

cc @anuraaga fyi

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