Rename 'encoding' modules to 'enc_tables'.

These modules contain encoding tables, not the 'Encoding' struct.
This commit is contained in:
Jakob Stoklund Olesen
2016-09-19 13:00:16 -07:00
parent 047bf5ab28
commit b5ffd3af92
4 changed files with 13 additions and 14 deletions

View File

@@ -41,7 +41,7 @@
//! concurrent function compilations. //! concurrent function compilations.
pub mod riscv; pub mod riscv;
mod encoding; mod enc_tables;
use settings; use settings;
use ir::{InstructionData, DataFlowGraph}; use ir::{InstructionData, DataFlowGraph};

View File

@@ -4,7 +4,7 @@ use ir::{Opcode, InstructionData};
use ir::instructions::InstructionFormat; use ir::instructions::InstructionFormat;
use ir::types; use ir::types;
use predicates; use predicates;
use isa::encoding::{Level1Entry, Level2Entry}; use isa::enc_tables::{Level1Entry, Level2Entry};
// Include the generated encoding tables: // Include the generated encoding tables:
// - `LEVEL1_RV32` // - `LEVEL1_RV32`

View File

@@ -1,19 +1,19 @@
//! RISC-V Instruction Set Architecture. //! RISC-V Instruction Set Architecture.
pub mod settings; pub mod settings;
mod encoding; mod enc_tables;
use super::super::settings as shared_settings; use super::super::settings as shared_settings;
use isa::encoding as shared_encoding; use isa::enc_tables::{self as shared_enc_tables, lookup_enclist, general_encoding};
use super::Builder as IsaBuilder; use isa::Builder as IsaBuilder;
use super::{TargetIsa, Encoding}; use isa::{TargetIsa, Encoding};
use ir::{InstructionData, DataFlowGraph}; use ir::{InstructionData, DataFlowGraph};
#[allow(dead_code)] #[allow(dead_code)]
struct Isa { struct Isa {
shared_flags: shared_settings::Flags, shared_flags: shared_settings::Flags,
isa_flags: settings::Flags, isa_flags: settings::Flags,
cpumode: &'static [shared_encoding::Level1Entry<u16>], cpumode: &'static [shared_enc_tables::Level1Entry<u16>],
} }
pub fn isa_builder() -> IsaBuilder { pub fn isa_builder() -> IsaBuilder {
@@ -27,9 +27,9 @@ fn isa_constructor(shared_flags: shared_settings::Flags,
builder: shared_settings::Builder) builder: shared_settings::Builder)
-> Box<TargetIsa> { -> Box<TargetIsa> {
let level1 = if shared_flags.is_64bit() { let level1 = if shared_flags.is_64bit() {
&encoding::LEVEL1_RV64[..] &enc_tables::LEVEL1_RV64[..]
} else { } else {
&encoding::LEVEL1_RV32[..] &enc_tables::LEVEL1_RV32[..]
}; };
Box::new(Isa { Box::new(Isa {
isa_flags: settings::Flags::new(&shared_flags, builder), isa_flags: settings::Flags::new(&shared_flags, builder),
@@ -40,21 +40,20 @@ fn isa_constructor(shared_flags: shared_settings::Flags,
impl TargetIsa for Isa { impl TargetIsa for Isa {
fn encode(&self, _: &DataFlowGraph, inst: &InstructionData) -> Option<Encoding> { fn encode(&self, _: &DataFlowGraph, inst: &InstructionData) -> Option<Encoding> {
use isa::encoding::{lookup_enclist, general_encoding};
lookup_enclist(inst.first_type(), lookup_enclist(inst.first_type(),
inst.opcode(), inst.opcode(),
self.cpumode, self.cpumode,
&encoding::LEVEL2[..]) &enc_tables::LEVEL2[..])
.and_then(|enclist_offset| { .and_then(|enclist_offset| {
general_encoding(enclist_offset, general_encoding(enclist_offset,
&encoding::ENCLISTS[..], &enc_tables::ENCLISTS[..],
|instp| encoding::check_instp(inst, instp), |instp| enc_tables::check_instp(inst, instp),
|isap| self.isa_flags.numbered_predicate(isap as usize)) |isap| self.isa_flags.numbered_predicate(isap as usize))
}) })
} }
fn recipe_names(&self) -> &'static [&'static str] { fn recipe_names(&self) -> &'static [&'static str] {
&encoding::RECIPE_NAMES[..] &enc_tables::RECIPE_NAMES[..]
} }
} }