fix(armv5te): implement obscure behaviour on invalid LDM writeback

All I have to do is implement ARMv5TE specific instructions, and then
we're finished with ARMWRESTLER!
This commit is contained in:
2023-09-06 00:19:25 -05:00
parent 591352a65b
commit e6863e7a9b
2 changed files with 77 additions and 53 deletions

View File

@@ -27,11 +27,12 @@ const condition_lut = [_]u16{
0x0000, // NV - never
};
pub fn Arm32(comptime arch: Architecture) type {
const is_v5te = arch == .v5te;
pub fn Arm32(comptime isa: Architecture) type {
const is_v5te = isa == .v5te;
return struct {
const Self = @This();
pub const arch = isa;
r: [16]u32 = [_]u32{0x00} ** 16,
pipe: Pipeline = Pipeline.init(),
@@ -46,12 +47,12 @@ pub fn Arm32(comptime arch: Architecture) type {
itcm: if (is_v5te) Itcm else void,
dtcm: if (is_v5te) Dtcm else void,
const arm = switch (arch) {
const arm = switch (isa) {
.v4t => @import("arm/v4t.zig").arm,
.v5te => @import("arm/v5te.zig").arm,
};
const thumb = switch (arch) {
const thumb = switch (isa) {
.v4t => @import("arm/v4t.zig").thumb,
.v5te => @import("arm/v5te.zig").thumb,
};
@@ -388,7 +389,7 @@ pub fn Arm32(comptime arch: Architecture) type {
}
pub fn interface(self: *Self) Interpreter {
return switch (arch) {
return switch (isa) {
.v4t => .{ .v4t = self },
.v5te => .{ .v5te = self },
};