3

Deprecate llvm_asm! by Amanieu · Pull Request #87590 · rust-lang/rust · GitHub

 2 years ago
source link: https://github.com/rust-lang/rust/pull/87590
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

This comment has been hidden.

// 1. passing the value to some external process

// 2. allowing that process to access any memory that the value may point to

// 3. reading a potentially modified value back

#[cfg(any(

nagisa 21 days ago

Contributor

My concern with this implementation is that once support for assembly is added for any of these architectures, it is trivial to miss updating this location.

Any way we can avoid this? We could make up an intrinsic for this, perhaps?

RalfJung 21 days ago

Member

Instead of using the fallback for all other architectures, could we have an explicit list of architectures that do use the fallback?

Amanieu 21 days ago

Author

Contributor

Instead of using the fallback for all other architectures, could we have an explicit list of architectures that do use the fallback?

This will likely cause problems when people try to use a new architecture with a custom json target.

Any way we can avoid this? We could make up an intrinsic for this, perhaps?

We could have a target_has_asm cfg flag like we do for atomics. But it seems a bit excessive to have this just for black_box.

nagisa 18 days ago

Contributor

Having thought about this more, an intrinsic seems significantly more straightforward to me. But I guess I'm okay with this implementation too.

If we continue using cfgs here, consider cfg_if! maybe? It'll reduce the clutter here significantly I feel.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK