pub struct FrameInsts {
pub prefix: &'static str,
pub classes: &'static [ClassMoves],
pub push: &'static str,
pub pop: &'static str,
pub add: &'static str,
pub sub: &'static str,
pub align: &'static str,
pub lea: &'static str,
pub ret: &'static str,
}Expand description
Every instruction a prologue, an epilogue, a spill or a reload is made of.
Fields§
§prefix: &'static strWhat a rule file and the machine IR put in front of this target’s opcodes, such as
x64., which says which target a term belongs to and is not part of the opcode.
classes: &'static [ClassMoves]How a register of each class is moved, one for each class of the register file in the order the file numbers them.
Shorter than the file when the classes at the end are ones nothing spills. An x87 stack register is one of those: the allocator is never given one to hand out, so nothing ever asks how to move it, and a target that answered anyway would be writing down a guess.
push: &'static strPuts a register on the stack and moves the stack pointer down by one word.
pop: &'static strTakes a word off the stack into a register and moves the stack pointer back up.
add: &'static strAdds a constant to the stack pointer, which is how an epilogue gives the frame back.
sub: &'static strTakes a constant off the stack pointer, which is how a prologue takes the frame.
align: &'static strClears the low bits of the stack pointer, which is how a prologue forces an alignment nothing else can give it.
lea: &'static strWrites a register with an address rather than with what is at it, which is how an epilogue puts the stack pointer back when the frame pointer is the only record of where it was.
ret: &'static strReturns to the caller.
Implementations§
Source§impl FrameInsts
impl FrameInsts
Sourcepub fn moves(&self, class: RegClass) -> Option<ClassMoves>
pub fn moves(&self, class: RegClass) -> Option<ClassMoves>
How a register of that class is moved, or None for a class nothing spills.
Trait Implementations§
Source§impl Clone for FrameInsts
impl Clone for FrameInsts
Source§fn clone(&self) -> FrameInsts
fn clone(&self) -> FrameInsts
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more