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

@@ -36,7 +36,7 @@ pub fn fmt1(comptime InstrFn: type, comptime op: u2, comptime offset: u5) InstrF
// ASR
if (offset == 0) {
cpu.cpsr.c.write(cpu.r[rs] >> 31 & 1 == 1);
break :blk @bitCast(u32, @bitCast(i32, cpu.r[rs]) >> 31);
break :blk @as(u32, @bitCast(@as(i32, @bitCast(cpu.r[rs])) >> 31));
} else {
break :blk asr(true, &cpu.cpsr, cpu.r[rs], offset);
}
@@ -115,7 +115,7 @@ pub fn fmt2(comptime InstrFn: type, comptime I: bool, is_sub: bool, rn: u3) Inst
return struct {
fn inner(cpu: Arm32, _: Bus, opcode: u16) void {
const rs = opcode >> 3 & 0x7;
const rd = @truncate(u3, opcode);
const rd = @as(u3, @truncate(opcode));
const op1 = cpu.r[rs];
const op2: u32 = if (I) rn else cpu.r[rn];