feat(v5te): stub THUMB BKPT

This commit is contained in:
Rekai Nyangadzayi Musuka 2023-09-19 23:15:04 -05:00
parent 3c5d4acc5f
commit 502647806c
2 changed files with 22 additions and 7 deletions

View File

@ -216,3 +216,13 @@ pub fn fmt13(comptime InstrFn: type, comptime S: bool) InstrFn {
} }
}.inner; }.inner;
} }
pub fn bkpt(comptime InstrFn: type) InstrFn {
const Arm32 = @typeInfo(@typeInfo(@typeInfo(InstrFn).Pointer.child).Fn.params[0].type.?).Pointer.child;
return struct {
fn inner(cpu: *Arm32, _: u16) void {
cpu.panic("TODO: handle THUMB BKPT", .{});
}
}.inner;
}

View File

@ -212,13 +212,18 @@ pub const thumb = struct {
const rd = i >> 2 & 0x7; const rd = i >> 2 & 0x7;
break :blk processing.fmt12(InstrFn, isSP, rd); break :blk processing.fmt12(InstrFn, isSP, rd);
}, },
0b011 => if (i >> 4 & 1 == 1) blk: { 0b011 => switch (@as(u2, @truncate(i >> 3 & 0x3))) {
const L = i >> 5 & 1 == 1; 0b10 => blk: {
const R = i >> 2 & 1 == 1; // PUSH / POP
break :blk block_transfer.fmt14(InstrFn, L, R); const L = i >> 5 & 1 == 1;
} else blk: { const R = i >> 2 & 1 == 1;
const S = i >> 1 & 1 == 1; break :blk block_transfer.fmt14(InstrFn, L, R);
break :blk processing.fmt13(InstrFn, S); },
0b11 => processing.bkpt(InstrFn),
else => blk: {
const S = i >> 1 & 1 == 1;
break :blk processing.fmt13(InstrFn, S);
},
}, },
0b100 => blk: { 0b100 => blk: {
const L = i >> 5 & 1 == 1; const L = i >> 5 & 1 == 1;