feat(ps5lift): add the runtime for lifted programs #15798
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15798"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by oberonlift on 2026-11-04T16:23:50Z.
Merge after #15797. Until it merges, this PR also shows #15797's changes; oberonlift/AnyPS5#18 shows only this PR's own.
ps5lift is a static recompiler for PS5 executables: it lifts a game's x86-64 code to LLVM IR and compiles it ahead of time to aarch64, which runs on Linux against AnyPS5's own libraries with no interpreter or JIT. It runs AnyPS5's PS5-style test programs and a homebrew media player to its home screen; commercial games are not playable yet. Branch
ps5lift-previewmerges all of its PRs (how to try it); native Apple Silicon support is coming along fast. It is a separate approach from the ARM64 compiler in #5021; #1835 has an introduction.This is 2 of 8 PRs that let AnyPS5's libraries run a lifted program; the lifter itself follows them. The runtime does not need #15797; this branch is stacked on it.
What
ps5lift's runtime is the library a lifted program links, and the one AnyPS5's libraries link when they are built for a lifted program.
ps5lift/runtime): maps the guest images at their link addresses, dispatches indirect calls, lays out TLS as x86-64 does, runs x87 code on Berkeley SoftFloat, answerscpuidandxgetbvas the PS5's Zen 2, and calls native functions through guest function pointers and back.GuestCpu*functions, which the later PRs call underANYPS5_GUEST_LIFTED: the guest's MXCSR and x87 state, x87 extended-precision arithmetic, the timestamp counter,cpuidandxgetbv, calls into guest code and interrupted contexts, guest stacks and fibers, unwinding, and the program's images and their symbols.State.handBridge.hppare the headers lifted code and the generated import bridges build against.tools/ps5lift.py runtimebuilds it with SoftFloat, a new submodule, into a shared library for a target and CPU, and the program'smaininto an archive. The CPU is the one the lifted code targets,neoverse-v2on aarch64 unless--cpunames another, so the runtime needs no feature the program doesn't; a library older than any of its objects is linked again.ps5lift/or the workflow.Tested
On a DGX Spark (aarch64 Linux, NVIDIA GB10, LLVM 18),
tools/ps5lift.py runtimebuilds the runtime foraarch64-unknown-linux-gnu. The later PRs exercise it: with all eight PRs and ps5lift on top: every library builds for a lifted program, 2,288 of AnyPS5's own tests pass in that build on lavapipe, and ps5lift's 69 tests pass, among them its libc, exceptions, kernel, fiber and module-loading fixtures and upstream's libc test programs.The conventions check passes on this branch.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Pull request closed