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

Implement Intrinsics.pause for aarch64 #11742

Merged
merged 3 commits into from
Jan 21, 2022

Conversation

lbguilherme
Copy link
Contributor

@lbguilherme lbguilherme commented Jan 12, 2022

This was made by @jgaskins, full credits to him. Taken from https://forum.crystal-lang.org/t/intrinsics-pause-no-op-on-non-intel-cpus/4199.

Implements Intrinsics.pause for ARM. This is useful for busy loops inside a spinlock or a mutex implementation. Doesn't change correctness, but should provide some speedup in very high contention cases.

Update: Only AArch64 is supported because the plain ARM variant (llvm.arm.hint) seems to require ARMv7 at least and I don't see a way to select it.

@jgaskins
Copy link
Contributor

@lbguilherme Thanks for knocking this out. Super appreciated!

@straight-shoota straight-shoota added this to the 1.4.0 milestone Jan 18, 2022
@straight-shoota straight-shoota changed the title feat: implement Intrinsics.pause for ARM Implement Intrinsics.pause for aarch64 Jan 21, 2022
@straight-shoota straight-shoota merged commit 932ce2d into crystal-lang:master Jan 21, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants