Generate binemit::emit_inst() functions.
Use the meta language encoding recipes to generate an emit_inst() function for each ISA. The generated calls into recipe_*() functions that must be implemented by hand. Implement recipe_*() functions for the RISC-V recipes. Add the TargetIsa::emit_inst() entry point which emits an instruction to a CodeSink trait object.
This commit is contained in:
@@ -2,14 +2,16 @@
|
||||
|
||||
pub mod settings;
|
||||
mod abi;
|
||||
mod binemit;
|
||||
mod enc_tables;
|
||||
mod registers;
|
||||
|
||||
use super::super::settings as shared_settings;
|
||||
use binemit::CodeSink;
|
||||
use isa::enc_tables::{self as shared_enc_tables, lookup_enclist, general_encoding};
|
||||
use isa::Builder as IsaBuilder;
|
||||
use isa::{TargetIsa, RegInfo, Encoding, Legalize, RecipeConstraints};
|
||||
use ir::{InstructionData, DataFlowGraph, Signature};
|
||||
use ir::{Function, Inst, InstructionData, DataFlowGraph, Signature};
|
||||
|
||||
#[allow(dead_code)]
|
||||
struct Isa {
|
||||
@@ -80,6 +82,10 @@ impl TargetIsa for Isa {
|
||||
// We can pass in `self.isa_flags` too, if we need it.
|
||||
abi::legalize_signature(sig, &self.shared_flags)
|
||||
}
|
||||
|
||||
fn emit_inst(&self, func: &Function, inst: Inst, sink: &mut CodeSink) {
|
||||
binemit::emit_inst(func, inst, sink)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user