Move the ctrl_typevar function into dfg.

Soon, InstructionData won't have sufficient information to compute this.

Give TargetIsa::encode() an explicit ctrl_typevar argument. This
function does not require the instruction to be inserted in the DFG
tables.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-12 13:14:03 -07:00
parent 00ee850e33
commit 9c6a36d36d
11 changed files with 69 additions and 53 deletions

View File

@@ -46,7 +46,7 @@ pub use isa::registers::{RegInfo, RegUnit, RegClass, RegClassIndex};
use binemit::CodeSink;
use settings;
use ir::{Function, Inst, InstructionData, DataFlowGraph, Signature};
use ir::{Function, Inst, InstructionData, DataFlowGraph, Signature, Type};
pub mod riscv;
pub mod intel;
@@ -141,7 +141,11 @@ pub trait TargetIsa {
/// Otherwise, return `None`.
///
/// This is also the main entry point for determining if an instruction is legal.
fn encode(&self, dfg: &DataFlowGraph, inst: &InstructionData) -> Result<Encoding, Legalize>;
fn encode(&self,
dfg: &DataFlowGraph,
inst: &InstructionData,
ctrl_typevar: Type)
-> Result<Encoding, Legalize>;
/// Get a data structure describing the instruction encodings in this ISA.
fn encoding_info(&self) -> EncInfo;