Commit Graph
103 Commits
Author SHA1 Message Date
Stefanos Kornilios Mitsis Poiitidis 81756b2346 IR: Add opreator != for NodeWrapperBase 2021-01-05 17:14:57 +02:00
Ryan Houdek 4907bda639 Adds support for proper sized GPR->FPR sized conversions
Both x86 and AArch64 support converting from one sized GPR to another
sized FPR. Expose it in our IR op.

Fixes a bug in CVTSI2SS with a 64bit source and it was treating the
input source as a 32bit value.

eg:
0x0000'0000'FFFF'FFFF was treated as converting to -1 float, which was wrong since it is a 64bit value
2020-12-30 10:07:12 -08:00
Stefanos Kornilios Mitsis Poiitidis ef75b8e4ec Merge pull request #582 from Sonicadvance1/move_syscalls
Moves FEXCore's SignalDelegator and SyscallHandler to the frontend
2020-12-16 12:52:39 +02:00
Ryan Houdek 7eb708afee Shuts up a c++20 warning
This operator== is claiming to be ambiguous.
Just make the function const to make it unambiguous
2020-12-14 03:57:56 -08:00
Ryan Houdek 37983006f0 Moves FEXCore's SignalDelegator and SyscallHandler to the frontend
Sadly these things can't be split without breaking functionality so it
turns in to a bit of a mess.

SyscallHandler is very much something that is a Linux only construct and
shouldn't be in FEXCore itself. Lets the frontend register a
Syscallhandler with FEXCore. FEXCore itself is then aware of the current
syscall ABI and handles the ABI in an optimal fashion.
So it is not a 100% clean break otherwise we would lose performance.

The SignalDelegator then needs to move to the frontend since the
SyscallHandler requires it for signal based syscalls.
The CPU backend signal handling still needs to happen in FEXCore because
it is a very tight coupling with the CPU backend.
Once we need to support more Signal handling we can give the backends
cleaner support to select which specific OS handler to handle.
2020-12-13 22:38:04 -08:00
Ryan Houdek 36b24ad141 Removes all uses of non-unified memory and SHM regions
Let's just delete the whole thing!
2020-12-10 02:09:52 -08:00
Ryan Houdek 01831ec264 Check for binfmt_misc install and run directly only if installed
If we want to execve files directly we need to ensure that the
binfmt_misc interpreter path is installed.
If it isn't installed then we need to fall down the regular path of
pushing FEX to the front of the argument list.
2020-12-09 20:34:03 -08:00
Ryan Houdek 4603b92b9f Adds an option for determining if we were interpreter executed
Will be necessary soon
2020-12-08 07:28:50 -08:00
Ryan Houdek a23c045c23 Adds a ELFLoader helper to determine supported ELF file
We will need to check if an application can be executed through the
interpreter by checking program getting executed
2020-12-08 07:28:50 -08:00
Ryan Houdek f14cd54791 Switches over to having a correctly layered configuration system
Instead of having the configuration being loaded and stored in to a
frontend system. First moves the backing store of the configuration in
to FEXCore.

Each layer that is constructed then loads its particular configuration.
After the layers are loaded, then a meta layer is constructed that
merges the layers flat.

This means we will no longer hit the problem where a configuration is
stored in the "main" configuration file, then environment and arguments
passed manage to overwrite it.

The order of the layers going from inner most layer to outer most, with
outermost overwriting previous layer configurations is as follows:

Main < Global application < Local application < Arguments < Environment

One step that needs to be changed in the future is that FEXCore can then
just load its configuration from the layers directly since the data is
in FEXCore now. This will be reserved for a future change so we are less
disruptive.
2020-12-07 11:15:48 -08:00
Ryan Houdek a0149dff07 Merge pull request #554 from FEX-Emu/skmp/cmt-around-select
CMT: Move unary ops before selects
2020-12-03 20:20:45 -08:00
Ryan Houdek c7c2e56ae5 Merge pull request #552 from FEX-Emu/skmp/perblock-debug-data
JITSYMS: Per-block symbol information
2020-12-03 20:13:34 -08:00
Stefanos Kornilios Mitsis Poiitidis b2d862a8c7 IR: Replace Sext with Sbfe 2020-12-03 20:08:08 +02:00
Stefanos Kornilios Mitsis Poiitidis c802b82450 CMT: Move unary ops before selects, if both True & False values are consts 2020-12-03 19:11:25 +02:00
Stefanos Kornilios Mitsis Poiitidis 28bff432e5 DebugData: Add Subblock list, populate it from arm64 backend 2020-12-03 18:43:38 +02:00
Ryan Houdek a28df9f5c1 Moves SonicUtils in to FEXCore
Removes the extraneous and dead VM CPU backend
2020-11-29 00:30:28 -08:00
Scott Mansell 5b1d4eadd4 IR: Make BFI sizes explicit
Otherwise they can be quite hard to get right.
2020-11-26 12:40:37 +13:00
Ryan Houdek 6605c6e6eb Removes dead TLS setting code
This is no longer necessary now that phire fixed mapping of static elfs
2020-11-25 13:18:57 -08:00
Ryan Houdek 830d8146cf Support unity+mono+bdwgc sigsuspend GC shenanigans 2020-11-20 01:07:54 -08:00
Ryan Houdek 4503f41957 Merge pull request #473 from FEX-Emu/skmp/memops-addressgen
Complex address generation for Load/StoreMem
2020-11-19 23:57:20 -08:00
Ryan Houdek c430f10c86 Implements a threaded compile service routine
This is made to be completely synchronous to a thread
2020-11-18 10:07:47 -08:00
Stefanos Kornilios Mitsis Poiitidis 59c9138282 Merge pull request #511 from Sonicadvance1/compile_service_shared_data
Adds function for copying data required for threaded compiler
2020-11-18 20:03:27 +02:00
Ryan Houdek 47d47fac86 Adds function for copying data required for threaded compiler
These structures need to be shared to the threaded compiler, so set it
up for copying.

Will be necessary for the compile service
2020-11-17 13:48:10 -08:00
Ryan Houdek 1b21bb7699 Allow copying of an IRListView copy
This will be useful with the compile service coming up to keep
IRListViews coherent across threads
2020-11-17 12:31:53 -08:00
Stefanos Kornilios Mitsis Poiitidis f38179913a IR: Swith MemoryOffsetType to a type from uint8_t 2020-11-17 16:23:50 +02:00
Stefanos Kornilios Mitsis Poiitidis 9fdd2a5b10 LoadMem/StoreMem: Add OffsetType, OffsetScale 2020-11-17 16:23:50 +02:00
Stefanos Kornilios Mitsis Poiitidis 74254a1a9c IR: Load/Store mem with two args 2020-11-17 16:23:48 +02:00
Ryan Houdek deaf879e78 Merge pull request #490 from FEX-Emu/skmp/extended-condjump-branching
CondJump: Add support for two operands to match Select
2020-11-17 01:19:21 -08:00
Stefanos Kornilios Mitsis Poiitidis 11e12a9b36 Add --unsafe-no-pf 2020-11-17 11:11:13 +02:00
Stefanos Kornilios Mitsis Poiitidis 8fc6f73571 IR: InvalidateFlags + --abi-local-flags
- InvalidateFlags pseudo-op is a hint for the Dead Flags Elimination pass that flags are not needed past that point
- Adds a new option, --abi-local-flags, that invalidates the flags on CALLs or RETs. This might break code that doesn't follow the ABI rules.
2020-11-17 11:08:29 +02:00
Stefanos Kornilios Mitsis Poiitidis 908796be1a Typofix: UnwarpNode -> UnwrapNode 2020-11-17 11:06:01 +02:00
Stefanos Kornilios Mitsis Poiitidis 2dad4718d6 IR: Add DumpIR option, --dump-ir command line
This dumps the IR before and after optimizations

--dump-ir can be

"no" -> Do not dump
"stderr" -> Dump to stderr
"stdout" -> Dump to stdout
"some/path" -> Dump to "some/path/$GuestRip-pre.ir" and "some/path/$GuestRip-post.ir"
2020-11-16 16:14:07 +02:00
Stefanos Kornilios Mitsis Poiitidis 709f5cd925 CondJump: Now with cmp/b.cc support 2020-11-06 10:54:52 +02:00
Stefanos Kornilios Mitsis Poiitidis eafe853c75 CondJump: Switch to two arguments + Cond for flexible branching 2020-11-06 10:54:52 +02:00
Stefanos Kornilios Mitsis Poiitidis 2abfe71c42 Select: Add compare & Data sizes, cset/setcc specializations
- CompareSize can be 4 or 8
- DataSize can be 4 or 8
- Support for INLINE_CONSTANTS for `Select cmp1,cmp2,1,0` that specializes to cset / setcc
2020-11-05 19:46:57 +02:00
Ryan Houdek 7f4836b982 Fixes 32bit x87 usage
All of the ops that were relying on a 64bit memory offset were being
downgraded to 32bit.

Abuses the XMM_FLAGS option a bit to indicate that it shouldn't
downgrade the 64bit size flag. Which isn't an issue since all these
operations can't encode a register since modrm_r is used for table
decoding
2020-10-25 11:17:00 -07:00
Stefanos Kornilios Mitsis Poiitidis 93e372c7a4 IR/JITs: Inline Constants Implementation
Based on @phire's idea, Inline constants are constants that can be used as imms in instructions.

This
- Adds OP_INLINECONSTANT to represent them in the IR
- Modifies the ConstProp pass to transform OP_CONSTANT to OP_INLINECONSTANT based on per-platform heuristics
- Modifies the backends to use imms
- Supported opcodes: Add, Sub, Lsl, Lsr, Asr, Ror, Rol
2020-10-22 18:49:17 +03:00
Ryan Houdek dd49a04809 Fixes RIP literal sign extending on 32bit
RIP Literal isn't actually RIP literal on 32bit, it is RIP absolute.
64bit treats the 32bit as a signed offset, while 32bit treats it as a
32bit unsigned offset
2020-10-17 20:19:50 -07:00
Ryan Houdek a8175ca891 Moves away from std::is_pod
This is deprecated in C++20 and will spam warnings all over the place
2020-10-17 16:02:55 -07:00
Ryan Houdek 02d029877c Adds segment register flags mask 2020-10-09 23:33:07 -07:00
Ryan Houdek 83ac23be21 Implements new VTBL1 IR op
This perfectly matches the AArch64 variant and almost perfectly matches
x86's pshufb instruction
2020-09-26 12:59:34 -07:00
Ryan Houdek ddd7b8f406 Adds a mixxing VXor op to the IREmitter helper 2020-09-26 12:52:26 -07:00
Stefanos Kornilios Mitsis Poiitidis 83db01f505 Merge pull request #429 from Sonicadvance1/psign
Implements support for SSSE3 PSIGN{B,W,D}
2020-09-26 20:20:06 +03:00
Ryan Houdek b68832f31b Adds the IR ops to the IREmitter helper 2020-09-24 19:45:17 -07:00
Ryan Houdek 09ee71b8c3 Adds missing VFSub IREmitter function 2020-09-23 18:07:53 -07:00
Ryan Houdek de2a165a7d Adds ability for the frontend to register a signal handler
This will come to be useful for our host code execution and wine in the
future
2020-09-22 13:19:41 -07: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
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 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