Move encoding-related information into an EncInfo struct.

The tables returned by recipe_names() and recipe_constraints() are now
collected into an EncInfo struct that is available from
TargetIsa::encoding_info(). This is equivalent to the register bank
tables available fro TargetIsa::register_info().

This cleans of the TargetIsa interface and makes it easier to add
encoding-related information.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-05 10:07:19 -07:00
parent 847c8045fd
commit 6ab35e54b8
15 changed files with 88 additions and 83 deletions

View File

@@ -184,7 +184,7 @@ fn write_instruction(w: &mut Write,
if let Some(enc) = func.encodings.get(inst).cloned() {
let mut s = String::with_capacity(16);
if let Some(isa) = isa {
write!(s, "[{}", isa.display_enc(enc))?;
write!(s, "[{}", isa.encoding_info().display(enc))?;
// Write value locations, if we have them.
if !func.locations.is_empty() {
let regs = isa.register_info();