Skip to content

test+fix: Add asm testing and fix core_hint_black_box #147

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 1 commit into
base: main
Choose a base branch
from

Conversation

Daniel-Aaron-Bloom
Copy link

@Daniel-Aaron-Bloom Daniel-Aaron-Bloom commented Apr 29, 2025

Per this zulip discussion and rust-lang/rust#140341 and in contrast to the discussion on #107, read_volatile (and all other equivalent functions in the standard library) should provide strict fewer optimization barriers than black_box.

In service of testing this, I've added a script which makes sure the assembly instructions of a simple case are approximately the expected length across most common architectures.

Also read_volatile is never going to be const, and it would be nice to constify this library (which will hopefully be my next PR if this one is accepted).

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.

1 participant