chore: don't panic on 32-bit I/O

This commit is contained in:
2022-02-17 01:23:35 -04:00
parent f6c8d7ca07
commit 3746cf6025
6 changed files with 22 additions and 31 deletions

View File

@@ -12,7 +12,7 @@ pub fn format16(comptime cond: u4) InstrFn {
const offset = u32SignExtend(8, opcode & 0xFF) << 1;
const should_execute = switch (cond) {
0xE, 0xF => cpu.panic("[CPU/THUMB] Undefined conditional branch with condition {}", .{cond}),
0xE, 0xF => cpu.panic("[CPU/THUMB.16] Undefined conditional branch with condition {}", .{cond}),
else => checkCond(cpu.cpsr, cond),
};

View File

@@ -45,10 +45,7 @@ pub fn format1(comptime op: u2, comptime offset: u5) InstrFn {
break :blk shifter.arithmeticRight(true, &cpu.cpsr, cpu.r[rs], offset);
}
},
else => {
log.err("0b{b:0>2} is not a valid op", .{op});
// TODO: Should we panic here?
},
else => cpu.panic("[CPU/THUMB.1] 0b{b:0>2} is not a valid op", .{op}),
};
// Equivalent to an ARM MOVS