chore: relocate barrel_shifter zig file

This commit is contained in:
Rekai Nyangadzayi Musuka 2022-01-29 18:52:16 -04:00
parent 599e068c7e
commit e0acabf050
5 changed files with 9 additions and 10 deletions

View File

@ -1,7 +1,6 @@
const std = @import("std");
const util = @import("util.zig");
const BarrelShifter = @import("cpu/arm/barrel_shifter.zig");
const Bus = @import("Bus.zig");
const Bit = @import("bitfield").Bit;
const Bitfield = @import("bitfield").Bitfield;

View File

@ -1,6 +1,6 @@
const std = @import("std");
const shifter = @import("barrel_shifter.zig");
const shifter = @import("../barrel_shifter.zig");
const Bus = @import("../../Bus.zig");
const Arm7tdmi = @import("../../cpu.zig").Arm7tdmi;
const InstrFn = @import("../../cpu.zig").ArmInstrFn;

View File

@ -1,7 +1,7 @@
const std = @import("std");
const util = @import("../../util.zig");
const BarrelShifter = @import("barrel_shifter.zig");
const shifter = @import("../barrel_shifter.zig");
const Bus = @import("../../Bus.zig");
const Arm7tdmi = @import("../../cpu.zig").Arm7tdmi;
const InstrFn = @import("../../cpu.zig").ArmInstrFn;
@ -58,9 +58,9 @@ fn registerOffset(cpu: *Arm7tdmi, opcode: u32) u32 {
const rm = cpu.r[opcode & 0xF];
return switch (@truncate(u2, opcode >> 5)) {
0b00 => BarrelShifter.logicalLeft(false, &cpu.cpsr, rm, amount),
0b01 => BarrelShifter.logicalRight(false, &cpu.cpsr, rm, amount),
0b10 => BarrelShifter.arithmeticRight(false, &cpu.cpsr, rm, amount),
0b11 => BarrelShifter.rotateRight(false, &cpu.cpsr, rm, amount),
0b00 => shifter.logicalLeft(false, &cpu.cpsr, rm, amount),
0b01 => shifter.logicalRight(false, &cpu.cpsr, rm, amount),
0b10 => shifter.arithmeticRight(false, &cpu.cpsr, rm, amount),
0b11 => shifter.rotateRight(false, &cpu.cpsr, rm, amount),
};
}

View File

@ -1,7 +1,7 @@
const std = @import("std");
const Arm7tdmi = @import("../../cpu.zig").Arm7tdmi;
const CPSR = @import("../../cpu.zig").PSR;
const Arm7tdmi = @import("../cpu.zig").Arm7tdmi;
const CPSR = @import("../cpu.zig").PSR;
pub fn execute(comptime S: bool, cpu: *Arm7tdmi, opcode: u32) u32 {
var result: u32 = undefined;

View File

@ -3,7 +3,7 @@ const std = @import("std");
const Bus = @import("../../Bus.zig");
const Arm7tdmi = @import("../../cpu.zig").Arm7tdmi;
const InstrFn = @import("../../cpu.zig").ThumbInstrFn;
const shifter = @import("../arm/barrel_shifter.zig");
const shifter = @import("../barrel_shifter.zig");
pub fn format1(comptime op: u2, comptime offset: u5) InstrFn {
return struct {