aboutsummaryrefslogtreecommitdiff
path: root/src/common/x64
Commit message (Collapse)AuthorAgeFilesLines
* [common] Switch to boost::unordered_flat containers (#4326)crueter2026-08-311-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [common] rework BitField and BitUtil, use concepts whenever possible (#4076)lizzie2026-07-091-1/+1
| | | | | | | | | | test no regressions especially on Liiinux Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4076 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [dynarmic] fix pre-SSE4.1 having errors on CMHI/CMLO, fix extra nuisances ↵lizzie2026-06-031-9/+5
| | | | | | | | | | | | | and add INTERP testcase (#4025) does a bit of code dedup fixes pre-SSE4.1 having horrific CMHI/CMLO Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4025 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [core/core_timing] better MWAITX and WAITPKG delays (#3984)lizzie2026-05-304-417/+0
| | | | | | | | | | | | | 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>
* [common/cpu_detect] Remove SSE/SSE2/FMA4/AVX_VNNI detection (#3979)RedBlackAka2026-05-202-10/+3
| | | | | | | | | | | | | Removes Eden's own feature detection for SSE, SSE2, FMA4 and AVX_VNNI, in order to clean up code and make the function slightly lighter. They are all unused and I have specific reasons for their removal: - SSE/SSE2 are always true for x64 - FMA4 is a deprecated AMD exclusive extension, replaced by the regular FMA and was logged here as "FMA" for no reason - AVX_VNNI simply does not seem applicable for Eden (but can still be checked for through Xbyak's feature detection if necessary) Co-authored-by: RedBlackAka <140876408+RedBlackAka@users.noreply.github.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3979 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [dynarmic, macroHLE] Use faster ankerl for xbyak maps (#3716)lizzie2026-05-152-53/+65
| | | | | | | | | | | | the nominal std::unordered_map<> isn't enough to warrant it's continued usage in xbyak internal structures, thus using ankerl should greatly remove a lot of indirection/stdc++ specific overhead from the usually poorly performant std::unordered_map Both dynarmic and macroHLE should benefit greatly from a less-stupid unordered_dense This should speedup both CPU and shader compilation latency (NOT BY A GREAT MARGIN) just enough to make loading zones in ToTK less horrific Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3716 Reviewed-by: crueter <crueter@eden-emu.dev>
* [common] remove ptr indirection on WallClock (#3864)lizzie2026-05-152-84/+0
| | | | | | | | | 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>
* [common/logging] Simplify logging logic and fix issues when logging before ↵lizzie2026-03-121-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [windows] Return x86 microsleep for Windows (#3563)John2026-02-172-0/+85
| | | | | | | | | | Microsleep removal may have regressed AOC in msvc Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3563 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: Lizzie <lizzie@eden-emu.dev> Co-authored-by: John <john@eden-emu.dev> Co-committed-by: John <john@eden-emu.dev>
* [core, windows] remove microSleep() and simply wait on events like on linux ↵lizzie2026-02-092-88/+0
| | | | | | | | | | | | | | | (#3498) we shall see if the original code was put there for a reason or if the microsleeps actually are horrid Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3498 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [meta] fix license headers (#2547)lizzie2025-09-211-0/+3
| | | | | | | Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2547 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [cmake] enable clang-cl and WoA builds (#348)lizzie2025-09-091-1/+1
| | | | | | | | | | | | | | Compilation and CMake fixes for both Windows on ARM and clang-cl, meaning Windows can now be built on both MSVC and clang on both amd64 and aarch64. Compiling on clang is *dramatically* faster so this should be useful for CI. Co-authored-by: crueter <crueter@eden-emu.dev> Co-authored-by: crueter <crueter@crueter.xyz> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/348 Reviewed-by: CamilleLaVey <camillelavey99@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] jit fix branch v2 (#203)crueter2025-08-271-0/+1
| | | | | | Co-authored-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/203 Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev>
* [dynarmic] revert bad changes (#202)crueter2025-08-041-1/+0
| | | | | | | | | | | | This reverts commit 56acd4041ac0052c3b753950587851877e961a66. pr needs rebase and fix, audio broke Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/202 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Signed-off-by: crueter <crueter@eden-emu.dev>
* [dynarmic] XMM spill, SSE/AVX emit, sub/add, configurable JIT state pointer, ↵lizzie2025-08-021-0/+1
| | | | | | | | | | remove unnecessary stuff (#128) Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/128 https://www.agner.org/optimize/ Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* Rework time service to fix time passing offline.Kelebek12024-01-242-21/+14
|
* x64: cpu_wait: Implement MWAITX for non-MSVC compilersMorph2023-06-281-0/+10
|
* x64: cpu_wait: Remove magic valuesMorph2023-06-281-3/+8
|
* x64: cpu_wait: Make use of MWAITX in MicroSleepMorph2023-06-281-12/+21
| | | | | MWAITX is equivalent to UMWAIT on Intel's Alder Lake CPUs. We can emulate TPAUSE by using MONITORX in conjunction with MWAITX to wait for 100K cycles.
* x64: Add detection of monitorx instructionsMorph2023-06-282-0/+2
| | | | monitorx introduces 2 instructions: MONITORX and MWAITX.
* (wall, native)_clock: Add GetGPUTickMorph2023-06-072-1/+9
| | | | Allows us to directly calculate the GPU tick without double conversion to and from the host clock tick.
* (wall, native)_clock: Rework NativeClockMorph2023-06-072-181/+40
|
* x64: Deduplicate RDTSC usageMorph2023-06-074-19/+80
|
* x64: Simplify RDTSC on non-MSVC compilersMorph2023-03-272-16/+10
| | | | Co-Authored-By: liamwhite <liamwhite@users.noreply.github.com>
* x64: Add MicroSleepMorph2023-03-272-0/+82
| | | | | | | MicroSleep allows the processor to pause for a "short" amount of time (in the microsecond range). This is useful for spin-waiting that does not require nanosecond precision. This uses the new TPAUSE instruction introduced on Intel's newest processors as part of the waitpkg instructions. For CPUs that do not support waitpkg instructions, this is equivalent to yield(). Co-Authored-By: liamwhite <liamwhite@users.noreply.github.com>
* x64: cpu_detect: Add detection of waitpkg instructionsMorph2023-03-272-0/+2
| | | | waitpkg introduces 3 instructions, UMONITOR, UMWAIT and TPAUSE.
* native_clock: Wait for 10 seconds instead of 30Morph2023-03-071-3/+3
| | | | It was experimentally determined to be sufficient.
* native_clock: Use RealTimeClock instead of SteadyClockMorph2023-03-071-4/+4
| | | | We want to synchronize RDTSC to real time.
* native_clock: Re-adjust the RDTSC frequencyMorph2023-03-072-5/+34
| | | | | The RDTSC frequency reported by CPUID is not accurate to its true frequency. We will spawn a separate thread to calculate the true RDTSC frequency after a measurement period of 30 seconds has elapsed.
* native_clock: Round RDTSC frequency to the nearest 1000Morph2023-03-051-5/+12
|
* Add CPU core count to log filesMatías Locatti2022-11-112-3/+60
|
* Revert Coretiming PRs 8531 and 7454 (#8591)Maide2022-07-271-1/+1
|
* chore: make yuzu REUSE compliantAndrea Pappacoda2022-07-272-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [REUSE] is a specification that aims at making file copyright information consistent, so that it can be both human and machine readable. It basically requires that all files have a header containing copyright and licensing information. When this isn't possible, like when dealing with binary assets, generated files or embedded third-party dependencies, it is permitted to insert copyright information in the `.reuse/dep5` file. Oh, and it also requires that all the licenses used in the project are present in the `LICENSES` folder, that's why the diff is so huge. This can be done automatically with `reuse download --all`. The `reuse` tool also contains a handy subcommand that analyzes the project and tells whether or not the project is (still) compliant, `reuse lint`. Following REUSE has a few advantages over the current approach: - Copyright information is easy to access for users / downstream - Files like `dist/license.md` do not need to exist anymore, as `.reuse/dep5` is used instead - `reuse lint` makes it easy to ensure that copyright information of files like binary assets / images is always accurate and up to date To add copyright information of files that didn't have it I looked up who committed what and when, for each file. As yuzu contributors do not have to sign a CLA or similar I couldn't assume that copyright ownership was of the "yuzu Emulator Project", so I used the name and/or email of the commit author instead. [REUSE]: https://reuse.software Follow-up to b2eb10382941bef0914f4a0a4685b9033440aa9f
* guard against div-by-zeroMarshall Mohror2022-07-061-2/+5
|
* common/x64: Use TSC clock rate from CPUID when availableMarshall Mohror2022-07-062-0/+18
| | | | The current method used to estimate the TSC is fairly accurate - within a few kHz - but the exact value can be extracted from CPUID if available.
* Adress Feedback.Fernando Sahmkow2022-06-301-1/+0
|
* Native clock: Use atomic ops as before.Fernando Sahmkow2022-06-282-24/+29
|
* Native Clock: remove inaccuracy mask.Fernando Sahmkow2022-06-282-6/+1
|
* Core: Fix tests.Fernando Sahmkow2022-06-281-0/+1
|
* Common: improve native clock.Fernando Sahmkow2022-06-282-29/+24
|
* general: Convert source file copyright comments over to SPDXMorph2022-04-234-10/+10
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* native_clock: Internal linkage for FencedRDTSCMerry2022-04-031-2/+4
| | | | __forceinline required on MSVC for function to be inlined
* native_clock: Use lfence with rdtscmerry2022-04-031-14/+33
|
* native_clock: Use writeback from CAS to avoid double-loadingmerry2022-04-021-4/+6
|
* native_clock: Use AtomicLoad128Merry2022-04-021-2/+2
|
* common: Reduce unused includesameerj2022-03-193-5/+0
|
* cpu_detect: Add additional x86 flags and telemetryWunkolo2022-03-112-11/+40
| | | | | | | | | | | Adds detection of additional CPU flags to cpu_detect and additions to telemetry output. This is not exhaustive but guided by features that [dynarmic utilizes](https://github.com/merryhime/dynarmic/blob/bcfe377aaa5138af740e90af5be7a7dff7b62a52/src/dynarmic/backend/x64/host_feature.h#L12-L33) as well as features that are currently utilized but not reported to telemetry(invariant_tsc). This is intended to guide future optimizations. AVX512 in particular is broken up into its individual subsets and some other processor features such as [sha](https://en.wikipedia.org/wiki/Intel_SHA_extensions) and [gfni](https://en.wikipedia.org/wiki/AVX-512#GFNI) are added to have some forward-facing data-points. What used to be a single `CPU_Extension_x64_AVX512` telemetry field is also broken up into individual `CPU_Extension_x64_AVX512{F,VL,CD,...}` fields.
* cpu_detect: Revert `__cpuid{ex}` array-type argumentWunkolo2022-03-091-6/+6
| | | | Restores compatibility with MSVC's `__cpuid` intrinsic.
* cpu_detect: Add missing `lzcnt` detectionWunkolo2022-03-091-0/+1
|
* cpu_detect: Refactor cpu/manufacturer identificationWunkolo2022-03-092-24/+38
| | | | | | | Set the zero-enum value to Unknown Move the Manufacterer enum into the CPUCaps structure namespace Add "ParseManufacturer" utility-function Fix cpu/brand string buffer sizes(!)