peepmatic: Make the results of match operations a smaller and more cache friendly

This commit is contained in:
Nick Fitzgerald
2020-05-07 12:15:50 -07:00
parent 9a1f8038b7
commit 469104c4d3
14 changed files with 580 additions and 149 deletions

View File

@@ -307,7 +307,9 @@ pub struct TestIsa {
pub native_word_size_in_bits: u8,
}
impl<'a> InstructionSet<'a> for TestIsa {
// Unsafe because we must ensure that `instruction_result_bit_width` never
// returns zero.
unsafe impl<'a> InstructionSet<'a> for TestIsa {
type Context = Program;
type Instruction = Instruction;
@@ -521,7 +523,9 @@ impl<'a> InstructionSet<'a> for TestIsa {
fn instruction_result_bit_width(&self, program: &mut Program, inst: Instruction) -> u8 {
log::debug!("instruction_result_bit_width({:?})", inst);
let ty = program.data(inst).r#type;
ty.bit_width.fixed_width().unwrap()
let width = ty.bit_width.fixed_width().unwrap();
assert!(width != 0);
width
}
fn native_word_size_in_bits(&self, _program: &mut Program) -> u8 {