High and low-level emulation: Difference between revisions
No edit summary |
|||
| Line 258: | Line 258: | ||
====Compiler Toolchains and Build Environments==== | ====Compiler Toolchains and Build Environments==== | ||
Modern emulators are built and optimized using diverse compiler toolchains depending on the host operating system. GCC and Clang/LLVM dominate on Linux and macOS, offering advanced optimization capabilities such as Profile-Guided Optimization (PGO), Link-Time Optimization (LTO), ThinLTO, and auto-vectorization, which are critical for performance-sensitive workloads like dynamic recompilation and JIT execution. Emulators increasingly use these capabilities to generate more efficient binaries.<ref>{{cite web|url=https://old.reddit.com/r/rpcs3/comments/1jhgiqo/rpcs3_linktime_optimisations_lto_are_now_enabled/|title=RPCS3 Link-Time Optimisations (LTO) Are Now Enabled|publisher=Reddit}}</ref><ref>{{cite web|url=https://github.com/RPCS3/rpcs3/issues/17196|title=changing the win compiler from msvc to clang can bring 3%~5% performance improvement|publisher=GitHub}}</ref><ref>{{cite web|url=https://github.com/RPCS3/rpcs3/issues/16778|title=LTO implementation for RPCS3|publisher=GitHub}}</ref><ref>{{cite web|url=https://github.com/xemu-project/xemu/pull/2648|title=Incremental LTO implementation for xemu|publisher=GitHub}}</ref> Microsoft Visual C++ (MSVC) is the primary compiler on Windows, providing tight integration with Visual Studio and host-specific optimizations for x86-64 and ARM64 platforms. MinGW-w64 | Modern emulators are built and optimized using diverse compiler toolchains depending on the host operating system. GCC and Clang/LLVM dominate on Linux and macOS, offering advanced optimization capabilities such as Profile-Guided Optimization (PGO), Link-Time Optimization (LTO), ThinLTO, and auto-vectorization, which are critical for performance-sensitive workloads like dynamic recompilation and JIT execution. Emulators increasingly use these capabilities to generate more efficient binaries.<ref>{{cite web|url=https://old.reddit.com/r/rpcs3/comments/1jhgiqo/rpcs3_linktime_optimisations_lto_are_now_enabled/|title=RPCS3 Link-Time Optimisations (LTO) Are Now Enabled|publisher=Reddit}}</ref><ref>{{cite web|url=https://github.com/RPCS3/rpcs3/issues/17196|title=changing the win compiler from msvc to clang can bring 3%~5% performance improvement|publisher=GitHub}}</ref><ref>{{cite web|url=https://github.com/RPCS3/rpcs3/issues/16778|title=LTO implementation for RPCS3|publisher=GitHub}}</ref><ref>{{cite web|url=https://github.com/xemu-project/xemu/pull/2648|title=Incremental LTO implementation for xemu|publisher=GitHub}}</ref> Microsoft Visual C++ (MSVC) is the primary compiler on Windows, providing tight integration with Visual Studio and host-specific optimizations for x86-64 and ARM64 platforms. | ||
To bridge the gap between Unix-centric codebases and the Windows platform, developers historically relied on environments like MSYS2 and MinGW-w64 to supply POSIX-compatible toolchains natively on Windows. However, maintaining native Windows build environments in automated infrastructure introduces overhead and potential environment drift. Consequently, modern emulator projects increasingly deprecate MSYS2 deployment in favor of MXE (M cross environment).<ref>{{cite web|url=https://github.com/azahar-emu/azahar/discussions/2126|title=Azahar 2126.0 Alpha 1 Changelog: Deprecation of MSYS2 for MXE|publisher=GitHub}}</ref> MXE allows developers to cross-compile fully static Windows binaries directly from a Linux host. This shift removes environment friction, leverages faster Unix continuous integration (CI) builders, and ensures rigorous dependency tracking. | |||
These compiler toolchains influence ABI compatibility, available SIMD instruction sets (such as AVX2 and AVX-512 on x86-64, or NEON on ARM), and overall binary performance characteristics. Emulator developers frequently maintain multiple build configurations to balance portability, debuggability, and maximum runtime efficiency across architectures. | These compiler toolchains influence ABI compatibility, available SIMD instruction sets (such as AVX2 and AVX-512 on x86-64, or NEON on ARM), and overall binary performance characteristics. Emulator developers frequently maintain multiple build configurations to balance portability, debuggability, and maximum runtime efficiency across architectures. | ||