Commit graph

87 commits

Author SHA1 Message Date
Jeffrey Pfau
c9a25f9484 Common: CallLambdaTrampoline can return a value
As it is currently written, CallLambdaTrampoline does not return a
value. However, some of the functions that are being wrapped may
return a value that the JIT is expected to understand. A compiler
*cough cough clang* may opt to alter %rax after the wrapped lambda
returns, e.g. popping a previous value, which can clobber the
return value. If we actually have a return value, then the compiler
must not clobber it.
2015-07-04 00:57:41 -07:00
Matthew Parlane
f32cede086 Revert "x64: build a Position-Independent Executable (PIE)" 2015-06-14 16:06:26 +12:00
Tillmann Karras
5ddd2cef6c zfreeze: cache vertex positions
Suggested by degasus.
2015-06-07 12:13:00 +02:00
flacs
d3e47dfcf5 Merge pull request #2496 from Tilka/fma4
Jit64: add FMA4 support to fmaddXX
2015-06-06 17:31:55 +02:00
Tillmann Karras
a0597f0d62 Jit64: turn 32 bit addresses into offsets 2015-06-03 21:44:31 +02:00
Tillmann Karras
8db6588bb9 XEmitter: add FMA4 instructions 2015-06-02 19:19:52 +02:00
Ryan Houdek
210d7c4d54 Merge pull request #2486 from Tilka/x86_32
Jit64: drop more x86_32 left-overs
2015-05-31 13:06:19 -04:00
Tillmann Karras
eb057d49a0 x64Emitter: drop duplicate enum & unused wrappers
Keep the more explicit version of the two SSECompare enums.

And the unused CMP* wrappers wouldn't exactly make the code more
readable anyway.
2015-05-31 08:32:31 +02:00
Tillmann Karras
a6004f8274 Jit64: drop more x86_32 left-overs 2015-05-31 05:28:40 +02:00
Lioncash
e3a6191f02 x64Emitter: Pass some OpArg parameters by const reference
Considering OpArg is a struct, passing by value creates unnecessary copies.
2015-05-29 01:13:29 -04:00
Lioncash
810a04db58 x64Emitter: Remove 'Gen::' namespace prefix from some parameters
The emitter is already within the Gen namespace, so this isn't necessary.
2015-05-29 01:05:09 -04:00
Lioncash
84ed196c14 x64Emitter: Adjust position of reference and pointer indicators
Matches the coding style.
2015-05-29 01:04:45 -04:00
Ryan Houdek
7c04c76a26 Merge pull request #2421 from Tilka/jit_stuff
Jit64: fixes + less code
2015-05-25 23:08:24 -04:00
Tillmann Karras
30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
Tillmann Karras
cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
Tillmann Karras
6593ba7ecc XEmitter: add BLENDPS/BLENDPD 2015-05-21 12:33:36 +02:00
Tillmann Karras
c2c31086ae XEmitter: restructure WriteVEXOp wrappers 2015-05-17 18:44:56 +02:00
Tillmann Karras
ae8efaa6a3 XEmitter: add VBLENDVPD and VCMPPD 2015-05-17 18:42:36 +02:00
Tillmann Karras
18e9241637 XEmitter: rename WriteVex to WriteVEX 2015-05-17 09:35:53 +02:00
Tillmann Karras
9e3f4df733 XEmitter: rename WriteRex to WriteREX 2015-05-17 09:35:53 +02:00
comex
b3aaa46d42 Merge pull request #2088 from Sintendo/diecmp
Emit 'TEST reg, reg' for 'CMP reg, 0' automatically
2015-04-23 16:34:23 -04:00
comex
ad95454d04 Merge pull request #2223 from phire/imm
Cleanup OpArg, make immediates more explicit.
2015-04-23 01:53:18 -04:00
Sintendo
c19482c9a3 Add function to emit CMP, or TEST when possible
Also, a spelling mistake.
2015-03-22 17:22:27 +01:00
magumagu
52aeab3d0e Merge pull request #2240 from lioncash/emitter
x64Emitter: Remove emitter pointer parameter from WriteNormalOp.
2015-03-20 22:09:11 -07:00
Lioncash
fab7add718 x64Emitter: Remove emitter pointer parameter from WriteNormalOp.
It only ever passed the equivalent of the class' this pointer. May as well get rid of it.
2015-03-20 23:28:36 -04:00
Tillmann Karras
9793fed742 XEmitter: add PUNPCKLQDQ 2015-03-18 12:09:06 +01:00
Scott Mansell
858ff69c01 Make OpArg.offset and operandReg private.
Also cleaned up WriteRest function.
2015-03-17 18:49:30 +13:00
Scott Mansell
6262a9bcbe Make immediates more explicit
Instead of just casting OpArg::offset when needed, add some
accessor functions.

Also add some safety asserts to catch any mistakes.
2015-03-17 18:49:26 +13:00
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