Generate register bank descriptions.

Use the information in the ISA's registers.py files to generate a
RegInfo Rust data structure.
This commit is contained in:
Jakob Stoklund Olesen
2016-11-22 10:51:42 -08:00
parent 9cdccf6691
commit 1f6dd0dab7
11 changed files with 232 additions and 2 deletions

View File

@@ -2,11 +2,12 @@
pub mod settings;
mod enc_tables;
mod registers;
use super::super::settings as shared_settings;
use isa::enc_tables::{self as shared_enc_tables, lookup_enclist, general_encoding};
use isa::Builder as IsaBuilder;
use isa::{TargetIsa, Encoding, Legalize};
use isa::{TargetIsa, RegInfo, Encoding, Legalize};
use ir::{InstructionData, DataFlowGraph};
#[allow(dead_code)]
@@ -48,6 +49,10 @@ impl TargetIsa for Isa {
&self.shared_flags
}
fn register_info(&self) -> &RegInfo {
&registers::INFO
}
fn encode(&self, _: &DataFlowGraph, inst: &InstructionData) -> Result<Encoding, Legalize> {
lookup_enclist(inst.first_type(),
inst.opcode(),