Commit Graph

1758 Commits

Author SHA1 Message Date
c12418788a Merge pull request #5963 from JMC47/mtmsrfix
Fix JIT64 mtmsr issue after PIE support.
2017-08-22 22:12:13 +02:00
f7b133b39a Fix JIT64 mtmsr - PIE support caused the codesize
to get bigger, breaking an optimization.  This forces the emitter to use a
32bit pointer instead of an 8bit one, fixing the issue at the expense of
efficiency.
2017-08-22 06:44:38 -04:00
b00c60618b JitArm64: Fix rlwinmx.
Seems like I was wrong that ANDI2R doesn't require a temporary register here.
There is *one* case when the mask won't fit in the ARM AND instruction:
mask = 0xFFFFFFFF
But let's just use MOV instead of AND here for this case...
2017-08-22 08:47:43 +02:00
5aed9a67ef Merge pull request #5904 from leoetlino/indirect-include
PowerPC: Fix indirect includes for GDBStub
2017-08-20 19:59:53 -04:00
93b5a5369b SymbolDB: Blank stripped symbol name fixed 2017-08-16 04:07:19 +01:00
06da1973a8 Merge pull request #5919 from degasus/arm
JitArm64: Small performance optimizations.
2017-08-14 00:01:27 +02:00
d791e5d3a8 JitArm64: Use the updated wrappers.
They are faster, no need to use the slow path in the CPU.
2017-08-12 00:00:41 +02:00
5ee7f86199 JitArm64: Optimize rlwinmx.
The new code adds fast paths for most usages which fits in one
instruction with one cycle latency.
2017-08-12 00:00:41 +02:00
ec5cfd2aae JitArm64: Update CR helpers to reflect their usage.
This helpers are not for general CR calculation, they are just for the
common case of the sign extended result of integer instructions if the
rc bit is set.
They must not be used by other instructions like cmp, so there is no
need to be as flexible.
2017-08-11 21:17:13 +02:00
7d4c14feba JitArm64: Fix and improve the cmpXX instructions. 2017-08-11 21:17:13 +02:00
b89e4b5258 Interpreter: Fix cmpi.
cmpi shall compare two signed 32 bit values. The used difference a-b
may overflow and so the resulting 32 bit value can't represent it.
A correct way would be cr = s64(a) - s64(b) and it should be done in
this way in the JITs, but the Interpreter shall implement the most
readable way.

Also drops the now unused helper function.
2017-08-11 17:35:22 +02:00
e10e42c09e PowerPC: Fix indirect includes for GDBStub 2017-08-08 17:47:20 +08:00
f6c21e002b General: Remove unnecessary semicolons 2017-07-30 16:39:53 -04:00
f106a9637d Replace balanced Core::PauseAndLock calls with RunAsCPUThread
Core::PauseAndLock requires all calls to it to be balanced, like this:

    const bool was_unpaused = Core::PauseAndLock(true);
    // do stuff on the CPU thread
    Core::PauseAndLock(false, was_unpaused);

Aside from being a bit cumbersome, it turns out all callers really
don't need to know about was_unpaused at all. They just need to do
something on the CPU thread safely, including locking/unlocking.

So this commit replaces Core::PauseAndLock with a function that
makes both the purpose and the scope of what is being run on the
CPU thread visually clear. This makes it harder to accidentally run
something on the wrong thread, or forget the second call to
PauseAndLock to unpause, or forget that it needs to be passed
was_unpaused at the end.

We also don't need comments to indicate code X is being run on the
CPU thread anymore, as the function name makes it obvious.
2017-07-21 16:45:59 +08:00
e66e034419 Fix some GCC ODR warnings
struct GekkoOPTemplate was implemented differently in different
compilation units, which breaks the ODR and could end up causing issues
as symbols exported from one compilation unit could end up being used by
another even if they have different implementations.

This puts them in an anonymous namespace, restricting any generated
symbols to the single compilation unit.
2017-06-29 12:21:32 -07:00
56158ca176 Replace MMU mask tests with dedicated function.
The efficient function (that is nearly the same as
https://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2)
replaces one loop based instance (which also reused the xx variable
afterwards, whereas it should have used htabmask instead) and one
instance using the population count a.k.a. Hamming weigth.
2017-06-22 20:22:53 +02:00
9a2bef97da JitCache: use SymbolDB names as JIT block names 2017-06-18 06:58:44 +01:00
dd4203bec8 Core: Remove unnecessary includes
Also moves a cpp file's related header file to the top of the inclusions if it isn't already there.
2017-06-15 18:52:22 -04:00
cf94ce6305 Add a namespace to OpenFStream
For consistency with the other functions in FileUtil.h.
2017-06-15 21:34:04 +02:00
f09ceaa735 Move IOFile to a separate file
Reduces the number of files that need to be recompiled
when making changes to FileUtil.h.
2017-06-15 21:33:50 +02:00
50f34f8b05 jit64: silence signedness comparison warnings 2017-06-07 20:09:44 -07:00
ef9090d7da powerpc: silence an int->u32 init warning 2017-06-07 20:09:43 -07:00
a97d079138 jit64: quiet variable init warnings 2017-06-07 20:09:43 -07:00
f730b775b6 quiet warnings about possibly-uninitialized variable usage 2017-06-07 19:52:07 -07:00
e1a3e41bf3 fix various instances of -1 being assigned to unsigned types 2017-06-07 19:52:07 -07:00
b676edd80c Core: include what you use
Eliminates a swath of indirectly included standard headers
2017-06-07 01:20:48 -04:00
096399d371 quick UB fix for 3c0bdd74 2017-06-06 03:49:01 -07:00
7702771d61 Interpreter: simplify srawx/srawix
This also avoids -Wint-in-bool-context warnings in GCC 7.
2017-06-06 11:05:33 +01:00
5d6074f157 Merge pull request #5366 from sepalani/set-sym-size
CodeView: Set Symbol Size/End Address added
2017-06-03 19:00:45 +02:00
3443454ba2 Merge pull request #5271 from JosJuice/allow-aslr
Allow (but don't force) ASLR
2017-06-02 21:53:02 -07:00
933767f1bd Merge pull request #5475 from sepalani/map-vaddr
PPCSymbolDB: Fix LoadMap corrupting virtual addresses
2017-05-26 10:21:38 +02:00
82695ccd99 PPCSymbolDB: Fix LoadMap corrupting virtual addresses 2017-05-24 21:08:15 +01:00
98b6446249 Merge pull request #5459 from sepalani/code
PPCSymbolDB: Split SaveMap function
2017-05-24 13:59:28 +02:00
4870e4119b Merge pull request #5435 from sepalani/add-function
PPCSymbolDB: Remove biased address check
2017-05-23 14:39:36 +02:00
c3bab0b0e7 SignatureDB: Remove unnecessary header 2017-05-21 17:39:44 -04:00
bbe1e643fb SignatureDB: in-class initialize DBFunc members 2017-05-21 17:39:42 -04:00
d0089191e1 SignatureDB: default the format handler destructor 2017-05-21 17:39:41 -04:00
5301efddd0 SignatureDB: Remove unnecessary qualifiers and virtual keywords 2017-05-21 17:39:40 -04:00
3c94962332 SignatureDB: Move two functions into the cpp file
These are implementation details.
2017-05-21 17:39:34 -04:00
56f2d523dd PPCSymbolDB: Split SaveMap function
Rewrite the code map file generation
2017-05-21 01:00:36 +01:00
4b4cf509f8 Remove code for only allocating low memory
This is unnecessary when we have position-independent code.
2017-05-20 09:35:53 +02:00
256a0cf4db Remove JITIL 2017-05-19 22:21:07 +02:00
e0231d0b30 PPCSymbolDB: Remove biased address check
The appropriate check is already done by PPCAnalyst::AnalyzeFunction.
2017-05-17 19:37:27 +01:00
aa65ca4b6b PPCAnalyst: Use the proper RAM check 2017-05-17 02:10:26 +01:00
198d686a41 MEGASignatureDB: Add missing override specifiers 2017-05-14 16:20:45 -04:00
40c243df28 PPCAnalyst: Fix off by one instruction 2017-05-07 04:56:16 +01:00
93ba6aa9f2 PPCAnalyst: Function calls without link added 2017-05-07 04:55:36 +01:00
95d0a48759 PPCAnalyst: EvaluateBranchTarget improved 2017-05-07 04:55:36 +01:00
7f552581e7 CodeView: Set Symbol Size added 2017-05-06 13:18:00 +01:00
90d551e0d1 JitArm64: Drop ps_res.
The accuracy doesn't match ppc, and worse, it doesn't set the error flags if the input is zero.

Lets stop to ship broken instructions, so right now, the interpreter is the closest one.
2017-05-03 23:48:14 +02:00