Add a PredicateView type to abstract the predicate bit vector a bit.

The encoding tables contain references to numbered ISA predicates.

- Give the ISA Flags types a predicate_view() method which returns a
  PredicateView.
- Delete the old predicate_bytes() method which returned a raw &[u8].
- Use a 'static lifetime for the encoding list slice in the Encodings
  iterator, and a single 'a lifetime for everything else.
This commit is contained in:
Jakob Stoklund Olesen
2017-07-21 13:48:18 -07:00
parent 4142a9ca9c
commit f651ec4f78
8 changed files with 78 additions and 54 deletions

View File

@@ -61,11 +61,11 @@ impl TargetIsa for Isa {
enc_tables::INFO.clone()
}
fn legal_encodings<'a, 'b>(&'a self,
_dfg: &'b ir::DataFlowGraph,
inst: &'b ir::InstructionData,
ctrl_typevar: ir::Type)
-> Result<Encodings<'a, 'b>, Legalize> {
fn legal_encodings<'a>(&'a self,
_dfg: &'a ir::DataFlowGraph,
inst: &'a ir::InstructionData,
ctrl_typevar: ir::Type)
-> Result<Encodings<'a>, Legalize> {
lookup_enclist(ctrl_typevar,
inst.opcode(),
self.cpumode,
@@ -75,7 +75,7 @@ impl TargetIsa for Isa {
&enc_tables::ENCLISTS[..],
inst,
enc_tables::check_instp,
self.isa_flags.predicate_bytes()))
self.isa_flags.predicate_view()))
})
}