Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This stabilizes inline assembly for PowerPC and PowerPC64.
Corresponding reference PR: rust-lang/reference#2056
From the requirements of stabilization mentioned in #93335
Done in #146949.
Done in #131341
Similarly,
preserves_flags
is also implemented by this PR. Notably, the consensus was to make this option do nothing on powerpc.The followings can be used as input/output:
r0
,r[3-12]
,r[14-r28]
): Any usable general-purpose registerr[3-12]
,r[14-r28]
): General-purpose registers, but excludesr0
. This is needed for instructions which definer0
to be the value 0, such as register + immediate memory operations.f[0-31]
): 64 bit floating pointer registersThe following are clobber-only:
ctr
,lr
,xer
: commonly clobbered special-purpose registers used in inline asmcr
(cr[0-7]
,cr
): the condition register fields, or the entire condition register.vreg
(v[0-31]
): altivec/vmx registervsreg
(vs[0-63]
): vector-scalar registerThe vreg and vsreg registers technically accept
#[repr(simd)]
types, but require the experimentalaltivec
orvsx
target features to be enabled. That work seems to be tracked here, #42743.The following cannot be used as operands for inline asm:
r2
: the TOC pointer, required for most PIC code.r13
: the TLS pointerr[29-30]
: Reserved for internal usage by LLVMr31
: the frame pointervrsave
: this is effectively an unused special-purpose register.The following registers are unavailable:
spe_acc
,spefscr
: These are available exclusively on the SPE target (the e500, not cell). I am not sure how these are actually used. I think they can be added later if needed.mma[0-7]
: These are new "registers" available on Power10, they are 512b registers which overlay 4x vsx registers. They could be added if needed, however their usage is very specialized.ap
,mq
: I don't think these registers exist on any usable power target supported by gcc/llvm.fpscr
: it is not modelled by gcc or llvm.vscr
: clang/gcc accept this as a clobber, but do not actually save/restore it.cc @taiki-e
r? @Amanieu
@rustbot label +A-inline-assembly