Commit Graph

133 Commits

Author SHA1 Message Date
chss95cs@gmail.com
7a17fad88a fix crash from precompiling out of range funcs, add xexcache version, increment xexcache version (all priors are version 0 thanks to 0 initialization) 2022-11-07 05:40:18 -08: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
Gliniak
1d00372e6b Merge branch 'master' of https://github.com/xenia-project/xenia into canary_experimental 2022-07-10 10:50:39 +02:00
Triang3l
88c055eb30 [CPU] Null backend enough for GPU trace viewing 2022-07-06 23:28:06 +03:00
Triang3l
326e718035 [CPU] MMIO: Arm64, load register writes + exception cleanup 2022-07-06 21:05:05 +03:00
Triang3l
d51fafd07c [Base] Linux Arm64 exception handler 2022-07-05 20:46:49 +03:00
Gliniak
84e5b159c3 Do not store obsolete info about deleted threads 2022-05-22 13:11:21 +02:00
Gliniak
75f0dfd6f3 Merge remote-tracking branch 'GliniakRepo/deleteFunctionsFromUnloadedModule' into canary_pr 2022-05-19 10:18:18 +02:00
Wunkolo
1a8068b151 [Base] Add user-literals for several memory sizes
Rather than using `n * 1024 * 1024`, this adds a convenient `_MiB`/`_KiB` user-literal to the new `literals.h` header to concisely describe units of memory in a much more readable way. Any other useful literals can be added to this header. These literals exist in the `xe::literals` namespace so they are opt-in, similar to `std::chrono` literals, and require a `using namespace xe::literals` statement to utilize it within the current scope.

I've done a pass through the codebase to replace trivial instances of `1024 * 1024 * ...` expressions being used but avoided anything that added additional casting complexity from `size_t` to `uint32_t` and such to keep this commit concise.
2022-01-02 11:51:31 -06:00
Gliniak
371441ec3a [XModule] Remove module and its functions while unloading 2021-12-27 09:18:44 +01:00
Joel Linn
a86d7173e1 Refactor FourCC magic uses
- Use new fourcc_t type
- Improves compiler compatibility by removing multi chars
2021-06-02 22:28:43 -05:00
gibbed
1513dd235b [Kernel] Code reentrance for guest fibers.
[Kernel] Code reentrance using exceptions for guest fibers.
2020-12-05 14:17:33 -06:00
gibbed
a48bb71c2f Overhaul logging. 2020-04-07 16:09:41 -05:00
gibbed
5bf0b34445 C++17ification.
C++17ification!

- Filesystem interaction now uses std::filesystem::path.
- Usage of const char*, std::string have been changed to
  std::string_view where appropriate.
- Usage of printf-style functions changed to use fmt.
2020-04-07 16:09:41 -05:00
Jonathan Goyvaerts
c1af632562 Replace all gflag implementations with cvar implementations 2019-08-03 02:34:07 +02:00
DrChat
d43e2c7ff8 xenia-cpu-ppc-tests is now building on linux 2017-02-10 23:54:10 -06:00
Dr. Chat
4c55039c22 Remove xenia-cpu dependency on xenia-kernel 2017-02-06 21:57:18 -06:00
Dr. Chat
a148b965f1 KernelState should handle module launching 2016-10-24 11:01:10 -05:00
Ben Vanik
06ba273492 Warn and be ok with symbol services failing. 2016-02-21 14:26:16 -08:00
Ben Vanik
6777ce6668 Reconcile debugger and save state stuff into a single implementation.
Fixes #497 and fixes #496.
Still rough edges, but at least less duplication.
2016-01-18 11:48:21 -08:00
sephiroth99
9451c0b1cf Fix different types in std::min arguments 2015-12-30 17:42:18 -05:00
Ben Vanik
948aa2400d Formatting all code. Too gnarly to rebase properly. 2015-12-29 13:13:34 -08:00
Dr. Chat
0f82e0d090 Make the processor automatically generate any ungenerated functions when installing a breakpoint. 2015-12-29 13:09:37 -08:00
Dr. Chat
ce2d6da2a1 Processor breakpoints: Change iterators to C++11 syntax where necessary 2015-12-29 13:09:35 -08:00
Dr. Chat
38a09cbcc2 ExecuteRaw: Pass in 0xBC... magic so Xenia will return to the guest caller. 2015-12-29 12:35:57 -08:00
Dr. Chat
42c657c40a Remove processor dependency on XThread for breakpoints 2015-12-29 12:32:47 -08:00
Dr. Chat
41d5b41523 Automatically install any CPU breakpoints in any newly-defined functions if necessary. 2015-12-29 12:32:01 -08:00
Dr. Chat
28468f8a18 cpu::Processor now tracks a pointer to the emulator. 2015-12-29 12:32:00 -08:00
Dr. Chat
7d59258839 Processor::ExecuteRaw
Changed the breakpoint lock to a recursive mutex.
2015-12-29 12:28:57 -08:00
Dr. Chat
e383e2f101 Processor breakpoint support 2015-12-29 12:28:56 -08:00
Ben Vanik
15816327b4 Renaming xe::cpu::frontend to xe::cpu::ppc. 2015-12-14 21:17:55 -08:00
Ben Vanik
4af6c41740 Moving profiling.h to base - UI could be separated for cleanliness. 2015-11-07 12:31:07 -08:00
Dr. Chat
c33e95981b Formatting. 2015-09-25 18:46:50 -05:00
Dr. Chat
a9b557e8b9 Allow passing of >7 arguments through Processor::Execute
Set entry status to failed if LookupFunction failed
2015-09-25 18:24:12 -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
f5e374f9b5 Changing the way the global lock works. Some things are better, I think.
Regressions are likely.
2015-09-01 09:45:32 -07:00
Ben Vanik
5e08889d93 More style cleanup. 2015-08-06 20:17:01 -07:00
Ben Vanik
eaa1a8ee3a Refactoring SymbolInfo/FunctionInfo/Function into Symbol/Function. 2015-08-05 21:50:02 -07:00
Ben Vanik
b0425f7ee2 Moving source map to Function. 2015-08-01 14:07:13 -07:00
Ben Vanik
e657276996 Mostly working stack walking (besides issue #372). 2015-07-29 00:15:52 -07:00
Ben Vanik
d01abd4694 Starting debugger rework, adding base async socket, removing flatbuffers. 2015-07-22 00:01:36 -07:00
Ben Vanik
91d7acf59e Fixing some particularly bad /W4. 2015-07-18 23:04:21 -07:00
Ben Vanik
ecd4af10c9 Fixing some clang warnings/errors. 2015-07-15 23:26:58 -07:00
Ben Vanik
8c69a4df09 Cleaning up apu/ and renaming -private files to _flags.
Part of #296.
2015-06-27 11:25:56 -07:00
Ben Vanik
dbcdc5b543 Function lookup is slow - replacing with a faster test. 2015-06-08 23:44:38 -07:00
Ben Vanik
9c3d2b54fb Cleanup before kernel export refactor. 2015-05-31 16:31:19 -07:00
Ben Vanik
41cee3d337 Switching vsync to custom thread. 2015-05-25 21:12:27 -07:00
Ben Vanik
f5a2b85d42 Switching to xe::mutex. 2015-05-25 00:52:21 -07:00
Ben Vanik
576d6492dc Basic debugger networking. 2015-05-25 00:51:22 -07:00
Ben Vanik
ad72c193a6 Fixing stack traces, making lr BC... to diff from stack scribble BE... 2015-05-20 23:28:34 -07:00