Commit graph

1854 commits

Author SHA1 Message Date
Ryan Houdek
c27ee21dd9 [AArch64] Workaround builtin byteswap bug.
The builtin byteswap routines cause critical failure on AArch64 when built with the Android toolchain.
I didn't experience this issue when building for Linux using a local qemu chroot.
Seems to be only an issue with the Android toolchain when building AArch64.
Use our generic version instead.
2014-11-30 01:23:03 -06:00
Fiora
72c96c20d3 JIT: more optimizing of float ops based on known input characteristics
If the inputs are both float singles, and the top half is known to be identical
to the bottom half, we can use packed arithmetic instead of scalar to skip
the movddup.

This is slower on a few rather old CPUs, plus the Atom+Silvermont, so detect
Atom and disable it in that case.

Also avoid PPC_FP on stores if we know that the output came from a float op.
2014-11-29 11:33:11 -08:00
Ryan Houdek
ce059769f6 Merge pull request #1439 from Armada651/ogl-stereo-3d
OGL: Stereoscopic 3D Support
2014-11-28 11:45:38 -06:00
Lioncash
e9b09a4c9f Arm(64)Emitter: Make some variables static 2014-11-25 23:27:48 -05:00
comex
245ff601b7 Merge pull request #1552 from waddlesplash/dolphin-qt
DolphinQt: GameList!
2014-11-25 00:24:32 -05:00
Gabriel Corona
5b9aeaa686 Use CLI argument for Linux perf JIT support 2014-11-24 23:30:29 +01:00
Gabriel Corona
9722ae2a5d Move the JIT registration logic in its own file
Move the JITed function/basic-block registration logic out of the CPU
subsystem in order to add JIT registration to JITed DSP and
Video/VertexLoader code.

This necessary in order to add /tmp/perf-$pid.map support to other
JITed code as they need to write to the same file.
2014-11-24 23:18:18 +01:00
Rohit Nirmal
4d931c16ad Silence a few "zero as null pointer" warnings. 2014-11-24 12:36:46 -06:00
Jules Blok
f6ea293027 VertexShaderManager: Compute stereoscopy projection matrices. 2014-11-23 14:23:41 +01:00
Augustin Cavalier
1e17bbce0f DolphinQt: GameList! 2014-11-21 18:36:49 -05:00
Ryan Houdek
b24197f913 Adds MCR/MRC to the ARMv7 emitter. 2014-11-16 09:29:27 +00:00
Stevoisiak
b25e1a2eb4 Various formatting and consistency fixes 2014-11-13 22:42:18 -05:00
Fiora
6603f98d04 JIT: add 64-bit write support to FIFO functions
Also fix 64-bit values passed to CallAC and otherwise correct immediate
handling in FIFO writes.
Fixes 007 Nightfire.
2014-11-09 21:24:30 -08:00
Lioncash
f6b4b4dbba Merge pull request #1497 from lioncash/host
Host: Kill off Host_SysMessage
2014-11-06 20:41:53 -05:00
Lioncash
d79c794e8c Merge pull request #1490 from rohit-n/initialize
Common: Fix -Wmaybe-uninitialized warning.
2014-11-06 20:37:32 -05:00
Lioncash
884ec2ed13 Host: Kill off Host_SysMessage
Equivalent facilities already exist.
2014-11-05 02:30:48 -05:00
Rohit Nirmal
f361ef1eb3 Common: Fix -Wmaybe-uninitialized warning. 2014-11-03 21:38:42 -06:00
comex
9cba787871 Merge pull request #1408 from randomstuff/perf
Profiling: measure time on non-Windows/POSIX using clock_gettime
2014-11-03 22:36:32 -05:00
Jasper St. Pierre
e290a3d39c MemArena: Fix the launching of non-Wii games
When we cleaned up the code to calculate the shm_position and total_mem
in one step, we sometimes skipped over certain views because they were
Wii-only. When looking at the total memory, we'd look at the last field,
whether or not it was skipped. Since Wii-only fields are the last view,
this meant that the shm_position was 0, since it was skipped, causing us
to map a 0-sized field. Fix this by explicitly returning the total size
from MemoryMap_InitializeViews.

Additionally, the shm_position was being calculated incorrectly because
it was adding up the shm_position *before* the mirror, rather than after
it. Fix this by adopting a scheme similar to what we had before.
2014-11-03 11:08:59 -08:00
Jasper St. Pierre
f660789254 MemArena: Merge the initialization code with the size calculation code
To make mistakes like in the previous commit less prevalent in the future.
2014-11-02 19:59:14 -08:00
Jasper St. Pierre
5e5ed07b41 MemArena: Fix the calculation of position in SHM
The code to calculate the offsets into the SHM file wasn't properly
respecting the skip flags, causing it to calculate offsets beyond
the end of the SHM file.
2014-11-02 19:25:42 -08:00
Jasper St. Pierre
64540bc60d MemArena: Fix a memory leak caused by pointer confusion
This code was ported from out_ptr, which was a double-pointer, and
wanted to double-check that the proper arena was actually allocated.

When I ported it to store the pointer directly in the view regardless
of whether out_ptr was non-NULL, I got confused here and instead
caused the code to only free the arena if the first byte was non-zero.
2014-11-02 19:25:42 -08:00
Jasper St. Pierre
1e93b0db19 MemArena: Rename GrabLowMemSpace to GrabSHMSegment
This code originally tried to map the "low space" for the Gamecube's
memory layout, but since has expanded to mapping all of the easily
mappable memory on the system. Change the name to "GrabSHMSegment" to
indicate that we're looking for a shared memory segment we can map into
our process space.
2014-11-02 16:51:27 -08:00
Jasper St. Pierre
079b881d20 MemArena: Clean up the code that does the mirroring 2014-11-02 16:51:26 -08:00
Jasper St. Pierre
6813473367 MemArena: Remove the low mappings for our pointers
These are effectively unused, since the memmap already maps them in one
place. For 32-bit, they might have some slight advantage, but we already
special-case the regular "high-mem" pointer for 32-bit, so just use the
one we already have...
2014-11-02 16:50:36 -08:00
Jasper St. Pierre
4a59750b30 MemArena: Bail on Arch64 if the out_ptr allocation fails 2014-11-02 16:34:17 -08:00
Jasper St. Pierre
48aff73b6a MemArena: Remove duplicated code
I can't find any obvious difference between these two paths.
2014-11-02 16:34:17 -08:00
Gabriel Corona
641e820257 Profiling: measure time on POSIX systems using clock_gettime 2014-11-03 00:07:12 +01:00
Tillmann Karras
033f2a7e93 x64ABI: get rid of some duplicate code 2014-11-02 02:00:47 +01:00
Rohit Nirmal
a09afe8821 Fix build failing with PCH disabled. 2014-10-29 13:00:48 -04:00
comex
089e32ba7d Merge pull request #1307 from comex/bitset
Higher level bitset wrapper
2014-10-28 23:39:35 -04:00
Jasper St. Pierre
d9a1fc1564 BreakPoints: Fix compile warning 2014-10-28 12:22:30 -07:00
skidau
1630b0c684 Merge pull request #1291 from skidau/debugger-step-out
Dolphin debugger enhancements
2014-10-28 12:53:22 +11:00
Ryan Houdek
043bd710a0 Merge pull request #1394 from Sonicadvance1/fix-arm-cpudetect
Fixes ARM CPU detection routine for the hardware.
2014-10-27 05:07:24 -06:00
skidau
4570dd7eeb Fixed a crash that would occur if a new watch were added by entering a watch name.
Code style updates.
2014-10-26 23:23:45 +11:00
skidau
73dca1ca33 Added a new option to add memchecks from the Watch window.
Fixed watch labels from being truncated at the first whitespace.
2014-10-26 16:14:17 +11:00
skidau
b73130af77 Added Load/Save function for the Watch window.
Made the floating windows toolbars dockable.
Scaled down the breakpoint toolbar icons to 16x16.
2014-10-26 14:56:03 +11:00
skidau
b34e220086 Added a "Delete watch" context menu to the Watch window.
Added a "View memory" command to the context menu.
2014-10-26 14:56:03 +11:00
skidau
613cae613a Added a RAM Watch window to the debugger
Conflicts:
	Source/Core/Core/HW/Memmap.cpp
	Source/Core/Core/HW/Memmap.h
	Source/Core/DolphinWX/Debugger/CodeWindow.h
2014-10-26 14:56:02 +11:00
skidau
df37649b9f Changed the step over routine to a single stepping version that steps until a blr is encountered.
Cleared out all temporary breakpoints on each step to prevent phantom breakpoints from stopping the debugger.
2014-10-26 14:56:02 +11:00
comex
5f21683343 Merge pull request #1388 from waddlesplash/dolphin-qt
DolphinQt: About dialog fixes, SystemInfo dialog
2014-10-25 21:20:02 -04:00
comex
f51c233a08 Add workaround for OS X symbol clash and AllOnes helper method. 2014-10-25 16:57:25 -04:00
comex
eb7f4dac50 Convert registersInUse to BitSet. 2014-10-25 16:57:25 -04:00
comex
b6a7438053 Add BitSet and, as a test, convert some JitRegCache stuff to it.
This is a higher level, more concise wrapper for bitsets which supports
efficiently counting and iterating over set bits.  It's similar to
std::bitset, but the latter does not support efficient iteration (and at
least in libc++, the count algorithm is subpar, not that it really
matters).  The converted uses include both bitsets and, notably,
considerably less efficient regular arrays (for in/out registers in
PPCAnalyst).

Unfortunately, this may slightly pessimize unoptimized builds.
2014-10-25 16:56:51 -04:00
comex
4b0c6d8e0f Merge pull request #1385 from lioncash/bitfield
BitField: Fix a typo in the sample usage.
2014-10-25 16:48:31 -04:00
Ryan Houdek
3ac2d8e1f1 Revert "Removes ARMv7 specific byteswap routines from CommonFuncs.h" 2014-10-25 15:28:04 -05:00
Ryan Houdek
b66a7f83c2 Fixes ARM CPU detection routine for the hardware.
We weren't dropping a newline character from the string, we were cutting off the last character of the hardware name.
This fixes my TK1 being called 'lagun' when it's name is 'laguna'
2014-10-25 09:14:14 -05:00
skidau
8598d6bc2b Merge pull request #1364 from RachelBryk/titles
Read game title from ini file, or titles.txt if it exists.
2014-10-25 13:33:26 +11:00
Ryan Houdek
6483f8d45c Removes ARMv7 specific byteswap routines from CommonFuncs.h
GCC has optimized this using the exact same code since 4.7 or 4.8.
Android building falls back to the __linux__ route.
No need to keep these around anymore since we aren't building on an old GCC version.
2014-10-24 16:21:54 -05:00
Augustin Cavalier
51700a2b68 Fix the brand/cpu_string reversal.
Before this commit, the two were reversed ("cpu_string" had the brand, e.g. "AuthenticAMD"; and "brand_string" had the CPU type, e.g. "AMD Phenom II X4 925").
2014-10-24 16:09:21 -04:00
Lioncash
c0c835d0b6 BitField: Fix a typo in the sample usage. 2014-10-24 13:33:02 -04:00
skidau
716fe06289 Merge pull request #1349 from comex/good-job-dereferencing-null-on-purpose
Fix some warnings from Clang trunk in an overly aggressive manner
2014-10-24 13:03:09 +11:00
comex
00c6ec97a6 Merge pull request #1347 from comex/header-hygiene
Add missing includes where headers depend on other headers having been included first.
2014-10-22 23:23:58 -04:00
Rachel Bryk
b1e14a65a2 Read game title from ini file, or titles.txt if it exists. 2014-10-22 22:19:40 -04:00
comex
6e774f1b64 Add missing includes where headers depend on other headers having been included first.
This is good hygiene, and also happens to be required to build Dolphin
using Clang modules.

(Under this setup, each header file becomes a module, and each #include
is automatically translated to a module import.  Recursive includes
still leak through (by default), but modules are compiled independently,
and can't depend on defines or types having previously been set up.  The
main reason to retrofit it onto Dolphin is compilation performance - no
more textual includes whatsoever, rather than putting a few blessed
common headers into a PCH.  Unfortunately, I found multiple Clang bugs
while trying to build Dolphin this way, so it's not ready yet, but I can
start with this prerequisite.)
2014-10-21 21:22:16 -04:00
comex
06433652be Improve some libcdio CoreFoundation code.
I found it via clang complaining about a useless null check on an array,
but I decided to get rid of the array in favor of dynamic allocation, as
there was no reason to assume a maximum length of 0x32 bytes.  Plus, add
a CFString type check just in case, and switch to UTF-8 in the
off-chance it matters.

The result has not actually been tested, as I have no CD drive.
2014-10-21 21:20:11 -04:00
Ryan Houdek
2e94814441 Changes from ARMv6 NOP to ARMv7 NOP.
Dolphin doesn't support ARMv6. Get this out of here.
2014-10-21 14:17:07 +00:00
skidau
e8da34ef25 Merge pull request #1320 from FioraAeterna/hash64bitcrc
Use CRC to output 64 bits instead of 32
2014-10-20 14:50:21 +11:00
Lioncash
3782be15a3 Merge pull request #1309 from Stevoisiak/spellingFix
Minor spelling fix
2014-10-18 22:40:41 -04:00
Fiora
d2e004fa9e Use CRC to output 64 bits instead of 32
A bit hacky, but should dramatically reduce the odds of hash collision.
2014-10-18 00:24:35 -07:00
Fiora
15a4bccb73 Hash: unroll CRC loop, since CRC32 typically has nontrivial latency
Seems to be about 20-30% faster texture cache hashing on my machine.
2014-10-17 15:39:08 -07:00
Stevoisiak
ed5e698511 Minor spelling fix 2014-10-17 15:51:19 -04:00
skidau
9ddbdeb39f Merge pull request #995 from FioraAeterna/fma
Add FMA support to emitter and use it in the JIT
2014-10-12 13:56:18 +11:00
Henrik Rydgård
877081c7df Be consistent with braces. 2014-10-10 22:34:03 +02:00
Henrik Rydgård
9bca1a00d7 x64 emitter: Add some more missing ops (MOVDQA, MOVDQU, PSHUFHW)
Also constify some pointers.
2014-10-10 18:30:05 +02:00
Henrik Rydgård
a2c46665c5 x64 emitter: Add a few missing instructions 2014-10-10 18:30:04 +02:00
Fiora
019657cd93 X64Emitter: add FMA3 support 2014-10-07 18:21:07 -07:00
skidau
b3b34d16e6 Merge pull request #1218 from hthh/trampolinecaching
JIT: reuse trampolines when possible
2014-10-07 13:26:23 +11:00
skidau
8fdf43109f Merge pull request #1216 from FioraAeterna/movoptimizations
Add more AVX support, refactor emitter, reduce redundant XMM moves
2014-10-07 13:25:28 +11:00
hthh
c7208318fb JIT: Reuse trampolines when possible 2014-10-05 15:03:11 +11:00
Fiora
7a2dd3a3c6 x64Emitter: refactor, add some new AVX instructions 2014-10-03 10:05:10 -07:00
Fiora
85547d94be JIT: properly remove FIFO write addresses when code is invalidated
Fixes a bug caused by interaction with carry optimizations; might fix other
issues too.
2014-09-30 01:00:23 -07:00
comex
a9b4016cd3 Merge pull request #1166 from FioraAeterna/flaglocking
JIT+Emitter: support locking flags
2014-09-30 02:57:53 -04:00
comex
2eebdff01b Remove useless STACKALIGN macro.
It only ever did anything on 32-bit OS X.

Anyway, it wasn't even on the right functions, and these days
ABI_PushRegistersAndAdjustStack should handle maintaining the ABI
correctly.
2014-09-30 01:42:47 -04:00
Fiora
c102fed36a GekkoDisassembler: show W and I in psq_l/psq_st disassembly 2014-09-28 17:01:35 -07:00
Fiora
ac1fc9ad03 JIT+Emitter: support locking flags
This helps us avoid accidentally clobbering flags between two instructions
when the flags are expected to be maintained. Dolphin will of course crash
immediately, but at least it will crash loudly and alert us of the mistake,
instead of forcing hours of bisecting to find the subtle way in which the JIT
has managed to sneak a flag-modifying instruction where there shouldn't be one.
2014-09-26 20:47:06 -07:00
comex
fb3d9c9d58 Fix warning in x64CPUDetect.cpp in generic build by not building it. 2014-09-25 18:48:00 -04:00
Rohit Nirmal
3168361e32 Android: Silence some more warnings. 2014-09-22 17:45:42 -04:00
Ryan Houdek
9206dd016e Merge pull request #1135 from FioraAeterna/twidisasmfix
Disassembler: fix disassembly of some twi instructions
2014-09-21 14:19:05 -05:00
Fiora
9c4407fb80 Disassembler: fix disassembly of some twi instructions 2014-09-21 08:17:41 -07:00
Tony Wasserka
6d4fd54683 ChunkFile: Add a DoArray overload which takes an std::array.
This is inconsistent with how other containers are used (i.e. with Do()), but making std::array be used with Do() seems rather confusing when there's also a DoArray available.
2014-09-21 10:38:22 +02:00
Ryan Houdek
eb23882398 Merge pull request #1120 from rohit-n/muh-precompiled-headers
Fix build failing when disabling precompiled headers.
2014-09-19 17:43:42 -05:00
Rohit Nirmal
46057db37d Fix build failing when disabling precompiled headers. 2014-09-19 18:17:51 -04:00
Ryan Houdek
522d7eb275 Merge pull request #1109 from FioraAeterna/ps_cmp
JIT: add ps_cmp0/ps_cmp1/ps_res/ps_rsqrte
2014-09-19 14:41:05 -05:00
Fiora
3c49200b22 X64Emitter: add MOVHLPS/MOVLHPS 2014-09-18 17:57:27 -07:00
Ryan Houdek
7608e3f11e Add AArch64 emitter aliases for MOV and MVN. 2014-09-18 16:30:40 -05:00
comex
7ad9027593 Be pedantic about stack overflow on Linux and OS X.
Add some magic to the fault handler to handle stack overflow due to BLR
optimization, and disable the optimization if fastmem is not enabled.
2014-09-17 20:08:09 -04:00
Fiora
d3dee1d7ed GekkoDisassembler: fix some float opcodes 2014-09-16 02:06:40 -07:00
skidau
8361d2b1da Merge pull request #805 from FioraAeterna/storerefactor
JIT: support immediate stores
2014-09-16 13:31:39 +10:00
Dolphin Bot
bef2016909 Merge pull request #1091 from FioraAeterna/fixdisasm
GekkoDisassembler: fix/improve disassembly for a few instructions
2014-09-16 03:53:18 +02:00
Fiora
7368c2ee9e GekkoDisassembler: fix/improve disassembly for a few instructions 2014-09-15 18:48:54 -07:00
Fiora
d02b7c7755 JIT: support immediate stores 2014-09-15 07:25:32 -07:00
Fiora
02dce5dbbf x64Emitter: fix silent failure if WriteNormalOp is passed two memory operands
Should now fail loudly and clearly instead.
2014-09-15 07:08:08 -07:00
Ryan Houdek
4e7f284a81 Merge pull request #1064 from Sonicadvance1/AArch64-Fix-MOVI2R
Fix AArch64 MOVI2R helper function.
2014-09-14 09:26:02 -05:00
Fiora
997c5c2d0e x64Emitter: add LZCNT/TZCNT support and detection
Also add a unit test.
2014-09-14 05:31:22 -07:00
Pierre Bourdon
439068acae Merge pull request #1055 from FioraAeterna/smallermov
X64Emitter: support shorter mov reg, imm opcodes
2014-09-14 01:57:36 +02:00
Lioncash
a92003c1ab ARM64: Make getters within ArithOption const. 2014-09-12 20:55:26 -04:00
Ryan Houdek
17d31ecd6c Fix AArch64 MOVI2R helper function.
In the case of a zero immediate, it wouldn't generate code at all.
Also in the case of max u32/u64, use ORN to optimize it.
2014-09-12 05:45:10 -05:00
Ryan Houdek
5061a33c29 Merge pull request #1051 from Sonicadvance1/ARM-Common
Include a missing include in the ARM emitter's common code.
2014-09-11 21:12:21 -05:00
Fiora
18d83a310e X64Emitter: support shorter mov reg, imm opcodes
Also refactor WriteNormalOp a little bit and add comments.
2014-09-11 11:40:30 -07:00