beetle-psx-libretro/deps/lightrec
Zachary Cook a093ffec37 git subrepo commit (merge) deps/lightrec
subrepo:
  subdir:   "deps/lightrec"
  merged:   "a7bd81d3"
upstream:
  origin:   "https://github.com/pcercuei/lightrec.git"
  branch:   "master"
  commit:   "16a375e4"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"
2021-04-22 06:10:56 -04:00
..
.gitignore Add deps for dynarec 2020-01-21 19:39:21 -05:00
.gitrepo git subrepo commit (merge) deps/lightrec 2021-04-22 06:10:56 -04:00
blockcache.c Update to latest lightrec and extract PGXP from lightrec 2020-04-28 16:57:13 -04:00
blockcache.h Update to latest lightrec and extract PGXP from lightrec 2020-04-28 16:57:13 -04:00
CMakeLists.txt git subrepo commit (merge) deps/lightrec 2021-04-22 06:10:56 -04:00
config.h Add deps for dynarec 2020-01-21 19:39:21 -05:00
config.h.cmakein git subrepo commit (merge) deps/lightrec 2021-04-22 06:10:56 -04:00
COPYING Add deps for dynarec 2020-01-21 19:39:21 -05:00
debug.h Update to latest lightrec and extract PGXP from lightrec 2020-04-28 16:57:13 -04:00
disassembler.c git subrepo commit (merge) deps/lightrec 2021-04-22 06:10:56 -04:00
disassembler.h git subrepo commit (merge) deps/lightrec 2021-04-22 06:10:56 -04:00
emitter.c git subrepo commit (merge) deps/lightrec 2021-04-22 06:10:56 -04:00
emitter.h Update to latest lightrec and extract PGXP from lightrec 2020-04-28 16:57:13 -04:00
interpreter.c git subrepo commit (merge) deps/lightrec 2021-04-22 06:10:56 -04:00
interpreter.h Update to latest lightrec and extract PGXP from lightrec 2020-04-28 16:57:13 -04:00
lightrec-private.h git subrepo commit (merge) deps/lightrec 2021-04-22 06:10:56 -04:00
lightrec.c git subrepo commit (merge) deps/lightrec 2021-04-22 06:10:56 -04:00
lightrec.h Update to latest lightrec and extract PGXP from lightrec 2020-04-28 16:57:13 -04:00
memmanager.c git subrepo pull (merge) deps/lightrec 2020-01-23 16:11:33 -05:00
memmanager.h Update to latest lightrec and extract PGXP from lightrec 2020-04-28 16:57:13 -04:00
optimizer.c git subrepo commit (merge) deps/lightrec 2021-04-22 06:10:56 -04:00
optimizer.h git subrepo commit (merge) deps/lightrec 2021-04-22 06:10:56 -04:00
README.md Update to latest lightrec and extract PGXP from lightrec 2020-04-28 16:57:13 -04:00
reaper.c Update to latest lightrec and extract PGXP from lightrec 2020-04-28 16:57:13 -04:00
reaper.h Update to latest lightrec and extract PGXP from lightrec 2020-04-28 16:57:13 -04:00
recompiler.c lightrec: fix race that could cause a freeze 2020-06-08 00:03:33 -04:00
recompiler.h Update to latest lightrec and extract PGXP from lightrec 2020-04-28 16:57:13 -04:00
regcache.c git subrepo pull (merge) deps/lightrec 2020-01-23 16:11:33 -05:00
regcache.h Update to latest lightrec and extract PGXP from lightrec 2020-04-28 16:57:13 -04:00
slist.h Update to latest lightrec and extract PGXP from lightrec 2020-04-28 16:57:13 -04:00

Lightrec

Lightrec is a MIPS-to-everything dynamic recompiler for PlayStation emulators, using GNU Lightning as the code emitter.

As such, in theory it should be able to run on every CPU that Lightning can generate code for; including, but not limited to, x86, x86_64, ARM, Aarch64, MIPS, PowerPC and Risc-V.

Features

  • High-level optimizations. The MIPS code is first pre-compiled into a form of Intermediate Representation (IR). Basically, just a single-linked list of structures representing the instructions. On that list, several optimization steps are performed: instructions are modified, reordered, tagged; new meta-instructions can be added, for instance to tell the code generator that a certain register won't be used anymore.

  • Lazy compilation. If Lightrec detects a block of code that would be very hard to compile properly (e.g. a branch with a branch in its delay slot), the block is marked as not compilable, and will always be emulated with the built-in interpreter. This allows to keep the code emitter simple and easy to understand.

  • Run-time profiling. The generated code will gather run-time information about the I/O access (whether they hit RAM, or hardware registers). The code generator will then use this information to generate direct read/writes to the emulated memories, instead of jumping to C for every call.

  • Threaded compilation. When entering a loading zone, where a lot of code has to be compiled, we don't want the compilation process to slow down the pace of emulation. To avoid that, the code compiler optionally runs on a thread, and the main loop will emulate the blocks that have not been compiled yet with the interpreter. This helps to drastically reduce the stutter that typically happens when a lot of new code is run.

Emulators

Lightrec has been ported to the following emulators: