Commit graph

2038 commits

Author SHA1 Message Date
german77
25c46f82c5 yuzu: Add custom ringcon configuration 2022-04-16 00:49:26 -05:00
bunnei
e1b3368c18 hle: kernel: Use std::mutex instead of spin locks for most kernel locking. 2022-04-11 21:13:40 -07:00
Merry
ae642bbff2 common: Replace lock_guard with scoped_lock 2022-04-07 19:30:55 +01:00
Fernando S
62d668fc79 Merge pull request #8143 from merryhime/rdtsc
native_clock: Use lfence with rdtsc
2022-04-07 16:17:45 +02:00
Liam
d414904aef service: jit: stub JIT service 2022-04-06 20:07:01 -04:00
bunnei
18017f7adf Merge pull request #8089 from merryhime/paranoia
configuration: Add Paranoid CPU accuracy level
2022-04-04 11:07:38 -07:00
Merry
42d6a01039 native_clock: Internal linkage for FencedRDTSC
__forceinline required on MSVC for function to be inlined
2022-04-03 22:38:12 +01:00
merry
b8d8677ed1 native_clock: Use lfence with rdtsc 2022-04-03 22:38:10 +01:00
merry
7470fdd77c native_clock: Use writeback from CAS to avoid double-loading 2022-04-02 22:22:48 +01:00
merry
eeca2f2df9 atomic_ops: Implement AtomicCompareAndSwap with writeback 2022-04-02 22:22:48 +01:00
Merry
18ecb3053b native_clock: Use AtomicLoad128 2022-04-02 20:55:36 +01:00
Merry
14df27ff04 atomic_ops: Implement AtomicLoad128 2022-04-02 20:55:36 +01:00
merry
e752529c4c configuration: Add Paranoid CPU accuracy level
Disables most optimizations for the paranoid.
2022-03-26 08:46:25 +00:00
bunnei
0b6b398bd4 hle: nvflinger: Merge Rect with Common::Rectangle. 2022-03-24 18:13:33 -07:00
bunnei
e3ee327a30 common: logging: Add a logger for NVFlinger. 2022-03-24 18:13:32 -07:00
ameerj
f9709bb9e9 general: Fix clang/gcc build errors 2022-03-20 02:25:09 -04:00
ameerj
e70b4f3fc5 common: Reduce unused includes 2022-03-19 15:01:31 -04:00
ameerj
582332d13f common: Reduce unused includes 2022-03-19 02:23:33 -04:00
bunnei
492b983af4 common: tree: Various updates. 2022-03-14 18:14:53 -07:00
bunnei
3a7ac3cb72 common: intrusive_red_black_tree: Various updates. 2022-03-14 18:14:53 -07:00
Wunkolo
c802f8fbd2 cpu_detect: Add additional x86 flags and telemetry
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](bcfe377aaa/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.
2022-03-11 10:27:00 -08:00
Wunkolo
21ccb35705 common/telemetry: Update AddField name type to string_view
Non-owning `string_view` is flexable and
avoids some of the many redundant copies made over `std::string`
2022-03-11 10:26:59 -08:00
Merry
a993e93abd backend: Ensure backend_thread is destructed before message_queue
Ensures that stop_token signals that stop has been requested before destruction of conditional_variable
2022-03-10 10:49:15 +00:00
Wunkolo
7cb99ccf23 cpu_detect: Revert __cpuid{ex} array-type argument
Restores compatibility with MSVC's `__cpuid` intrinsic.
2022-03-09 19:50:01 -08:00
Wunkolo
b603adb6ac cpu_detect: Add missing lzcnt detection 2022-03-09 13:57:47 -08:00
Wunkolo
4aa5b5779b cpu_detect: Refactor cpu/manufacturer identification
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(!)
2022-03-09 13:57:47 -08:00
Wunkolo
14618c0e98 cpu_detect: Update array-types to span and array
Update some uses of `int` into some more explicitly sized types as well
2022-03-09 13:57:47 -08:00
Wunkolo
609c64196b cpu_detect: Utilize Bit<N> utility function 2022-03-09 13:57:47 -08:00
Wunkolo
31f8d6f0cf cpu_detect: Compact capability fields
As this structure gets more explicit, bools can be bitfields and
small enums can use smaller types for their span of values.
2022-03-09 13:57:47 -08:00
Wunkolo
fbf00e7fbc bit_util: Add bit utility function
Extracts a singular bit, as a bool, from the specified compile-time index.
2022-03-09 13:57:47 -08:00
Fernando S
bc96f67ce1 Merge pull request #7973 from Morph1984/debug-crash
host_memory: Fix fastmem crashes in debug builds
2022-03-06 04:49:27 +01:00
bunnei
9d25f5409d Merge pull request #7935 from Wunkolo/logging-join-fix
logging: Convert `backend_thread` into an `std::jthread`
2022-03-02 19:09:26 -08:00
Morph
5ea520a149 host_memory: Fix fastmem crashes in debug builds
It is possible for virtual_offset to not be 0 when the iterator is at the beginning, and thus, std::prev(it) may be evaluated, leading to a crash in debug mode.

Co-Authored-By: Fernando S. <1731197+FernandoS27@users.noreply.github.com>
2022-03-02 18:36:59 -05:00
Wunkolo
8da42d8235 logging: Convert backend_thread into an std::jthread
Was getting an unhandled `invalid_argument` [exception](https://en.cppreference.com/w/cpp/thread/thread/join) during
shutdown on my linux machine. This removes the need for a `StopBackendThread` function entirely since `jthread`
[automatically handles both checking if the thread is joinable and stopping the token before attempting to join](https://en.cppreference.com/w/cpp/thread/jthread/~jthread) in the case that `StartBackendThread` was never called.
2022-02-27 16:23:52 -08:00
merry
3fe2c2d40d dynarmic: Inline exclusive memory accesses
Inlines implementation of exclusive instructions into JITted code,
improving performance of applications relying heavily on these
instructions.

We also fastmem these instructions for additional speed, with
support for appropriate recompilation on fastmem failure.

An unsafe optimization to disable the intercore global_monitor is also
provided, should one wish to rely solely on cmpxchg semantics for
safety.

See also: merryhime/dynarmic#664
2022-02-27 19:40:05 +00:00
bunnei
5dc4c92dc2 settings: Add a new "use_extended_memory_layout" setting.
- This will be used to enable emulation of a larger memory arrangement.
2022-02-21 13:07:19 -08:00
bunnei
e1af26d5b3 fixup! core: hle: kernel: KPageTable: Improve Un/MapPhysicalMemory. 2022-02-19 00:14:27 -08:00
bunnei
6075031e99 core: hle: kernel: KPageTable: Improve Un/MapPhysicalMemory.
- Improves the implementations of MapPhysicalMemory and UnmapPhysicalMemory to more closely reflect latest HOS.
2022-02-18 23:42:27 -08:00
Wunkolo
fe8b240a39 common: Add NullVisitor default constructor
Addresses https://github.com/yuzu-emu/yuzu/issues/7881 to fix linux
builds.

`YUZU_NON_COPYABLE` deletes the `T(const T&)` constructor which will
cause the implicitly defined default ctor/dtor to no-longer generate.
2022-02-17 06:28:19 -08:00
bunnei
3f85da2231 Merge pull request #7878 from german77/mnpp
service/mnpp: Stub mnpp_app
2022-02-16 18:42:49 -07:00
Morph
0d71098873 common: fs_util: Add buffer to string view utility functions
These functions allow to construct a string view from an input buffer, avoiding the copy done by the non string view counterparts. However, callers must be cognizant of the viewed buffer's lifetime to avoid a use-after-free.
2022-02-13 18:53:21 -05:00
Narr the Reg
4eef3a0cde service/mnpp: Stub mnpp_app
Used in Super Nintendo Entertainment System™ - Nintendo Switch Online
2022-02-10 21:55:28 -06:00
Morph
9429bb6222 common: uuid: Use sizeof(u64) instead of 8 in Hash() 2022-02-10 15:03:49 -05:00
Morph
2d8d60bf9b common: uuid: Return an invalid UUID if conversion from string fails
The string constructor of UUID states:
Should the input string not meet the above requirements, an assert will be triggered and an invalid UUID is set instead.
2022-02-05 13:56:21 -05:00
Morph
e47b5e6a26 general: Rename NewUUID to UUID, and remove the previous UUID impl
This completes the removal of the old UUID implementation.
2022-02-05 13:56:21 -05:00
Morph
ad33e58c2d common: uuid: Add AsU128()
This copies the internal bytes of the UUID into a u128 for backwards compatibility. This should not be used.
2022-02-05 13:56:21 -05:00
Morph
51c445f7e8 input/hid: Migrate to the new UUID implementation 2022-02-05 13:18:41 -05:00
Morph
77bc383079 common: Implement NewUUID
This is a fixed and revised implementation of UUID that uses an array of bytes as its internal representation of a UUID instead of a u128 (which was an array of 2 u64s).
In addition to this, the generation of RFC 4122 Version 4 compliant UUIDs is also implemented.
2022-02-05 13:18:31 -05:00
Lioncash
45fd47ef0a common_types: Remove NonCopyable struct
Now that we're moved over to the YUZU_ defines, we can get rid of this
struct.
2022-02-02 13:19:01 -05:00
Lioncash
8a509e5a2c general: Replace NonCopyable struct with equivalents 2022-02-02 13:17:12 -05:00