Commit Graph
73 Commits
Author SHA1 Message Date
Scott Mansell b054807270 WIP Dead Code Elimitation pass 2020-03-06 07:55:36 +02:00
Ryan Houdek 741599baa8 Update IR documentation 2020-03-06 07:55:36 +02:00
Ryan Houdek aabc6f6de2 Extends ConstProp pass a bit more.
Still doesn't cover all the IROps but it hits quite a few more that I
could see.
2020-03-06 07:55:35 +02:00
Ryan Houdek 160240dc23 Adds a few AVX instructions to the X86Tables 2020-03-06 07:55:35 +02:00
Ryan Houdek 6890ae4e20 Adds an inblock time sampling routine to the x86-64 JIT
Useful for a quick overview of the time spent in a function. It isn't
amazing for profiling since it effects the time in the function by
itself.
Only useful as a reference.
2020-03-06 07:55:35 +02:00
Ryan Houdek 0a959475c5 Removes support for non-RA path on x86-64 JIT
RA is now fully working, so this path is no longer necessary
2020-03-06 07:55:35 +02:00
Ryan Houdek 668d392eb7 Adds support for spilling in the AArch64 JIT 2020-03-06 07:55:35 +02:00
Ryan Houdek 0eb86389de Cleans up RA spill slot calculation.
RA spill slots now have live ranges so we can reuse the spill slot.
This can reduce spill stack usage significantly in code ranges with
large live ranges.
2020-03-06 07:55:35 +02:00
Ryan Houdek b2ffa28759 Adds gitignore 2020-03-06 07:55:35 +02:00
Ryan Houdek 012805fd72 Fixes multiblock and a few bugs in RA.
This makes it so multiblock can now be enabled with the JITs.
Results in a decent performance increase by itself.
2020-03-06 07:55:35 +02:00
Ryan Houdek 625112780a Adds support for IR::Print to the x86 JIT 2020-03-06 07:55:34 +02:00
Ryan Houdek c105c52d67 Changes IRValidation to use the new IR::GetArgs function. 2020-03-06 07:55:34 +02:00
Ryan Houdek 05205515b5 Handle IR::Break on x86-64 better
HLT converts to Break, which is used for leaving the VM so we need to
handle that correctly.
2020-03-06 07:55:34 +02:00
Ryan Houdek 1a3498107b Minor cleanup in the non-RA x86 JIT path 2020-03-06 07:55:34 +02:00
Ryan Houdek 26a3290b43 Fix a couple mistakes in the x86 JIT using movsx instead of movsxd 2020-03-06 07:55:34 +02:00
Ryan Houdek 570ff7b29b Supports FS/GS on CMPXCHG 2020-03-06 07:55:33 +02:00
Ryan Houdek 52b5ac9e19 Changes slightly how IR::IRHeader is represented 2020-03-06 07:55:33 +02:00
Ryan Houdek f27f9485f6 Changes IR::CondJump's condition to dump textually. 2020-03-06 07:55:33 +02:00
Ryan Houdek a8ff6414c1 Fixes indent failure on IR dumping.
Depending on IR ordering then it could have wrapped around to max
indent.
2020-03-06 07:55:22 +02:00
Ryan Houdek 7a43b3150b Fixes bug in frontend displacement calculation
When an instruction had a literal and also a SIB displacement then this
was causing it to be calculated incorrectly.
2020-03-06 07:55:21 +02:00
Ryan Houdek a8bb815a76 Adds IR::ADD to constprop pass. 2020-03-06 07:55:21 +02:00
Ryan Houdek 218f38ff3d Adds new IR::GetArgs function
This returns SSA args that will eventually be register allocated.
2020-03-06 07:55:20 +02:00
Ryan Houdek 58e019fbf1 Disabled AVX512 reporting in CPUID
We don't support it and it'll be something we won't want to support for
a long time.
2020-03-06 07:55:20 +02:00
Ryan Houdek 1b751f11dc Fixes a bug in BitSet
If the number of nodes in a bitset grew too large then it wouldn't fit
in that calculation.
2020-03-06 07:55:19 +02:00
Ryan Houdek 6d92146578 Flesh out X86Tables some more
Adds an EVEX table and throws some ops in to an unimplemented function.
This is necessary for multiblock in the future where it will see
unsupported instructions but not actually execute them.
2020-03-06 07:55:18 +02:00
Scott Mansell d32ebc0de0 Signal our lack of support for CET shadow stacks
Needed to support binaries linked with glibc 2.30 and later.

glibc doesn't actually check CPUID, as kernel support is needed.
Instead, it just calls ARCH_CET_STATUS and checks for an error.
2020-03-06 07:55:18 +02:00
Ryan Houdek 13a15d6f3e Fix RA pass to support spilling 2020-03-06 07:55:17 +02:00
Ryan Houdek 3f0d020899 Add support for an Invalid NodeWrapperIterator 2020-03-06 07:55:17 +02:00
Ryan Houdek db5467211c Fixes the AArch64 JIT
Moves it to the new IR iterating style.
Forgot to clear icache after generation.
Fixes overly aggressive struct packing causing a fault
2020-03-06 07:55:16 +02:00
Ryan Houdek c21f711417 Adds a JitSymbols interface
This allows linux perf to see execution inside of JIT functions.
This could be extended in the future to support something like vtune or
oprofile.
2020-03-06 07:55:16 +02:00
Ryan Houdek d645e58721 Remove some debug logs 2020-03-06 07:55:15 +02:00
Ryan Houdek 1dbeff462c Fixes Redundant Context Load Elimination pass
Allows other passes to see more things it can optimize
`ReplaceAllUsesWith` is a bit of a trap and needs to be replaced.
2020-03-06 07:55:14 +02:00
Ryan Houdek 4ccdd689ce Fixes a bug in the CBW/CWDE/CDQE instruction
Was running at the wrong size the entire time
2020-03-06 07:55:14 +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 6ac9f93d0d Update vixl submodule 2020-03-06 07:54:33 +02:00
Ryan Houdek 2975161e89 Cleanup the Frontend x86 decoder
Makes it easier to follow the source
2020-03-06 07:54:32 +02:00
Ryan Houdek 71a9713970 Add some stracing to the syscall emulation 2020-03-06 07:54:32 +02:00
Ryan Houdek 55b4eb8689 Defined a few more Linux syscalls 2020-03-06 07:54:32 +02:00
Ryan Houdek c2e8c8d430 Minor cleanup in BlockCache 2020-03-06 07:54:31 +02:00
Ryan Houdek 47d91e05f0 Add ioctl to filemanagement 2020-03-06 07:54:31 +02:00
Ryan Houdek e59a6fcd5d Add cmake message about which JIT we are using 2020-03-06 07:54:30 +02:00
Ryan Houdek 0e35fddac6 Fixed shadowed variable warning 2020-03-06 07:54:29 +02:00
Ryan Houdek 185f6c78a9 Cleans up X86Tables and removes a bunch of templates and lambdas
Drops compile time dramatically
2020-03-06 07:52:38 +02:00
Ryan Houdek e78ad71f4f Fixes IR definition file getting rebuilt every time ninja is ran
Speeds up rebuild time significantly
2020-03-06 07:52:37 +02:00
Ryan Houdek 6dd6f83c30 [X86Tables] Fixes and implements five instruction's flags 2020-03-06 07:52:36 +02:00
Ryan Houdek 925ce8b35e [CPUBackend] Add custom dispatch virtual functions to be implemented 2020-03-06 07:52:36 +02:00
Ryan Houdek 0d20ec0f2c [MemoryMapper] Adds debug only GetPointer with size check. 2020-03-06 07:52:35 +02:00
Ryan Houdek 92d4aaf2e2 Partial FXSave/FXRStor instruction implementations. 2020-03-06 07:52:35 +02:00
Ryan Houdek 3e4743512d Stub FXSave and FXRStor instructions. Necessary for launching dynamic apps from ld.so 2020-03-06 07:52:34 +02:00
Ryan Houdek febd707634 Removes some debug logging in the file manager and stops explicitly avoiding the ld.so.cache 2020-03-06 07:52:33 +02:00