Add an isa::StackRef type.

This contains encoding details for a stack reference: The base register
and offset to use in the specific instruction encoding.

Generate StackRef objects called in_stk0 etc for the binemit recipe
code. All binemit recipes need to compute base pointer offsets for stack
references, so have the automatically generated code do it.
This commit is contained in:
Jakob Stoklund Olesen
2017-09-22 11:16:07 -07:00
parent 2946cc54d3
commit 76eb7df9f0
6 changed files with 123 additions and 12 deletions

View File

@@ -43,6 +43,7 @@
pub use isa::constraints::{RecipeConstraints, OperandConstraint, ConstraintKind, BranchRange};
pub use isa::encoding::{Encoding, EncInfo};
pub use isa::registers::{RegInfo, RegUnit, RegClass, RegClassIndex, regs_overlap};
pub use isa::stack::{StackBase, StackBaseMask, StackRef};
use binemit;
use flowgraph;
@@ -68,6 +69,7 @@ pub mod registers;
mod encoding;
mod enc_tables;
mod constraints;
mod stack;
/// Returns a builder that can create a corresponding `TargetIsa`
/// or `Err(LookupError::Unsupported)` if not enabled.