MCPcopy Create free account
hub / github.com/N64Recomp/N64Recomp / unsigned_reloc

Function unsigned_reloc

src/cgenerator.cpp:109–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107}
108
109static 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
122static std::string signed_reloc(const N64Recomp::InstructionContext& context) {
123 return "(int16_t)" + unsigned_reloc(context);

Callers 2

signed_relocFunction · 0.85
get_operand_stringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected