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

cmov: Set asm options #746

Merged
merged 1 commit into from
Mar 2, 2022
Merged

Conversation

KamilaBorowska
Copy link
Contributor

Those options tell the compiler that ASM statements do not read or write memory, can be removed if the dst ends up unused during compilation, and that they don't push data to the stack.

This can help compiler generate more optimal code. See https://doc.rust-lang.org/nightly/reference/inline-assembly.html#options for documentation of those options.

Those options tell the compiler that ASM statements do not read
or write memory, can be removed if the dst ends up unused during
compilation, and that they don't push data to the stack.
@tarcieri tarcieri merged commit 286dc1a into RustCrypto:master Mar 2, 2022
@tarcieri
Copy link
Member

tarcieri commented Mar 2, 2022

Thanks!

@newpavlov
Copy link
Member

Is it correct to use nomem here? The goal of the blocks is to literally write data to dst if condition is met. Same for pure, IIUC writing to a pointer makes blocks not pure.

@KamilaBorowska
Copy link
Contributor Author

KamilaBorowska commented Mar 3, 2022

Is it correct to use nomem here? The goal of the blocks is to literally write data to dst if condition is met. Same for pure, IIUC writing to a pointer makes blocks not pure.

asm block is not writing to memory, rather, it's writing to a register. Handling dereferences from and to register is on Rust side.

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.

None yet

3 participants