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

Migration from llvm_asm! to asm! #904

Closed
tesuji opened this issue Sep 13, 2020 · 4 comments · Fixed by #1052
Closed

Migration from llvm_asm! to asm! #904

tesuji opened this issue Sep 13, 2020 · 4 comments · Fixed by #1052

Comments

@tesuji
Copy link
Contributor

tesuji commented Sep 13, 2020

Not really a high priority task, but it would be nice to see official rust crates
using new recommended language features over old ones.

Related issues/PRs:

@bjorn3
Copy link
Member

bjorn3 commented Sep 13, 2020

This would be nice for cg_clif as only asm! is implemented.

@tesuji
Copy link
Contributor Author

tesuji commented Sep 14, 2020

As noted in rust-lang/rust#76669 (comment) , we have to support LLVM 8 (which is currently the minimum supported version).
We have to use ATT syntax for x86.

@tesuji
Copy link
Contributor Author

tesuji commented Sep 16, 2020

Note: Some architectures currently aren't supported by asm!: mips, ppc, ...
So if the llvm_asm code don't have target_arch or target_arch only on those archs,
we have to continue using llvm_asm.

@josephlr
Copy link
Contributor

josephlr commented Nov 3, 2020

It looks like all of the current llvm_asm! uses in core_arch and std_detect are on arm, aarch64, x86, or x86_64, so we should be able to switch all of them to asm!, using att-syntax on 32-bit x86.

The only other use is in assert-instr-macro, where it's not used for assembly, but as a "volatile" fence. This is similar to how libcore implements black_box. So perhaps we can just use that instead.

josephlr added a commit to josephlr/stdarch that referenced this issue Nov 4, 2020
The implementation is the same (where possible), and it unblocks rust-lang#904

Signed-off-by: Joe Richey <[email protected]>
Amanieu pushed a commit that referenced this issue Nov 4, 2020
The implementation is the same (where possible), and it unblocks #904

Signed-off-by: Joe Richey <[email protected]>
sadlerap added a commit to sadlerap/stdarch that referenced this issue Nov 24, 2020
sadlerap added a commit to sadlerap/stdarch that referenced this issue Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants