-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Tracking Issue for LLVM-style inline assembly (llvm_asm
)
#70173
Comments
cc #68404 |
Replace uses of asm! with llvm_asm!, add the llvm_asm feature [Tracking Issue for LLVM-style inline assembly](rust-lang/rust#70173) `cargo test` now passes for me with rustc 1.45.0-nightly (9310e3bd4 2020-05-21)
The fact that this is a Are there plans to either fix that, or else entirely remove legacy inline assembly support? |
The plan is to deprecate I think we should be able to remove it after a deprecation period of a month or two. |
While I'm not volunteering :-) it would be great if someone implemented a |
@RalfJung can you elaborate a bit about the semantic assumptions you are referring to? I guess the freedom to move code about within a block or something? Certainly we could make it a terminator, although that seems a bit arbitrary. |
I believe @RalfJung is referring to things like this. @BartMassey Unfortunately this is very difficult to do reliably due to the differences between the two syntax. Currently we have an automated |
@Amanieu Yeah, I think solving it completely would be pretty hard, but it would be nice to at least transform the simplest cases (all the arguments in registers, simple read/write/clobbers) and somehow mark/warn about the cases that couldn't be auto-transformed so that people would notice them and fix them. If But like I say, this is a wish list item: if I really cared I'd do it myself 🤷. Thanks again for all the hard work that has gone into this — I'm really looking forward to our sane-syntax assembly future. |
Things like what @Amanieu said. Generally, basic blocks should have the property that if any statement gets executed, they all do. There are no control dependencies, and thus data dependencies are the only constraint to reordering. An Asm block with an infinite loop throws a wrench in that reasoning. So while |
The new |
I will say that rewriting the assembly to use the new syntax was significantly easier than writing it in the first place and that new system is quite pleasant to use. The RFC text is pretty thorough, so any questions I had when rewriting were easily answered. On the whole, it took maybe 30m to transform 7 asm blocks, of which 3 where subtle context-switching code. |
Also, it might be worthwhile to make it impossible to silence the llvm_asm lint so that people get annoyed and fix it. I don't feel bad doing it because it's the nightly channel! |
I would like more people to test the new |
Replace uses of asm! with llvm_asm!, add the llvm_asm feature [Tracking Issue for LLVM-style inline assembly](rust-lang/rust#70173) `cargo test` now passes for me with rustc 1.45.0-nightly (9310e3bd4 2020-05-21)
Two months to deprecation? Please, I've got so much else I'm working on right now! |
@stormmq Deprecation doesn't mean removal. Deprecation marks the begin of the final phase of the transition period away from the old macro. |
Given this way of writing asm has been around for years, is there an automated way to transition to the new functionality? |
I'm not aware of any, but the RFC text is pretty thorough, and I transitioned 7 asm blocks (3 of which were tricky) in about 30 minutes... |
Tue 20 Oct 2020 13:09:57 AEDT Just so that anyone wandering into this discussion is unaware of the manifestations of these errors I have uploaded to my repository the captured text error files (using >1= {file1} and >2= {file2} ). Two sets of files are available subdir asm and subdir llvm as appropriate for the change on line 53 of my compiler input file. When I started my interest in Rust I managed to get something working. I use multiple platforms due to availability and poverty to check repeatability. A recent resurgence in interest, due to a 'Meetup' meeting produced some stimulation. You can see my efforts in my repo rust_on_msp. Subsequent attempts to build the same code for modification (normal development) stumbled into these ***asm errors. The irritating error line : I have started to investigate crates.io/keywords/msp430 . |
FYI |
See rust-lang/rust#70173 (comment). This gets shipped starting with nightly 2022-01-17.
See rust-lang/rust#70173 (comment). This gets shipped starting with nightly 2022-01-17.
The macro llvm_asm! finally got removed as 'asm!' got stabilized in nightly. See rust-lang/rust#70173 (comment) and this gets shipped starting with nightly 2022-01-17. According to https://users.rust-lang.org/t/volatile-option-in-new-asm-macro/44289/2 assembly is volatile by default with asm!.
The macro llvm_asm! finally got removed as 'asm!' got stabilized in nightly. See rust-lang/rust#70173 (comment) and this gets shipped starting with nightly 2022-01-17. According to https://users.rust-lang.org/t/volatile-option-in-new-asm-macro/44289/2 assembly is volatile by default with asm!.
The macro llvm_asm! finally got removed as 'asm!' got stabilized in nightly. See rust-lang/rust#70173 (comment) and this gets shipped starting with nightly 2022-01-17. According to https://users.rust-lang.org/t/volatile-option-in-new-asm-macro/44289/2 assembly is volatile by default with asm!.
The macro llvm_asm! finally got removed as 'asm!' got stabilized in nightly. See rust-lang/rust#70173 (comment) and this gets shipped starting with nightly 2022-01-17. According to https://users.rust-lang.org/t/volatile-option-in-new-asm-macro/44289/2 assembly is volatile by default with asm!.
The macro llvm_asm! finally got removed as 'asm!' got stabilized in nightly. See rust-lang/rust#70173 (comment) and this gets shipped starting with nightly 2022-01-17. According to https://users.rust-lang.org/t/volatile-option-in-new-asm-macro/44289/2 assembly is volatile by default with asm!.
Remove deprecated LLVM-style inline assembly The `llvm_asm!` was deprecated back in rust-lang#87590 1.56.0, with intention to remove it once `asm!` was stabilized, which already happened in rust-lang#91728 1.59.0. Now it is time to remove `llvm_asm!` to avoid continued maintenance cost. Closes rust-lang#70173. Closes rust-lang#92794. Closes rust-lang#87612. Closes rust-lang#82065. cc `@rust-lang/wg-inline-asm` r? `@Amanieu`
Remove deprecated LLVM-style inline assembly The `llvm_asm!` was deprecated back in rust-lang#87590 1.56.0, with intention to remove it once `asm!` was stabilized, which already happened in rust-lang#91728 1.59.0. Now it is time to remove `llvm_asm!` to avoid continued maintenance cost. Closes rust-lang#70173. Closes rust-lang#92794. Closes rust-lang#87612. Closes rust-lang#82065. cc `@rust-lang/wg-inline-asm` r? `@Amanieu`
Remove deprecated LLVM-style inline assembly The `llvm_asm!` was deprecated back in rust-lang#87590 1.56.0, with intention to remove it once `asm!` was stabilized, which already happened in rust-lang#91728 1.59.0. Now it is time to remove `llvm_asm!` to avoid continued maintenance cost. Closes rust-lang#70173. Closes rust-lang#92794. Closes rust-lang#87612. Closes rust-lang#82065. cc `@rust-lang/wg-inline-asm` r? `@Amanieu`
The macro llvm_asm! finally got removed as 'asm!' got stabilized in nightly. See rust-lang/rust#70173 (comment) and this gets shipped starting with nightly 2022-01-17. According to https://users.rust-lang.org/t/volatile-option-in-new-asm-macro/44289/2 assembly is volatile by default with asm!.
This is a tracking issue for the RFC "2843" (rust-lang/rfcs#2843).
The feature gate for the issue is
#![feature(llvm_asm)]
.This issue tracks the legacy inline assembly macro
llvm_asm!
which more-or-less maps directly to LLVM's internal representation of inline assembly.There is currently no plan for stabilizing this macro, but there is a proposal to replace it with the new inline assembly macro specified in RFC 2873 (rust-lang/rfcs#2873).
Implementation PR: #68404
The text was updated successfully, but these errors were encountered: