Ryan Houdek
c6385093eb
Adds a few new IR ops
...
VectorZero, useful to generate a zero vector without any previous
dependencies
and comparisons with zero which ARM supports faster versions of
2020-09-24 19:34:19 -07:00
Ryan Houdek
04d2d70e51
Implements LZCNT unit test
...
Verified correct with the hsot unit test runner
2020-09-23 22:35:32 -07:00
Ryan Houdek
84936e6297
Implements ABM's LZCNT instruction
...
This overlaps the previous BSR instruction which is why the table had to
be changed.
We were accidently claiming support for ABM in CPUID before so that
didn't need to be changed.
We now implement both LZCNT and TZCNT so we fully support ABM now.
2020-09-23 22:35:32 -07:00
Ryan Houdek
697df88314
Implements the new CLZ IR op in the x86 JIT
2020-09-23 22:14:56 -07:00
Ryan Houdek
47c3fdafd7
Implements the new CLZ op in the ARM64 JIT
2020-09-23 22:14:36 -07:00
Ryan Houdek
935deb0167
Implements new CLZ op in the interpreter
2020-09-23 22:14:15 -07:00
Ryan Houdek
479505b069
Implements new CountLeadingZeroes IR op
2020-09-23 22:13:28 -07:00
Ryan Houdek
c72d50a9c6
Implements the couple of duplicated ops
...
SAL is exactly the same as SHL
TEST is exactly the same as the previous TESTs
Bit silly of encodings since compilers will never actually generate
these
No unit tests on these since getting nasm to emit it is a PITA
2020-09-23 18:56:26 -07:00
Ryan Houdek
61f1d28077
Implements ADDSUB{PS, PD} unit tests
...
Verified with the host runner
2020-09-23 18:09:02 -07:00
Ryan Houdek
ae3c38e9e5
Implements ADDSUB{PS, PD} in the OpDispatcher
2020-09-23 18:08:19 -07:00
Ryan Houdek
09ee71b8c3
Adds missing VFSub IREmitter function
2020-09-23 18:07:53 -07:00
Ryan Houdek
e238afe2fb
Removes some direct usage of widening flag
...
Instead use our helpers to determine the sizes to stay consistent
2020-09-23 17:30:43 -07:00
Ryan Houdek
b0065435e2
Missing MMX conversion ops unit tests
2020-09-23 17:21:01 -07:00
Ryan Houdek
35798c8d9d
Implements missing mmx conversion ops
2020-09-23 17:21:01 -07:00
Stefanos Kornilios Mitsis Poiitidis
d5d0899d5f
Merge pull request #421 from Sonicadvance1/fix_mov_mem_offset
...
Fixes move with mem offset
2020-09-23 21:11:16 +03:00
Ryan Houdek
811e956df5
Fixes move memoffset tests to have address size override prefix
...
Required for the 32bit literal offset
2020-09-23 10:43:20 -07:00
Ryan Houdek
f5a7a3deec
Fixes move with mem offset
...
Move with mem offset defaults to 64bit offset and the literal size is
changed based on address size override rather than operand size
override.
Operand size override still works in this case, but only for the
register being passed in.
2020-09-23 10:43:12 -07:00
Stefanos Kornilios Mitsis Poiitidis
6f58e1e1c5
Merge pull request #419 from Sonicadvance1/x87_fixes
...
x87 fixes
2020-09-23 20:19:29 +03:00
Stefanos Kornilios Mitsis Poiitidis
f90dd64682
Merge pull request #420 from Sonicadvance1/cmps_fixes
...
Fixes flags calculation in CMPSB
2020-09-23 20:10:29 +03:00
Ryan Houdek
d8e5495780
Fixes CMPSB unit tests
...
These were confirmed by host runner
2020-09-23 10:03:33 -07:00
Ryan Houdek
e395c37de6
Fixes flags calculation in CMPSB
...
The order of these ops were flipped
2020-09-23 10:00:18 -07:00
Ryan Houdek
6fdb78bb87
fscale test is no longer failing
2020-09-23 09:46:47 -07:00
Ryan Houdek
a4f92b8564
Removes some undefined behaviour in f2xm1 unit test
...
If the input range is outside of -1.0 to +1.0 then the result is
undefined.
To avoid precision problems just check for zero, aka 2^0-1 which also
returns zero
2020-09-23 09:45:08 -07:00
Ryan Houdek
f5d15df6be
Flips incorrect argument order in fyl2x unit test
2020-09-23 09:44:32 -07:00
Ryan Houdek
9ed9497f06
Removes some undefined behaviour in x87 inc/dec stp tests
2020-09-23 09:42:45 -07:00
Ryan Houdek
6cd4896db3
Fixes bugged x87 fcmov tests
2020-09-23 09:42:10 -07:00
Ryan Houdek
57021e5e11
Fixes x87 FCMOV
...
One flag type was having inverted results
2020-09-23 09:41:32 -07:00
Ryan Houdek
12dc4ad0c4
Fixes x87 FYL2X
2020-09-23 09:41:00 -07:00
Ryan Houdek
422dc9c104
Merge pull request #417 from Sonicadvance1/convert_with_host_flags
...
Implements OpDispatcher ops for host flag conversion ops
2020-09-23 09:32:08 -07:00
Ryan Houdek
6d8406b613
Fixes failing unit tests that were just fixed
2020-09-23 09:27:02 -07:00
Ryan Houdek
2983e4c421
Implements OpDispatcher ops for host flag conversion ops
...
These rely on the host flag being correct. Which will match what is set
through the regular host flag setting routines
2020-09-23 09:04:44 -07:00
Stefanos Kornilios Mitsis Poiitidis
57a835f475
Merge pull request #415 from Sonicadvance1/fix_unaligned_unittest
...
Fixes unit test that relies on unaligned XMM load
2020-09-23 14:22:40 +03:00
Stefanos Kornilios Mitsis Poiitidis
d8b5ae3fdf
Merge pull request #414 from Sonicadvance1/fix_eflag_state
...
Ensures eflags matches real state
2020-09-23 14:21:04 +03:00
Stefanos Kornilios Mitsis Poiitidis
437d6e984d
Merge pull request #418 from Sonicadvance1/hsub
...
Fixes the HSUB ops
2020-09-23 14:17:48 +03:00
Stefanos Kornilios Mitsis Poiitidis
6e4507ea2b
Merge pull request #416 from Sonicadvance1/loadstore_roundingmode
...
Support setting emulator host rounding mode with ldmxcsr/stmxcsr
2020-09-23 14:17:00 +03:00
Ryan Houdek
bef4e2ff01
Fixes HSUB unit tests
...
I had the values reversed from what was expected.
Changed to reflect what changed in the previous commit.
Confirmed by host unit test runner
2020-09-23 00:32:28 -07:00
Ryan Houdek
d425aa4f49
Fixes the HSUB ops
...
These were swizzling in the wrong direction.
Confirmed by host runner
2020-09-23 00:31:39 -07:00
Ryan Houdek
a69b700afb
Support setting emulator host rounding mode with ldmxcsr/stmxcsr
2020-09-23 00:21:52 -07:00
Ryan Houdek
72567f6f3a
Fixes unit test that relies on unaligned XMM load
2020-09-23 00:17:49 -07:00
Ryan Houdek
aef0f81a23
Ensures eflags matches real state
...
0x2 is the default state for hardware boot, but it isn't the state we
boot applications in.
When an application boots under Linux it is actually set to 0x202
because interrupts have been enabled.
Since we can't disable interrupts we will just always have at least
0x202 in the eflags.
This modifies the unit tests to first clear the full eflags state then
loads it so we hit "default". Once we hit the unit test runner we won't
have known the eflags state at that point, so we need to clear it
initially.
2020-09-23 00:09:35 -07:00
Ryan Houdek
6c37a4dea6
Adds support for BCD x87 intructions
2020-09-22 23:56:03 -07:00
Ryan Houdek
69a21f4d8c
Supports uint64_t softfloat conversions
2020-09-22 23:55:21 -07:00
Ryan Houdek
1997ae1ae9
Adds more soft float functions
2020-09-22 23:55:21 -07:00
Stefanos Kornilios Mitsis Poiitidis
e168e5053a
Merge pull request #410 from Sonicadvance1/pmovmskb
...
Implements MMX PMOVMSKB
2020-09-23 09:51:48 +03:00
Stefanos Kornilios Mitsis Poiitidis
91bea781f4
Merge pull request #408 from Sonicadvance1/rounding_mode_host
...
Adds new IR ops for supporting host rounding mode conversion
2020-09-23 09:50:37 +03:00
Stefanos Kornilios Mitsis Poiitidis
75109050c0
Merge pull request #409 from Sonicadvance1/maskmov
...
Implements MASKMOVQ and MASKMOVDQU
2020-09-23 09:49:20 +03:00
Ryan Houdek
4b35cf3c3e
Merge pull request #405 from Sonicadvance1/HostRunner
...
Implements x86 host runner
2020-09-22 23:36:33 -07:00
Ryan Houdek
f01f3053f5
Merge pull request #407 from Sonicadvance1/remove_undefined_behaviour
...
Removes undefined behaviour in our unit tests
2020-09-22 23:32:17 -07:00
Ryan Houdek
8a62065917
Implements new unit tests for these instructions
2020-09-22 23:23:51 -07:00
Ryan Houdek
74e2f189f1
Implements MASKMOVQ and MASKMOVDQU
...
Without supporting phis this entire loop needs to be unrolled.
I just found out while reading the x86 documentation that this
instruction is explicitly a weakly ordered memory operation.
So this operation can be changed over to a couple vector conditional
loadstores soon after merging
2020-09-22 23:23:51 -07:00