chore: update to latest builtin syntax

This commit is contained in:
2023-07-10 22:00:59 -05:00
parent 90d5c19e01
commit f8c2479ed9
15 changed files with 69 additions and 73 deletions

View File

@@ -174,7 +174,7 @@ pub fn Arm32(comptime arch: Architecture) type {
}
pub fn setCpsr(self: *Self, value: u32) void {
if (value & 0x1F != self.cpsr.raw & 0x1F) self.changeModeFromIdx(@truncate(u5, value & 0x1F));
if (value & 0x1F != self.cpsr.raw & 0x1F) self.changeModeFromIdx(@as(u5, @truncate(value & 0x1F)));
self.cpsr.raw = value;
}
@@ -257,7 +257,7 @@ pub fn Arm32(comptime arch: Architecture) type {
},
}
self.cpsr.mode.write(@enumToInt(next));
self.cpsr.mode.write(@intFromEnum(next));
}
pub fn step(self: *Self) void {
@@ -267,12 +267,12 @@ pub fn Arm32(comptime arch: Architecture) type {
}
if (self.cpsr.t.read()) {
const opcode = @truncate(u16, self.pipe.step(self, u16) orelse return);
const opcode = @as(u16, @truncate(self.pipe.step(self, u16) orelse return));
thumb.lut[thumb.idx(opcode)](self, self.bus, opcode);
} else {
const opcode = self.pipe.step(self, u32) orelse return;
if (self.cpsr.check(@truncate(u4, opcode >> 28))) {
if (self.cpsr.check(@as(u4, @truncate(opcode >> 28)))) {
arm.lut[arm.idx(opcode)](self, self.bus, opcode);
}
}
@@ -391,7 +391,7 @@ pub const PSR = extern union {
}
pub inline fn check(self: @This(), cond: u4) bool {
const flags = @truncate(u4, self.raw >> 28);
const flags = @as(u4, @truncate(self.raw >> 28));
return condition_lut[cond] & (@as(u16, 1) << flags) != 0;
}