From e5a8ad3c629102a7b9175c89409bd2c4562fd72f Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Thu, 9 Apr 2026 08:54:17 -0400 Subject: [PATCH 1/2] Update rabbitizer to 2.0.0-alpha.8 - Properly display the `.xyzw` suffix for R5900EE VU instructions - Add option to invert the VU register order for some R5900EE, following the order used by ProDG SN AS --- Cargo.lock | 4 ++-- objdiff-core/Cargo.toml | 2 +- objdiff-core/config-schema.json | 9 ++++++++- objdiff-core/src/arch/mips.rs | 4 +++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6e5b1c55..840dc571 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4201,9 +4201,9 @@ checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rabbitizer" -version = "2.0.0-alpha.7" +version = "2.0.0-alpha.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2e1f4b7a38a8aa084cf0a9d54921a1546701249f4c2d8b3a3748d34b7415d47" +checksum = "831ef2f5b90ad594176a99fbf291d5cbeebc6881caefc2d0b54b154f754b96ed" dependencies = [ "bitflags 2.10.0", "ordered-float", diff --git a/objdiff-core/Cargo.toml b/objdiff-core/Cargo.toml index 0c9b87a9..7c56a19c 100644 --- a/objdiff-core/Cargo.toml +++ b/objdiff-core/Cargo.toml @@ -155,7 +155,7 @@ powerpc = { version = "0.4", optional = true } rlwinmdec = { version = "1.1", optional = true } # mips -rabbitizer = { version = "2.0.0-alpha.7", default-features = false, features = ["all_extensions"], optional = true } +rabbitizer = { version = "2.0.0-alpha.8", default-features = false, features = ["all_extensions"], optional = true } # x86 iced-x86 = { version = "1.21", default-features = false, features = ["decoder", "intel", "gas", "masm", "nasm", "exhaustive_enums", "no_std"], optional = true } diff --git a/objdiff-core/config-schema.json b/objdiff-core/config-schema.json index b1bca011..ff4b365e 100644 --- a/objdiff-core/config-schema.json +++ b/objdiff-core/config-schema.json @@ -300,6 +300,13 @@ "name": "Register '$' prefix", "description": "Display MIPS register names with a '$' prefix." }, + { + "id": "mips.prodgSnAsInvertedRegs", + "type": "boolean", + "default": false, + "name": "ProDG SN AS VU register order", + "description": "Changes the register order for specific R5900EE instructions to match the syntax used by the SN AS from ProDG (-snas flag)." + }, { "id": "ppc.calculatePoolRelocations", "type": "boolean", @@ -363,7 +370,7 @@ { "id": "mips", "name": "MIPS", - "properties": ["mips.abi", "mips.instrCategory", "mips.registerPrefix"] + "properties": ["mips.abi", "mips.instrCategory", "mips.registerPrefix", "mips.prodgSnAsInvertedRegs"] }, { "id": "ppc", diff --git a/objdiff-core/src/arch/mips.rs b/objdiff-core/src/arch/mips.rs index 0ce2e65b..656e6b02 100644 --- a/objdiff-core/src/arch/mips.rs +++ b/objdiff-core/src/arch/mips.rs @@ -188,6 +188,7 @@ impl ArchMips { rabbitizer::InstructionDisplayFlags::default() .with_unknown_instr_comment(false) .with_use_dollar(diff_config.mips_register_prefix) + .with_r5900ee_prodg_sn_as_inverted_regs(diff_config.mips_prodg_sn_as_inverted_regs) } fn parse_ins_ref( @@ -237,7 +238,8 @@ impl Arch for ArchMips { let instruction = self.parse_ins_ref(resolved.ins_ref, resolved.code, diff_config)?; let display_flags = self.instruction_display_flags(diff_config); let opcode = instruction.opcode(); - cb(InstructionPart::opcode(opcode.name(), opcode as u16))?; + let mnemonic = instruction.mnemonic_display(&display_flags).to_string(); + cb(InstructionPart::opcode(mnemonic, opcode as u16))?; push_args(&instruction, resolved.relocation, &display_flags, cb)?; Ok(()) } From b686052b6b1f232ff72ad07efcb49da7b8f676f8 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Tue, 2 Jun 2026 07:46:06 -0400 Subject: [PATCH 2/2] bump rabbitizer to 2.0.0-alpha.9 --- Cargo.lock | 11 +++++++++-- objdiff-core/Cargo.toml | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 840dc571..1107becf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,6 +28,12 @@ dependencies = [ "serde", ] +[[package]] +name = "address_space" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a636fa14876e21c4162d323c7545c3ef2d9a78a253098bebee720c024d6c027a" + [[package]] name = "adler2" version = "2.0.1" @@ -4201,10 +4207,11 @@ checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rabbitizer" -version = "2.0.0-alpha.8" +version = "2.0.0-alpha.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831ef2f5b90ad594176a99fbf291d5cbeebc6881caefc2d0b54b154f754b96ed" +checksum = "9f79a2bb675522959249aa5074d7ac6a2aa502d6b1b3c8570f36567eaf36bd6a" dependencies = [ + "address_space", "bitflags 2.10.0", "ordered-float", ] diff --git a/objdiff-core/Cargo.toml b/objdiff-core/Cargo.toml index 7c56a19c..dbf9e817 100644 --- a/objdiff-core/Cargo.toml +++ b/objdiff-core/Cargo.toml @@ -155,7 +155,7 @@ powerpc = { version = "0.4", optional = true } rlwinmdec = { version = "1.1", optional = true } # mips -rabbitizer = { version = "2.0.0-alpha.8", default-features = false, features = ["all_extensions"], optional = true } +rabbitizer = { version = "2.0.0-alpha.9", default-features = false, features = ["all_extensions"], optional = true } # x86 iced-x86 = { version = "1.21", default-features = false, features = ["decoder", "intel", "gas", "masm", "nasm", "exhaustive_enums", "no_std"], optional = true }