Ryan Houdek
177cf1979f
Switches SonicUtils over to be a static library
...
Removes installing since it doens't make sense anymore
2020-10-20 19:16:22 -07:00
Ryan Houdek
a42bdd9c2f
Fixes 64bit ppoll
...
32bit ppoll is completely wrong here.
Will be fixed in upcoming PR
2020-10-20 18:33:46 -07:00
Stefanos Kornilios Mitsis Poiitidis
7d7f4cdb10
DCE: Needs reverse iteration to be effective
2020-10-18 16:51:52 +03:00
Stefanos Kornilios Mitsis Poiitidis
c31b32cb48
Merge pull request #463 from Sonicadvance1/more_32bit_fixes
...
More 32bit fixes
2020-10-18 11:44:59 +03:00
Ryan Houdek
7f8c2eef25
Adds 32bit call unit tests
...
Specifically written to test sign extension on the offset
2020-10-17 20:29:19 -07:00
Ryan Houdek
19f29c14a7
Adds 32bit move offset unit tests
2020-10-17 20:27:24 -07:00
Ryan Houdek
5d730db054
Fixes MEM_OFFSET size override.
...
A couple of instructions were incorrectly marked as mem offset.
Fixes the mem offset literal size which is only modified with the
address size modifier.
Previously this was causing these instructions to narrow based on
operand size override incorrectly
2020-10-17 20:22:21 -07:00
Ryan Houdek
b17b3a5721
Fixes literal constant size
...
It is the size in the bytes unless it is extended.
Once extended it should behave like the operand size
2020-10-17 20:21:17 -07: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
6741b9d23f
Fixes Unit Test loader offset
...
This was causing 32bit unit tests to load in to high 64bits.
Loads at offset constant 0x1'0000 so we always know where the code is
loaded
2020-10-17 20:17:45 -07:00
Ryan Houdek
8d3a4d58a9
Merge pull request #462 from Sonicadvance1/enable_cpp20
...
Enables C++20 feature level
2020-10-17 16:20:03 -07:00
Ryan Houdek
551f6b49cd
Enables C++20 feature level
...
There are a few nice features in C++20 that can make our life easier.
This isn't requiring the full C++20 suite of features, but instead
should allow us to start bringing in features that were at least in
Clang 10.
LLVM 11 came out yesterday (2020-10-12) so it would be a shame to have
that as a minimum requirement.
2020-10-17 16:03:12 -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
f1861b0bd4
Merge pull request #459 from Sonicadvance1/32Bit_ELFLoader_improvements
...
Fixes 32bit ELF Loading
2020-10-17 15:59:50 -07:00
Stefanos Kornilios Mitsis Poiitidis
c10f534122
Merge pull request #461 from Sonicadvance1/support_iwyu
...
Adds support for cmake IWYU option
2020-10-16 09:54:08 +03:00
Stefanos Kornilios Mitsis Poiitidis
196578e0bf
Merge pull request #460 from Sonicadvance1/more_32bit_syscall_shuffling
...
Shuffles more x86-64 specific syscalls to the correct folder
2020-10-16 09:53:26 +03:00
Stefanos Kornilios Mitsis Poiitidis
4111f795bd
Merge pull request #458 from Sonicadvance1/fs_only_on_64bit
...
Only sets up FS on 64bit
2020-10-15 19:29:31 +03:00
Stefanos Kornilios Mitsis Poiitidis
bd476bb8ea
Merge pull request #457 from Sonicadvance1/cpu_family
...
Changes CPU family reported by CPUID
2020-10-15 19:28:49 +03:00
Ryan Houdek
4adadaba6b
Adds support for cmake IWYU option
...
Only adds the option to enable the Include-What-You-Use program.
This will be useful for cleaning up includes
2020-10-13 17:39:52 -07:00
Ryan Houdek
db77d5f580
Shuffles more x86-64 specific syscalls to the correct folder
2020-10-13 16:56:09 -07:00
Ryan Houdek
7a62fad444
Fixes 32bit ELF Loading
...
This requires some changes to how the ELF memory bases are calculated
and which auxp variables are passed in
2020-10-13 15:46:27 -07:00
Ryan Houdek
471f41fa62
Changes CPU family reported by CPUID
...
Java VM uses this to determine if the CPU is new enough to be a 486 or
newer.
Also fixes some comment text.
Java VM scans all the leafs for hypervisor entries
Instead of adding directly which was causing our CPUID map to grow to
1500 entries.
Do the correct CPUID thing and return zeroes for non-understood leafs.
Gives us the same result since we cover almost all leaves with it anyway
2020-10-13 13:19:07 -07:00
Ryan Houdek
00849a6fee
Only sets up FS on 64bit
...
Unnecessary when executing in 32bit since glibc will set up the TLS
2020-10-13 12:29:19 -07:00
Stefanos Kornilios Mitsis Poiitidis
c2f6534084
Merge pull request #456 from Sonicadvance1/segment_registers
...
32bit and Segment register fixes
2020-10-10 19:15:45 +03:00
Ryan Houdek
101ef4f42d
32Bit Opdispatcher fixes
...
Biggest thing is that it fixes segment register prefixing entirely.
Every op that supports segment prefixing now uses a helper to handle the
prefix
2020-10-09 23:33:10 -07:00
Ryan Houdek
9f84e3cead
move with literal uses operating size mode for literal size
2020-10-09 23:33:10 -07:00
Ryan Houdek
ea1bc55aef
Ensures 64bit vector ops don't reduce to 32bit
2020-10-09 23:33:10 -07:00
Ryan Houdek
02d029877c
Adds segment register flags mask
2020-10-09 23:33:07 -07:00
Ryan Houdek
b7759060ab
Merge pull request #450 from Sonicadvance1/32bit_syscalls
...
Fixes 32bit syscalls
2020-10-07 11:16:27 -07:00
Ryan Houdek
868e2944c4
Merge pull request #454 from Sonicadvance1/32bit_ELFLoader
...
Adds support for 32bit ELFs to the code loader
2020-10-07 11:13:23 -07:00
Ryan Houdek
867955b9a0
Merge pull request #453 from Sonicadvance1/32bit_searchpath
...
Updates ELFSymbolDatabase for 32bit library paths
2020-10-07 11:08:38 -07:00
Ryan Houdek
910de79701
Merge pull request #452 from Sonicadvance1/32bit_move_memoffset
...
Fixes 32bit move with memoffset
2020-10-07 11:08:06 -07:00
Stefanos Kornilios Mitsis Poiitidis
ad007a0896
Merge pull request #451 from Sonicadvance1/32bit_leave
...
Fixes 32bit LEAVE instruction
2020-10-07 16:53:05 +03:00
Ryan Houdek
fecdc312f3
Adds support for 32bit ELFs to the code loader
...
Matches most of the 64bit behaviour but with expected 32bit pointers
2020-10-06 20:39:57 -07:00
Ryan Houdek
36d9d9a7c5
Updates ELFSymbolDatabase for 32bit library paths
...
Doesn't really matter but let's put it there
2020-10-06 20:14:10 -07:00
Ryan Houdek
97a832f81d
Removes some broken 32bit unit tests
...
These were leftovers
2020-10-06 19:57:24 -07:00
Ryan Houdek
d868a1b18d
Fixes 32bit move with memoffset
...
The offset can not be 8bytes on 32bit
2020-10-06 19:57:15 -07:00
Ryan Houdek
567be0eea0
Fixes Test Harness runner loading tables with wrong mode
...
We weren't passing the operating mode to context's static initializer
correctly
2020-10-06 19:57:12 -07:00
Ryan Houdek
1818eab221
Adds 32bit LEAVE unit test
2020-10-06 19:18:21 -07:00
Ryan Houdek
ba69f5c877
Removes 32bit assert in LEAVE
...
This is working correctly, just was untested
2020-10-06 19:10:45 -07:00
Ryan Houdek
ee55204eaa
Fixes 32bit syscalls
...
This doesn't change behaviour on the 64bit side of things.
Currently the 32bit syscall implementation is "best effort".
Anything that easily maps is passed through, and a few minor ones that
rely on iovec are handled.
Still around 80 syscalls that aren't punched through yet.
Few of these changes could have been split up so it's a bit of a
nightmare.
2020-10-06 18:46:26 -07:00
Stefanos Kornilios Mitsis Poiitidis
c7cb79264f
Merge pull request #449 from Sonicadvance1/valgrind_fixes
...
Fixes from Valgrind's test suite
2020-10-05 09:25:03 +03:00
Ryan Houdek
b2010ed9a7
Updates xbyak to the latest version
...
Needed to have correct CPU feature detection
2020-10-04 16:18:41 -07:00
Ryan Houdek
56f46a6abb
Extends LZCNT unit tests
...
Ensures proper behaviour while the other tests were mainly testing flags
2020-10-04 16:13:50 -07:00
Ryan Houdek
31be022348
Fixes bad implementation in fallback x86 LZCNT
...
This was just wrong and the unit tests hadn't caught it
2020-10-04 16:13:03 -07:00
Ryan Houdek
5466ea4df2
Extends PSHUFB unit tests to ensure correct behaviour
...
Explicitly testign bits being set in the reserved bits
2020-10-04 16:12:22 -07:00
Ryan Houdek
4ff7046ddb
Fixes bugs in PSHUFB
...
If bits were set in the reserved bits then the shuffle was incorrect
2020-10-04 16:10:03 -07:00
Ryan Houdek
9c7cc2db1f
Implements unit test for MOVNTPD
2020-10-04 16:09:41 -07:00
Ryan Houdek
d9414ee8ad
Implements SSE2 MOVNTPD
...
We apparently missed this one
2020-10-04 16:09:15 -07:00
Ryan Houdek
7569120495
Fix a unit test's alignment
2020-10-04 16:05:16 -07:00