[decompiler] Update vector ops, reduce casts (#3849)

Update the decompiler to use the new vf macros.

Also, fix a bunch of silly casting issues where accessing inline fields
with an offset of 0 would be better than a cast:

![image](https://github.com/user-attachments/assets/885bbb07-634f-47b8-99f5-5a947941cdde)

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
This commit is contained in:
water111
2025-01-20 16:32:58 -05:00
committed by GitHub
parent 98d6618a8b
commit 7348e6a4ff
958 changed files with 8680 additions and 10112 deletions
+7 -7
View File
@@ -207,6 +207,13 @@ std::string OpenGOALAsm::full_function_name() {
func_name = fmt::format(fmt::runtime(func_name), bc);
}
}
// Handle destination masks
if (func.allows_modifier(MOD::DEST_MASK) && m_instr.cop2_dest != 0xff &&
m_instr.cop2_dest != 15) {
func_name += m_instr.cop2_dest_to_char();
}
return func_name;
}
@@ -270,13 +277,6 @@ std::vector<goos::Object> OpenGOALAsm::get_args(const std::vector<DecompilerLabe
args.push_back(pretty_print::to_symbol("acc"));
}
// Handle destination masks
if (func.allows_modifier(MOD::DEST_MASK) && m_instr.cop2_dest != 0xff &&
m_instr.cop2_dest != 15) {
named_args.push_back(
pretty_print::to_symbol(fmt::format(":mask #b{:b}", m_instr.cop2_dest_mask_intel())));
}
// Some functions are configured, or its easiest to swap the source args
// NOTE - this currently assumes it is the first two args that must be swapped
if (func.allows_modifier(MOD::SWAP_FIRST_TWO_SOURCE_ARGS)) {