[Libre-soc-bugs] [Bug 451] Add PowerPC64 to Rust's new inline assembly implementation

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Aug 6 23:08:57 BST 2020


https://bugs.libre-soc.org/show_bug.cgi?id=451

--- Comment #2 from Jacob Lifshay <programmerjake at gmail.com> ---
Better description:
Add PowerPC64 support to Rust's new `asm!` macro for inline assembly. This
includes writing the code and going through the process of merging it into
upstream Rust and addressing any concerns that arise in the process.
A GitHub account is required.
Knowledge of PowerPC assembly and/or Rustc's internals would be useful.

Amanieu:
> Adding support for a new architecture is actually quite straightforward since
> most of the work is already done in LLVM. You only need to make 2 changes:
> 
> Add the register definitions to src/librustc_target/asm/.
> Add lowering to LLVM asm to src/librustc_codegen_llvm/asm.rs.
> Have a look at #73214 which added inline asm support for Hexagon.

This is more complex than adding support for Hexagon since PowerPC has many
more constraint kinds than Hexagon (the example pull request below).

Links:
LLVM inline assembly ISA-specific constraint code list:
https://llvm.org/docs/LangRef.html#supported-constraint-code-list
LLVM inline assembly reference:
https://llvm.org/docs/LangRef.html#inline-assembler-expressions
PowerPC Spec (not expected to read all of it):
https://wiki.raptorcs.com/w/images/f/f5/PowerISA_public.v3.1.pdf
Example pull request for adding ISA to Rust's `asm!` macro:
https://github.com/rust-lang/rust/pull/73214
RFC for Rust's `asm!` macro:
https://github.com/rust-lang/rfcs/pull/2873

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list