Skip to content

transpile: revert __builtin_ia32_pause/__builtin_arm_yield to emit _mm_pause and __yield instead of cross-platform spin_loop #1292

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

Open
wants to merge 2 commits into
base: kkysen/arch-specific-snapshots
Choose a base branch
from

Conversation

kkysen
Copy link
Contributor

@kkysen kkysen commented Jul 21, 2025

Fixes #1263 (comment).

This switches back to emitting the more direct but unstable translations of _mm_pause and __yield.

@kkysen kkysen changed the base branch from kkysen/ci-arm64-macos to kkysen/arch-specific-snapshots July 22, 2025 17:26
@kkysen kkysen force-pushed the kkysen/revert-spin_loop branch from b990568 to 84affd0 Compare July 22, 2025 17:26
kkysen added 2 commits July 22, 2025 10:30
`__yield` is the more direct, unstable equivalent of `__builtin_arm_yield`.

Fixes 1st half of <#1263 (comment)>.
`_mm_pause` is the more direct, unstable equivalent of `__builtin_ia2_pause`.

Fixes 2nd half of <#1263 (comment)>.
@kkysen kkysen force-pushed the kkysen/revert-spin_loop branch from 84affd0 to cd6c23b Compare July 22, 2025 17:31
Copy link
Contributor

@thedataking thedataking left a comment

Choose a reason for hiding this comment

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

LGTM.

The import_simd_function can also cause stdstimd to be used. Would it make sense to open an issue capturing the TODOs you noted for deprecation and reference that issue in both locations where stdsimd might be pulled in? E.g.

// TODO(#123):  In Rust 1.88 (probably earlier), `#![feature(stdsimd)]` has been removed

You can easily test if it was pulled in 1.88 or 1.87 using compiler-explorer if you want.

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