From 26f644b3d00930680c8ee5480b2def436f6542ac Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Mon, 9 Dec 2019 22:55:13 +0000 Subject: [PATCH 1/3] Introduce the ASM project group --- text/0000-project-asm.md | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 text/0000-project-asm.md diff --git a/text/0000-project-asm.md b/text/0000-project-asm.md new file mode 100644 index 00000000000..1dd5b1e8366 --- /dev/null +++ b/text/0000-project-asm.md @@ -0,0 +1,54 @@ +- Feature Name: `project-asm` +- Start Date: 2019-12-07 +- RFC PR: [rust-lang/rfcs#0000](https://github.com/rust-lang/rfcs/pull/0000) +- Rust Issue: [rust-lang/rust#0000](https://github.com/rust-lang/rust/issues/0000) + +# Summary +[summary]: #summary + +To create a [project group] with the purpose of designing subsequent RFCs to extend the language to support inline assembly in Rust code. + +# Motivation +[motivation]: #motivation + +In systems programming some tasks require dropping down to the assembly level. The primary reasons are for performance, precise timing, and low level hardware access. Using inline assembly for this is sometimes convenient, and sometimes necessary to avoid function call overhead. + +The inline assembler syntax currently available in nightly Rust is very ad-hoc. It provides a thin wrapper over the inline assembly syntax available in LLVM IR. For stabilization a more user-friendly syntax that lends itself to implementation across various backends is preferable. + +# Project group details + +[Repository][asm project] + +[Zulip stream][zulip] + +Initial shepherds: + +* [Amanieu (Amanieu d'Antras)](https://github.com/Amanieu) + +Lang team liaisons: + +* [joshtriplett (Josh Triplett)](https://github.com/joshtriplett) + +# Charter +[charter]: #charter + +The main goal of the asm project group is to design and implement an `asm!` macro using a syntax that we feel we can maintain, easily write, and stabilize. + +The project group has the following additional goals: +* to provide a transition path for existing users of the unstable `asm!` macro. +* to ensure that the chosen `asm!` syntax is portable to different compiler backends such as LLVM, GCC, etc. +* to provide a fallback implementation on compiler backends that do not support inline assembly natively (e.g. [Cranelift][cranelift]). +* to initially support most major architectures (x86, ARM, RISC-V) with the intention of extending to other architectures in the future. + +With a lower priority, the project group also intends to tackle the following secondary, future goals: +* support for module-level assembly (`global_asm!`). +* support for naked functions (`#[naked]`). + +Certain elements are definitively out of scope: + +* The chosen `asm!` syntax should not involve rustc "understanding" the asm code itself, since this would require a huge amount of work in the compiler to support the full assembly syntax of multiple architectures. Instead, interpretation of the assembly code should be left to the compiler backend (LLVM) or an external assembler (GAS). + +[asm project]: https://github.com/rust-lang/project-asm +[zulip]: https://rust-lang.zulipchat.com/#narrow/stream/216763-project-inline-asm +[cranelift]: https://github.com/CraneStation/cranelift/issues/444 +[project group]: https://github.com/rust-lang/wg-governance/blob/master/draft-rfcs/working-group-terminology.md From 9b40deca976315430996398c191ff2d08793d64b Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Wed, 11 Dec 2019 17:38:35 +0000 Subject: [PATCH 2/3] Fix repo link --- text/0000-project-asm.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/text/0000-project-asm.md b/text/0000-project-asm.md index 1dd5b1e8366..29da2554b51 100644 --- a/text/0000-project-asm.md +++ b/text/0000-project-asm.md @@ -1,4 +1,4 @@ -- Feature Name: `project-asm` +- Feature Name: `project-inline-asm` - Start Date: 2019-12-07 - RFC PR: [rust-lang/rfcs#0000](https://github.com/rust-lang/rfcs/pull/0000) - Rust Issue: [rust-lang/rust#0000](https://github.com/rust-lang/rust/issues/0000) @@ -48,7 +48,7 @@ Certain elements are definitively out of scope: * The chosen `asm!` syntax should not involve rustc "understanding" the asm code itself, since this would require a huge amount of work in the compiler to support the full assembly syntax of multiple architectures. Instead, interpretation of the assembly code should be left to the compiler backend (LLVM) or an external assembler (GAS). -[asm project]: https://github.com/rust-lang/project-asm +[asm project]: https://github.com/rust-lang/project-inline-asm [zulip]: https://rust-lang.zulipchat.com/#narrow/stream/216763-project-inline-asm [cranelift]: https://github.com/CraneStation/cranelift/issues/444 [project group]: https://github.com/rust-lang/wg-governance/blob/master/draft-rfcs/working-group-terminology.md From eaaead5463b0a2f4e330e2b70b6b114e87412edb Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Sun, 15 Dec 2019 23:48:25 +0000 Subject: [PATCH 3/3] Remove scope limitation --- text/0000-project-asm.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/text/0000-project-asm.md b/text/0000-project-asm.md index 29da2554b51..b9d88dd10fe 100644 --- a/text/0000-project-asm.md +++ b/text/0000-project-asm.md @@ -43,10 +43,6 @@ The project group has the following additional goals: With a lower priority, the project group also intends to tackle the following secondary, future goals: * support for module-level assembly (`global_asm!`). * support for naked functions (`#[naked]`). - -Certain elements are definitively out of scope: - -* The chosen `asm!` syntax should not involve rustc "understanding" the asm code itself, since this would require a huge amount of work in the compiler to support the full assembly syntax of multiple architectures. Instead, interpretation of the assembly code should be left to the compiler backend (LLVM) or an external assembler (GAS). [asm project]: https://github.com/rust-lang/project-inline-asm [zulip]: https://rust-lang.zulipchat.com/#narrow/stream/216763-project-inline-asm