Commit Graph

59 Commits

Author SHA1 Message Date
Scott Mansell 75815b9b0d Added a comment to document an issue with the codegen. 2015-01-24 16:08:26 +13:00
Tillmann Karras e80b657cf4 Move MOVBE wrappers directly into XEmitter class 2015-01-18 13:29:34 +01:00
Tillmann Karras eb13aa43fe XEmitter: overload MOVBE() 2015-01-18 12:59:33 +01:00
Tillmann Karras 1efa9b8b72 x64Emitter: add MOVLPS/MOVHPS 2015-01-07 11:23:52 +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
Tillmann Karras 6e928d08a0 Jit64: clean up casts in memory operands 2014-12-07 20:23:27 +01: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
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
comex eb7f4dac50 Convert registersInUse to BitSet. 2014-10-25 16:57:25 -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 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
Fiora 7a2dd3a3c6 x64Emitter: refactor, add some new AVX instructions 2014-10-03 10:05:10 -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
Fiora 3c49200b22 X64Emitter: add MOVHLPS/MOVLHPS 2014-09-18 17:57:27 -07: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 997c5c2d0e x64Emitter: add LZCNT/TZCNT support and detection
Also add a unit test.
2014-09-14 05:31:22 -07: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
Rohit Nirmal fbc64984ca Include CommonTypes.h instead of Common.h. 2014-09-08 15:39:58 -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 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
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
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
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 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
Lioncash ba4934b75e Common: Clean up brace placements 2014-08-30 18:06:35 -04:00
Fiora f9d4ff0d5d x64Emitter: add support for some missing CVT instructions 2014-08-27 20:15:42 -07:00
Tillmann Karras 80be585fef x64Emitter: remove redundant "Gen::" 2014-08-20 02:56:07 +02:00
Tillmann Karras a363f4fa3e x64Emitter: make 'packed' parameter a bool 2014-08-20 02:54:30 +02:00
Fiora 802b28daf9 x64Emitter: refactor to support longer opcodes
Also add some new SSE4 opcodes.
2014-08-17 04:48:17 -07:00
Ryan Houdek 0c24e1dcf2 Remove the rest of x86_32 support from Common. 2014-08-03 13:49:46 -05:00
Tillmann Karras 6df48ed432 x64Emitter: add CVTTPD2DQ 2014-07-15 23:53:56 +02:00
Tillmann Karras f8280401f6 x64Emitter: J_CC: use 32 bit offset automatically 2014-06-03 23:08:58 +02:00
Tillmann Karras e659f5ac58 JitBackpatch: fix NOP padding
The new NOP emitter breaks when called with a negative count. As it
turns out, it did happen when deoptimizing 8 bit MOVs because they are
only 4 bytes long and need no BSWAP.
2014-04-30 15:26:11 +02:00
Tillmann Karras 957649b7af Optimize NOPs 2014-04-23 21:15:09 +02:00
Pierre Bourdon b2597739ff x64Emitter: Add the MOVBE instruction. 2014-04-11 23:33:21 +02:00
Ryan Houdek 87d106d65c Remove dumb CodeBlock duplication in the emitters.
Fixes issue 6990.
This uses a bit of templating to remove the duplicate code that is the CodeBlocks in each emitter headers.
No actual functionality change in this.
2014-04-09 13:53:43 -05:00
Pierre Bourdon 664c8d30a0 Remove all trailing whitespaces from our codebase. 2014-03-29 11:05:44 +01:00
Tillmann Karras d802d39281 clang-modernize -use-nullptr
and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
2014-03-09 21:14:26 +01:00
Pierre Bourdon edba8096bf x64Emitter: Add functions to call a C++ std::function from JITed code 2014-03-08 23:32:43 +01:00
Pierre Bourdon 9869c53859 x64ABI: Add two more CallFunction functions (for additional parameter types). 2014-03-08 23:32:43 +01:00
Pierre Bourdon 6d6abfa61f x64Emitter: Allow const pointers where it makes sense to do so. 2014-03-08 23:32:43 +01:00
Ryan Houdek 4f02132f93 Make our architecture defines less stupid.
Our defines were never clear between what meant 64bit or x86_64
This makes a clear cut between bitness and architecture.
This commit also has the side effect of bringing up aarch64 compiling support.
2014-03-04 09:36:59 -06:00
Pierre Bourdon 311caef094 Merge pull request #25 from Tilka/ppc_fp
Fix non-IEEE mode
2014-02-23 04:15:37 +01:00
Pierre Bourdon 83b7bb64aa Make Common/ mostly IWYU clean (and fix errors in rest of the project detected by this change). 2014-02-22 23:37:29 +01:00