Commit Graph

13257 Commits

Author SHA1 Message Date
degasus
5205d7baa6 ogl: fix rasterfont 2014-07-31 19:03:18 +02:00
Lioncash
c5188c76b3 Merge pull request #705 from Sonicadvance1/fix-memoryutil-check
Fixes a check for what mmap returns.
2014-07-31 03:06:00 -04:00
Lioncash
5bb9a74759 Merge pull request #527 from delroth/flags-opt
[RFC] PowerPC flags emulation optimization
2014-07-31 02:51:48 -04:00
Ryan Houdek
33450c80c3 Fixes a check for what mmap returns.
On error mmap returns MAP_FAILED(-1) not null.
FreeBSD was checking the return correctly, Linux was not.
This was noticed by triad attempting to run Dolphin under valgrind and not getting a memory space under the 2GB limit(Because -1 wraps around on
unsigned obviously)
2014-07-31 00:53:00 -05:00
Ryan Houdek
fda2190a37 Support the 64bit CR flags in the ARM JIT. 2014-07-30 21:41:18 -07:00
Ryan Houdek
3627bd21f1 Remove JitArmIL files from the project.
Due to how the new CR-flags work, it isn't possible without some hefty work in the JITIL backend to support this on 32bit systems.
2014-07-30 21:41:17 -07:00
magumagu
f27940478d JitIL: Attempt to constant-fold more aggressively. 2014-07-30 21:41:17 -07:00
magumagu
79ecdf5fd0 JitIL: Misc small optimizations. 2014-07-30 21:41:17 -07:00
magumagu
c8dd557dde JITIL: compare instruction folding. 2014-07-30 21:41:17 -07:00
magumagu
5bb428c685 JITIL: optimize branches. 2014-07-30 21:41:17 -07:00
magumagu
79cc000d62 JITIL: Optimize compare instruction. 2014-07-30 21:41:17 -07:00
magumagu
1429fccb97 Initial unoptimized JITIL flag optimization. 2014-07-30 21:41:17 -07:00
Pierre Bourdon
5506e57ab8 CR: Replace some magic values with constants. 2014-07-30 21:41:17 -07:00
Pierre Bourdon
0ff1481494 Optimize PPC CR emulation by using magic 64 bit values
PowerPC has a 32 bit CR register, which is used to store flags for results of
computations. Most instructions have an optional bit that tells the CPU whether
the flags should be updated. This 32 bit register actually contains 8 sets of 4
flags: Summary Overflow (SO), Equals (EQ), Greater Than (GT), Less Than (LT).
These 8 sets are usually called CR0-CR7 and accessed independently. In the most
common operations, the flags are computed from the result of the operation in
the following fashion:
  * EQ is set iff result == 0
  * LT is set iff result < 0
  * GT is set iff result > 0
  * (Dolphin does not emulate SO)

While X86 architectures have a similar concept of flags, it is very difficult
to access the FLAGS register directly to translate its value to an equivalent
PowerPC value. With the current Dolphin implementation, updating a PPC CR
register requires CPU branching, which has a few performance issues: it uses
space in the BTB, and in the worst case (!GT, !LT, EQ) requires 2 branches not
taken.

After some brainstorming on IRC about how this could be improved, calc84maniac
figured out a neat trick that makes common CR operations way more efficient to
JIT on 64 bit X86 architectures. It relies on emulating each CRn bitfield with
a 64 bit register internally, whose value is the result of the operation from
which flags are updated, sign extended to 64 bits. Then, checking if a CR bit
is set can be done in the following way:
  * EQ is set iff LOWER_32_BITS(cr_64b_val) == 0
  * GT is set iff (s64)cr_64b_val > 0
  * LT is set iff bit 62 of cr_64b_val is set

To take a few examples, if the result of an operation is:
  * -1 (0xFFFFFFFFFFFFFFFF) -> lower 32 bits not 0       => !EQ
                            -> (s64)val (-1) is not > 0  => !GT
                            -> bit 62 is set             =>  LT
            !EQ, !GT, LT

  *  0 (0x0000000000000000) -> lower 32 bits are 0       =>  EQ
                            -> (s64)val (0) is not > 0   => !GT
                            -> bit 62 is not set         => !LT
            EQ, !GT, !LT

  *  1 (0x0000000000000001) -> lower 32 bits not 0       => !EQ
                            -> (s64)val (1) is > 0       =>  GT
                            -> bit 62 is not set         => !LT
            !EQ, GT, !LT

Sometimes we need to convert PPC CR values to these 64 bit values. The
following convention is used in this case:
  * Bit 0 (LSB) is set iff !EQ
  * Bit 62 is set iff LT
  * Bit 63 is set iff !GT
  * Bit 32 always set to disambiguize between EQ and GT

Some more examples:
  * !EQ, GT, LT -> 0x4000000100000001 (!B63, B62, B32, B0)
                -> lower 32 bits not 0          => !EQ
                -> (s64)val is > 0              =>  GT
                -> bit 62 is set                =>  LT
  * EQ, GT, !LT -> 0x0000000100000000
                -> lower 32 bits are 0          =>  EQ
                -> (s64)val is > 0 (note: B32)  =>  GT
                -> bit 62 is not set            => !LT
2014-07-30 21:41:17 -07:00
Lioncash
f507827399 Merge pull request #681 from phire/non-sse4_1
Fix PPC_FP on non-sse4.1 code paths.
2014-07-31 00:31:02 -04:00
Scott Mansell
8c857b45f8 Fix PPC_FP on non-sse4.1 code paths.
The Invalid bit on the x87 fpu is sticky, so once a single NaN goes
through the old code on CPUs without sse4.1 all future floats are
mutilated.

Patch to emulate PTEST by Fiora.

Fixes issue 7237 and issue 7510.
2014-07-31 16:00:27 +12:00
Pierre Bourdon
83838a645f Merge pull request #690 from Armada651/d3dfullscreen_fixes
Exclusive fullscreen fixes
2014-07-30 16:28:56 -07:00
Pierre Bourdon
9b9817f927 x64Emitter: Fix REX encoding for SETcc
Previously using the new "lower 8 bits" registers (SIL, SPL, ...) caused SETcc
to write to other registers (for example, SETcc SIL would generate SETcc DH).
2014-07-30 06:41:29 -07:00
Jules Blok
3b5625c76b VideoConfig: Ignore Borderless Fullscreen setting when the backend does not support exclusive fullscreen.
This was expected to be handled by VerifyValidity(), but that only verifies the validity of the INI files.
2014-07-30 12:15:58 +02:00
Jules Blok
5bbd34637b CFrame: Don't check the video config fullscreen setting.
Checking this flag could sometimes incorrectly have the UI assume fullscreen is already off when we're still exiting.
2014-07-30 12:15:32 +02:00
Jules Blok
4501aeefbe CFrame: Check borderless fullscreen setting before enabling exclusive fullscreen in the video config.
Fixes a bug where "Use Fullscreen" would initialize into exclusive fullscreen regardless of the borderless fullscreen setting.

Also relieves the need for the video renderer to check the borderless fullscreen setting each time.
2014-07-30 12:15:26 +02:00
Matthew Parlane
5516b0382c Merge pull request #699 from lioncash/enum
Core: Use an enum for the Gekko exception flags instead of defines
2014-07-30 13:53:58 +12:00
Matthew Parlane
a3ca3b0424 Merge pull request #696 from lioncash/more-forward-decls
Convert some more header inclusions into forward declarations
2014-07-30 13:53:48 +12:00
Lioncash
ad3ade1510 Core: Use an enum for the Gekko exception flags instead of defines 2014-07-29 21:51:30 -04:00
Pierre Bourdon
4b66c6c65a Merge pull request #698 from lioncash/missed-workaround
Really get rid of the MSVC 2005 workaround completely
2014-07-29 18:23:04 -07:00
Lioncash
b03c12764d Really get rid of the MSVC 2005 workaround completely 2014-07-29 21:20:43 -04:00
Ryan Houdek
91647f5944 Merge pull request #697 from lioncash/unused-android
Android: Remove an unused variable from MainAndroid.cpp
2014-07-29 20:08:06 -05:00
Lioncash
abc7845e0c Android: Remove an unused variable from MainAndroid.cpp 2014-07-29 21:05:57 -04:00
Lioncash
522a5c35ad Convert some more header inclusions into forward declarations 2014-07-29 20:55:07 -04:00
Pierre Bourdon
c0e8d9879a Merge pull request #678 from lioncash/overflow
Fix a possible overflow in EXI_DeviceIPL.
2014-07-29 16:42:58 -07:00
Pierre Bourdon
f6fe299c31 Merge pull request #694 from lioncash/interp-defines
Core: Remove defines used to work around an MSVC 2005 bug
2014-07-29 16:39:05 -07:00
Lioncash
412196a055 Core: Remove defines used to work around an MSVC 2005 bug 2014-07-29 19:33:08 -04:00
Pierre Bourdon
8ff3cf1838 Merge pull request #684 from lioncash/forward-decls
Core: Turn some includes into forward declarations.
2014-07-28 20:50:27 -07:00
Pierre Bourdon
062bce8b7e Merge pull request #659 from Parlane/classic_controller_fix2
Classic controller fix
2014-07-28 20:34:00 -07:00
Pierre Bourdon
9f86d3efcf Merge pull request #689 from Shadoxfix/master
Update framelimit tooltip text because the Audio option has been removed...
2014-07-28 10:28:23 -07:00
Oussama Danba
313a743cee Update framelimit tooltip text because the Audio option has been removed. 2014-07-28 19:08:43 +02:00
Tony Wasserka
3fb829ca73 Merge pull request #589 from LPFaint99/gcifolder-fifo
Gcifolder use correct region for fifologs
2014-07-28 14:44:01 +02:00
Tony Wasserka
9c7d4b6408 Merge pull request #667 from RachelBryk/remove-audio-limit
Remove audio frame limit.
2014-07-28 14:38:35 +02:00
Matthew Parlane
3554a15180 Merge pull request #680 from lioncash/fakepoll-removal
Remove fakepoll.h
2014-07-28 21:06:37 +12:00
Matthew Parlane
86db0040b7 Merge pull request #682 from lioncash/style-oversight
Fix a style guide oversight
2014-07-28 11:39:01 +12:00
Lioncash
e225e3679a Merge pull request #685 from lioncash/invalid-reg
Core: Use the enum constant for an invalid reg in JitRegCache
2014-07-27 19:37:43 -04:00
Lioncash
0bb84a1f65 Core: Use the enum constant for an invalid reg in JitRegCache 2014-07-27 19:29:52 -04:00
Lioncash
eb3a1de3f6 Core: Turn some includes into forward declarations. 2014-07-27 13:37:09 -04:00
Tony Wasserka
83c2c99a8c Merge pull request #605 from neobrain/mmio_cleanup
MMIO: Cleanup Mapping class by using templates instead of macros.
2014-07-27 19:27:21 +02:00
Tony Wasserka
38c8a4efb2 MMIO: Cleanup Mapping class by using templates instead of macros. 2014-07-27 19:23:19 +02:00
Lioncash
2791f6053e Clarify the preferred prefix form to be within loops in the style guide 2014-07-27 07:45:34 -04:00
Lioncash
adf3543a57 Fix a style guide oversight
Fixes an oversight which says to not use mult-line comments.
2014-07-27 06:25:51 -04:00
Lioncash
4fa71dd59e Remove fakepoll.h.
It was only used for Windows XP and lower.

This also bumps the _WIN32_WINNT define in the stdafx precompiled headers to set the minimum version as Windows Vista.
2014-07-26 22:53:40 -04:00
Lioncash
0b8a6f852b Core: Use character literals within EXI_DeviceIPL 2014-07-26 19:07:19 -04:00
Lioncash
70ba8cfbc2 Core: Fix a possible overflow in EXI_DeviceIPL
m_szBuffer has a size of 256, but addressable range is 0 - 255
2014-07-26 19:06:23 -04:00