Commit Graph

49 Commits

Author SHA1 Message Date
Margen67
4cb783bf22 Header cleanup 2025-07-19 14:42:21 -07:00
Gliniak
3318ab5d4c [3PP] Uplifted FMT version and adjusted messages 2024-12-12 20:28:11 +01:00
chss95cs@gmail.com
7fb4b4cd41 Attempt to emulate reserved load/store more closely. can't do anything for stores of the same value that are done via a non-reserved store to a reserved location
uses a bitmap that splits up the memory space into 65k blocks per bit.  Currently is using the guest virtual address but should be using physical addresses instead.

Currently if a guest does a reserve on a location and then a reserved store to a totally different location we trigger a breakpoint. This should never happen
Also removed the NEGATED_MUL_blah operations. They weren't necessary, nothing special is needed for the negated result variants.

Added a log message for when watched physical memory has a race, it just would be nice to know when it happens and in what games.
2023-04-15 16:06:07 -04:00
chss95cs@gmail.com
c1d922eebf Minor decoder optimizations, kernel fixes, cpu backend fixes 2022-11-05 10:50:33 -07:00
chrisps
8186792113 Revert "Minor decoder optimizations, kernel fixes, cpu backend fixes" 2022-11-01 14:45:36 -07:00
chss95cs@gmail.com
bff264b5fd Fixed RtlCompareString and RtlCompareStringN, they were very wrong, for CompareString the params are struct ptrs not char ptrs
Fixed a ton of clang-cl compiler warnings about unused variables, still many left. Fixed a lot of inconsistent override ones too
2022-10-30 10:47:09 -07:00
chss95cs@gmail.com
cb85fe401c Huge set of performance improvements, combined with an architecture specific build and clang-cl users have reported absurd gains over master for some gains, in the range 50%-90%
But for normal msvc builds i would put it at around 30-50%
Added per-xexmodule caching of information per instruction, can be used to remember what code needs compiling at start up
Record what guest addresses wrote mmio and backpropagate that to future runs, eliminating dependence on exception trapping. this makes many games like h3 actually tolerable to run under a debugger
fixed a number of errors where temporaries were being passed by reference/pointer
Can now be compiled with clang-cl 14.0.1, requires -Werror off though and some other solution/project changes.
Added macros wrapping compiler extensions like noinline, forceinline, __expect, and cold.
Removed the "global lock" in guest code completely. It does not properly emulate the behavior of mfmsrd/mtmsr and it seriously cripples amd cpus. Removing this yielded around a 3x speedup in Halo Reach for me.
Disabled the microprofiler for now. The microprofiler has a huge performance cost associated with it. Developers can re-enable it in the base/profiling header if they really need it
Disable the trace writer in release builds. despite just returning after checking if the file was open the trace functions were consuming about 0.60% cpu time total
Add IsValidReg, GetRegisterInfo is a huge (about 45k) branching function and using that to check if a register was valid consumed a significant chunk of time
Optimized RingBuffer::ReadAndSwap and RingBuffer::read_count. This gave us the largest overall boost in performance. The memcpies were unnecessary and one of them was always a no-op
Added simplification rules for multiplicative patterns like (x+x), (x<<1)+x
For the most frequently called win32 functions i added code to call their underlying NT implementations, which lets us skip a lot of MS code we don't care about/isnt relevant to our usecases
^this can be toggled off in the platform_win header
handle indirect call true with constant function pointer, was occurring in h3
lookup host format swizzle in denser array
by default, don't check if a gpu register is unknown, instead just check if its out of range. controlled by a cvar
^looking up whether its known or not took approx 0.3% cpu time
Changed some things in /cpu to make the project UNITYBUILD friendly
The timer thread was spinning way too much and consuming a ton of cpu, changed it to use a blocking wait instead
tagged some conditions as XE_UNLIKELY/LIKELY based on profiler feedback (will only affect clang builds)
Shifted around some code in CommandProcessor::WriteRegister based on how frequently it was executed
added support for docdecaduple precision floating point so that we can represent our performance gains numerically
tons of other stuff im probably forgetting
2022-08-13 12:59:00 -07:00
Triang3l
326e718035 [CPU] MMIO: Arm64, load register writes + exception cleanup 2022-07-06 21:05:05 +03:00
gibbed
a48bb71c2f Overhaul logging. 2020-04-07 16:09:41 -05:00
Triang3l
8ec813de82 [Memory, D3D12] Various refactoring from data provider development 2020-02-15 21:35:24 +03:00
Triang3l
741b5ae2ec [Memory] Add HostToGuestVirtual and use it in a couple of places 2019-08-13 23:49:49 +03:00
Triang3l
f1b9e1afce [CPU] Remove unused access violation handler variables 2019-08-13 00:06:29 +03:00
Triang3l
d20c2fa9da [Memory/Vulkan] Move old memory watches to the Vulkan backend 2019-08-03 21:06:59 +03:00
Triang3l
4aceeb73c4 [Memory] Move new watches to heap-aware Memory from MMIOHandler 2019-07-30 08:00:20 +03:00
Triang3l
9427667a27 [D3D12] Experimental 2x resolution scale 2018-12-06 10:38:13 +03:00
Triang3l
da280347c4 Merge branch 'master' into d3d12 2018-11-22 21:01:05 +03:00
Margen67
896ac4a682 Update documentation.
- Convert http to https, provide archive link when possible.
- Made CPU-JIT.png more readable on dark themes;
Added a white background so there isn't black text on a black
background.
2018-11-22 09:20:09 -06:00
Triang3l
6e36101b42 [D3D12] Experimental write watch implementation for shared memory 2018-09-24 23:18:16 +03:00
Triang3l
db625892ea [D3D12] Shared memory typo fix and improvements 2018-08-01 01:09:51 +03:00
Triang3l
4f7edff19d [D3D12] SHM: Watches prototype, some uploading 2018-07-26 22:52:26 +03:00
DrChat
a1677d34e1 [CPU] MMIOHandler IsRangeWatched now returns true if the entire range is watched. 2018-02-09 19:23:24 -06:00
DrChat
7da973d9e6 [CPU] Handle cases in access watches where base addresses overlap 2018-02-09 17:21:35 -06:00
DrChat
aaf281351d Format all code with new clang-format 2017-12-14 20:44:43 -06:00
Dr. Chat
c4b728b121 MMIO Handler: Don't allow more than one watch to occupy the same region (fire old watches if a new one overlaps) 2017-03-11 20:55:01 -06:00
Dr. Chat
0e3c113375 Physical write watches -> access watches (read and/or write watching) 2016-03-17 21:55:16 -05:00
Dr. Chat
529227e4e6 MMIOHandler::InvalidateRange 2015-11-08 18:18:28 -06:00
Dr. Chat
430d4c7182 Fix rare deadlock in the MMIO handler. 2015-11-05 18:13:15 -06:00
Dr. Chat
55e811450d Lint 2015-10-22 20:22:34 -05:00
Dr. Chat
407d79cf3e Fix MMIO handler race condition by rechecking page access protections under the global lock. 2015-10-22 20:18:08 -05:00
Ben Vanik
5d033f9cb3 A new debugger.
Lots of bugs/rough edges/etc - issues will be filed.
Old-style debugging still works (just use --emit_source_annotations to get
the helpful movs back and --break_on_instruction will still fire).
2015-09-20 21:31:05 -07:00
Dr. Chat
a2bc0443f2 Quick-kill the MMIO handler if the fault address is above the mapping range. 2015-09-07 21:26:33 -05:00
Ben Vanik
3c96b6fa0a DANGER DANGER. Switching to global critical region.
This changes almost all locks held by guest threads to use a single global
critical region. This emulates the behavior on the PPC of disabling
interrupts (by calls like KeRaiseIrqlToDpcLevel or masking interrupts),
and prevents deadlocks from occuring when threads are suspended or
otherwise blocked.
This has performance implications and a pass is needed to ensure the
locking is as granular as possible. It could also break everything
because it's fundamentally unsound. We'll see.
2015-09-06 09:30:54 -07:00
Ben Vanik
5e08889d93 More style cleanup. 2015-08-06 20:17:01 -07:00
Ben Vanik
ec326119cf Replacing beaengine in mmio handler with custom decoder.
Fixes #358.
2015-08-04 08:25:42 -07:00
Ben Vanik
91d7acf59e Fixing some particularly bad /W4. 2015-07-18 23:04:21 -07:00
Ben Vanik
58c3a1ba79 VirtualProtect platform abstraction. 2015-07-15 18:20:05 -07:00
Ben Vanik
40621a90bd Switching to standard mutex for now (but keeping xe::mutex). 2015-07-13 21:49:32 -07:00
Ben Vanik
d335555277 Manually page align address range for write watch. 2015-06-23 17:37:09 -07:00
Ben Vanik
40a6a12800 Attempting to inline a lot of MMIO operations. Works for GPU stuff mainly. 2015-06-02 20:15:43 -07:00
Ben Vanik
8bfc43bb0d Trying to do MMIO protects on allocation granularity. 2015-05-18 20:47:41 -07:00
Ben Vanik
147a70b9c1 Rewriting memory manager. 2015-05-17 00:16:56 +01:00
Ben Vanik
0c646f4bc2 Prevent some stack overflows in MMIO handler. 2015-05-09 00:53:28 -07:00
Ben Vanik
e3220f7ae6 Code cleanup: moving poly/ into xenia/base/ 2015-05-02 03:42:51 -07:00
Ben Vanik
99816056be Code cleanup: removing poly.h 2015-05-02 02:29:26 -07:00
Ben Vanik
f9a3f0c48e Fix broken VirtualProtect reset on ClearWriteWatch. 2015-02-02 23:07:17 -08:00
Ben Vanik
00e4a4fe1b Fix #include format. 2015-01-31 22:49:47 -08:00
Ben Vanik
0529fdb84d Basic hacky write watching for texture invalidation. Doesn't scale. 2015-01-04 16:28:42 -08:00
Ben Vanik
4ad7662ef7 Fixing MMIO build on Windows. 2014-08-01 20:29:57 -07:00
Ben Vanik
0129a96225 Cross-platformizing MMIO stuff.
MSVC build likely needs some fixes.
2014-07-29 22:12:39 -07:00