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: fix ARMv8 regression introduced in #2345 #2365

Merged
merged 2 commits into from
Feb 15, 2025
Merged

compiler: fix ARMv8 regression introduced in #2345 #2365

merged 2 commits into from
Feb 15, 2025

Conversation

ncruces
Copy link
Contributor

@ncruces ncruces commented Jan 16, 2025

This is an attempt to fix the performance regression introduced in #2345 by requiring ARMv8.1 when it is only strictly needed for experimental.CoreFeaturesThreads.

When I did #2345 I was trying to fix wasilibs/go-re2#136, and assumed (from the bug description) that these processors were really uncommon. It turns out that (e.g.) RaspberryPi 3 and 4 don't support these, and neither does the original Graviton (still in use by AWS).

Also, only Linux and FreeBSD allow us to figure out if the processor is an ARMv8.1 (we assume it is for macOS and take the chance on Windows, because 11 requires it). Still, the ARM compiler works fine on NetBSD too (I test this it in SQLite, as well as the ARM FreeBSD compiler).

I'm happy to reconsider the approach if this seems confusing.

Signed-off-by: Nuno Cruces <ncruces@users.noreply.github.com>
@ncruces
Copy link
Contributor Author

ncruces commented Jan 16, 2025

I clearly need to run tests with the race detector on. Sorry about that.

@faddat
Copy link

faddat commented Jan 17, 2025

What I am thinking about #2360 is that I am going to try out this branch, and see if it changes anything, then investigate the rest.

Thanks for your responses!

Signed-off-by: Nuno Cruces <ncruces@users.noreply.github.com>
@ncruces
Copy link
Contributor Author

ncruces commented Jan 17, 2025

OK, so I guess this is ready.

This delays the determination of whether to use the compiler or interpreter to NewRuntimeWithConfig, then taking account of enabledFeatures.

Potentially amd64 could run on all x64 processors if SIMD is disabled, but I didn't go there. I'm just stating the possibility.

@ncruces ncruces marked this pull request as ready for review January 17, 2025 12:41
@ncruces ncruces requested a review from mathetake as a code owner January 17, 2025 12:41
NyaaaWhatsUpDoc added a commit to NyaaaWhatsUpDoc/gotosocial that referenced this pull request Feb 6, 2025
NyaaaWhatsUpDoc added a commit to superseriousbusiness/gotosocial that referenced this pull request Feb 6, 2025
Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

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

Seems like a generally good simplification too

@mathetake mathetake merged commit a40188c into main Feb 15, 2025
50 checks passed
@mathetake mathetake deleted the arm branch February 15, 2025 00:17
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.

"Illegal instruction" on an ARMv8.1 instruction set CPU.
4 participants