Commit Graph
944 Commits
Author SHA1 Message Date
Stefanos Kornilios Mitsis Poiitidis b3600a453c RA/SRA: Don't read-alias not full sized regs, it is not safe 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis 30d7c02b60 arm64: Really fix Popcount to take into account opsize 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis 5f481ff56d IR: Fix Ashr, Ror OpSize calculation 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis c518151800 IR: Fix Lshr op size detection 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis 20a9b93019 OpDisp: Fix CondJUMPRCXOp 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis 76367f0afc arm64: Remove some debug logic 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis c20b27965d arm64: Fix Popcount to take into account opsize 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis 6e053f0055 arm64: Fix IsGPR && IsFPR for SRA 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis 80d1766bf0 arm64: Correctly handle signal and SRA interactions 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis a1f7c7da55 arm64: Fix Exit handler calling from signal 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis de0ed19e86 Arm64: Fix build for CreateRegPair 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis cdb2075522 X64: Fix RegisterClasses Count 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis 5a3c55f621 RA: Fix Class Conflicts 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis 204fda62f1 IR: Fix CreateElementPair edge cases, Remove Load/StoreContextPair 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis fbe87101db IR: Remove Load/StoreContextPair 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis 17dc0bfcd8 SRA: Only do read-alias if accessing low part of register 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis c67aa0b83d OpDisp: Don't use LoadContextPair, it is kludgy and breaks SRA 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis 9c5a1fd5ea SRA: Static Register Allocation, arm64 only 2021-01-05 17:14:57 +02:00
Stefanos Kornilios Mitsis Poiitidis f724392ef8 Merge pull request #601 from Sonicadvance1/fix_cvtsi2ss_64bit
Adds support for proper sized GPR->FPR sized conversions
2021-01-05 12:03:33 +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
Ryan Houdek 8bd76885ea Implements the rest of the prefetch ops and nops
Prefetch is highly architecture specific and a lot of these don't
actually map 1:1 with AArch64 anyway.
Just nop out
2020-12-27 19:10:41 -08:00
Stefanos Kornilios Mitsis Poiitidis 3cfae8ab30 Merge pull request #588 from Sonicadvance1/32bit_table_fixes
Fixes some tables definitions for 32bit
2020-12-25 15:15:36 +02:00
Stefanos Kornilios Mitsis Poiitidis 2fbf22a9de Hotfix: Disable ConstProp/RemoveUselessMasking, add a test for it 2020-12-25 15:04:27 +02:00
Ryan Houdek 69de873c34 Fixes some tables definitions for 32bit 2020-12-19 19:33:28 -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 e50a03fcdc Some warning fixes and uninitialized values fixes in ConstProp 2020-12-14 04:00:04 -08:00
Ryan Houdek ba134ea634 Fixes a bug in RA that valgrind found
Needs to ensure the interference list only checks against the class
interference if that register fits in its array.

Checking only empty wasn't good enough, check the array size first.
2020-12-14 03:56:39 -08:00
Ryan Houdek 232fac8fb7 Makes sure to memset the invalid node
Valgrind caught it relying on uninitialized values
2020-12-14 03:56:04 -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
Stefanos Kornilios Mitsis Poiitidis 22629b6f5a ConstProp: Remove ROR case, ROR no longer exists 2020-12-12 12:10:14 +02:00
Stefanos Kornilios Mitsis Poiitidis 0df84be18c ConstProp: Remove some BFEs that do nothing 2020-12-12 12:10:14 +02:00
Stefanos Kornilios Mitsis Poiitidis 784cd648f1 ConstProp: SBFE useless masking elim, VMOV elim 2020-12-12 12:10:14 +02:00
Stefanos Kornilios Mitsis Poiitidis 60ce62cb2d ConstProp: Special case BFE, AND in RemoveUselessMasking sub-pass 2020-12-12 12:10:14 +02:00
Stefanos Kornilios Mitsis Poiitidis 5eb42e4490 ConstProp: Documented different sub-passes, remove leftover continue; statements 2020-12-12 12:10:14 +02:00
Stefanos Kornilios Mitsis Poiitidis b2eeb104f7 ConstProp: Add RemoveUselessMasking, implement for a few ops 2020-12-12 12:10:14 +02: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 899e24abd0 Removes non-unified memory path from Interpreter 2020-12-10 02:01:14 -08:00
Ryan Houdek dc8caeaf91 Removes non-unified memory path from x86_64 2020-12-10 02:01:14 -08:00
Ryan Houdek 8e3ac44e65 Removes non-unified memory path from ARM64 2020-12-10 02:01:14 -08:00
Stefanos Kornilios Mitsis Poiitidis 6d671166e4 Merge pull request #578 from Sonicadvance1/more_robust_interpreter_check
More robust FEXInterpreter checks
2020-12-10 11:37:21 +02: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 20a93ba96c Makes us handle DFL smarter
For the ones that should be IGNORE we can safely ignore them at that
point.
For the ones that have a default behaviour of crashing, just go ahead
and crash.

This was having the fun problem space that if we received an ignore
event, we would remove the fault handler then if the guest registered a
handler it would have never been called.

SIGWINCH specifically is one that defaults to ignore and we need to care
about. If SIGWICH happened before the guest registered a handler then it
would never receive the signal.

The ones that their default behaviour is faulting are fine to uninstall
and then immediately crash, since it is a real crash at that point.
2020-12-09 20:07:03 -08:00
Ryan Houdek 61641dcc92 Adds interpreter handling to the x86 execve path
Will fix the same bugs as the 64bit path
2020-12-08 07:28:50 -08:00
Ryan Houdek 9882447ed5 Adds interpreter handling to the x64 execve path
Will fix some application launching problems
2020-12-08 07:28:50 -08:00
Ryan Houdek 3d21aaf617 Adds config option to syscall handler for determining if we're
interpreter
2020-12-08 07:28:50 -08:00
Stefanos Kornilios Mitsis Poiitidis 3ebc080bd4 Merge pull request #566 from Sonicadvance1/overlay_config
Switches over to having a correctly layered configuration system
2020-12-08 11:14:16 +02: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 f091878100 More 32bit syscall fixes
fstatfs64 and statfs64 was wrong, the syscall doesn't quite match the
glibc definition

Fixes recvmsg. Specifically the aux data was failing, thus SCM_RIGHTS
wasn't getting passed correctly.

Fixes a couple of time syscalls where their arguments are optional.
2020-12-04 09:30:33 -08:00
Ryan Houdek 30dc9128ca Removes the last usage of 8bit and 16bit multiply
This was causing issues in 32bit xeyes.
A couple of the multiply ops were still using 8bit and 16bit multiply
while the other one was already sexting or zexting the source.
2020-12-04 08:59:52 -08:00
Stefanos Kornilios Mitsis Poiitidis b2b0d9318a arm64: Fix OP_SELECT & OP_CONDJUMP gpr/fpr detection 2020-12-04 16:04:27 +02:00