| 107 | } |
| 108 | |
| 109 | static std::string unsigned_reloc(const N64Recomp::InstructionContext& context) { |
| 110 | switch (context.reloc_type) { |
| 111 | case N64Recomp::RelocType::R_MIPS_HI16: |
| 112 | return fmt::format("{}RELOC_HI16({}, {:#X})", |
| 113 | context.reloc_tag_as_reference ? "REF_" : "", context.reloc_section_index, context.reloc_target_section_offset); |
| 114 | case N64Recomp::RelocType::R_MIPS_LO16: |
| 115 | return fmt::format("{}RELOC_LO16({}, {:#X})", |
| 116 | context.reloc_tag_as_reference ? "REF_" : "", context.reloc_section_index, context.reloc_target_section_offset); |
| 117 | default: |
| 118 | throw std::runtime_error(fmt::format("Unexpected reloc type {}\n", static_cast<int>(context.reloc_type))); |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | static std::string signed_reloc(const N64Recomp::InstructionContext& context) { |
| 123 | return "(int16_t)" + unsigned_reloc(context); |
no outgoing calls
no test coverage detected