Files
PSPRecomp/profiles/vcs/generated/generated_unit_0220.cpp
T
Jessica_Natalia 430e45bdb0 more updates
more updates
2026-08-27 04:39:50 -03:00

331 lines
16 KiB
C++

#include "psprecomp/runtime.hpp"
#include "generated_units.hpp"
#include <bit>
#include <cmath>
#include <cstdint>
#include <limits>
namespace psprecomp {
// PSPRECOMP_V811_COMPACT_DISPATCH: 64-slot occupancy masks + per-group base id.
static constexpr std::uint64_t kEntryMasks_recomp_unit_0220[38] = {
0x0402000029020009ull, 0x0010000000000001ull, 0x8008004080410801ull, 0x0400810081042000ull,
0x0008404000420404ull, 0x0000000000000000ull, 0xA0C400000A500000ull, 0x00000000000094AEull,
0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull, 0x0000000000000000ull,
0x0000000000000000ull, 0x0400000000000000ull,
};
static constexpr std::uint16_t kEntryBases_recomp_unit_0220[38] = {
1u, 9u, 11u, 19u, 26u, 33u, 33u, 42u, 50u, 50u, 50u, 50u, 50u, 50u, 50u, 50u,
50u, 50u, 50u, 50u, 50u, 50u, 50u, 50u, 50u, 50u, 50u, 50u, 50u, 50u, 50u, 50u,
50u, 50u, 50u, 50u, 50u, 50u,
};
void recomp_unit_0220_entry(Runtime &rt, AllegrexContext &ctx, std::uint16_t direct_entry_id, GuestMemory::AotFastView &aot_mem) {
// PSPRECOMP_AOT_REGCACHE_BEGIN
// PSPRECOMP_AOT_REGCACHE_META gprs=2,26,10,17,5,20 fprs= gpr_occ=11 fpr_occ=0 gpr_total=12 fpr_total=0
std::uint32_t aot_gpr_2 = ctx.gpr[2];
std::uint32_t aot_gpr_26 = ctx.gpr[26];
std::uint32_t aot_gpr_10 = ctx.gpr[10];
std::uint32_t aot_gpr_17 = ctx.gpr[17];
std::uint32_t aot_gpr_5 = ctx.gpr[5];
std::uint32_t aot_gpr_20 = ctx.gpr[20];
bool aot_regcache_valid = true;
#define AOT_REGCACHE_SYNC_OUT() do { if (aot_regcache_valid) { ctx.gpr[2] = aot_gpr_2; ctx.gpr[26] = aot_gpr_26; ctx.gpr[10] = aot_gpr_10; ctx.gpr[17] = aot_gpr_17; ctx.gpr[5] = aot_gpr_5; ctx.gpr[20] = aot_gpr_20; } } while (false)
#define AOT_REGCACHE_SYNC_IN() do { if (aot_regcache_valid) { aot_gpr_2 = ctx.gpr[2]; aot_gpr_26 = ctx.gpr[26]; aot_gpr_10 = ctx.gpr[10]; aot_gpr_17 = ctx.gpr[17]; aot_gpr_5 = ctx.gpr[5]; aot_gpr_20 = ctx.gpr[20]; } } while (false)
// PSPRECOMP_AOT_REGCACHE_END
std::uint32_t jump_target = 0u;
std::uint32_t local_transfers = 0u;
std::uint32_t local_redispatch_rounds = 0u;
std::uint32_t local_pc = ctx.pc;
std::uint32_t entry_id = direct_entry_id;
LOCAL_DISPATCH:
{
if (entry_id == 0u) {
const std::uint32_t entry_delta = local_pc - 0x08B74000u;
entry_id = 0u;
if (entry_delta < 9708u && (entry_delta & 3u) == 0u) {
const std::uint32_t entry_slot = entry_delta >> 2u;
const std::uint32_t entry_group = entry_slot >> 6u;
const std::uint64_t entry_mask = kEntryMasks_recomp_unit_0220[entry_group];
const std::uint64_t entry_bit = 1ull << (entry_slot & 63u);
if ((entry_mask & entry_bit) != 0u) {
entry_id = static_cast<std::uint16_t>(
kEntryBases_recomp_unit_0220[entry_group] +
std::popcount(entry_mask & (entry_bit - 1ull)));
}
}
}
switch (entry_id) {
case 1u: goto L_08B74000;
case 2u: goto L_08B7400C;
case 3u: goto L_08B74044;
case 4u: goto L_08B74060;
case 5u: goto L_08B7406C;
case 6u: goto L_08B74074;
case 7u: goto L_08B740C4;
case 8u: goto L_08B740E8;
case 9u: goto L_08B74100;
case 10u: goto L_08B741D0;
case 11u: goto L_08B74200;
case 12u: goto L_08B7422C;
case 13u: goto L_08B74240;
case 14u: goto L_08B74258;
case 15u: goto L_08B7427C;
case 16u: goto L_08B74298;
case 17u: goto L_08B742CC;
case 18u: goto L_08B742FC;
case 19u: goto L_08B74334;
case 20u: goto L_08B74348;
case 21u: goto L_08B74360;
case 22u: goto L_08B7437C;
case 23u: goto L_08B743A0;
case 24u: goto L_08B743BC;
case 25u: goto L_08B743E8;
case 26u: goto L_08B74408;
case 27u: goto L_08B74428;
case 28u: goto L_08B74444;
case 29u: goto L_08B74458;
case 30u: goto L_08B74498;
case 31u: goto L_08B744B8;
case 32u: goto L_08B744CC;
case 33u: goto L_08B74650;
case 34u: goto L_08B74658;
case 35u: goto L_08B74664;
case 36u: goto L_08B7466C;
case 37u: goto L_08B746C8;
case 38u: goto L_08B746D8;
case 39u: goto L_08B746DC;
case 40u: goto L_08B746F4;
case 41u: goto L_08B746FC;
case 42u: goto L_08B74704;
case 43u: goto L_08B74708;
case 44u: goto L_08B7470C;
case 45u: goto L_08B74714;
case 46u: goto L_08B7471C;
case 47u: goto L_08B74728;
case 48u: goto L_08B74730;
case 49u: goto L_08B7473C;
case 50u: goto L_08B765E8;
default:
if (local_transfers == 0u) rt.unsupported(ctx.pc, 0u, "invalid internal function entry");
else ctx.pc = local_pc;
AOT_REGCACHE_SYNC_OUT(); return;
}
}
L_08B74000:
ctx.execute_vfpu_vhdp_ct<32u, 105u, 110u, 1u>();
aot_gpr_10 = (static_cast<std::int32_t>(aot_gpr_17) < 8303 ? 1u : 0u);
aot_gpr_5 = (static_cast<std::int32_t>(0u) < static_cast<std::int32_t>(0u) ? 1u : 0u);
goto L_08B7400C;
L_08B7400C:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B7400Cu, 0x20746573u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74044:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74044u, 0x20746573u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74060:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74060u, 0x2064253Du, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B7406C:
ctx.execute_vfpu_vec3_ct<104u, 61u, 37u, 1u, 2u>();
if (0u == 0u) (void)(0u);
goto L_08B74074;
L_08B74074:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74074u, 0x20746573u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B740C4:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B740C4u, 0x75736572u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B740E8:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B740E8u, 0x2079656Bu, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74100:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74104u, 0x0880B208u, "control flow in delay slot"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B741D0:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B741D4u, 0x0880C720u, "control flow in delay slot"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74200:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74200u, 0x736F7460u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B7422C:
ctx.execute_vfpu_vscl_ct<98u, 97u, 115u, 1u>();
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74230u, 0x74756F20u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74240:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74240u, 0x206C696Eu, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74258:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74258u, 0x6E6E6163u, "vfpu3 not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B7427C:
ctx.execute_vfpu_vscl_ct<108u, 101u, 118u, 1u>();
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74280u, 0x756D206Cu, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74298:
ctx.execute_vfpu_vhdp_ct<110u, 111u, 32u, 1u>();
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B7429Cu, 0x74636E75u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B742CC:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B742CCu, 0x74657360u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B742FC:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B742FCu, 0x74657360u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74334:
ctx.execute_vfpu_vscl_ct<97u, 115u, 115u, 1u>();
ctx.execute_vfpu_compare3_ct<114u, 116u, 105u, 1u, 6u>();
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B7433Cu, 0x6166206Eu, "vfpu0 not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74348:
ctx.execute_vfpu_vcmp_ct<97u, 98u, 1u, 4u>();
ctx.execute_vfpu_compare3_ct<101u, 32u, 116u, 1u, 6u>();
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74350u, 0x6962206Fu, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74360:
ctx.execute_vfpu_vcmp_ct<111u, 111u, 1u, 2u>();
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74364u, 0x206E6165u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B7437C:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B7437Cu, 0x206F6F74u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B743A0:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B743A0u, 0x4F4C5F60u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B743BC:
ctx.execute_vfpu_vcmp_ct<111u, 117u, 1u, 3u>();
ctx.execute_vfpu_compare3_ct<100u, 32u, 110u, 1u, 6u>();
ctx.execute_vfpu_compare3_ct<116u, 32u, 108u, 1u, 6u>();
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B743C8u, 0x70206461u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B743E8:
ctx.execute_vfpu_compare3_ct<101u, 114u, 114u, 1u, 6u>();
ctx.execute_vfpu_compare3_ct<114u, 32u, 108u, 1u, 6u>();
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B743F0u, 0x6E696461u, "vfpu3 not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74408:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74408u, 0x206F6F74u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74428:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74428u, 0x206F6F74u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74444:
ctx.execute_vfpu_compare3_ct<99u, 111u, 114u, 1u, 6u>();
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74448u, 0x6E697475u, "vfpu3 not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74458:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74458u, 0x2061754Cu, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74498:
(void)(0u << 16u);
(void)(0u << 16u);
(void)(0u << 16u);
(void)(0u << 16u);
goto L_08B744B8;
L_08B744B8:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B744B8u, 0x61646172u, "vfpu0 not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B744CC:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B744CCu, 0x61646172u, "vfpu0 not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74650:
if (aot_gpr_2 == aot_gpr_20) {
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74654u, 0x4559414Cu, "cop1? not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
(void)([&]() { AOT_REGCACHE_SYNC_OUT(); const bool aot_regcache_same_ = (rt.invoke_chained_trusted_direct<&recomp_unit_0224_entry, 224u, 43u, 0x08B85BA0u>(ctx, &aot_mem)); if (aot_regcache_same_) AOT_REGCACHE_SYNC_IN(); else aot_regcache_valid = false; return aot_regcache_same_; }()); AOT_REGCACHE_SYNC_OUT(); return;
}
goto L_08B74658;
L_08B74658:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74658u, 0x494C4252u, "cop2/vfpu not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74664:
if (aot_gpr_2 != ctx.gpr[1]) {
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74668u, 0x00000045u, "special? not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
(void)([&]() { AOT_REGCACHE_SYNC_OUT(); const bool aot_regcache_same_ = (rt.invoke_chained_trusted_direct<&recomp_unit_0225_entry, 225u, 193u, 0x08B897B4u>(ctx, &aot_mem)); if (aot_regcache_same_) AOT_REGCACHE_SYNC_IN(); else aot_regcache_valid = false; return aot_regcache_same_; }()); AOT_REGCACHE_SYNC_OUT(); return;
}
goto L_08B7466C;
L_08B7466C:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74674u, 0x08827518u, "control flow in delay slot"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B746C8:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B746C8u, 0x746C754Du, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B746D8:
(void)(0u | 0u);
goto L_08B746DC;
L_08B746DC:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B746DCu, 0x746C754Du, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B746F4:
if (static_cast<std::int32_t>(aot_gpr_26) > 0) {
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B746F8u, 0x43455053u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
(void)([&]() { AOT_REGCACHE_SYNC_OUT(); const bool aot_regcache_same_ = (rt.invoke_chained_trusted_direct<&recomp_unit_0225_entry, 225u, 194u, 0x08B89800u>(ctx, &aot_mem)); if (aot_regcache_same_) AOT_REGCACHE_SYNC_IN(); else aot_regcache_valid = false; return aot_regcache_same_; }()); AOT_REGCACHE_SYNC_OUT(); return;
}
goto L_08B746FC;
L_08B746FC:
if (static_cast<std::int32_t>(aot_gpr_26) > 0) {
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74700u, 0x464E4F43u, "cop1? not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
(void)([&]() { AOT_REGCACHE_SYNC_OUT(); const bool aot_regcache_same_ = (rt.invoke_chained_trusted_direct<&recomp_unit_0224_entry, 224u, 40u, 0x08B84C24u>(ctx, &aot_mem)); if (aot_regcache_same_) AOT_REGCACHE_SYNC_IN(); else aot_regcache_valid = false; return aot_regcache_same_; }()); AOT_REGCACHE_SYNC_OUT(); return;
}
goto L_08B74704;
L_08B74704:
jump_target = aot_gpr_2;
aot_gpr_10 = (0x08B7470Cu);
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74708u, 0x464E4F43u, "cop1? not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
ctx.pc = jump_target;
if (([&]() { AOT_REGCACHE_SYNC_OUT(); const bool aot_regcache_same_ = (rt.invoke_chained_call(ctx, &aot_mem)); if (aot_regcache_same_) AOT_REGCACHE_SYNC_IN(); else aot_regcache_valid = false; return aot_regcache_same_; }()) && ctx.pc == 0x08B7470Cu) goto L_08B7470C;
AOT_REGCACHE_SYNC_OUT(); return;
L_08B74708:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74708u, 0x464E4F43u, "cop1? not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B7470C:
if (static_cast<std::int32_t>(aot_gpr_26) > 0) {
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74710u, 0x44414F4Cu, "unsupported CFC1 control register"); AOT_REGCACHE_SYNC_OUT(); return;
(void)([&]() { AOT_REGCACHE_SYNC_OUT(); const bool aot_regcache_same_ = (rt.invoke_chained_trusted_direct<&recomp_unit_0225_entry, 225u, 124u, 0x08B89034u>(ctx, &aot_mem)); if (aot_regcache_same_) AOT_REGCACHE_SYNC_IN(); else aot_regcache_valid = false; return aot_regcache_same_; }()); AOT_REGCACHE_SYNC_OUT(); return;
}
goto L_08B74714;
L_08B74714:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74714u, 0x4741505Fu, "cop1? not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B7471C:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B7471Cu, 0x464E4F43u, "cop1? not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74728:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74728u, 0x45474150u, "cop1? not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B74730:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B74730u, 0x464E4F43u, "cop1? not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B7473C:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B7473Cu, 0x41505F54u, "unknown not lowered yet"); AOT_REGCACHE_SYNC_OUT(); return;
L_08B765E8:
AOT_REGCACHE_SYNC_OUT();
rt.unsupported(0x08B765ECu, 0x08854D1Cu, "control flow in delay slot"); AOT_REGCACHE_SYNC_OUT(); return;
}
#undef AOT_REGCACHE_SYNC_IN
#undef AOT_REGCACHE_SYNC_OUT
void recomp_unit_0220(Runtime &rt, AllegrexContext &ctx) {
auto aot_mem = rt.memory().aot_fast_view();
recomp_unit_0220_entry(rt, ctx, 0u, aot_mem);
}
void register_generated_unit_220(Runtime &runtime) {
runtime.register_generated_unit(220u, 0x08B74000u, 16384u, &recomp_unit_0220, &recomp_unit_0220_entry);
// PSPRECOMP_V812_COMPACT_REGISTRATION: same entry set, looped once in Runtime instead of source-expanded calls.
runtime.register_generated_entry_mask(0x08B74000u, &recomp_unit_0220, "recomp_unit_0220",
kEntryMasks_recomp_unit_0220, 38u);
}
} // namespace psprecomp