Commit Graph
9533 Commits
Author SHA1 Message Date
Ryan Houdek 52aae9b3e6 Optimize the syscall IR op argument loading based on syscall definition
When we have function calls we can call the handler directly instead of
a thunk step in between
2020-04-05 14:00:22 -07:00
Ryan Houdek 8c2beba584 Cleans up x86-64 syscall implementation
Splits out to a jump table approach and loosely classifies and groups
the syscalls.

Also defines syscalls by number of arguments so it can be optimized
2020-04-05 14:00:13 -07:00
Ryan Houdek ea4476f687 Fixes stack alignment in x86_64 JIT
SystemV ABI mandates that the stack frame is aligned to 16bytes.
Once the call instruction happens then it is offset by 8bytes, so it is
on the callee's hands to realign the stack pointer to 16bytes.
We rely on the assumption that the stack is aligned to 16bytes for spill
slots and other function calls
2020-04-05 13:45:14 -07:00
Stefanos Kornilios Mitsis Poiitidis 227d6dc8c1 Merge pull request #83 from Sonicadvance1/unordered_ordered_compare
Implements unordered and ordered compare IR op
2020-04-05 13:02:44 +03:00
Stefanos Kornilios Mitsis Poiitidis 80fa73868e Merge pull request #82 from Sonicadvance1/rootfs_elfloader
Adds RootFS search path in ELFLoader
2020-04-05 13:00:49 +03:00
Stefanos Kornilios Mitsis Poiitidis 133aa604a2 Merge pull request #79 from Sonicadvance1/fix_sign_extend
Fixes bug in CBW op
2020-04-05 12:58:14 +03:00
Stefanos Kornilios Mitsis Poiitidis aa073d9190 Merge pull request #78 from Sonicadvance1/fix_x86_fcmp
Fixes FCMP in x86-64
2020-04-05 12:56:51 +03:00
Stefanos Kornilios Mitsis Poiitidis 234799ebde Merge pull request #77 from Sonicadvance1/fix_x86_vector_cvt
Use the correct float vector op for Vector_FToZS on x86
2020-04-05 12:55:11 +03:00
Ryan Houdek 8e369da1e9 Merge pull request #74 from Sonicadvance1/mmx_insts
Implements 80 new MMX instructions
2020-04-05 00:31:31 -07:00
Ryan Houdek 3e7fe47f23 Merge pull request #71 from Sonicadvance1/elfloader_debug
Removes debug logs from the frontend ELF loader
2020-04-05 00:31:13 -07:00
Ryan Houdek b0c9ae848b Implements unit tests for the unordered and ordered comparisons 2020-04-04 23:19:30 -07:00
Ryan Houdek 840fee77b4 Implements unordered and ordered compare IR op
Implements the remaining missed comparisons for x86's compare ops
2020-04-04 23:19:22 -07:00
Ryan Houdek 15d5ba6fc1 Adds RootFS search path in ELFLoader
Fixes #69, makes it less annoying to run things on non x86 hosts
2020-04-04 23:17:40 -07:00
Ryan Houdek 6f2726379c Implements CVTTPS2DQ x86 instruction 2020-04-04 23:16:53 -07:00
Ryan Houdek 6412b5fcbf Adds more unit tests for Sign extension 2020-04-04 23:11:48 -07:00
Ryan Houdek 1e9badadd0 Fixes bug in CBW op 2020-04-04 23:11:35 -07:00
Ryan Houdek 85b75b3f12 Fixes FCMP in x86-64
We were overwriting flags while reading from them.
Keep the flags in AX with LAHF/SAHF to be easy
2020-04-04 23:10:53 -07:00
Ryan Houdek 05fa263653 Use the correct float vector op for Vector_FToZS on x86 2020-04-04 23:09:34 -07:00
Ryan Houdek 3e398a1b9b Pass Context to the OpDispatcher 2020-04-04 23:05:03 -07:00
Ryan Houdek 33a4ff061d Allow IRValidation pass to ignore invalid SSA nodes 2020-04-04 23:04:56 -07:00
Ryan Houdek f1d928d468 Allow RA pass to work with invalid SSA nodes 2020-04-04 23:04:49 -07:00
Ryan Houdek a7079e5bec Allow the value domination pass to work with invalid SSA values 2020-04-04 23:04:42 -07:00
Ryan Houdek 4561413e4e Add IsValid function to NodeWrapperBase 2020-04-04 23:04:35 -07:00
Ryan Houdek fd4fb37056 Adds a new VMOV IR op
Both AArch64 and x86 don't have optimal paths to move <64bit FPRs to
another with ZEXT.
So this is optimal for 128bit and 64bit while smaller ops have have the
expected overhead when using it
2020-04-01 20:04:05 -07:00
Ryan Houdek f06d6c8274 Makes MMX PMULUDQ more efficent and fixes unit test on LLVM+AArch64 2020-04-01 20:04:05 -07:00
Ryan Houdek 842ef332eb Implements 71 new MMX unit tests 2020-04-01 20:04:05 -07:00
Ryan Houdek 1a5cf0b8a3 Implements 80 new MMX instructiosn in the OpDispatcher 2020-04-01 20:04:05 -07:00
Ryan Houdek f8b7df00b9 Fill out MMX instructions in the x86 tables 2020-04-01 20:04:05 -07:00
Ryan Houdek 7f0a98673d Make the MMX frontend register selection use InvalidReg 2020-04-01 20:04:05 -07:00
Ryan Houdek 94c10e3518 Implement MMX register loadstores in generic helper 2020-04-01 19:53:21 -07:00
Stefanos Kornilios Mitsis Poiitidis e6bcecf2d5 Merge pull request #73 from Sonicadvance1/push_pop_flags
Implements push and pop flags instruction
2020-03-29 14:16:26 +03:00
Stefanos Kornilios Mitsis Poiitidis 66924cc37f Merge pull request #72 from Sonicadvance1/new_ir_ops
Adds new IR ops
2020-03-29 14:15:13 +03:00
Stefanos Kornilios Mitsis Poiitidis 3fe256c370 Merge pull request #70 from Sonicadvance1/mmx_frontend
Adds MMX decoding support to the frontend
2020-03-29 13:35:57 +03:00
Ryan Houdek 5d55f73cd2 Adds new IR ops to the LLVM JIT 2020-03-27 20:56:56 -07:00
Ryan Houdek 6f14607a82 Adds the new IR ops to the x86 JIT 2020-03-27 20:56:56 -07:00
Ryan Houdek 7c4b5c3be8 Adds to IR ops to the AArch64 JIT 2020-03-27 20:56:56 -07:00
Ryan Houdek 3cd1e0ee8f Adds new vector ops to the interpreter 2020-03-27 20:56:56 -07:00
Ryan Houdek a8d4d0d3c3 Adds new IR ops
vector pairwise add
vector unsigned shift right with narrowing
vector unsigned and signed extend with lengthening from upper bits
vector unsigned and signed multiply with lengthening from upper bits
2020-03-27 20:56:56 -07:00
Ryan Houdek 65219ba4e4 Implements push and pop flags instruction
This allows applications to push the eflags to and from the stack.
Noticed when running some GL games
2020-03-27 18:28:23 -07:00
Ryan Houdek f78773c2ee Removes debug logs from the frontend ELF loader 2020-03-27 18:08:50 -07:00
Ryan Houdek a97c2c8bb3 Adds MMX decoding support to the frontend 2020-03-27 18:07:57 -07:00
Stefanos Kornilios Mitsis Poiitidis 84743796a5 Merge pull request #67 from Sonicadvance1/more_cvt
Implements two more CVT instructions
2020-03-23 00:39:59 +02:00
Stefanos Kornilios Mitsis Poiitidis d0667452e6 Merge pull request #66 from Sonicadvance1/pmul
Implements PMULLW
2020-03-23 00:39:49 +02:00
Stefanos Kornilios Mitsis Poiitidis 75e3f1a9aa Merge pull request #68 from Sonicadvance1/paddb
Implements PADDB
2020-03-23 00:39:37 +02:00
Ryan Houdek 8e21e6b456 Implements PADDB unit test 2020-03-22 13:07:39 -07:00
Ryan Houdek 33e68cf0c4 Implements PADDB in OpDispatcher 2020-03-22 13:07:25 -07:00
Ryan Houdek 7cdaefccd4 Adds CVTSS2SI unit test 2020-03-22 13:06:19 -07:00
Ryan Houdek c87ef005b1 Adds CVTTPD2DQ unit test 2020-03-22 13:05:54 -07:00
Ryan Houdek 71b507f8de Extends CVTTSS2SI test to test negative numbers 2020-03-22 13:05:34 -07:00
Ryan Houdek eeebfeaec1 Implements two more CVT instructions
CCVTSS2SI and CVTTPD2DQ
2020-03-22 13:03:34 -07:00