aboutsummaryrefslogtreecommitdiff
path: root/src/core/arm
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/fix/dynarmic-invalidate-code-page' into ↵Takoroka3 days2-0/+8
|\ | | | | | | test/linux-all-prs
| * dynarmic: drop the cached code page when a range is invalidatedTakoroka4 days2-0/+8
| | | | | | | | | | | | | | | | | | | | MemoryReadCode keeps the last code page it read, and only an ISB, an IC instruction or a full cache clear reset it. InvalidateCacheRange did not, so blocks recompiled after a range was invalidated could still decode the old instructions when that page was the cached one. The gdbstub hits this on every breakpoint: inserting or removing one writes the instruction and invalidates its range, so breakpoints were skipped, fired after removal, or single steps ran from stale code.
* | Initial linux aarch64 commitOmar Mahboubi3 days1-0/+26
|/ | | | | | | This adds an experimental aarch64 platform in Github Actions (with and without PGO) to compile for aarch64 on Linux. Signed-off-by: Omar Mahboubi <omar_mahboubi@tutanota.com>
* nx2: run the guest counter at 31.25 MHz for Switch 2 titlesTakoroka5 days3-3/+7
| | | | | | | | | | | | | | | | | | | | The Switch 2 counter runs at 31.25 MHz and its SDK converts ticks with that constant: Mario Kart World's sdk builds 31,250,000 in nn::os::GetSystemTickFrequency, TickManager::ConvertToTimeSpan and TickManager::ConvertToTick (19.2 MHz appears nowhere). Eglantine counted at the Switch 1 rate for every title, so every tick-based time in a Switch 2 game was off by 1.63x: elapsed times read short, and a deadline of one 60 Hz frame converted to ticks waited ~27 ms. The wall clock now has a guest counter frequency, set at boot: 31.25 MHz for Switch 2 programs, 19.2 MHz otherwise, EDEN_NX2_CNTFRQ=<Hz> to force one. CNTPCT reads, CNTFRQ_EL0, svcGetSystemTick, thread tick counts and the time services' tick conversions follow it, and the CNTPCT spin detection keeps its ~1.7 us threshold. Mario Kart World, title screen and attract demo, 180 s, same build: frame times unchanged (17-19 ms once warm), process CPU time 848 s instead of 930 s.
* core: pause in guest loops that poll the system counterTakoroka5 days2-1/+25
| | | | | | | | Title 1's main thread reads CNTPCT ~17 million times a second while it waits for the GPU (~23% of its samples are the counter read). On an SMT core that spin takes resources from the sibling thread, often the GPU thread. Two reads within ~1.7 us of each other now execute two PAUSE instructions first; the guest sees the same values. EDEN_NX2_CNTPCT_PAUSE=0 turns it off.
* nx2: frame-locked input replay and quieter logsTakoroka7 days1-4/+16
| | | | | | | | | | | EDEN_NX2_KEY_RECORD records keyboard transitions as "f<frame>:code" against a global count of guest presents; EDEN_NX2_KEY_SCRIPT replays them on the same frames (or by seconds, as before), so a played session reproduces exactly. Debug aids: the PC/LR/SP of the first unmapped reads, NSO load addresses, EDEN_NX2_IPC_SUMMARY (request counts every 5 s), EDEN_NX2_FORCE_LOD0. Unmapped-access logging is rate limited and the per-draw/semaphore spam is demoted, so long sessions stay under the log size cap.
* [nce] handles duplicate NCE interrupts (#4530)xbzk9 days1-2/+2
| | | | | | | | | | | | | | | | | | | - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Another crash observed in Ender Magnolia: A deadlock caused between CPUCore_0/GPU/GPUFencingThread. CPUCore_0 waits for GPU work inside the NCE fault handler GPU waits for the syncpoint mutex GPUFencingThread holds that mutex while waiting for CPUCore_0 NCE interrupt lock The fix makes duplicate interrupts return before acquiring the lock, while the first request keeps its original behavior. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4530 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev>
* Fix aarch and android builds (#4576)PavelBARABANOV10 days1-0/+16
| | | | | | | | | | | | - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- credit: John and Crueter Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4576 Reviewed-by: crueter <crueter@eden-emu.dev>
* [patcher, ro, settings] runtime tls patch (#4492) optimization and nuke ↵xbzk2026-10-152-0/+49
| | | | | | | | | | | | | | | | toggle (#4502) (#4523) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- This is a follow up for the biomutant fix. By the time i knew it was shallow, coz i was running patchtext routine even for svc and modules, causing a routine which were needed to run 14 times to run 4000+ instead. Since some perf loss was reported in 30 sep nightly, and it caused ac3r to not boot, we had added a temp toggle, which is now being removed as optimizations + fix are in. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4523 Reviewed-by: lizzie <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [dynarmic] Coalesce non-exclusive Write/Read fallback functions (#4158)lizzie2026-09-194-83/+42
| | | | | | | | | | | | | | | | | | | the general idea is to have a common procedure form whom to call this way theres less "jumping around" for values of different sizes additionally this **should** allow for better codegen since most of the u8,u16,u32,u64 can be held within a u64 theoretically this means that you could deifne callbacks in suck a way that it's essentially as costly as a `mov r64, m64` but that's not doable due to the fact we have to do translations... Is this a good change? Primarily aimed for x86 and ARM to benefit, but I suppose LooooooongArch64 can benefit too. Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4158 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [msvc] fix build errors (#4451)lizzie2026-09-172-4/+4
| | | | | | | | | | | | | | | | | MSVC doesn't consider atomic<u64> to be trivially copyable on x86 (why?). And other chary idiosyncrasies from constructing `std::optional<uint8_t>` Signed-off-by: lizzie <lizzie@eden-emu.dev> - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4451 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [common/core/dynarmic] Optimize page table allocations (#4219)Exverge2026-09-092-11/+26
| | | | | | | | | | | | | | Reduces the page entries from 32 bytes to 8 and rewrites `VirtualBuffer` to be more efficient in memory usage and specifically for large zero regions. The page table will now only reserve 1GiB instead of 4GiB and of this memory it should only use at most ~8MiB. This PR has the side effect of using Eden on Windows on low memory systems much more plausible since it would previously require ~10GiB of committable memory at front (despite using ~5-6 at most, inadvertently stalling other processes) where as now it should only require around the amount that it'll actually use. Co-authored-by: Lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4219 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: lizzie <lizzie@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [nce] avoid cyrilic utf8 strings being interpreted as exclusive store ↵xbzk2026-09-081-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instructions (#4369) - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Problem: In cyrilic idioms, Absolum won't past beyond 1st area (intro miniboss). From the user panic i`ve extracted these strings: > GlobalState.request_next() > save_state_to_saveGame(...) > platform.ProcessSave() > bin_serialize_to_file(...) > StandaloneTypeModel.Write(SaveGame, ...) > Write(SaveGame.AdventureSaveSlot, ...) > Write(PlayerState, ...) > ProtoBuf.ProtoWriter.WriteString(...) + 0xcc > ProtoBuf.Helpers.DebugAssert(...) > Debug.Fail(...) By debugging ProtoBuf.ProtoWriter.WriteString(...) argument it was found that the string Отлично! (Great! expression for combos between 6 and 30 iirc) was reaching a size comparison of different values and causing an assert in guest side.. It seems the game tries to save highest combo level. I've managed to skip this bug by doing a perfect combo for entire level, so that the problematic word never was generated or attempted to be saved. After further research, the issue chain was identified: Game maths literal string size via two ways and compare, and one of them was getting replaced by a wrong value due to Eden letting the literal string be interpreted as a real instruction. Logic added: const bool pair = decltype(l)::ExtractValue(raw) & 1; const bool fixed_rt2 = decltype(rt2)::ExtractValue(raw) == 0b11111; return pair || fixed_rt2; - pair checks bit 21 (L & 1): register-pair instructions actually use Rt2, so they remain accepted. - For single-register forms, require Rt2 == 31. The table word fails this check, so NCE leaves it intact. Sources https://www.scs.stanford.edu/~zyedidia/arm64/stxrb.html https://www.scs.stanford.edu/~zyedidia/arm64/stxp.html https://github.com/qemu/qemu/blob/master/target/arm/tcg/a64.decode#L344 Altough the solution is a case specific guard, it is data agnostic: This is a true fix to avoid a specific case in which a literal may be interpreted as a valid instruction, without interfering with other true instruction cases. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4369 Reviewed-by: lizzie <lizzie@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [common] Switch to boost::unordered_flat containers (#4326)crueter2026-08-312-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces all instances of ankerl's unordered map/set with boost's `unordered_flat_*` classes. This uses std::hash since boost::hash is actually a lot slower. Also adds an abstraction layer in `Common` so future changes are quicker and easier. Other implementation details: - ankerl provided hash specializations for tuple and pair, so those were ported here - std::erase_if doesn't work on boost, so just used the ADL'd erase_if This should be about equal or superior performance as unordered_dense for everything except iteration. Signed-off-by: crueter <crueter@eden-emu.dev> - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4326 Reviewed-by: Lizzie and Samuel <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* Revert "[dynarmic] Remove Ignore Global Monitor from CPU Accuracy Auto ↵lizzie2026-08-232-0/+2
| | | | | | | | | | | | | | | | | | | | (#3846)" (#4276) This reverts commit 3a823de605252c7c994626fa7586b932d2b119ee. - [x] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). - [x] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) - [x] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- kills performance and doesn't fix graphical glitches (according to gido) "It improved nothing but kills performance on default setting" Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4276 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [nce, fs] tico support, fix FS bug that would nuke entire 'switch' folder ↵xbzk2026-07-232-1/+20
| | | | | | | | | | | | | | | (#4086) Contains the minimal set of functionalities to allow tico installer succeed, and tico work normally EXCEPT for game launching (which me or someone else will investigate later) First three commits are from PR 4012. The other six, kinda dizzy to explain each one. All were implemented based on tico source, switchbrew and libnx. Hopefully the commit messages will do. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4086 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: Maufeat <sahyno1996@gmail.com>
* [core/core_timing] better MWAITX and WAITPKG delays (#3984)lizzie2026-05-301-1/+1
| | | | | | | | | | | | | This implements MWAITX and WAITPKG extensions (umonitor, mwait) for CPUs that support them. Reduces wait times and bypasses the timing stuff from the OS that is slow (windows notably). generally it should answer within 0.2 to 0.5 microsecs (since most requests wait for that long). Also does a general rework of static ctors and stuff Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3984 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev>
* [*] fix missing '#pragma once' on header files (#4014)lizzie2026-05-262-2/+6
| | | | | | | | | | | | `find src -type f -name '*.h' -not -exec grep -q "#pragma once" {} \; -print` - ignore qt with header guards already - smaa too Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4014 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev>
* [core/arm/nce] suppress unused variable warnings (#4002)lost-chaos2026-05-232-4/+4
| | | | | | | | Add `[[maybe_unused]]` to unused constants in the ARM NCE backend to suppress compiler warnings. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4002 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [common] remove ptr indirection on WallClock (#3864)lizzie2026-05-153-12/+11
| | | | | | | | | also devirtualizes manually since compiler doesn't do it with LTO Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3864 Reviewed-by: crueter <crueter@eden-emu.dev>
* [jit] fix Super Mario 64 in SM3D: All-Stars (#3950)lizzie2026-05-134-93/+90
| | | | | | | | | | | | | jit service had wrong check for module versions missing handlers for some funcs the page cache i added interfered with jit (gee who would've tought) Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3950 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev>
* [dynarmic] remove decode matcher function handlers using std::function<>, ↵lizzie2026-05-091-4/+3
| | | | | | | | | | | | | | | use raw function pointers (#3920) issues: - std::function<> is used, which is famously bad - storage of tehse in tables makes big fucking tables for no good reason - lets just store a normal pointer and stuff! :) this pr attempts to address that Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3920 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
* [dynarmic] Remove Ignore Global Monitor from CPU Accuracy Auto (#3846)MaranBr2026-04-212-2/+0
| | | | | | | | This fixes a flickering issue in some games, such as The Legend of Zelda: Echoes of Wisdom. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3846 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: Lizzie <lizzie@eden-emu.dev>
* [dynarmic, cmake] Assorted RISC-V build fixes (#3797)lizzie2026-04-061-10/+2
| | | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3797 Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [dynarmic] restore proper backtraces for A64 (#3794)lizzie2026-03-291-1/+5
| | | | | | | | | | | | trivial changes, fixes hard crashes Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3794 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [ports, freebsd] remove fastmem ban (#3786)lizzie2026-03-272-9/+9
| | | | | | | | | | | | whatever issue there was, is now fixed on FBSD 15 Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3786 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [common/logging] Simplify logging logic and fix issues when logging before ↵lizzie2026-03-124-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | system is created (#3688) - our logging code was bigger than spdlog itself, why???? just keep it simple - fix issues when logging before logging system is even started - removes the "initialized logging twice" issue - removes uneeded indirection in file logging - uses direct formatting instead of jumping hoopla-around the fmt::format() ressult - code duplication and dead code removal as usual I did explore dup2() but I think it's not worth the hassle I did try `fwopen()` but it's better if things are just kept as-is. there is a lot of noise because I removed a bunch of redundant files on logging and just put everything in one file now normally this wouldn't be a good idea, however consider: the complexity of logging; it's less than 500 lines... does it really need a whole subsystem?!?!?! ITS JUST LOGGING Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3688 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: DraVee <chimera@dravee.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [core/loader] prevent program_image reallocations in NSO+KIP loading methods ↵lizzie2026-02-282-11/+5
| | | | | | | | | | | | | | | (#3639) also changes some methods to std::span<> as well, but mainly std::vector<> in the NSO/KIP loading stuff is not needed to be memcpy'ed and memmove'd around this should save a marginal amount of loading time (RDR1) Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3639 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: Maufeat <sahyno1996@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [dynarmic] Fix ISB with new JIT schema (#3576)lizzie2026-02-212-0/+6
| | | | | | | | | | | | | | | If an ISB is issued, the changes on the memory wouldn't be reflected Now we emulate "instruction cache" properly by just telling the mechanism to re-fetch the entire page again (to make ANY changes visible immediately) This mainly fixes a potential issue where an ISB is emitted before a branch on the same codepage. Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3576 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: DraVee <dravee@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [dynarmic] remove dead-code interpreter (#3547)lizzie2026-02-215-23/+3
| | | | | | | | | | | | | interpreter was never called in practice and doesn't do anything other than just crash Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3547 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: DraVee <dravee@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [dynarmic] add current code page cache (#3459)lizzie2026-02-124-5/+25
| | | | | | | | | | | | | | | | | | | should make JIT translation a bit faster - especially for non-fastmem test if thumb still werks previously: we read 32-bits one by one, and do translation **for each u32 we read** now: one big read of 4096 bytes (aligned of course), only 1 VAddr translation Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3459 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [android, nce] Remove LRU-Cache (#3500)lizzie2026-02-103-236/+4
| | | | | | | | | | | | | This PR removes the obsolete logic of LRU-cache within, removing old and dead code, allows Android to avoid unnecesary usage of memory caching, aside to prevent some old bugs to arise in other systems that allows NCE, improves a small margin of performance and makes memory ram consumption overall better, by 300 - 500mb, revealing that part of the code was still active, even if LRU wasn't enabled. Signed-off-by: lizzie <lizzie@eden-emu.dev> Signed-off-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3500 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [*] change all std::unordered_map and std::unordered_set into ↵lizzie2026-02-103-7/+7
| | | | | | | | | | | | | | | | | | | ankerl::unordered_dense::map/set variants (#3442) mainly doing this to reduce memory footprint; we all know how nice ankerl::unordered_dense is in theory 4x faster - in practice these maps arent that "hot" anyways so not likely to have much perf gained i just want to reduce mem fragmentation to ease my porting process, plus it helps other platforms as well (ahem weak Mediatek devices) :) Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3442 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [nce] add split patch mode to support modules bigger than 128MB (#3489)Maufeat2026-02-072-163/+370
| | | | | | | | | | nce patcher was extended to support modules larger than 128MB due to ARM64 branch limit. now added a pre-patch and (existing) post-patch module code. Allowwing MRS/MSR/SVC handler to remain within branch branch range Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3489 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: Maufeat <sahyno1996@gmail.com> Co-committed-by: Maufeat <sahyno1996@gmail.com>
* [nce] use correct process memory in fault handlers (#3391)Maufeat2026-01-271-3/+4
| | | | | | | | | | Lets you correctly play games in qlaunch on NCE Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3391 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: Maufeat <sahyno1996@gmail.com> Co-committed-by: Maufeat <sahyno1996@gmail.com>
* [common, core] remove uneeded memory indirection overhead at startup (#3306)lizzie2026-01-164-380/+411
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for core stuff: just remove unique ptrs that dont need any pointer stability at all (afterall its an allocation within an allocation so yeah) for fibers: Main reasoning behind this is because virtualBuffer<> is stupidly fucking expensive and it also clutters my fstat view ALSO mmap is a syscall, syscalls are bad for performance or whatever ALSO std::vector<> is better suited for handling this kind of "fixed size thing where its like big but not THAT big" (512 KiB isn't going to kill your memory usage for each fiber...) for core.cpp stuff - inlines stuff into std::optional<> as opposed to std::unique_ptr<> (because yknow, we are making the Impl from an unique_ptr, allocating within an allocation is unnecessary) - reorganizes the structures a bit so padding doesnt screw us up (it's not perfect but eh saves a measly 44 bytes) - removes unused/dead code - uses std::vector<> instead of std::deque<> no perf impact expected, maybe some initialisation boost but very minimal impact nonethless lto gets rid of most calls anyways - the heavy issue is with shared_ptr and the cache coherency from the atomics... but i clumped them together because well, they kinda do not suffer from cache coherency - hopefully not a mistake this balloons the size of Impl to about 1.67 MB - which is fine because we throw it in the stack anyways REST OF INTERFACES: most of them ballooned in size as well, but overhead is ok since its an allocation within an alloc, no stack is used (when it comes to storing these i mean) Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3306 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [dynarmic, common] pagetable clustering (#3215)lizzie2026-01-132-4/+10
| | | | | | | | | | | | | | | | Raises the size of each page entry to 32 bytes, however, it merges them into a single structure THEORETICALLY this is better since the access pattern observed corresponds to the program wanting backing_addr/pointers/blocks immediately after one another. This may improve performance at the cost of some extra memory. Another implementation would be to structure only backing_addr/blocks within the same virtual buffer. Alas spamming virtual buffers is evil since each of them is a cache trasher (imagine jumping from wildly different block to wildly different block immediately). Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3215 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [FIXUP] Partially revert "[NCE] Fix cache invalidation and signal interrupt ↵Caio Oliveira2025-12-221-15/+2
| | | | | | | | | | | | | | race condition (#3063)" (#3190) * this fixes Jamboree and SSB This reverts commit e3c942b2092761c1f812f1eff086f437b843341a. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3190 Reviewed-by: Maufeat <sahyno1996@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Co-committed-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
* [NCE] Fix cache invalidation and signal interrupt race condition (#3063)MrPurple6662025-12-041-6/+21
| | | | | | | | | | | | | | | | Inspired by PR #3047 This should theoretically fix 3 bugs in NCE: - **Bug 1**: `ClearInstructionCache()` now properly invalidates L1 instruction cache using IC IALLU instead of only using memory barriers - **Bug 2**: `InvalidateCacheRange()` implements proper range-based cache invalidation instead of always flushing entire L1 cache - **Bug 3**: `SignalInterrupt()` adds acquire fence to guarantee memory visibility of the `is_running` flag, preventing lost signals Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3063 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Co-authored-by: MrPurple666 <antoniosacramento666usa@gmail.com> Co-committed-by: MrPurple666 <antoniosacramento666usa@gmail.com>
* [port] NetBSD and improper ctor for SpinLock fixes (#3092)lizzie2025-11-302-3/+3
| | | | | | | | | | | | | | | So when libc starts it has to start at an entry point located into crt0, now most OSes will do "enough" setup to allow mprotect() and mmap() to be called in static ctors (remember they're called BEFORE main) By some stupid miracle, NetBSD doesn't; this means that using those functions on NetBSD will result in spurious results The reason why is still unknown to me, but this is also combined with the fact that allocating a big chunk of memory for the JIT will make NetBSD refuse to mprotect()/mmap() it in low memory situations (even when space is available); so I take the same approach as with solaris Also I now make it so fastmem handlers are NOT registered for OSes that disabled fastmem, this is because they pollute sigsegv and makes debugging stupidier Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3092 Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [dynarmic] remove scopedjit remnants (#3029)lizzie2025-11-172-81/+7
| | | | | | | | | | | | not even used anymore, yay! Signed-off-by: lizzie lizzie@eden-emu.dev Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3029 Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [dynarmic] removes ScopedJitExecution / fix-ac3 (#3018)PavelBARABANOV2025-11-162-10/+0
| | | | | | | | | Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3018 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Co-authored-by: PavelBARABANOV <pavelbarabanov94@gmail.com> Co-committed-by: PavelBARABANOV <pavelbarabanov94@gmail.com>
* [dynarmic] attempt fix totk regression from #358 (#3013)lizzie2025-11-142-4/+10
| | | | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3013 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* Revert "[core/memory] Remove defered heap allocation on Linux." (#2974)PavelBARABANOV2025-11-094-0/+82
| | | | | | | | | Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2974 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: PavelBARABANOV <pavelbarabanov94@gmail.com> Co-committed-by: PavelBARABANOV <pavelbarabanov94@gmail.com>
* [nce] remove software prefetching instances (#2857)lizzie2025-11-082-54/+0
| | | | | | | | | | | May be a complete hit or miss on performance with NCE Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2857 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [compat] Fix other DragonFlyBSD/NixOS issues (#2860)lizzie2025-11-072-2/+2
| | | | | | | | | | | Uh - the other pr that had "Fix dragonfly" got commits lost and I didn't notice... oops; cherry picked them back through :) Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2860 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [core/arm] more verbose backtrace showing ALL of the thread's context state ↵lizzie2025-11-031-3/+25
| | | | | | | | | | | | | | (#2924) Should make backtraces infinitely better :) Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2924 Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [core/memory] Remove defered heap allocation on Linux. (#2587)lizzie2025-10-314-79/+3
| | | | | | | | | | Authored-by: weakboson <weakboson@eden-emu.dev> Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2587 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [dynarmic] Refactoring to reduce latency hit from recompilation (#358)lizzie2025-10-282-10/+4
| | | | | | | | | | Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/358 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [compat] HaikuOS port (#2805)lizzie2025-10-222-2/+2
| | | | | | | | | | | Still had the issues with libusb, but that should get solved with the other PRs anyways Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2805 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>