Skip to content

Commit 26f644b

Browse files
committed
Introduce the ASM project group
1 parent cacbf7d commit 26f644b

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

text/0000-project-asm.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
- Feature Name: `project-asm`
2+
- Start Date: 2019-12-07
3+
- RFC PR: [rust-lang/rfcs#0000](https://github.com/rust-lang/rfcs/pull/0000)
4+
- Rust Issue: [rust-lang/rust#0000](https://github.com/rust-lang/rust/issues/0000)
5+
6+
# Summary
7+
[summary]: #summary
8+
9+
To create a [project group] with the purpose of designing subsequent RFCs to extend the language to support inline assembly in Rust code.
10+
11+
# Motivation
12+
[motivation]: #motivation
13+
14+
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.
15+
16+
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.
17+
18+
# Project group details
19+
20+
[Repository][asm project]
21+
22+
[Zulip stream][zulip]
23+
24+
Initial shepherds:
25+
26+
* [Amanieu (Amanieu d'Antras)](https://github.com/Amanieu)
27+
28+
Lang team liaisons:
29+
30+
* [joshtriplett (Josh Triplett)](https://github.com/joshtriplett)
31+
32+
# Charter
33+
[charter]: #charter
34+
35+
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.
36+
37+
The project group has the following additional goals:
38+
* to provide a transition path for existing users of the unstable `asm!` macro.
39+
* to ensure that the chosen `asm!` syntax is portable to different compiler backends such as LLVM, GCC, etc.
40+
* to provide a fallback implementation on compiler backends that do not support inline assembly natively (e.g. [Cranelift][cranelift]).
41+
* to initially support most major architectures (x86, ARM, RISC-V) with the intention of extending to other architectures in the future.
42+
43+
With a lower priority, the project group also intends to tackle the following secondary, future goals:
44+
* support for module-level assembly (`global_asm!`).
45+
* support for naked functions (`#[naked]`).
46+
47+
Certain elements are definitively out of scope:
48+
49+
* 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).
50+
51+
[asm project]: https://github.com/rust-lang/project-asm
52+
[zulip]: https://rust-lang.zulipchat.com/#narrow/stream/216763-project-inline-asm
53+
[cranelift]: https://github.com/CraneStation/cranelift/issues/444
54+
[project group]: https://github.com/rust-lang/wg-governance/blob/master/draft-rfcs/working-group-terminology.md

0 commit comments

Comments
 (0)