pub struct AbiDescription {
pub name: &'static str,
pub banks: Banks,
pub scalars: Scalars,
pub returns: &'static [Rule],
pub arguments: &'static [Rule],
pub return_pointer: ReturnPointer,
pub variadic: Variadic,
pub stack_args: StackArgs,
}Expand description
One psABI, completely.
Everything an ABI decides about how a value travels is in here. What is deliberately not in
here is in AbiDescription::stack_args’s note: prologue emission, register allocation
constraints and unwind emission are per architecture code with per ABI parameters, and
section 6.7 is explicit that turning those into tables costs more than the duplication.
Fields§
§name: &'static strWhat the ABI is called, which is the name that goes in a diagnostic and in the report.
banks: BanksThe registers a call starts with, and how a scalar spends them.
scalars: ScalarsHow a scalar spends registers, which differs between ABIs more than it looks like it should.
returns: &'static [Rule]The rules for a return value, tried in order.
arguments: &'static [Rule]The rules for an argument, tried in order.
return_pointer: ReturnPointerWhere the address of a return value that comes back in memory travels.
variadic: VariadicWhat a variadic argument does differently.
stack_args: StackArgsHow arguments that did not get a register sit in the argument area.
Nothing in this crate reads it. It is here because it is a fact about the ABI and section 6.7 wants the description to be the source of truth for the whole ABI rather than for the half of it that happens to be classification, and because the backend that does read it should be reading it from the same place the tests are generated from.
Implementations§
Source§impl AbiDescription
impl AbiDescription
Sourcepub const fn scalar_is_by_reference(&self, size: u64) -> bool
pub const fn scalar_is_by_reference(&self, size: u64) -> bool
Whether a scalar of this size travels as the address of a copy the caller made.
The size rule of the one ABI that does this is written over the size of the object and says
nothing about what is in it, which is why this takes a number rather than a Scalar: a
pass writing a call to a runtime routine has a width in hand and no C type behind it, and the
answer is the same for both askers because there is only the one rule.
Sourcepub const fn wide_integer_returns_in(&self, size: u64) -> Option<Format>
pub const fn wide_integer_returns_in(&self, size: u64) -> Option<Format>
The format an integer of this size comes back in, where the ABI brings one back whole in a vector register rather than through the address the caller passed.
The companion to AbiDescription::scalar_is_by_reference and asked by the same kind of
caller for the same reason, a pass writing a call to a runtime routine with a width in hand
and no C type behind it. It is a separate question rather than the same one answered the
other way because the two disagree on the one ABI that says yes to either: Windows x64
passes a sixteen byte integer as an address and brings one back in xmm0, so __fixtfti
there takes an address and answers in a vector register.
None where the size is one a register holds, since then nothing about it is wide, and
None on every ABI that does not do this.
Trait Implementations§
Source§impl Clone for AbiDescription
impl Clone for AbiDescription
Source§fn clone(&self) -> AbiDescription
fn clone(&self) -> AbiDescription
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more