Commit Graph

1980 Commits

Author SHA1 Message Date
Tillmann Karras 3daa6ab259 x64Emitter: fix MOVLPD/MOVHPD
These instructions were using the wrong prefix which turned
MOVLPD(reg, mem) into MOVDDUP(reg, mem) and made the rest of them
invalid.
2015-01-07 11:23:52 +01:00
Dolphin Bot 89b7f1057f Merge pull request #1804 from FioraAeterna/fastermmu2_master
MMU: various improvements, bugfixes, optimizations
2015-01-07 00:49:58 +01:00
Markus Wick d8d4c94e07 Merge pull request #1819 from Tilka/cmake
CMake: simplify some expressions
2015-01-06 09:27:59 +01:00
Fiora 53b44ccb3a x64ABI: enhance MOVTwo to take an offset
This lets us merge displacements into MOVTwo in trampolines.
2015-01-05 10:45:58 -08:00
Fiora 8a6ea918b6 GekkoDisassembler: fix display of CRs in branch operations 2015-01-03 19:53:55 -08:00
Tillmann Karras 6bcdb10eee CMake: simplify some expressions 2015-01-03 13:17:57 +01:00
Ryan Houdek 479d1e56c3 Merge pull request #1783 from degasus/disablelogs
OGL: disable driver warnings fetch
2015-01-01 14:12:02 -06:00
degasus c6dd5044d6 VideoCommon: make hash independet from hires textures 2014-12-29 10:24:27 +01:00
Markus Wick c5a0b6bf50 Merge pull request #1432 from randomstuff/linux-perf
Add Linux perf JIT support (/tmp/perf-$pid.map)
2014-12-28 23:12:52 +01:00
degasus 1ed41672f5 OGL: disable driver warnings fetch
This did give a decent slowdown on some drivers.
2014-12-28 22:31:24 +01:00
Ryan Houdek 47b67fe527 Merge pull request #1744 from Buddybenj/google-code
Update Outdated Google Code References
2014-12-21 20:55:56 -06:00
Benjamin Przybocki fba3c48ec4 Update Outdated Google Code References 2014-12-20 21:17:51 -06:00
Ryan Houdek d3c2e8fb0a [AArch64] Improvements to the AArch64 emitter.
Fixes issues with negative offsets in loadstore instructions.
Adds ADRP/ADR instructions.
Optimizes MOVI2R function to take advantage of ADRP on pointers, can change a 3 instruction operation down to one.
Adds GPR push/pop operations for ABI related things.
2014-12-20 19:35:52 -06:00
Pierre Bourdon dad7911214 Merge pull request #1486 from rohit-n/goto
Remove some gotos.
2014-12-20 16:47:55 +01:00
Rachel Bryk 6a2973ac1d Fix hires texture path. 2014-12-11 19:24:16 -05:00
Tillmann Karras 6e928d08a0 Jit64: clean up casts in memory operands 2014-12-07 20:23:27 +01:00
Ryan Houdek 4e98078daf Merge pull request #1658 from lioncash/locale
Common: Remove locale based functions from CommonFuncs.
2014-12-07 01:12:00 -06:00
Tillmann Karras 986d19b9d5 x64Emitter: fix bitwise AVX opcodes
The reason this didn't break is that bitwise instructions like VPAND,
VANDPS, and VANDPD do the exact same thing. The only difference is the
data type they are intended for.
2014-12-06 22:28:03 +01:00
Lioncash 9bcadc8029 Common: Remove locale based functions from CommonFuncs.
Since %f isn't used anymore in the shader generators, these can go.
2014-12-05 20:55:29 -05:00
Rohit Nirmal e7ddaf86f5 Fix building with PCH disabled. 2014-12-03 22:01:12 -06:00
skidau 7bc78827ed Merge pull request #1574 from degasus/profiler
Common: Add a built-in profiler
2014-12-04 13:22:31 +11:00
Ryan Houdek 2c39d4044d [AArch64] Add loadstore paired emitter instructions. 2014-12-02 21:08:34 -06:00
degasus 94d9d138d9 Common: Add a built-in profiler 2014-12-03 00:50:41 +01:00
Rohit Nirmal a53c5217bb Common: Remove goto in MemArena. 2014-12-01 11:47:37 -06:00
Rohit Nirmal e3abad234c Common: Remove gotos in FileUtil, and replace FILE*s with IOFile/ifstreams. 2014-12-01 11:47:36 -06:00
Ryan Houdek 414e36d8c9 Merge pull request #1258 from FioraAeterna/avoidfmulround
JIT: optimize single-precision ops based on knowledge of their inputs
2014-11-30 15:47:34 -06:00
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
Lioncash b06ec302d1 Remove some unnecessary semicolons 2014-09-11 13:05:31 -04:00
Fiora 5726e0cdfb JIT: use XCHG in MOVTwo
Roughly the same speed or slightly faster depending on CPU; mostly just cleaner
since we don't have to pass in a temp.
2014-09-10 22:17:38 -07:00
Ryan Houdek 44baab30cf Include a missing include in the ARM emitter's common code. 2014-09-10 20:39:19 -05:00
Ryan Houdek 24f6c98a55 Add sign extending aliases to the ARM64Emitter. 2014-09-10 17:52:54 -05:00
Ryan Houdek 71cb09f1ca Merge pull request #1027 from rohit-n/change-include
Include CommonTypes.h instead of Common.h.
2014-09-10 00:35:16 -05:00
Ryan Houdek 09c1ad1631 Merge pull request #753 from FioraAeterna/integeropts
JIT64: various integer optimizations
2014-09-09 04:10:30 -05:00
Ryan Houdek f09cb723c5 Merge pull request #1044 from lioncash/pedantry
Common: Fix code styling in Arm64Emitter
2014-09-08 23:29:19 -05:00
Ryan Houdek af732dea39 Merge pull request #1043 from lioncash/unused
Common: Remove unused variable in MemoryMap_Setup
2014-09-08 22:46:04 -05:00
Lioncash bc331ee809 Common: Fix code styling in Arm64Emitter 2014-09-08 23:39:20 -04:00
Ryan Houdek ed476c997c Fix Generic build from AArch64 merge.
I had missed this file and hadn't tested the branch on my new build system.
2014-09-08 22:24:23 -05:00
Fiora 94c20db369 Rename Log2 and add IsPow2 to MathUtils for future use
Also remove unused pow2/pow2f functions.
2014-09-08 20:15:45 -07:00
skidau 0926f1d344 Merge pull request #897 from Sonicadvance1/AArch64-jit
Initial AArch64 JIT
2014-09-09 12:34:58 +10:00
Lioncash 22800dc711 Common: Remove unused variable in MemoryMap_Setup 2014-09-08 21:44:03 -04:00
Rohit Nirmal fbc64984ca Include CommonTypes.h instead of Common.h. 2014-09-08 15:39:58 -04:00
comex 7fb6628789 Merge pull request #1024 from comex/abi-cleanup
ABI cleanup
2014-09-08 01:03:36 -04:00
comex 4dc090643d Remove ABI_AlignStack/ABI_RestoreStack and the noProlog option to ABI_CallFunctionRR.
The latter being true was the only case where the former would do
anything, and it was never true.  They became obsolete with x86's
removal.
2014-09-08 01:00:10 -04:00
comex c5c0b36046 Remove the inaccurately named ABI_PushAllCalleeSavedRegsAndAdjustStack (it didn't preserve FPRs!) and replace with ABI_PushRegistersAndAdjustStack.
To avoid FPRs being pushed unnecessarily, I checked the uses: DSPEmitter
doesn't use FPRs, and VertexLoader doesn't use anything but RAX, so I
specified the register list accordingly.  The regular JIT, however, does
use FPRs, and as far as I can tell, it was incorrect not to save them in
the outer routine.  Since the dispatcher loop is only exited when
pausing or stopping, this should have no noticeable performance impact.
2014-09-08 01:00:10 -04:00
comex 2dafbfb3ef Improve code and clarify parameters to ABI_Push/PopRegistersAndAdjustStack.
- Factor common work into a helper function.
- Replace confusingly named "noProlog" with "rsp_alignment".  Now that
x86 is not supported, we can just specify it explicitly as 8 for
clarity.
- Add the option to include more frame size, which I'll need later.
- Revert a change by magumagu in March which replaced MOVAPD with MOVUPD
on account of 32-bit Windows, since it's no longer supported.  True,
apparently recent processors don't execute the former any faster if the
pointer is, in fact, aligned, but there's no point using MOVUPD for
something that's guaranteed to be aligned...

(I discovered that GenFrsqrte and GenFres were incorrectly passing false
to noProlog - they were, in fact, functions without prologs, the
original meaning of the parameter - which caused the previous change to
break.  This is now fixed.)
2014-09-08 00:58:56 -04:00
Lioncash a38093729e Common: Inline declare some loop variables in ArmEmitter 2014-09-07 00:26:26 -04:00
Ryan Houdek 2b06257e16 Beginning of the AArch64 JIT branch.
This is the bare minimum required to run a few games on AArch64.
Was able to run starfield and Animal Crossing to the Nintendo logo.
QEmu emulation is literally the slowest thing in the world, it maxes out at around 12mhz on my Core i7-4930MX.
2014-09-06 20:14:52 -05:00
Ryan Houdek f107b5e176 [AArch64-emitter] Initial work on a emitter for 64bit ARM.
I've tested a few instruction encodings and am expecting most to work as long as one stays away from VFP/SIMD.
This implements mostly instructions to bring up an initial JIT with integer support.
This can be improved to allow ease of use functions in the future, dealing with the raw imms/immr encodings is probably the worst thing ever.
2014-09-06 20:13:44 -05:00
shuffle2 9302218a19 Merge pull request #851 from lioncash/logg
Common: Kill off duplicate log warning definitions
2014-09-06 12:35:19 -07:00
Ryan Houdek 01b90c1007 Fix ArmEmitter's asserts from failing to compile.
Changed them all from debug asserts to regular asserts, since they shouldn't only be run at debug time.
2014-09-06 15:11:39 -04:00
Lioncash 690ed8580c Common: Kill off duplicate log warning definitions
Also embed the log checks rather than using macros
2014-09-06 15:11:29 -04:00
shuffle2 85fd8c2bec Merge pull request #983 from lioncash/lol-str
Common: Fix a potential infinite loop in ReplaceAll
2014-09-06 12:00:23 -07:00
shuffle2 1b23432d34 Merge pull request #990 from rohit-n/fix-formatting
Fix formatting
2014-09-06 11:54:17 -07:00
comex 6c382f6627 Merge pull request #926 from comex/ppcstate-reg
PowerPCState register (and rationalize register usage, and add some registers to replace it)
2014-09-06 13:24:38 -04:00
comex 6fd0333c14 Symbolicize explicit uses of x86 registers where possible (GPRs only for now).
Uses are split into three categories:

- Arbitrary (except for size savings) - constants like RSCRATCH are
used.

- ABI (i.e. RAX as return value) - ABI_RETURN is used.

- Fixed by architecture (RCX shifts, RDX/RAX for some instructions) -
explicit register is kept.

In theory this allows the assignments to be modified easily.  I verified
that I was able to run Melee with all the registers changed, although
there may be issues if RSCRATCH[2] and ABI_PARAM{1,2} conflict.
2014-09-06 13:18:31 -04:00
comex 67cdb6e07a Factor code from ABI_CallFunctionRR and GetWriteTrampoline into a helper, and fix a special case.
The special case is where the registers are actually to be swapped (i.e.
func(ABI_PARAM2, ABI_PARAM1); this was previously impossible but would
be ugly not to handle anyway.
2014-09-06 13:16:20 -04:00
Lioncash 1d66b1d3f4 Common: Remove HAVE_CXX11_SYNTAX define from Common.h
All the compilers we support have C++11 support now, so this isn't needed.
2014-09-06 11:32:19 -04:00
Rohit Nirmal 629ceaf2b1 Split some parts of UpdateBoundingBox into multiple lines. Also,
fix issues causing failure on Lint.
2014-09-06 09:49:27 -05:00
Rohit Nirmal 1ecb318bcc Fix some formatting (new lines on collapsed single-line conditionals,
new lines for opening braces).
2014-09-06 01:23:05 -05:00
lioncash 3e0c04a83e Common: Fix a potential infinite loop in ReplaceAll
Prior to this change, it was possible to cause an infinite loop by making the string to be replaced and the replacing string the same thing.

e.g.

std::string some_str = "test";
ReplaceAll(some_str, "test", "test");

This also changes the replacing in a way that doesn't require starting from the beginning of the string on each replacement iteration.
2014-09-05 15:12:17 -04:00
Fiora 07e0c917c6 Revert "JIT64: optimize CA calculations" 2014-09-05 10:26:30 -07:00
comex 97420c6ec6 Merge pull request #852 from FioraAeterna/optimizeca
JIT64: optimize CA calculations
2014-09-05 11:52:02 -04:00
comex aa1df21bb6 Merge pull request #947 from FioraAeterna/rsqrte
JIT: implement frsqte
2014-09-05 11:48:00 -04:00
Lioncash 6369173981 DolphinWX: Simplify wiki link construction 2014-09-04 21:30:33 -04:00
lioncash bd91e8b0c8 Common: Remove unused header from Thread.cpp
This define isn't even used in the Windows builds.
2014-09-04 09:15:18 -04:00
Rachel Bryk 345b608d64 Change IniFile::Section::Set() with default value to use a template. 2014-09-04 03:29:49 -04:00
shuffle2 4fcb633df5 Merge pull request #961 from RachelBryk/logs
Read the config file before enabling logs.
2014-09-03 17:20:11 -07:00
Rachel Bryk 22d2c7d053 Read the config file before enabling logs. 2014-09-03 19:50:02 -04:00
shuffle2 05cd06539b Merge pull request #960 from lioncash/preproc-stuff
Common: Make TITLEID_SYSMENU a static const variable in NandPaths.h
2014-09-03 15:22:32 -07:00
lioncash a687cc556b Common: Make TITLEID_SYSMENU a static const variable in NandPaths.h 2014-09-03 18:03:23 -04:00
Fiora 1b50f9df14 JIT: implement fres
Mostly a straightforward translation of the interpreter code, with a few
tricksy optimizations and fallbacks for rare paths.
2014-09-03 12:15:30 -07:00
Fiora c72a133206 JIT: implement frsqrte
Mostly a straightforward translation of the interpreter code, with a few
tricksy optimizations and fallbacks for rare paths.
2014-09-03 11:21:04 -07:00
Dolphin Bot e1248599eb Merge pull request #868 from FioraAeterna/bmi
x64Emitter: add BMI1/BMI2 support
2014-09-03 19:24:27 +02:00
lioncash f69e6ef16f Common: Remove unnecessary define check in Log2 2014-09-03 13:04:48 -04:00
Fiora 5088a2b4e2 x64Emitter: add BMI1/BMI2 support
TZCNT and LZCNT use a completely different encoding scheme, so they should
probably go in a separate patch.

Also add some tests.
2014-09-03 10:04:01 -07:00
shuffle2 db84a22109 Merge pull request #770 from lioncash/panic
Core: Fix case where a panic alert wouldn't be shown in MemoryUtil.cpp
2014-09-03 00:10:12 -07:00
comex 64575d565a Merge pull request #923 from FioraAeterna/fixcallersave
JIT: Fix caller-save registers on WIN64
2014-09-03 02:27:44 -04:00
shuffle2 532b7bb7da Merge pull request #893 from rohitnirmal/scan-build-fixes
Scan build fixes
2014-09-02 23:15:18 -07:00
Fiora 9e4419e786 x64Emitter: add support for shorter EAX forms of instructions
Should save a few bytes of code size here and there.
2014-09-02 21:52:41 -07:00
Fiora 6655c7775e JIT: Fix callee-save registers on WIN64 2014-09-02 10:56:14 -07:00
Pierre Bourdon e72146d19c x64Emitter: Do not assert-fail on redundant MOVs, instead show an error log 2014-09-02 10:17:32 +02:00
Pierre Bourdon a79ced2fc2 x64Emitter: Make it clear for both SSE to int conv that X64 regs are expected 2014-09-02 09:55:47 +02:00
Pierre Bourdon c428c5999f x64Emitter: UNPCKLPS/HPS are now tested 2014-09-02 09:53:00 +02:00
Pierre Bourdon cc0b048c0b x64Emitter: Support FLD/FSTP with 80 bits operands 2014-09-02 09:52:59 +02:00
Pierre Bourdon f99f302c91 x64Emitter: assert instead of crashing when generating MOVZX with a wrong size 2014-09-02 09:52:04 +02:00
Pierre Bourdon b1738b60fc x64Emitter: Fix MUL with AH/BH/CH/DH registers. 2014-09-02 09:52:04 +02:00
Pierre Bourdon f0e8b1fda8 x64Emitter: Error out on 8 bits CMOV, and emit 16 bits CMOV properly 2014-09-02 09:52:04 +02:00
Pierre Bourdon d4ec9737bd x64Emitter: Assert when using an invalid POP instead of generating an INT3 2014-09-02 09:52:04 +02:00
Pierre Bourdon 9c4daac3a4 x64Emitter: RDTSC now without a typo'd name 2014-09-02 09:52:04 +02:00
Pierre Bourdon 88af225070 x64Emitter: Remove a declared function that is never implemented 2014-09-02 09:52:04 +02:00
Pierre Bourdon 5941653d47 Merge pull request #920 from shuffle2/msvc-gtest
Provide a way to build and run unittests on Windows
2014-09-02 07:40:49 +02:00
Pierre Bourdon 9b10d36a85 Merge pull request #938 from lioncash/statics
Common: Make the LUTs in ColorUtil static
2014-09-02 07:36:17 +02:00
Lioncash 824a0a19f1 Common: Make the LUTs in ColorUtil static 2014-09-02 00:52:13 -04:00
Shawn Hoffman 839cace5ff msvc: get UnitTests compiling
Choose it from VS or pass /p:RunUnitTests=true to msbuild
2014-09-01 21:27:45 -07:00
Shawn Hoffman 266992684d msvc: remove some remnants of SDL and DSound from projects and general cleanup. 2014-09-01 21:27:44 -07:00
Fiora b51aa4fa89 Rename Log2 and add IsPow2 to MathUtils for future use
Also remove unused pow2/pow2f functions.
2014-09-01 20:41:07 -07:00
Lioncash ec9fc6bfc1 Common: Remove unnecessary "using namespace Gen;" from x64emitter 2014-09-01 23:10:56 -04:00
Lioncash ba4934b75e Common: Clean up brace placements 2014-08-30 18:06:35 -04:00
Lioncash 1d706b2311 Get rid of C-style empty function parameter indicators 2014-08-30 15:23:48 -04:00
comex 683191b6c6 Merge pull request #892 from comex/oh-the-abstraction
Optimize PointerWrap.
2014-08-28 17:28:16 -04:00
comex faa2666393 PointerWrap currently checks its mode for every individual byte of everything it 'does', including all of RAM. Make it not do that.
Decreases total Wii state save time (not counting compression) from
~570ms to ~18ms.

The compiler can't remove this check because of potential aliasing; this
might be fixable (e.g. by making mode const), but there is no reason to
have the code work in such a braindead way in the first place.

- DoVoid now uses memcpy.
- DoArray now uses DoVoid on the whole rather than Doing each element
(would fail for an array of STL structures, but we don't have any of
those).
- Do also now uses DoVoid.  (In the previous version, it replicated
DoVoid's code in order to ensure each type gets its own implementation,
which for small types then becomes a simple load/store in any modern
compiler.  Now DoVoid is __forceinline, which addresses that issue and
shouldn't make a big difference otherwise - perhaps a few extra copies
of the code inlined into DoArray or whatever.)
2014-08-28 15:35:19 -04:00