chore: run zig fmt

This commit is contained in:
Rekai Nyangadzayi Musuka 2022-10-21 05:11:44 -03:00
parent e841bf44ca
commit 446eeba094
1 changed files with 4 additions and 4 deletions

View File

@ -131,7 +131,7 @@ const CPSR = struct {
pub fn set_v(self: *@This(), set: bool) void { pub fn set_v(self: *@This(), set: bool) void {
self.set_bit(28, set); self.set_bit(28, set);
} }
pub fn i(self: *const @This()) bool { pub fn i(self: *const @This()) bool {
return self.inner >> 7 & 0x01 == 0x01; return self.inner >> 7 & 0x01 == 0x01;
} }
@ -159,15 +159,15 @@ const CPSR = struct {
pub fn mode(self: *const @This()) Mode { pub fn mode(self: *const @This()) Mode {
return self.inner & 0x1F; return self.inner & 0x1F;
} }
pub fn set_mode(_: *@This(), _: Mode) void { pub fn set_mode(_: *@This(), _: Mode) void {
std.debug.panic("TODO: Implement set_mode for CPSR", .{}); std.debug.panic("TODO: Implement set_mode for CPSR", .{});
} }
fn set_bit(self: *@This(), comptime bit: usize, set: bool) void { fn set_bit(self: *@This(), comptime bit: usize, set: bool) void {
const set_val = @as(u32, @boolToInt(set)) << bit; const set_val = @as(u32, @boolToInt(set)) << bit;
const mask = ~(@as(u32, 1) << bit); const mask = ~(@as(u32, 1) << bit);
self.inner = (self.inner & mask) | set_val; self.inner = (self.inner & mask) | set_val;
} }
}; };