pub enum Slot {
Integer {
offset: u64,
size: u32,
},
Float {
offset: u64,
format: Format,
},
}Expand description
One register’s worth of an aggregate that travels in registers, and which of the object’s bytes go in it.
A slot is what the object’s bytes are read as rather than what the program wrote. An
eightbyte holding two floats is Slot::Float of Format::Double, because eight bytes
of floating point data go in one vector register whichever way they are divided up and the
bits that arrive are the same either way.
The offset is here because it cannot be worked out from the run of slots. Two eightbytes are
at zero and eight and four floats of a homogeneous aggregate are four bytes apart, but
struct { int a; double b; } on RISC-V travels as an integer and a floating point register
whose bytes are at zero and eight, and the second is not where the first one ended.
Variants§
Integer
An integer this many bytes wide, which is one general purpose register.
The last slot of an aggregate is as wide as what is left of it, so a twelve byte structure is eight bytes and then four, and nothing reads a byte past the object.
Float
A floating point value in this format, which is one vector register.