mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-12 08:00:43 +02:00
New RA does not need it for correctness, and the slight slow down to new RA from not compacting first is much smaller than the cost of compaction. Overall speeds up node.js start time by ~6% on top of new RA. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
9.8 KiB
9.8 KiB
FEX-2405
FEXCore
See FEXCore/Readme.md for more details
Glossary
- Splatter: a code generator backend that concaternates configurable macros instead of doing isel
- IR: Intermediate Representation, our high-level opcode representation, loosely modeling arm64
- SSA: Single Static Assignment, a form of representing IR in memory
- Basic Block: A block of instructions with no control flow, terminated by control flow
- Fragment: A Collection of basic blocks, possibly an entire guest function or a subset of it
backend
IR to host code generation
arm64
- ALUOps.cpp
- Arm64Relocations.cpp: relocation logic of the arm64 splatter backend
- AtomicOps.cpp
- BranchOps.cpp
- ConversionOps.cpp
- EncryptionOps.cpp
- FlagOps.cpp
- JIT.cpp: Main glue logic of the arm64 splatter backend
- JITClass.h
- MemoryOps.cpp
- MiscOps.cpp
- MoveOps.cpp
- VectorOps.cpp
shared
frontend
x86-meta-blocks
- Frontend.cpp: Extracts instruction & block meta info, frontend multiblock logic
x86-tables
Metadata that drives the frontend x86/64 decoding
- BaseTables.cpp
- DDDTables.cpp
- EVEXTables.cpp
- H0F38Tables.cpp
- H0F3ATables.cpp
- PrimaryGroupTables.cpp
- SecondaryGroupTables.cpp
- SecondaryModRMTables.cpp
- SecondaryTables.cpp
- VEXTables.cpp
- X86Tables.h
- X87Tables.cpp
- XOPTables.cpp
- X86Tables.cpp
x86-to-ir
- Crypto.cpp: Handles x86/64 Crypto instructions to IR
- Flags.cpp: Handles x86/64 flag generation
- Vector.cpp: Handles x86/64 Vector instructions to IR
- X87.cpp: Handles x86/64 x87 to IR
- X87F64.cpp: Handles x86/64 x87 to IR
- OpcodeDispatcher.cpp: Handles x86/64 ops to IR, no-pf opt, local-flags opt
glue
Logic that binds various parts together
block-database
- LookupCache.cpp: Stores information about blocks, and provides C++ implementations to lookup the blocks
driver
Emulation mainloop related glue logic
- Core.cpp: Glues Frontend, OpDispatcher and IR Opts & Compilation, LookupCache, Dispatcher and provides the Execution loop entrypoint
log-manager
thunks
FEXCore side of thunks: Registration, Lookup
x86-guest-code
- X86HelperGen.cpp: Guest-side assembly helpers used by the backends
- X86HelperGen.h
ir
debug
- IRDumperPass.cpp: Prints IR
dumper
IR -> Text
emitter
C++ Functions to generate IR. See IR.json for spec.
opts
IR to IR Optimization
- PassManager.cpp: Defines which passes are run, and runs them
- PassManager.h
- ConstProp.cpp: ConstProp, ZExt elim, addressgen coalesce, const pooling, fcmp reduction, const inlining
- DeadCodeElimination.cpp
- DeadContextStoreElimination.cpp: Transforms ContextLoad/Store to temporaries, similar to mem2reg
- DeadStoreElimination.cpp: Cross block store-after-store elimination
- IRValidation.cpp: Sanity checking pass
- InlineCallOptimization.cpp: Removes unused arguments if known syscall number
- LongDivideRemovalPass.cpp: Long divide elimination pass
- RedundantFlagCalculationElimination.cpp: This is not used right now, possibly broken
- RegisterAllocationPass.cpp
- RegisterAllocationPass.h
opcodes
cpuid
- CPUID.cpp: Handles presented capability bits for guest cpu
dispatcher-implementations
- Crypto.cpp: Handles x86/64 Crypto instructions to IR
- Flags.cpp: Handles x86/64 flag generation
- Vector.cpp: Handles x86/64 Vector instructions to IR
- X87.cpp: Handles x86/64 x87 to IR
- X87F64.cpp: Handles x86/64 x87 to IR
- OpcodeDispatcher.cpp: Handles x86/64 ops to IR, no-pf opt, local-flags opt
ThunkLibs
See ThunkLibs/README.md for more details
thunklibs
These are generated + glue logic 1:1 thunks unless noted otherwise
EGL
- libEGL_Guest.cpp: Depends on glXGetProcAddress thunk
- libEGL_Host.cpp
GL
- libGL_Guest.cpp: Handles glXGetProcAddress
- libGL_Host.cpp: Uses glXGetProcAddress instead of dlsym
SDL2
- libSDL2_Guest.cpp: Handles sdlglproc, dload, stubs a few log fns
- libSDL2_Host.cpp
VDSO
- libVDSO_Guest.cpp: Linux VDSO thunking
Vulkan
X11
- libXext_Guest.cpp
- libXext_Host.cpp
- libXfixes_Guest.cpp
- libXfixes_Host.cpp
- libXrender_Guest.cpp
- libXrender_Host.cpp
asound
cef
drm
fex_malloc
- Guest.cpp: Handles allocations between guest and host thunks
- Host.cpp: Handles allocations between guest and host thunks
fex_malloc_loader
- Guest.cpp: Delays malloc symbol replacement until it is safe to run constructors
fex_malloc_symbols
- Host.cpp: Allows FEX to export allocation symbols
fex_thunk_test
wayland-client
xshmfence
Source/Tests
unittests
See unittests/Readme.md for more details