MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / Decode

Method Decode

FEXCore/Source/Utils/variable_length_integer.h:213–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211 };
212
213 static Decoded Decode(const uint8_t* data) {
214 auto vl8_type = reinterpret_cast<const vl8_enc*>(data);
215 auto vl16_type = reinterpret_cast<const vl16_enc*>(data);
216 auto vl32_type = reinterpret_cast<const vl32_enc*>(data);
217 auto vl64_type = reinterpret_cast<const vl64_enc*>(data);
218
219 if (vl8_type->Type == vl8_type_header) {
220 return Decode(vl8_type);
221 } else if (vl16_type->HighBits.Type == vl16_type_header) {
222 return Decode(vl16_type);
223 } else if (vl32_type->Type == vl32_type_header) {
224 return Decode(vl32_type);
225 }
226 return {vl64_type->IntegerARMPC, vl64_type->IntegerX86RIP, sizeof(vl64_enc)};
227 }
228
229 static size_t Encode(uint8_t* dst, uint64_t data_arm, uint64_t data_rip) {
230 auto vl8_type = reinterpret_cast<vl8_enc*>(dst);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected