Skip to content

Commit

Permalink
remove shamt parsing in shift right arithmetic in favor of top level …
Browse files Browse the repository at this point in the history
…shamt
  • Loading branch information
svv232 committed Dec 11, 2024
1 parent 2e42495 commit becb4ee
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions o1vm/src/interpreters/riscv32im/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1793,13 +1793,6 @@ pub fn interpret_itype<Env: InterpreterEnv>(env: &mut Env, instr: IInstruction)
IInstruction::ShiftRightArithmeticImmediate => {
// srai: x[rd] = x[rs1] >> shamt
let local_rs1 = env.read_register(&rs1);
let shamt = {
let pos = env.alloc_scratch();
unsafe { env.bitmask(&imm, 5, 0, pos) }
};
// parse shamt from imm as 20-24 of instruction and 0-4 wrt to imm
// sign extend shamt for arithmetic shift
let shamt = env.sign_extend(&shamt, 4);

let local_rd = {
let pos = env.alloc_scratch();
Expand Down

0 comments on commit becb4ee

Please sign in to comment.