Skip to content

armgit / gecko

Public Imported from GitHub
0

A GameCube/Wii emulator and debugger written in Rust.

reorganized code, mmu stuff etc

Layled0dc3ab9ef8e
diff --git a/crates/gekko/Cargo.toml b/crates/gekko/Cargo.toml
index 86940b6..bd4329f 100644
--- a/crates/gekko/Cargo.toml
+++ b/crates/gekko/Cargo.toml
@@ -4,4 +4,4 @@ version = "0.1.0"
edition = "2024"
[build-dependencies]
-chipi = "0.4.0"
\ No newline at end of file
+chipi = "0.4.0"
diff --git a/crates/gekko/build.rs b/crates/gekko/build.rs
index 03829ae..e710c96 100644
--- a/crates/gekko/build.rs
+++ b/crates/gekko/build.rs
@@ -13,7 +13,8 @@ fn main() {
.group("branch", ["bx", "bclrx"])
.group("alu", ["ori", "addi", "addis"])
.group("msr", ["mtmsr", "mfmsr"])
- .group("spr", ["mtspr", "mfspr"]);
+ .group("spr", ["mtspr", "mfspr"])
+ .group("store_load", ["stwu", "sth", "sthu"]);
// Always regenerate the LUT dispatch tables
builder
diff --git a/crates/gekko/src/cpu.rs b/crates/gekko/src/cpu.rs
index a7596e1..0a95824 100644
--- a/crates/gekko/src/cpu.rs
+++ b/crates/gekko/src/cpu.rs
@@ -26,12 +26,12 @@ impl Cpu {
Cpu {
gprs: [0; 32],
fprs: [0.0; 32],
- pc: 0x100,
- cia: 0x100,
- nia: 0x104,
+ pc: 0x80000100,
+ cia: 0x80000100,
+ nia: 0x80000104,
lr: 0,
ctr: 0,
xer: 0,
}
}
-}
\ No newline at end of file
+}
diff --git a/crates/gekko/src/cpu/interpreter.rs b/crates/gekko/src/cpu/interpreter.rs
index 5088253..ea900f9 100644
--- a/crates/gekko/src/cpu/interpreter.rs
+++ b/crates/gekko/src/cpu/interpreter.rs
@@ -1,4 +1,7 @@
-pub fn branch<const OP: u32>(ctx: &mut crate::gekko::Gekko, instr: crate::cpu::semantics::Instruction) {
+pub fn branch<const OP: u32>(
+ ctx: &mut crate::gekko::Gekko,
+ instr: crate::cpu::semantics::Instruction,
+) {
if instr.lk() {
ctx.cpu.lr = ctx.cpu.cia.wrapping_add(4);
}
@@ -11,22 +14,31 @@ pub fn branch<const OP: u32>(ctx: &mut crate::gekko::Gekko, instr: crate::cpu::s
ctx.cpu.cia.wrapping_add_signed(instr.li())
}
}
- crate::cpu::lut::OP_BCLRX => {
- ctx.cpu.lr
- }
- _ => todo!("branch instruction with OP = {OP:#x}")
+ crate::cpu::lut::OP_BCLRX => ctx.cpu.lr,
+ _ => todo!("branch instruction with OP = {OP:#x}"),
};
ctx.cpu.nia = target;
}
-pub fn alu<const OP: u32>(ctx: &mut crate::gekko::Gekko, instr: crate::cpu::semantics::Instruction) {
+pub fn alu<const OP: u32>(
+ ctx: &mut crate::gekko::Gekko,
+ instr: crate::cpu::semantics::Instruction,
+) {
match OP {
crate::cpu::lut::OP_ADDI => {
- let ra = if instr.ra() == 0 { 0 } else { ctx.cpu.gprs[instr.ra()] };
+ let ra = if instr.ra() == 0 {
+ 0
+ } else {
+ ctx.cpu.gprs[instr.ra()]
+ };
ctx.cpu.gprs[instr.rd()] = ra.wrapping_add_signed(instr.simm());
}
crate::cpu::lut::OP_ADDIS => {
- let ra = if instr.ra() == 0 { 0 } else { ctx.cpu.gprs[instr.ra()] };
+ let ra = if instr.ra() == 0 {
+ 0
+ } else {
+ ctx.cpu.gprs[instr.ra()]
+ };
ctx.cpu.gprs[instr.rd()] = ra.wrapping_add_signed(instr.simm() << 16);
}
crate::cpu::lut::OP_ORI => {
@@ -35,11 +47,14 @@ pub fn alu<const OP: u32>(ctx: &mut crate::gekko::Gekko, instr: crate::cpu::sema
crate::cpu::lut::OP_ORIS => {
ctx.cpu.gprs[instr.ra()] = ctx.cpu.gprs[instr.rs()] | (instr.uimm() << 16);
}
- _ => todo!("ALU instruction with OP = {OP:#x}")
+ _ => todo!("ALU instruction with OP = {OP:#x}"),
}
}
-pub fn msr<const OP: u32>(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) {
+pub fn msr<const OP: u32>(
+ _ctx: &mut crate::gekko::Gekko,
+ _instr: crate::cpu::semantics::Instruction,
+) {
match OP {
crate::cpu::lut::OP_MTMSR => {
println!("OP_MTMSR!!");
@@ -47,245 +62,267 @@ pub fn msr<const OP: u32>(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::se
crate::cpu::lut::OP_MFMSR => {
println!("OP_MFMSR!!");
}
- _ => todo!("MSR instruction with OP = {OP:#x}")
+ _ => todo!("MSR instruction with OP = {OP:#x}"),
}
}
-pub fn spr<const OP: u32>(ctx: &mut crate::gekko::Gekko, instr: crate::cpu::semantics::Instruction) {
+pub fn spr<const OP: u32>(
+ ctx: &mut crate::gekko::Gekko,
+ instr: crate::cpu::semantics::Instruction,
+) {
match OP {
crate::cpu::lut::OP_MTSPR => {
println!("OP_MTSPR!! {}", instr.spr());
}
- crate::cpu::lut::OP_MFSPR => {
- match instr.spr() {
- 1 => ctx.cpu.gprs[instr.rd()] = ctx.cpu.xer,
- 8 => ctx.cpu.gprs[instr.rd()] = ctx.cpu.lr,
- 9 => ctx.cpu.gprs[instr.rd()] = ctx.cpu.ctr,
- _ => todo!("unimplemented SPR number {}", instr.spr())
+ crate::cpu::lut::OP_MFSPR => match instr.spr() {
+ 1 => ctx.cpu.gprs[instr.rd()] = ctx.cpu.xer,
+ 8 => ctx.cpu.gprs[instr.rd()] = ctx.cpu.lr,
+ 9 => ctx.cpu.gprs[instr.rd()] = ctx.cpu.ctr,
+ _ => todo!("unimplemented SPR number {}", instr.spr()),
+ },
+ _ => todo!("SPR instruction with OP = {OP:#x}"),
+ }
+}
+
+pub fn store_load<const OP: u32>(
+ ctx: &mut crate::gekko::Gekko,
+ instr: crate::cpu::semantics::Instruction,
+) {
+ match OP {
+ crate::cpu::lut::OP_STW | crate::cpu::lut::OP_STWU => {
+ let addr = ctx.cpu.gprs[instr.ra()].wrapping_add_signed(instr.disp());
+ ctx.mmu.virt_write_u32(addr, ctx.cpu.gprs[instr.rs()]);
+ if OP == crate::cpu::lut::OP_STWU {
+ ctx.cpu.gprs[instr.ra()] = addr;
+ }
+ }
+ crate::cpu::lut::OP_STH | crate::cpu::lut::OP_STHU => {
+ let addr = ctx.cpu.gprs[instr.ra()].wrapping_add_signed(instr.disp());
+ ctx.mmu
+ .virt_write_u16(addr, (ctx.cpu.gprs[instr.rs()] & 0xffff) as u16);
+ if OP == crate::cpu::lut::OP_STHU {
+ ctx.cpu.gprs[instr.ra()] = addr;
}
}
- _ => todo!("SPR instruction with OP = {OP:#x}")
+ _ => todo!("Store/Load instruction with OP = {OP:#x}"),
}
}
-pub fn twi(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("twi") }
-pub fn ps_cmpu0(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_cmpu0") }
-pub fn ps_cmpo0(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_cmpo0") }
-pub fn ps_cmpu1(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_cmpu1") }
-pub fn ps_cmpo1(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_cmpo1") }
-pub fn ps_res(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_res") }
-pub fn ps_rsqrte(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_rsqrte") }
-pub fn ps_neg(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_neg") }
-pub fn ps_mr(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_mr") }
-pub fn ps_nabs(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_nabs") }
-pub fn ps_abs(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_abs") }
-pub fn ps_merge00(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_merge00") }
-pub fn ps_merge01(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_merge01") }
-pub fn ps_merge10(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_merge10") }
-pub fn ps_merge11(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_merge11") }
-pub fn psq_lx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("psq_lx") }
-pub fn psq_stx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("psq_stx") }
-pub fn psq_lux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("psq_lux") }
-pub fn psq_stux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("psq_stux") }
-pub fn ps_sum0(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_sum0") }
-pub fn ps_sum1(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_sum1") }
-pub fn ps_muls0(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_muls0") }
-pub fn ps_muls1(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_muls1") }
-pub fn ps_madds0(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_madds0") }
-pub fn ps_madds1(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_madds1") }
-pub fn ps_div(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_div") }
-pub fn ps_sub(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_sub") }
-pub fn ps_add(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_add") }
-pub fn ps_sel(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_sel") }
-pub fn ps_mul(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_mul") }
-pub fn ps_msub(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_msub") }
-pub fn ps_madd(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_madd") }
-pub fn ps_nmsub(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_nmsub") }
-pub fn ps_nmadd(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_nmadd") }
-pub fn dcbz_l(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("dcbz_l") }
-pub fn mulli(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mulli") }
-pub fn subfic(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("subfic") }
-pub fn cmpli(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("cmpli") }
-pub fn cmpi(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("cmpi") }
-pub fn addic(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("addic") }
-pub fn addic_dot(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("addic_dot") }
-pub fn bcx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("bcx") }
-pub fn sc(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("sc") }
-pub fn mcrf(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mcrf") }
-pub fn bclrx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("bclrx") }
-pub fn crnor(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("crnor") }
-pub fn rfi(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("rfi") }
-pub fn crandc(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("crandc") }
-pub fn isync(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("isync") }
-pub fn crxor(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("crxor") }
-pub fn crnand(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("crnand") }
-pub fn crand(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("crand") }
-pub fn creqv(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("creqv") }
-pub fn crorc(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("crorc") }
-pub fn cror(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("cror") }
-pub fn bcctrx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("bcctrx") }
-pub fn rlwimix(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("rlwimix") }
-pub fn rlwinmx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("rlwinmx") }
-pub fn rlwnmx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("rlwnmx") }
-pub fn ori(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ori") }
-pub fn oris(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("oris") }
-pub fn xori(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("xori") }
-pub fn xoris(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("xoris") }
-pub fn andi_dot(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("andi_dot") }
-pub fn andis_dot(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("andis_dot") }
-pub fn cmp(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("cmp") }
-pub fn tw(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("tw") }
-pub fn subfcx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("subfcx") }
-pub fn mulhwux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mulhwux") }
-pub fn addcx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("addcx") }
-pub fn lwarx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lwarx") }
-pub fn lwzx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lwzx") }
-pub fn slwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("slwx") }
-pub fn cntlzwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("cntlzwx") }
-pub fn andx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("andx") }
-pub fn cmpl(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("cmpl") }
-pub fn subfx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("subfx") }
-pub fn dcbst(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("dcbst") }
-pub fn lwzux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lwzux") }
-pub fn andcx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("andcx") }
-pub fn mulhwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mulhwx") }
-pub fn mfcr(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mfcr") }
-pub fn dcbf(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("dcbf") }
-pub fn lbzx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lbzx") }
-pub fn negx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("negx") }
-pub fn lbzux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lbzux") }
-pub fn norx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("norx") }
-pub fn subfex(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("subfex") }
-pub fn addex(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("addex") }
-pub fn mtcrf(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mtcrf") }
-pub fn stwcx_dot(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stwcx_dot") }
-pub fn stwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stwx") }
-pub fn stwux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stwux") }
-pub fn subfzex(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("subfzex") }
-pub fn addzex(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("addzex") }
-pub fn mtsr(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mtsr") }
-pub fn stbx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stbx") }
-pub fn subfmex(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("subfmex") }
-pub fn addmex(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("addmex") }
-pub fn mullwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mullwx") }
-pub fn mtsrin(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mtsrin") }
-pub fn dcbtst(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("dcbtst") }
-pub fn stbux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stbux") }
-pub fn addx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("addx") }
-pub fn dcbt(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("dcbt") }
-pub fn lhzx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lhzx") }
-pub fn eqvx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("eqvx") }
-pub fn tlbie(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("tlbie") }
-pub fn eciwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("eciwx") }
-pub fn lhzux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lhzux") }
-pub fn xorx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("xorx") }
-pub fn lhax(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lhax") }
-pub fn tlbia(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("tlbia") }
-pub fn mftb(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mftb") }
-pub fn lhaux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lhaux") }
-pub fn sthx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("sthx") }
-pub fn orcx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("orcx") }
-pub fn ecowx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ecowx") }
-pub fn sthux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("sthux") }
-pub fn orx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("orx") }
-pub fn divwux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("divwux") }
-pub fn dcbi(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("dcbi") }
-pub fn nandx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("nandx") }
-pub fn divwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("divwx") }
-pub fn mcrxr(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mcrxr") }
-pub fn lwbrx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lwbrx") }
-pub fn lfsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lfsx") }
-pub fn srwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("srwx") }
-pub fn lswx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lswx") }
-pub fn tlbsync(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("tlbsync") }
-pub fn lfsux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lfsux") }
-pub fn mfsr(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mfsr") }
-pub fn lswi(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lswi") }
-pub fn sync(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("sync") }
-pub fn lfdx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lfdx") }
-pub fn lfdux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lfdux") }
-pub fn mfsrin(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mfsrin") }
-pub fn stswx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stswx") }
-pub fn stwbrx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stwbrx") }
-pub fn stfsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfsx") }
-pub fn stfsux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfsux") }
-pub fn stswi(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stswi") }
-pub fn stfdx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfdx") }
-pub fn stfdux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfdux") }
-pub fn dcba(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("dcba") }
-pub fn lhbrx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lhbrx") }
-pub fn srawx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("srawx") }
-pub fn srawix(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("srawix") }
-pub fn eieio(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("eieio") }
-pub fn sthbrx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("sthbrx") }
-pub fn extshx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("extshx") }
-pub fn extsbx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("extsbx") }
-pub fn icbi(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("icbi") }
-pub fn stfiwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfiwx") }
-pub fn tlbld(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("tlbld") }
-pub fn tlbli(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("tlbli") }
-pub fn dcbz(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("dcbz") }
-pub fn lwz(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lwz") }
-pub fn lwzu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lwzu") }
-pub fn lbz(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lbz") }
-pub fn lbzu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lbzu") }
-pub fn stw(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stw") }
-pub fn stwu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stwu") }
-pub fn stb(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stb") }
-pub fn stbu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stbu") }
-pub fn lhz(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lhz") }
-pub fn lhzu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lhzu") }
-pub fn lha(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lha") }
-pub fn lhau(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lhau") }
-pub fn sth(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("sth") }
-pub fn sthu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("sthu") }
-pub fn lmw(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lmw") }
-pub fn stmw(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stmw") }
-pub fn lfs(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lfs") }
-pub fn lfsu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lfsu") }
-pub fn lfd(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lfd") }
-pub fn lfdu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lfdu") }
-pub fn stfs(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfs") }
-pub fn stfsu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfsu") }
-pub fn stfd(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfd") }
-pub fn stfdu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfdu") }
-pub fn psq_l(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("psq_l") }
-pub fn psq_lu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("psq_lu") }
-pub fn fdivsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fdivsx") }
-pub fn fsubsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fsubsx") }
-pub fn faddsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("faddsx") }
-pub fn fsqrtsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fsqrtsx") }
-pub fn fresx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fresx") }
-pub fn fmulsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fmulsx") }
-pub fn fmsubsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fmsubsx") }
-pub fn fmaddsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fmaddsx") }
-pub fn fnmsubsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fnmsubsx") }
-pub fn fnmaddsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fnmaddsx") }
-pub fn psq_st(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("psq_st") }
-pub fn psq_stu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("psq_stu") }
-pub fn fcmpu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fcmpu") }
-pub fn frspx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("frspx") }
-pub fn fctiwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fctiwx") }
-pub fn fctiwzx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fctiwzx") }
-pub fn fcmpo(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fcmpo") }
-pub fn mtfsb1x(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mtfsb1x") }
-pub fn fnegx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fnegx") }
-pub fn mcrfs(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mcrfs") }
-pub fn mtfsb0x(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mtfsb0x") }
-pub fn fmrx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fmrx") }
-pub fn mtfsfix(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mtfsfix") }
-pub fn fnabsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fnabsx") }
-pub fn fabsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fabsx") }
-pub fn mffsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mffsx") }
-pub fn mtfsfx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mtfsfx") }
-pub fn fdivx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fdivx") }
-pub fn fsubx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fsubx") }
-pub fn faddx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("faddx") }
-pub fn fsqrtx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fsqrtx") }
-pub fn fselx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fselx") }
-pub fn fmulx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fmulx") }
-pub fn frsqrtex(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("frsqrtex") }
-pub fn fmsubx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fmsubx") }
-pub fn fmaddx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fmaddx") }
-pub fn fnmsubx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fnmsubx") }
-pub fn fnmaddx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fnmaddx") }
+#[rustfmt::skip] pub fn twi(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("twi") }
+#[rustfmt::skip] pub fn ps_cmpu0(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_cmpu0") }
+#[rustfmt::skip] pub fn ps_cmpo0(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_cmpo0") }
+#[rustfmt::skip] pub fn ps_cmpu1(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_cmpu1") }
+#[rustfmt::skip] pub fn ps_cmpo1(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_cmpo1") }
+#[rustfmt::skip] pub fn ps_res(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_res") }
+#[rustfmt::skip] pub fn ps_rsqrte(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_rsqrte") }
+#[rustfmt::skip] pub fn ps_neg(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_neg") }
+#[rustfmt::skip] pub fn ps_mr(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_mr") }
+#[rustfmt::skip] pub fn ps_nabs(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_nabs") }
+#[rustfmt::skip] pub fn ps_abs(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_abs") }
+#[rustfmt::skip] pub fn ps_merge00(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_merge00") }
+#[rustfmt::skip] pub fn ps_merge01(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_merge01") }
+#[rustfmt::skip] pub fn ps_merge10(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_merge10") }
+#[rustfmt::skip] pub fn ps_merge11(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_merge11") }
+#[rustfmt::skip] pub fn psq_lx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("psq_lx") }
+#[rustfmt::skip] pub fn psq_stx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("psq_stx") }
+#[rustfmt::skip] pub fn psq_lux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("psq_lux") }
+#[rustfmt::skip] pub fn psq_stux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("psq_stux") }
+#[rustfmt::skip] pub fn ps_sum0(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_sum0") }
+#[rustfmt::skip] pub fn ps_sum1(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_sum1") }
+#[rustfmt::skip] pub fn ps_muls0(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_muls0") }
+#[rustfmt::skip] pub fn ps_muls1(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_muls1") }
+#[rustfmt::skip] pub fn ps_madds0(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_madds0") }
+#[rustfmt::skip] pub fn ps_madds1(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_madds1") }
+#[rustfmt::skip] pub fn ps_div(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_div") }
+#[rustfmt::skip] pub fn ps_sub(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_sub") }
+#[rustfmt::skip] pub fn ps_add(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_add") }
+#[rustfmt::skip] pub fn ps_sel(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_sel") }
+#[rustfmt::skip] pub fn ps_mul(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_mul") }
+#[rustfmt::skip] pub fn ps_msub(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_msub") }
+#[rustfmt::skip] pub fn ps_madd(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_madd") }
+#[rustfmt::skip] pub fn ps_nmsub(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_nmsub") }
+#[rustfmt::skip] pub fn ps_nmadd(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ps_nmadd") }
+#[rustfmt::skip] pub fn dcbz_l(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("dcbz_l") }
+#[rustfmt::skip] pub fn mulli(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mulli") }
+#[rustfmt::skip] pub fn subfic(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("subfic") }
+#[rustfmt::skip] pub fn cmpli(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("cmpli") }
+#[rustfmt::skip] pub fn cmpi(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("cmpi") }
+#[rustfmt::skip] pub fn addic(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("addic") }
+#[rustfmt::skip] pub fn addic_dot(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("addic_dot") }
+#[rustfmt::skip] pub fn bcx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("bcx") }
+#[rustfmt::skip] pub fn sc(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("sc") }
+#[rustfmt::skip] pub fn mcrf(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mcrf") }
+#[rustfmt::skip] pub fn bclrx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("bclrx") }
+#[rustfmt::skip] pub fn crnor(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("crnor") }
+#[rustfmt::skip] pub fn rfi(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("rfi") }
+#[rustfmt::skip] pub fn crandc(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("crandc") }
+#[rustfmt::skip] pub fn isync(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("isync") }
+#[rustfmt::skip] pub fn crxor(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("crxor") }
+#[rustfmt::skip] pub fn crnand(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("crnand") }
+#[rustfmt::skip] pub fn crand(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("crand") }
+#[rustfmt::skip] pub fn creqv(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("creqv") }
+#[rustfmt::skip] pub fn crorc(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("crorc") }
+#[rustfmt::skip] pub fn cror(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("cror") }
+#[rustfmt::skip] pub fn bcctrx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("bcctrx") }
+#[rustfmt::skip] pub fn rlwimix(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("rlwimix") }
+#[rustfmt::skip] pub fn rlwinmx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("rlwinmx") }
+#[rustfmt::skip] pub fn rlwnmx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("rlwnmx") }
+#[rustfmt::skip] pub fn ori(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ori") }
+#[rustfmt::skip] pub fn oris(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("oris") }
+#[rustfmt::skip] pub fn xori(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("xori") }
+#[rustfmt::skip] pub fn xoris(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("xoris") }
+#[rustfmt::skip] pub fn andi_dot(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("andi_dot") }
+#[rustfmt::skip] pub fn andis_dot(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("andis_dot") }
+#[rustfmt::skip] pub fn cmp(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("cmp") }
+#[rustfmt::skip] pub fn tw(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("tw") }
+#[rustfmt::skip] pub fn subfcx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("subfcx") }
+#[rustfmt::skip] pub fn mulhwux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mulhwux") }
+#[rustfmt::skip] pub fn addcx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("addcx") }
+#[rustfmt::skip] pub fn lwarx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lwarx") }
+#[rustfmt::skip] pub fn lwzx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lwzx") }
+#[rustfmt::skip] pub fn slwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("slwx") }
+#[rustfmt::skip] pub fn cntlzwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("cntlzwx") }
+#[rustfmt::skip] pub fn andx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("andx") }
+#[rustfmt::skip] pub fn cmpl(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("cmpl") }
+#[rustfmt::skip] pub fn subfx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("subfx") }
+#[rustfmt::skip] pub fn dcbst(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("dcbst") }
+#[rustfmt::skip] pub fn lwzux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lwzux") }
+#[rustfmt::skip] pub fn andcx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("andcx") }
+#[rustfmt::skip] pub fn mulhwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mulhwx") }
+#[rustfmt::skip] pub fn mfcr(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mfcr") }
+#[rustfmt::skip] pub fn dcbf(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("dcbf") }
+#[rustfmt::skip] pub fn lbzx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lbzx") }
+#[rustfmt::skip] pub fn negx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("negx") }
+#[rustfmt::skip] pub fn lbzux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lbzux") }
+#[rustfmt::skip] pub fn norx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("norx") }
+#[rustfmt::skip] pub fn subfex(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("subfex") }
+#[rustfmt::skip] pub fn addex(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("addex") }
+#[rustfmt::skip] pub fn mtcrf(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mtcrf") }
+#[rustfmt::skip] pub fn stwcx_dot(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stwcx_dot") }
+#[rustfmt::skip] pub fn stwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stwx") }
+#[rustfmt::skip] pub fn stwux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stwux") }
+#[rustfmt::skip] pub fn subfzex(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("subfzex") }
+#[rustfmt::skip] pub fn addzex(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("addzex") }
+#[rustfmt::skip] pub fn mtsr(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mtsr") }
+#[rustfmt::skip] pub fn stbx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stbx") }
+#[rustfmt::skip] pub fn subfmex(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("subfmex") }
+#[rustfmt::skip] pub fn addmex(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("addmex") }
+#[rustfmt::skip] pub fn mullwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mullwx") }
+#[rustfmt::skip] pub fn mtsrin(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mtsrin") }
+#[rustfmt::skip] pub fn dcbtst(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("dcbtst") }
+#[rustfmt::skip] pub fn stbux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stbux") }
+#[rustfmt::skip] pub fn addx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("addx") }
+#[rustfmt::skip] pub fn dcbt(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("dcbt") }
+#[rustfmt::skip] pub fn lhzx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lhzx") }
+#[rustfmt::skip] pub fn eqvx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("eqvx") }
+#[rustfmt::skip] pub fn tlbie(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("tlbie") }
+#[rustfmt::skip] pub fn eciwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("eciwx") }
+#[rustfmt::skip] pub fn lhzux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lhzux") }
+#[rustfmt::skip] pub fn xorx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("xorx") }
+#[rustfmt::skip] pub fn lhax(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lhax") }
+#[rustfmt::skip] pub fn tlbia(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("tlbia") }
+#[rustfmt::skip] pub fn mftb(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mftb") }
+#[rustfmt::skip] pub fn lhaux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lhaux") }
+#[rustfmt::skip] pub fn sthx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("sthx") }
+#[rustfmt::skip] pub fn orcx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("orcx") }
+#[rustfmt::skip] pub fn ecowx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("ecowx") }
+#[rustfmt::skip] pub fn sthux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("sthux") }
+#[rustfmt::skip] pub fn orx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("orx") }
+#[rustfmt::skip] pub fn divwux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("divwux") }
+#[rustfmt::skip] pub fn dcbi(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("dcbi") }
+#[rustfmt::skip] pub fn nandx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("nandx") }
+#[rustfmt::skip] pub fn divwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("divwx") }
+#[rustfmt::skip] pub fn mcrxr(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mcrxr") }
+#[rustfmt::skip] pub fn lwbrx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lwbrx") }
+#[rustfmt::skip] pub fn lfsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lfsx") }
+#[rustfmt::skip] pub fn srwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("srwx") }
+#[rustfmt::skip] pub fn lswx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lswx") }
+#[rustfmt::skip] pub fn tlbsync(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("tlbsync") }
+#[rustfmt::skip] pub fn lfsux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lfsux") }
+#[rustfmt::skip] pub fn mfsr(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mfsr") }
+#[rustfmt::skip] pub fn lswi(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lswi") }
+#[rustfmt::skip] pub fn sync(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("sync") }
+#[rustfmt::skip] pub fn lfdx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lfdx") }
+#[rustfmt::skip] pub fn lfdux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lfdux") }
+#[rustfmt::skip] pub fn mfsrin(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mfsrin") }
+#[rustfmt::skip] pub fn stswx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stswx") }
+#[rustfmt::skip] pub fn stwbrx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stwbrx") }
+#[rustfmt::skip] pub fn stfsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfsx") }
+#[rustfmt::skip] pub fn stfsux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfsux") }
+#[rustfmt::skip] pub fn stswi(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stswi") }
+#[rustfmt::skip] pub fn stfdx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfdx") }
+#[rustfmt::skip] pub fn stfdux(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfdux") }
+#[rustfmt::skip] pub fn dcba(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("dcba") }
+#[rustfmt::skip] pub fn lhbrx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lhbrx") }
+#[rustfmt::skip] pub fn srawx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("srawx") }
+#[rustfmt::skip] pub fn srawix(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("srawix") }
+#[rustfmt::skip] pub fn eieio(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("eieio") }
+#[rustfmt::skip] pub fn sthbrx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("sthbrx") }
+#[rustfmt::skip] pub fn extshx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("extshx") }
+#[rustfmt::skip] pub fn extsbx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("extsbx") }
+#[rustfmt::skip] pub fn icbi(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("icbi") }
+#[rustfmt::skip] pub fn stfiwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfiwx") }
+#[rustfmt::skip] pub fn tlbld(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("tlbld") }
+#[rustfmt::skip] pub fn tlbli(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("tlbli") }
+#[rustfmt::skip] pub fn dcbz(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("dcbz") }
+#[rustfmt::skip] pub fn lwz(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lwz") }
+#[rustfmt::skip] pub fn lwzu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lwzu") }
+#[rustfmt::skip] pub fn lbz(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lbz") }
+#[rustfmt::skip] pub fn lbzu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lbzu") }
+#[rustfmt::skip] pub fn stw(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stw") }
+#[rustfmt::skip] pub fn stb(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stb") }
+#[rustfmt::skip] pub fn stbu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stbu") }
+#[rustfmt::skip] pub fn lhz(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lhz") }
+#[rustfmt::skip] pub fn lhzu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lhzu") }
+#[rustfmt::skip] pub fn lha(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lha") }
+#[rustfmt::skip] pub fn lhau(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lhau") }
+#[rustfmt::skip] pub fn lmw(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lmw") }
+#[rustfmt::skip] pub fn stmw(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stmw") }
+#[rustfmt::skip] pub fn lfs(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lfs") }
+#[rustfmt::skip] pub fn lfsu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lfsu") }
+#[rustfmt::skip] pub fn lfd(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lfd") }
+#[rustfmt::skip] pub fn lfdu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("lfdu") }
+#[rustfmt::skip] pub fn stfs(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfs") }
+#[rustfmt::skip] pub fn stfsu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfsu") }
+#[rustfmt::skip] pub fn stfd(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfd") }
+#[rustfmt::skip] pub fn stfdu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("stfdu") }
+#[rustfmt::skip] pub fn psq_l(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("psq_l") }
+#[rustfmt::skip] pub fn psq_lu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("psq_lu") }
+#[rustfmt::skip] pub fn fdivsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fdivsx") }
+#[rustfmt::skip] pub fn fsubsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fsubsx") }
+#[rustfmt::skip] pub fn faddsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("faddsx") }
+#[rustfmt::skip] pub fn fsqrtsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fsqrtsx") }
+#[rustfmt::skip] pub fn fresx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fresx") }
+#[rustfmt::skip] pub fn fmulsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fmulsx") }
+#[rustfmt::skip] pub fn fmsubsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fmsubsx") }
+#[rustfmt::skip] pub fn fmaddsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fmaddsx") }
+#[rustfmt::skip] pub fn fnmsubsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fnmsubsx") }
+#[rustfmt::skip] pub fn fnmaddsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fnmaddsx") }
+#[rustfmt::skip] pub fn psq_st(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("psq_st") }
+#[rustfmt::skip] pub fn psq_stu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("psq_stu") }
+#[rustfmt::skip] pub fn fcmpu(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fcmpu") }
+#[rustfmt::skip] pub fn frspx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("frspx") }
+#[rustfmt::skip] pub fn fctiwx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fctiwx") }
+#[rustfmt::skip] pub fn fctiwzx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fctiwzx") }
+#[rustfmt::skip] pub fn fcmpo(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fcmpo") }
+#[rustfmt::skip] pub fn mtfsb1x(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mtfsb1x") }
+#[rustfmt::skip] pub fn fnegx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fnegx") }
+#[rustfmt::skip] pub fn mcrfs(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mcrfs") }
+#[rustfmt::skip] pub fn mtfsb0x(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mtfsb0x") }
+#[rustfmt::skip] pub fn fmrx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fmrx") }
+#[rustfmt::skip] pub fn mtfsfix(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mtfsfix") }
+#[rustfmt::skip] pub fn fnabsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fnabsx") }
+#[rustfmt::skip] pub fn fabsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fabsx") }
+#[rustfmt::skip] pub fn mffsx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mffsx") }
+#[rustfmt::skip] pub fn mtfsfx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("mtfsfx") }
+#[rustfmt::skip] pub fn fdivx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fdivx") }
+#[rustfmt::skip] pub fn fsubx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fsubx") }
+#[rustfmt::skip] pub fn faddx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("faddx") }
+#[rustfmt::skip] pub fn fsqrtx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fsqrtx") }
+#[rustfmt::skip] pub fn fselx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fselx") }
+#[rustfmt::skip] pub fn fmulx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fmulx") }
+#[rustfmt::skip] pub fn frsqrtex(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("frsqrtex") }
+#[rustfmt::skip] pub fn fmsubx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fmsubx") }
+#[rustfmt::skip] pub fn fmaddx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fmaddx") }
+#[rustfmt::skip] pub fn fnmsubx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fnmsubx") }
+#[rustfmt::skip] pub fn fnmaddx(_ctx: &mut crate::gekko::Gekko, _instr: crate::cpu::semantics::Instruction) { todo!("fnmaddx") }
diff --git a/crates/gekko/src/cpu/semantics.rs b/crates/gekko/src/cpu/semantics.rs
index e285b40..6272051 100644
--- a/crates/gekko/src/cpu/semantics.rs
+++ b/crates/gekko/src/cpu/semantics.rs
@@ -21,6 +21,7 @@ impl Instruction {
#[inline] pub fn oe(&self) -> bool { (self.0 >> 10) & 1 != 0 }
#[inline] pub fn simm(&self) -> i32 { (self.0 as i16) as i32 }
+ #[inline] pub fn disp(&self) -> i32 { (self.0 as i16) as i32 }
#[inline] pub fn uimm(&self) -> u32 { self.0 & 0xffff }
#[inline] pub fn sh(&self) -> u32 { (self.0 >> 11) & 0x1f }
#[inline] pub fn mb(&self) -> u32 { (self.0 >> 6) & 0x1f }
diff --git a/crates/gekko/src/gekko.rs b/crates/gekko/src/gekko.rs
index 64a26cf..7d43643 100644
--- a/crates/gekko/src/gekko.rs
+++ b/crates/gekko/src/gekko.rs
@@ -1,4 +1,7 @@
-use crate::{cpu, mmu, scheduler};
+use crate::{
+ cpu::{self, semantics::Instruction},
+ mmu, scheduler,
+};
pub struct Gekko {
pub cpu: cpu::Cpu,
@@ -10,7 +13,7 @@ impl Gekko {
pub fn new(path: &str) -> Self {
let mut mmu = mmu::Mmu::new();
let data = std::fs::read(path).expect("failed to read ROM");
- mmu.memory[..data.len()].copy_from_slice(&data);
+ mmu.ram[..data.len()].copy_from_slice(&data);
Gekko {
cpu: cpu::Cpu::new(),
@@ -23,10 +26,10 @@ impl Gekko {
self.cpu.cia = self.cpu.pc;
self.cpu.nia = self.cpu.cia.wrapping_add(4);
- let instr = cpu::semantics::Instruction(self.mmu.read_u32(self.cpu.cia));
+ let instr = Instruction(self.mmu.virt_read_u32(self.cpu.cia));
cpu::lut::dispatch(self, instr);
self.scheduler.cycles += 1;
-
+
self.cpu.pc = self.cpu.nia;
}
}
diff --git a/crates/gekko/src/mmu.rs b/crates/gekko/src/mmu.rs
index 762934b..452c5ce 100644
--- a/crates/gekko/src/mmu.rs
+++ b/crates/gekko/src/mmu.rs
@@ -1,24 +1,120 @@
+#[cfg(test)]
+mod tests;
+
+pub mod constants;
+use constants::*;
+
pub struct Mmu {
- pub memory: Vec<u8>,
+ pub ram: Vec<u8>,
+ pub efb: Vec<u8>,
}
impl Mmu {
pub fn new() -> Self {
Mmu {
- memory: vec![0; 16 * 1024 * 1024],
+ ram: vec![0; RAM_SIZE],
+ efb: vec![0; EFB_SIZE],
}
}
- pub fn read_u8(&self, addr: u32) -> u8 {
- self.memory[addr as usize]
+ /// Resolve a physical address to a `(backing_slice, offset)` pair
+ /// This is the one place that maps physical addresses to memory regions
+ fn resolve(&self, phys: u32) -> (&[u8], usize) {
+ match phys {
+ RAM_BASE..=RAM_END => (&self.ram, phys as usize),
+ EFB_BASE..=EFB_END => (&self.efb, (phys - EFB_BASE) as usize),
+ HW_REG_BASE..=HW_REG_END => {
+ panic!("unimplemented HW register read at physical {phys:#010X}")
+ }
+ _ => panic!("unmapped physical read at {phys:#010X}"),
+ }
}
- pub fn read_u32(&self, addr: u32) -> u32 {
- let a = addr as usize;
- u32::from_be_bytes(self.memory[a..a + 4].try_into().unwrap())
+ /// Resolve a physical address to a `(backing_slice, offset)` pair
+ /// This is the one place that maps physical addresses to memory regions
+ /// Returns a mutable slice for write operations
+ fn resolve_mut(&mut self, phys: u32) -> (&mut [u8], usize) {
+ match phys {
+ RAM_BASE..=RAM_END => (&mut self.ram, phys as usize),
+ EFB_BASE..=EFB_END => (&mut self.efb, (phys - EFB_BASE) as usize),
+ HW_REG_BASE..=HW_REG_END => {
+ panic!("unimplemented HW register write at physical {phys:#010X}")
+ }
+ _ => panic!("unmapped physical write at {phys:#010X}"),
+ }
}
- pub fn write_u8(&mut self, addr: u32, value: u8) {
- self.memory[addr as usize] = value;
+ pub fn phys_read_u8(&self, addr: u32) -> u8 {
+ let (slice, offset) = self.resolve(addr);
+ slice[offset]
}
-}
\ No newline at end of file
+
+ pub fn phys_read_u16(&self, addr: u32) -> u16 {
+ let (slice, offset) = self.resolve(addr);
+ u16::from_be_bytes(slice[offset..offset + 2].try_into().unwrap())
+ }
+
+ pub fn phys_read_u32(&self, addr: u32) -> u32 {
+ let (slice, offset) = self.resolve(addr);
+ u32::from_be_bytes(slice[offset..offset + 4].try_into().unwrap())
+ }
+
+ pub fn phys_write_u8(&mut self, addr: u32, value: u8) {
+ let (slice, offset) = self.resolve_mut(addr);
+ slice[offset] = value;
+ }
+
+ pub fn phys_write_u16(&mut self, addr: u32, value: u16) {
+ let (slice, offset) = self.resolve_mut(addr);
+ let bytes = value.to_be_bytes();
+ slice[offset..offset + 2].copy_from_slice(&bytes);
+ }
+
+ pub fn phys_write_u32(&mut self, addr: u32, value: u32) {
+ let (slice, offset) = self.resolve_mut(addr);
+ let bytes = value.to_be_bytes();
+ slice[offset..offset + 4].copy_from_slice(&bytes);
+ }
+
+ pub fn virt_read_u8(&self, addr: u32) -> u8 {
+ self.phys_read_u8(Self::virt_to_phys(addr))
+ }
+
+ pub fn virt_read_u16(&self, addr: u32) -> u16 {
+ self.phys_read_u16(Self::virt_to_phys(addr))
+ }
+
+ pub fn virt_read_u32(&self, addr: u32) -> u32 {
+ self.phys_read_u32(Self::virt_to_phys(addr))
+ }
+
+ pub fn virt_write_u8(&mut self, addr: u32, value: u8) {
+ self.phys_write_u8(Self::virt_to_phys(addr), value);
+ }
+
+ pub fn virt_write_u16(&mut self, addr: u32, value: u16) {
+ self.phys_write_u16(Self::virt_to_phys(addr), value);
+ }
+
+ pub fn virt_write_u32(&mut self, addr: u32, value: u32) {
+ self.phys_write_u32(Self::virt_to_phys(addr), value);
+ }
+
+ /// Return a slice of physical memory starting at `addr` with length `len`
+ /// Useful for bulk reads (e.g. disassembler)
+ pub fn phys_slice(&self, addr: u32, len: usize) -> &[u8] {
+ let (slice, offset) = self.resolve(addr);
+ &slice[offset..offset + len]
+ }
+
+ /// Return a slice of virtual memory starting at `addr` with length `len`
+ /// This is just a thin wrapper around `phys_slice` that applies virtual-to-physical translation
+ pub fn virt_slice(&self, addr: u32, len: usize) -> &[u8] {
+ self.phys_slice(Self::virt_to_phys(addr), len)
+ }
+
+ // Simple virtual to physical translation that ignores caching and other MMU features
+ pub fn virt_to_phys(addr: u32) -> u32 {
+ addr & 0x3FFFFFFF
+ }
+}
diff --git a/crates/gekko/src/mmu/constants.rs b/crates/gekko/src/mmu/constants.rs
new file mode 100644
index 0000000..3f0a05d
--- /dev/null
+++ b/crates/gekko/src/mmu/constants.rs
@@ -0,0 +1,10 @@
+pub const RAM_BASE: u32 = 0x0000_0000;
+pub const RAM_END: u32 = 0x017F_FFFF;
+pub const RAM_SIZE: usize = 0x0180_0000; // 24 MB
+
+pub const EFB_BASE: u32 = 0x0800_0000;
+pub const EFB_END: u32 = 0x081F_FFFF;
+pub const EFB_SIZE: usize = 0x0020_0000; // 2 MB
+
+pub const HW_REG_BASE: u32 = 0x0C00_0000;
+pub const HW_REG_END: u32 = 0x0C7F_FFFF;
\ No newline at end of file
diff --git a/crates/gekko/src/mmu/tests.rs b/crates/gekko/src/mmu/tests.rs
new file mode 100644
index 0000000..08eb0a3
--- /dev/null
+++ b/crates/gekko/src/mmu/tests.rs
@@ -0,0 +1,68 @@
+#[cfg(test)]
+mod tests {
+ use crate::mmu::Mmu;
+
+ #[test]
+ fn ram_phys_read_write_roundtrip() {
+ let mut mmu = Mmu::new();
+ mmu.phys_write_u32(0x100, 0xDEAD_BEEF);
+ assert_eq!(mmu.phys_read_u32(0x100), 0xDEAD_BEEF);
+ assert_eq!(mmu.phys_read_u16(0x100), 0xDEAD);
+ assert_eq!(mmu.phys_read_u8(0x100), 0xDE);
+ }
+
+ #[test]
+ fn cached_virtual_maps_to_physical() {
+ let mut mmu = Mmu::new();
+ mmu.virt_write_u32(0x8000_0100, 0x1234_5678);
+ assert_eq!(mmu.phys_read_u32(0x100), 0x1234_5678);
+ }
+
+ #[test]
+ fn uncached_virtual_maps_to_physical() {
+ let mut mmu = Mmu::new();
+ mmu.virt_write_u32(0xC000_0100, 0xAAAA_BBBB);
+ assert_eq!(mmu.phys_read_u32(0x100), 0xAAAA_BBBB);
+ }
+
+ #[test]
+ fn efb_virtual_maps_to_efb_storage() {
+ let mut mmu = Mmu::new();
+ // 0xC8000000 virtual -> phys 0x08000000 (EFB)
+ mmu.virt_write_u32(0xC800_0000, 0xFB_FB_FB_FB);
+ assert_eq!(mmu.phys_read_u32(0x0800_0000), 0xFB_FB_FB_FB);
+ // Confirm it did NOT touch RAM
+ assert_eq!(mmu.phys_read_u32(0x0), 0);
+ }
+
+ #[test]
+ fn efb_address_does_not_alias_ram() {
+ let mut mmu = Mmu::new();
+ mmu.phys_write_u32(0x0, 0x1111_1111);
+ mmu.phys_write_u32(0x0800_0000, 0x2222_2222);
+ assert_eq!(mmu.phys_read_u32(0x0), 0x1111_1111);
+ assert_eq!(mmu.phys_read_u32(0x0800_0000), 0x2222_2222);
+ }
+
+ #[test]
+ #[should_panic(expected = "unmapped physical")]
+ fn unmapped_address_panics() {
+ let mmu = Mmu::new();
+ mmu.phys_read_u8(0x1000_0000);
+ }
+
+ #[test]
+ #[should_panic(expected = "unimplemented HW register")]
+ fn hw_register_panics() {
+ let mmu = Mmu::new();
+ mmu.phys_read_u8(0x0C00_0000);
+ }
+
+ #[test]
+ fn phys_slice_returns_correct_data() {
+ let mut mmu = Mmu::new();
+ mmu.phys_write_u32(0x200, 0xCAFE_BABE);
+ let slice = mmu.phys_slice(0x200, 4);
+ assert_eq!(slice, &[0xCA, 0xFE, 0xBA, 0xBE]);
+ }
+}
diff --git a/crates/tinyemu/src/fmt.rs b/crates/tinyemu/src/fmt.rs
new file mode 100644
index 0000000..9d780e2
--- /dev/null
+++ b/crates/tinyemu/src/fmt.rs
@@ -0,0 +1,29 @@
+use colored::Colorize;
+use disasm::tokenizer::{self, AsmToken};
+
+pub fn colorize(tok: &AsmToken<'_>) -> String {
+ match tok {
+ AsmToken::Mnemonic(s) => s.bold().cyan().to_string(),
+ AsmToken::Gpr(n) => format!("r{n}").yellow().to_string(),
+ AsmToken::Fpr(n) => format!("f{n}").magenta().to_string(),
+ AsmToken::CrField(n) => format!("cr{n}").green().to_string(),
+ AsmToken::Spr(s) => s.green().bold().to_string(),
+ AsmToken::ImmSigned(v) => format!("{v}").blue().to_string(),
+ AsmToken::ImmUnsigned(v) => format!("{v}").blue().to_string(),
+ AsmToken::ImmHex(v) if *v < 0 => format!("-0x{:X}", -v).blue().to_string(),
+ AsmToken::ImmHex(v) => format!("0x{v:X}").blue().to_string(),
+ AsmToken::Displacement(v) => format!("{v}").blue().to_string(),
+ AsmToken::BranchTarget(s) => s.bright_red().to_string(),
+ AsmToken::Punct(_) | AsmToken::Text(_) => tok.to_string(),
+ }
+}
+
+pub fn colorize_instr(instr: &disasm::gekko::GekkoInstruction) -> String {
+ let text = format!("{}", instr);
+ let tokens = tokenizer::tokenize(&text);
+ tokens
+ .into_iter()
+ .map(|t| colorize(&t))
+ .collect::<Vec<_>>()
+ .join("")
+}
diff --git a/crates/tinyemu/src/main.rs b/crates/tinyemu/src/main.rs
index 9b59b5f..7f33077 100644
--- a/crates/tinyemu/src/main.rs
+++ b/crates/tinyemu/src/main.rs
@@ -1,23 +1,9 @@
+mod fmt;
+mod snaptshot;
+
use colored::Colorize;
use disasm::gekko::GekkoInstruction;
-use disasm::tokenizer::{self, AsmToken};
-
-#[derive(Clone, Copy)]
-struct CpuSnapshot {
- gprs: [u32; 32],
- lr: u32,
- ctr: u32,
-}
-
-impl CpuSnapshot {
- fn from_cpu(cpu: &gekko::cpu::Cpu) -> Self {
- Self {
- gprs: cpu.gprs,
- lr: cpu.lr,
- ctr: cpu.ctr,
- }
- }
-}
+use snaptshot::CpuSnapshot;
fn main() {
let path = std::env::args()
@@ -27,10 +13,9 @@ fn main() {
let mut gekko = gekko::gekko::Gekko::new(&path);
let mut prev_snapshot = CpuSnapshot::from_cpu(&gekko.cpu);
-
+
loop {
- let addr = gekko.cpu.pc;
- let instr = GekkoInstruction::decode(&gekko.mmu.memory[addr as usize..])
+ let instr = GekkoInstruction::decode(gekko.mmu.virt_slice(gekko.cpu.pc, 4))
.expect("failed to decode instruction")
.0;
@@ -40,8 +25,8 @@ fn main() {
println!(
"{}: {}",
- format!("{:08X}", addr).bold(),
- colorize_instr(&instr)
+ format!("{:08X}", gekko.cpu.pc).bold(),
+ fmt::colorize_instr(&instr)
);
gekko.run_until_event();
@@ -55,23 +40,6 @@ fn main() {
}
}
-fn colorize(tok: &AsmToken<'_>) -> String {
- match tok {
- AsmToken::Mnemonic(s) => s.bold().cyan().to_string(),
- AsmToken::Gpr(n) => format!("r{n}").yellow().to_string(),
- AsmToken::Fpr(n) => format!("f{n}").magenta().to_string(),
- AsmToken::CrField(n) => format!("cr{n}").green().to_string(),
- AsmToken::Spr(s) => s.green().bold().to_string(),
- AsmToken::ImmSigned(v) => format!("{v}").blue().to_string(),
- AsmToken::ImmUnsigned(v) => format!("{v}").blue().to_string(),
- AsmToken::ImmHex(v) if *v < 0 => format!("-0x{:X}", -v).blue().to_string(),
- AsmToken::ImmHex(v) => format!("0x{v:X}").blue().to_string(),
- AsmToken::Displacement(v) => format!("{v}").blue().to_string(),
- AsmToken::BranchTarget(s) => s.bright_red().to_string(),
- AsmToken::Punct(_) | AsmToken::Text(_) => tok.to_string(),
- }
-}
-
fn dump_registers(curr: &CpuSnapshot, prev: &CpuSnapshot) {
let fmt_reg = |label: &str, val: u32, prev_val: u32| -> String {
let value = format!("{:08X}", val);
@@ -104,13 +72,3 @@ fn dump_registers(curr: &CpuSnapshot, prev: &CpuSnapshot) {
println!();
}
-
-fn colorize_instr(instr: &disasm::gekko::GekkoInstruction) -> String {
- let text = format!("{}", instr);
- let tokens = tokenizer::tokenize(&text);
- tokens
- .into_iter()
- .map(|t| colorize(&t))
- .collect::<Vec<_>>()
- .join("")
-}
diff --git a/crates/tinyemu/src/snaptshot.rs b/crates/tinyemu/src/snaptshot.rs
new file mode 100644
index 0000000..80f2e08
--- /dev/null
+++ b/crates/tinyemu/src/snaptshot.rs
@@ -0,0 +1,16 @@
+#[derive(Clone, Copy)]
+pub struct CpuSnapshot {
+ pub gprs: [u32; 32],
+ pub lr: u32,
+ pub ctr: u32,
+}
+
+impl CpuSnapshot {
+ pub fn from_cpu(cpu: &gekko::cpu::Cpu) -> Self {
+ Self {
+ gprs: cpu.gprs,
+ lr: cpu.lr,
+ ctr: cpu.ctr,
+ }
+ }
+}
\ No newline at end of file
diff --git a/rsrc/roms/panda.dol b/rsrc/roms/panda.dol
new file mode 100644
index 0000000..de9d7d0
Binary files /dev/null and b/rsrc/roms/panda.dol differ
diff --git a/rsrc/roms/panda.dol.i64 b/rsrc/roms/panda.dol.i64
new file mode 100644
index 0000000..1901cb6
Binary files /dev/null and b/rsrc/roms/panda.dol.i64 differ