Skip to content

Commit

Permalink
changing btype to sbtype to match the spec
Browse files Browse the repository at this point in the history
  • Loading branch information
svv232 authored and dannywillems committed Nov 4, 2024
1 parent 941d9ac commit 66709e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions o1vm/src/interpreters/riscv32i/column.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use super::{
interpreter::{
BInstruction, IInstruction, Instruction,
Instruction::{BType, IType, RType, SType, UJType, UType},
RInstruction, SInstruction, UInstruction,
IInstruction, Instruction,
Instruction::{IType, RType, SBType, SType, UJType, UType},
RInstruction, SBInstruction, SInstruction, UInstruction,
},
INSTRUCTION_SET_SIZE, SCRATCH_SIZE,
};
Expand Down Expand Up @@ -46,21 +46,21 @@ impl From<Instruction> for usize {
SType(stype) => {
SCRATCH_SIZE + 1 + RInstruction::COUNT + IInstruction::COUNT + stype as usize
}
BType(btype) => {
SBType(sbtype) => {
SCRATCH_SIZE
+ 1
+ RInstruction::COUNT
+ IInstruction::COUNT
+ SInstruction::COUNT
+ btype as usize
+ sbtype as usize
}
UType(utype) => {
SCRATCH_SIZE
+ 1
+ RInstruction::COUNT
+ IInstruction::COUNT
+ SInstruction::COUNT
+ BInstruction::COUNT
+ SBInstruction::COUNT
+ utype as usize
}
UJType(ujtype) => {
Expand All @@ -69,7 +69,7 @@ impl From<Instruction> for usize {
+ RInstruction::COUNT
+ IInstruction::COUNT
+ SInstruction::COUNT
+ BInstruction::COUNT
+ SBInstruction::COUNT
+ UInstruction::COUNT
+ ujtype as usize
}
Expand Down
12 changes: 6 additions & 6 deletions o1vm/src/interpreters/riscv32i/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub enum Instruction {
RType(RInstruction),
IType(IInstruction),
SType(SInstruction),
BType(BInstruction),
SBType(SBInstruction),
UType(UInstruction),
UJType(UJInstruction),
}
Expand Down Expand Up @@ -66,7 +66,7 @@ pub enum SInstruction {
#[derive(
Debug, Clone, Copy, Eq, PartialEq, EnumCount, EnumIter, Default, Hash, Ord, PartialOrd,
)]
pub enum BInstruction {
pub enum SBInstruction {
#[default]
BranchEq, // beq
BranchNeq, // bne
Expand Down Expand Up @@ -121,10 +121,10 @@ impl IntoIterator for Instruction {
}
iter_contents.into_iter()
}
Instruction::BType(_) => {
let mut iter_contents = Vec::with_capacity(BInstruction::COUNT);
for btype in BInstruction::iter() {
iter_contents.push(Instruction::BType(btype));
Instruction::SBType(_) => {
let mut iter_contents = Vec::with_capacity(SBInstruction::COUNT);
for sbtype in SBInstruction::iter() {
iter_contents.push(Instruction::SBType(sbtype));
}
iter_contents.into_iter()
}
Expand Down

0 comments on commit 66709e0

Please sign in to comment.