You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each architecture needs to be reviewed before stabilization:
* It must have clobber_abi.
* It must be possible to clobber every register that is normally clobbered by a function call.
* Generally review that the exposed register classes make sense.
Anyone can post a stabilization (or status) report answering the above, probably with examples/tests, and that would be a good place for any platform to start. It would also be good to make sure there aren't any open LLVM issues, and mention it there.
The bar for enabling AVR should be pretty low since it is tier 3. I am not a decision maker here but I think any of the tier 3 targets could probably be stabilized with just the report and some real-world usage backing it up.
I'm not sure what exactly would be needed for the tier 2 and above targets, e.g. WASM as requested by @solomatov. Having a better picture of LLVM support is more important. @alexcrichton maybe you have an idea about the WASM picture here, or know who would?
Cc @ecnelises with the above in case you are interested in moving ppc assembly forward, based on linked issues it seems like there may be some ecosystem use cases.
Ah I don't know very much about inline assembly for the wasm target. I believe it works enough to do "some things" but that's the extent of my knowledge, and I wouldn't be prepared to assist with or myself propose stabilization. I also don't know who might know more about the wasm side of things other than "generally LLVM folks doing wasm things may know more", which I realize is unfortunately not very specific or actionable...
@AtomicGamer9523#131258 is an example of stabilizing assembly for a target that is behind this feature. You could probably put up a similar PR for AVR.
In my understanding, here is the status on each architecture other than s390x (which already has stabilization PR):
(Disclaimer: I'm not an expert of any of these. In particular, I know almost nothing about asm for WASM, GPUs, and BPF.)
Docs simply says "The status register SREG", but (IIUC) I (Global Interrupt Enable) bit of it should not actually be considered as a target of this option. (the same as MSP430 case)
experimental in LLVM? (I'm not sure if this would be a blocker)
Docs simply says "The status register r2", but (IIUC) only C, Z, N, and V bits of it are should actually be considered as targets of this option. (previous discussion)
M68k
fp* register (at least as clobber-only) should be supported (needed for clobber_abi)
The FPSR (see Figure 1-2) contains a floating-point condition code (FPCC) byte, a floatingpoint exception status (EXC) byte, a quotient byte, and a floating-point accrued exception
(AEXC) byte. The user can read or write to all the bits in the FPSR. Execution of most
floating-point instructions modifies this register. The reset function or a restore operation of
the null state clears the FPSR.
fpiar?
From "1.2.4 Floating-Point Instruction Address Register (FPIAR)" of M68000 FAMILY Programmer's Reference Manual
The integer unit can be executing instructions while the FPU is simultaneously executing a
floating-point instruction. Additionally, the FPU can concurrently execute two floating-point
instructions. Because of this nonsequential instruction execution, the PC value stacked by
the FPU, in response to a floating-point exception trap, may not point to the offending
instruction.
For the subset of the FPU instructions that generate exception traps, the 32-bit FPIAR is
loaded with the logical address of the instruction before the processor executes it. The
floating-point exception handler can use this address to locate the floating-point instruction
that caused an exception. Since the FPU FMOVE to/from the FPCR, FPSR, or FPIAR and
FMOVEM instructions cannot generate floating- point exceptions, these instructions do not
modify the FPIAR. A reset or a null-restore operation clears the FPIAR.
experimental in LLVM? (I'm not sure if this would be a blocker)
Activity
solomatov commentedon Aug 11, 2024
Is there any chance that wasm32 assembly support will be stabilized any time soon? Are there any tasks where contributions might speed this up?
Enable feature(asm_experimental_arch) for tests
Gate out test functions that use probe! on ppc64le and s390x
matveitolochko commentedon Sep 27, 2024
Is there any news about AVR ? If not, where and how can I contribute to this?
tgross35 commentedon Sep 27, 2024
The top post mentions the following:
Anyone can post a stabilization (or status) report answering the above, probably with examples/tests, and that would be a good place for any platform to start. It would also be good to make sure there aren't any open LLVM issues, and mention it there.
The bar for enabling AVR should be pretty low since it is tier 3. I am not a decision maker here but I think any of the tier 3 targets could probably be stabilized with just the report and some real-world usage backing it up.
I'm not sure what exactly would be needed for the tier 2 and above targets, e.g. WASM as requested by @solomatov. Having a better picture of LLVM support is more important. @alexcrichton maybe you have an idea about the WASM picture here, or know who would?
tgross35 commentedon Sep 27, 2024
Cc @ecnelises with the above in case you are interested in moving ppc assembly forward, based on linked issues it seems like there may be some ecosystem use cases.
alexcrichton commentedon Sep 28, 2024
Ah I don't know very much about inline assembly for the wasm target. I believe it works enough to do "some things" but that's the extent of my knowledge, and I wouldn't be prepared to assist with or myself propose stabilization. I also don't know who might know more about the wasm side of things other than "generally LLVM folks doing wasm things may know more", which I realize is unfortunately not very specific or actionable...
Rollup merge of rust-lang#130630 - taiki-e:s390x-clobber-abi, r=Amanieu
Unrolled build for rust-lang#130630
tgross35 commentedon Oct 5, 2024
@AtomicGamer9523 #131258 is an example of stabilizing assembly for a target that is behind this feature. You could probably put up a similar PR for AVR.
taiki-e commentedon Oct 5, 2024
In my understanding, here is the status on each architecture other than s390x (which already has stabilization PR):
(Disclaimer: I'm not an expert of any of these. In particular, I know almost nothing about asm for WASM, GPUs,
and BPF.)clobber_abiis implemented but broken: https://godbolt.org/z/r3PTrGz5rrust/compiler/rustc_target/src/asm/nvptx.rs
Lines 47 to 49 in 83ab648
https://github.com/rust-lang/rust/pull/149793/files#diff-dc51024eee547c7fb62f3fbfede955a586f0e217d038e8b6357a1f4721a52510
p*) register (clobber-only) should be supported (needed for clobber_abi and writing code with branching))v*register (at least as clobber-only) should be supported (needed for clobber_abi on PowerPC64)ctrandlrshould be supported as clobber-only registers; done in Support ctr and lr as clobber-only registers in PowerPC inline assembly #146831spe_accregister (volatile) in PPC32 SPE ABIxerandcr*supported as clobber-only registers correspond to (some of) this.rust/compiler/rustc_target/src/asm/spirv.rs
Lines 45 to 46 in 83ab648
rust/compiler/rustc_target/src/asm/wasm.rs
Lines 45 to 46 in 83ab648
clobber_abiin AVR inline assembly #131323 (comment)clobber_abiin AVR inline assembly #131323clobber_abiin AVR inline assembly #131323 (comment)rust/src/bootstrap/src/core/build_steps/llvm.rs
Lines 339 to 342 in 8f8bee4
fp*register (at least as clobber-only) should be supported (needed for clobber_abi)From "1.2.3 Floating-Point Status Register (FPSR)" of M68000 FAMILY Programmer's Reference Manual
From "1.2.4 Floating-Point Instruction Address Register (FPIAR)" of M68000 FAMILY Programmer's Reference Manual
rust/src/bootstrap/src/core/build_steps/llvm.rs
Lines 339 to 342 in 8f8bee4
rust/src/bootstrap/src/core/build_steps/llvm.rs
Lines 339 to 342 in 8f8bee4
rust/compiler/rustc_target/src/asm/sparc.rs
Lines 46 to 48 in 241f82a
rust/compiler/rustc_target/src/asm/sparc.rs
Lines 67 to 72 in 241f82a
rust/compiler/rustc_target/src/asm/sparc.rs
Lines 80 to 84 in 241f82a
rust/compiler/rustc_target/src/asm/sparc.rs
Lines 113 to 115 in 241f82a
rust/src/bootstrap/src/core/build_steps/llvm.rs
Lines 339 to 342 in 8f8bee4
FYI:
33 remaining items
Avoid `feature(asm_experimental_arch)` on arches that don't need it.
Avoid `feature(asm_experimental_arch)` on arches that don't need it. (#…
phase-117.1: nros-platform-esp32s3-qemu crate
Rollup merge of rust-lang#160949 - beetrees:f128-inline-asm-sparc, r=…
Rollup merge of rust-lang#160949 - beetrees:f128-inline-asm-sparc, r=…
Unrolled build for #160949 in rollup 161566
Rollup merge of #160949 - beetrees:f128-inline-asm-sparc, r=folkertdev
Rollup merge of #160949 - beetrees:f128-inline-asm-sparc, r=folkertdev
Rollup merge of rust-lang#160851 - beetrees:f16-inline-asm-mips, r=fo…
Unrolled build for #160851 in rollup 161979
Rollup merge of #160949 - beetrees:f128-inline-asm-sparc, r=folkertdev
Rollup merge of #160851 - beetrees:f16-inline-asm-mips, r=folkertdev
Rollup merge of rust-lang#161667 - beetrees:f16-inline-asm-nvptx, r=f…
Rollup merge of rust-lang#161667 - beetrees:f16-inline-asm-nvptx, r=f…
Unrolled build for #161667 in rollup 163178