Commit Graph
28 Commits
Author SHA1 Message Date
Ryan Houdek f034cef9fc Fixes FindTrailingZeros IR interpreter
Was generating undefined behaviour when input was zero
Found via unit tests when testing TZCNT with zero input
2020-03-06 07:56:19 +02:00
Ryan Houdek 9c363fb317 Various fixes that unit tests have found
- Need to distinguish between unsigned and signed saturating ops
- Fixes vector splat
- Fixes VUMULL/VSMULL num element calculation
- Fixes undefined behaviour in a couple of vector shift ops
- Implements VSSHR
- Fixes VExtr calculating offset correctly
- Fixes VInsGPR calculating offset correctly
- Fixes PSRA (not immediate) x86 ops
- Fixes scalar vector unary ops to correctly insert lower bits
- Fixes conversion instructions correctly inserting lower bits
- Fixes PINSRW using the wrong element size
2020-03-06 07:56:19 +02:00
Ryan Houdek 9b21caa647 Adds support for CMPPD's NEQ comparison 2020-03-06 07:56:19 +02:00
Ryan Houdek c721810516 Adds some new IR ops to the interpreter 2020-03-06 07:56:18 +02:00
Ryan Houdek 20d04b0216 Fixes some undefined behaviour with shifts in the interpreter 2020-03-06 07:56:18 +02:00
Ryan Houdek f645bd7901 Adds a few new IR ops
Fixes REP CMPS. It needs to also break when ZF == 0
Fixes REPNE SCAS. It shouldn't set ZF to 0 on entry. Could result in erroneous flag setting.
Implements a few new x86 ops
2020-03-06 07:56:18 +02:00
Ryan Houdek 75f7bc0abd Fixes FindMSB op for the interpreter for 8bit/16bit types
Was zexting to 32bit and thing doing a findMSB which was wrong
2020-03-06 07:56:17 +02:00
Ryan Houdek c336a09641 Adds new IR ops to interpreter and x86 JIT 2020-03-06 07:56:17 +02:00
Ryan Houdek 8d293e9184 Adds support for unified memory to the interpreter core 2020-03-06 07:56:17 +02:00
Ryan Houdek 669aa99d3e Fixes stale data bug in the interpreter 2020-03-06 07:56:16 +02:00
Ryan Houdek bdda36496b Implements FindTrailingZeros IROp in the interpreter 2020-03-06 07:56:15 +02:00
Ryan Houdek dacd20f44b Fixes interpreter temp allocation size 2020-03-06 07:56:14 +02:00
Ryan Houdek 9b19d23977 Fixes FindMSB in Interpreter and Arm64 JIT 2020-03-06 07:56:14 +02:00
Ryan Houdek 2889c860d4 Adds new vector IR ops 2020-03-06 07:56:14 +02:00
Scott Mansell 26141e426a Fix unsigned/signed compare conditions
Also, rename to match the LLVM naming style, which is less confusing.
2020-03-06 07:56:07 +02:00
Ryan Houdek fb17e4d440 Adds atomic ops to the Interpreter 2020-03-06 07:56:07 +02:00
Scott Mansell 4fe10ca130 Add Load/StoreContextIndexted IR instructions
Useful for things like x87 where instructions can dynamically index
into a resgister file.

This commit includes support for irint and x86 jit.
2020-03-06 07:56:06 +02:00
Ryan Houdek e1d2a934e2 Fixes the scalar SSE ops and MOVD 2020-03-06 07:56:05 +02:00
Ryan Houdek e9d1ec6aff Adds new IR ops to the interpreter 2020-03-06 07:56:02 +02:00
Ryan Houdek e9be5430b9 Adds a couple new IR ops for easy movement of registers between classes. 2020-03-06 07:56:01 +02:00
Ryan Houdek afdbd9ebdc Fixes issues with PSLLDQ and PSRLDQ
These are whole vector shift instructions and they shift by bytes rather
than bits.
You only get an immediate offset for the instruction.
Implements two new IR ops to account for these instructions

This also doesn't match AArch64 behaviour 100%, requires two
instructions to emulate rather than the single one on the x86-side
2020-03-06 07:55:59 +02:00
Ryan Houdek af6eefb495 Fixes crash in IR Interpreter that can occur with large functions
If the tmp space grew too large and had to resize then we would have
stale pointers.
Keep around the offset instead so we don't store invalid pointers.
2020-03-06 07:55:59 +02:00
Ryan Houdek 3568cdb03b Adds VBITCast to IR Interpreter 2020-03-06 07:55:59 +02:00
Ryan Houdek 33ebeef246 Fixes IR Interpreter
Updates it to support the IR style and branching requirements.
2020-03-06 07:55:59 +02:00
Ryan Houdek f8b858e7fc Removes the EndFunction IR Op 2020-03-06 07:55:45 +02:00
Ryan Houdek f27f9485f6 Changes IR::CondJump's condition to dump textually. 2020-03-06 07:55:33 +02:00
Ryan Houdek 199cfd76d8 Refactor IR and other changes that are hard to split
I had to change how blocks are represented to make it easier to parse
This required a fairly substantial refactor that makes it so blocks are
represented differently and we can walk them sequentially.

This will make future analysis easier to deal with.
Had to rewrite the passes and core's parsing of the IR afterwards.

Moved RA in to a optimization pass to be shared between the JIT backends
This works because x86-64 and AArch64 RA can be identical.

Still doesn't support PHI nodes or spilling correctly, this is the first
step in the process of getting there.
2020-03-06 07:55:13 +02:00
Ryan Houdek 7252050e42 Initial commit 2020-03-06 07:48:39 +02:00