diff --git a/src/arm/cpu/arm/branch.zig b/src/arm/cpu/arm/branch.zig index 93cdc30..e943377 100644 --- a/src/arm/cpu/arm/branch.zig +++ b/src/arm/cpu/arm/branch.zig @@ -12,7 +12,7 @@ pub fn branch(comptime InstrFn: type, comptime L: bool) InstrFn { const offset = sext(u32, u24, opcode) << 2 | @as(u32, @intFromBool(H)) << 1; cpu.r[14] = cpu.r[15] - 4; - cpu.cpsr.t.set(); + cpu.cpsr.t.write(true); cpu.r[15] +%= offset; }, diff --git a/src/arm/cpu/arm/psr_transfer.zig b/src/arm/cpu/arm/psr_transfer.zig index 9139479..0d14792 100644 --- a/src/arm/cpu/arm/psr_transfer.zig +++ b/src/arm/cpu/arm/psr_transfer.zig @@ -68,7 +68,7 @@ pub fn control(comptime InstrFn: type, comptime I: bool, comptime op: u6) InstrF if (ret[1] == 0b1) { product = if (product < 0) std.math.maxInt(i32) else std.math.minInt(i32); - cpu.cpsr.q.set(); + cpu.cpsr.q.write(true); } break :blk product; @@ -79,7 +79,7 @@ pub fn control(comptime InstrFn: type, comptime I: bool, comptime op: u6) InstrF if (ret[1] == 0b1) { result = if (result < 0) std.math.maxInt(i32) else std.math.minInt(i32); - cpu.cpsr.q.set(); + cpu.cpsr.q.write(true); } cpu.r[rd] = @bitCast(result); @@ -102,7 +102,7 @@ pub fn control(comptime InstrFn: type, comptime I: bool, comptime op: u6) InstrF const result = @addWithOverflow(left * right, accumulate); cpu.r[rd] = @bitCast(result[0]); - if (result[1] == 0b1) cpu.cpsr.q.set(); + if (result[1] == 0b1) cpu.cpsr.q.write(true); }, 0b10_1000, 0b10_1010, 0b10_1100, 0b10_1110 => { // SMLAL @@ -143,7 +143,7 @@ pub fn control(comptime InstrFn: type, comptime I: bool, comptime op: u6) InstrF const ret = @addWithOverflow(@as(i32, @truncate((left * right) >> 16)), accumulate); cpu.r[rd] = @bitCast(ret[0]); - if (ret[1] == 0b1) cpu.cpsr.q.set(); + if (ret[1] == 0b1) cpu.cpsr.q.write(true); }, 0b01_1010, 0b01_1110 => { // SMULW diff --git a/src/arm/cpu/thumb/branch.zig b/src/arm/cpu/thumb/branch.zig index 6d8beb6..9dd34da 100644 --- a/src/arm/cpu/thumb/branch.zig +++ b/src/arm/cpu/thumb/branch.zig @@ -35,7 +35,7 @@ pub fn linkExchange(comptime InstrFn: type, comptime H: u2) InstrFn { cpu.r[15] = (cpu.r[14] +% (offset << 1)) & ~@as(u32, 0x3); cpu.r[14] = next_addr | 1; - cpu.cpsr.t.unset(); + cpu.cpsr.t.write(false); cpu.pipe.reload(cpu); },