Commit Graph
104 Commits
Author SHA1 Message Date
Stefanos Kornilios Mitsis Poiitidis 91bea781f4 Merge pull request #408 from Sonicadvance1/rounding_mode_host
Adds new IR ops for supporting host rounding mode conversion
2020-09-23 09:50:37 +03:00
Ryan Houdek e4182108f6 Adds new IR ops for supporting host rounding mode conversion 2020-09-22 18:42:23 -07:00
Ryan Houdek adb9b111ca Fixes crash when SSA value has size of zero
In the case of an invalid SSA destination size, the IR validation pass
would catch it and then when printing the IR it would crash with a
divide by zero.
Fixes that.
2020-09-22 18:20:32 -07:00
Ryan Houdek 00f0047cff Merge pull request #391 from phire/Remove_BFE
Remove unneeded BFEs around flag generation code.
2020-09-16 22:27:59 -07:00
Scott Mansell 5048753e37 Undo limitation of ASHR to 32/64bit
This should really be done later in a sperate PR.

 1. We don't have proper unit test coverage
 2. I still didn't get this right at time of removal
 3. I haven't done the jit changes to go along with this.
2020-09-17 16:26:41 +12:00
Scott Mansell 96603495ec OpcodeDispatcher: Remove BFEs from flag-gen calls 2020-09-17 14:59:50 +12:00
Scott Mansell d4844703d9 ReplaceAllUses: Early exit optimization 2020-09-17 11:29:57 +12:00
Scott Mansell b0cfc19267 Fast replacement path for constants 2020-09-17 11:29:57 +12:00
Ryan Houdek d424cf0eee Merge pull request #365 from phire/IR_iterators
Refactor the IR Interface to prevent "foot-shooting"
2020-09-16 11:24:44 -07:00
Ryan Houdek addcb824e2 Merge pull request #390 from FEX-Emu/skmp/add-pendatic-smc
SMC: Add --smc-full-checks, implement frontend, irint, irjit, unit test
2020-09-16 09:26:35 -07:00
Stefanos Kornilios Mitsis Poiitidis df3bdf361f SMC: Add --smc-full-checks, implement frontend, irint, irjit, unit test 2020-09-16 01:15:21 +03:00
Ryan Houdek 8878278402 Implements new EXTR IR op
This maps directly to AArch64's EXTR op.
Maps closely to x86's SHRD instruction
2020-09-13 17:28:09 -07:00
Ryan Houdek e9b74b0230 Initial Callback support
This interface is for native host code to be able to call back in to JIT
to execute guest code.
This is mainly for thunks but could be used for other purposes.
This can cross a couple ABI boundaries so one must be careful when
calling in to this
2020-09-11 15:48:51 -07:00
Scott Mansell 3102fb78e7 Minor IR validation fixes 2020-09-11 21:50:30 +12:00
Scott Mansell 92a64aad2e Update DeadFlagStoreElimiateion pass 2020-09-11 21:50:30 +12:00
Scott Mansell 0a78651cce Fix ListBegin usages that got missed.
There are still a few in interpeter and IR compaction
which are harder to fix.
2020-09-11 21:50:30 +12:00
Scott Mansell 70b3456536 Swich register allocator to new scheme. 2020-09-11 21:50:30 +12:00
Scott Mansell e756b46189 Allow AllNodes to iterate in reverse
We replace Dummy with the old unused BeginBlock
and pointing it at block header like EndBlock
2020-09-11 21:50:30 +12:00
Scott Mansell 3c6dbd0ade Change iterator type of IR.at
And switch over more passes to use the new interfaces.
2020-09-11 21:50:30 +12:00
Scott Mansell 6b26290b42 Switch most passes to use the new interface. 2020-09-11 21:50:27 +12:00
Scott Mansell df6618a4d2 New replace node functions
Probally doesn't build
2020-09-11 21:48:03 +12:00
Scott Mansell 36afd5b1c6 Block Iterator: Use structured bindings 2020-09-11 21:48:03 +12:00
Scott Mansell 446b261f24 Iterator for blocks 2020-09-11 21:48:03 +12:00
Scott Mansell 316a2f8d96 IRValidation: Add arg liveness, numUses checks 2020-09-11 21:48:03 +12:00
Ryan Houdek 07cb2c5ca2 Merge pull request #337 from FEX-Emu/skmp/dead-flags-mb
IR: Add DeadFlagStoreElimination
2020-09-10 16:43:52 -07:00
Stefanos Kornilios Mitsis Poiitidis 0adb874755 IR/ConstProp: Disable BFE identity as it breaks cs:go 2020-09-07 00:58:29 +03:00
Stefanos Kornilios Mitsis Poiitidis 3083f9e12e Merge pull request #332 from FEX-Emu/skmp/iterative-rclse
IR: Iterative RCLSE
2020-09-03 05:18:11 +03:00
Stefanos Kornilios Mitsis Poiitidis 2fb68583a0 IR: Add DeadFlagStoreElimination
Mutlblock pass that eliminates flag stores that are never read.

This is a sibling to RCLSE and will likely be absorbed by it when we add MB support there.
2020-09-02 21:57:39 +03:00
Stefanos Kornilios Mitsis Poiitidis b9ed084cc5 IR: Add identity opts for AND/OR/XOR 2020-09-02 21:50:54 +03:00
Stefanos Kornilios Mitsis Poiitidis aa3dc52799 RCLSE: Iterate until there are no changes 2020-09-02 21:34:39 +03:00
Ryan Houdek 74a310eeb2 Enables assertions option from cmake 2020-08-29 23:35:26 -07:00
Scott Mansell 65af0335dd DCSE: Refactor LoadContext slightly
* Use a single path for both truncated and non-truncated reads
  * Support more truncation types
  * Support truncating partial reads
2020-08-26 00:47:40 +12:00
Scott Mansell 5cb0827ec0 DCSE: Optimise partial reads. 2020-08-26 00:47:40 +12:00
Scott Mansell 5119a0bdb3 Elimiante ALU IR nodes that don't zero extend
Add and substract were the main culprits here.

We are trying to more towards a state where:
  * Every IR op can expect it isn't given extra bits
     on it's input
  * Every IR op never sets more bits than it's size
  * All unnessicary BFEs are never emitted
  * ARM doesn't have to implement special 8 and 16bit versions of IR ops
      All masking required to implement 8/16bit math on
      arm should be explictly generated from Opcode decoder
2020-08-26 00:47:40 +12:00
Scott Mansell 9af289eb9c Fix Truncation on context load elimitation 2020-08-26 00:47:40 +12:00
Scott Mansell 66aa9d1953 Formalise that store* ops should zext/truncate
The IR mostly worked this way already.
The one change I needed to make was in DCSE.

DCSE needs to add an explict truncate whenever an eliminated store was
doing an implict trunctate.
2020-08-26 00:47:01 +12:00
Scott Mansell 3989772a4f Remove OP_Zext
Zext has confusing sematics and does excatly the same thing as BFE

 * Repace with other ops (mostly BFE)
 * Allow specifying BFE size
2020-08-26 00:47:01 +12:00
Ryan Houdek b38983df35 Implements new TSO loadstore IR ops.
These need to end up being specially handled on non-x86 platforms
2020-08-12 15:24:00 -07:00
Ryan Houdek f3099647a2 Declares new sigret x86 instruction and IR op
We are rebranding an x86-64 illegal instruction near VIA's old ALTINST
instruction as an instruction to handle returning from guest signals
cleanly.

If this ever collides with a new x86-64 (unlikely) then we will need to
change the instruction.
This ends up looking similar to what we will do for thunk callbacks
2020-08-08 06:42:06 -07:00
Scott Mansell e319f038cc DCSE: minor fixes 2020-07-25 04:38:51 +12:00
Scott Mansell f77ee9a99c DCSE: Fix store flag elimination 2020-07-25 04:38:41 +12:00
Scott Mansell 4e783202bc DCSE: Rename Node2 to StoreNode 2020-07-24 16:30:29 +12:00
Stefanos Kornilios Mitsis Poiitidis 8c8e6294b6 Thunks: ALTINST, OP_THUNK, basic infrastructure 2020-07-20 13:52:28 +03:00
Stefanos Kornilios Mitsis Poiitidis c19e8b3d2f Implement PAVGB/PAVGW 2020-07-04 19:30:53 +03:00
Ryan Houdek ce15a1bdcd Corrects MM register alignment in CoreState
This was misaligned by 8 bytes, which worked fine on x86, but crashed
when loaded on ARM.

Now it is correctly aligned to 128bit
2020-07-01 06:08:39 +01:00
Ryan Houdek c2bd346297 Supports segment register moving
32bit apps are setting GS register that I saw.
64Bit applications can also technically use these instructions but it
has some major limitation that causes applications to never use them
2020-06-12 18:49:29 -07:00
Ryan Houdek 2f1d7f70a2 Adds new IR ops that PSADBW will need 2020-05-30 18:49:09 -07:00
Ryan Houdek 3759cbdb65 Interpreter based x87 support!
This implements support for 130 of the 132 x87 ops as interpreter
fallbacks.

The two missing ops are the BCD load and BCD store instructions and can
be implemented another time.

This allows us to no longer have to rely on a libstdc++ modification to
handle their usage of long double. This instead works entirely through
using `long double` directly in the interpreter. Which will either use
real x87 on an x86 host. Or in the case of ARM devices, fall down
glibc's long double soft float path.

This doesn't necessarily need to be quick right now. It's more important
to have the compatibility improvement from this.
2020-05-28 14:47:43 -07:00
Ryan Houdek fd857e4966 Makes threaded compilation not rely on a global mutex
As we run more threaded applications it is becoming apparent that this
needs to be fixed now.
This duplicates the FrontendDecoder and Passmanager per thread so they
no longer block each other while compiling.
Increases a bit of memory usage but completely worth it.
2020-05-27 10:18:02 -07:00
Stefanos Kornilios Mitsis Poiitidis 6669bcfffd Merge pull request #209 from Sonicadvance1/minor_opts
Minor memory allocation optimizations in the IR passes.
2020-05-27 14:27:08 +03:00