Hendiadyoin1
688782efab
UserspaceEmulator: Don't interpret SSE2 instructions as MMX ones
...
This is a huge FIXME right now, and should either be delegated to
SoftVPU or handled in these instructions.
2022-04-06 18:30:22 +02:00
Hendiadyoin1
1d2ad9cf61
UserspaceEmulator: Don't mark SoftFPU::mmx_get/set as ALWAYS_INLINE
...
These are exposed by SoftCPU, and this attribute would cause these not
to create any symbols to link against.
2022-04-02 18:37:38 +02:00
Idan Horowitz
086969277e
Everywhere: Run clang-format
2022-04-01 21:24:45 +01:00
Hendiadyoin1
cd21e03225
AK+Everywhere: Add sincos and use it in some places
...
Calculating sin and cos at once is quite a bit cheaper than calculating
them individually.
x87 has even a dedicated instruction for it: `fsincos`.
2022-03-15 11:39:42 +01:00
Hendiadyoin1
47fe911196
UserspaceEmulator: Clear c0 on x87 constant load instructions
2022-03-15 11:39:42 +01:00
Hendiadyoin1
3f581c77d9
UserspaceEmulator: Make error checks in FYL2XP1 and FYL2X a bit closer
...
...to the manual
This removes the non complete NaN checks and fixes a bounds check in
FYL2X.
2022-03-15 11:39:42 +01:00
Hendiadyoin1
60cb5b8dfa
UserspaceEmulator: Add more FIXMES to SoftFPU
...
This also includes an exception check for sqrt and two
pow(2,...) -> exp2(...) changes.
2022-03-15 11:39:42 +01:00
Ali Mohammad Pur
f6e82a8e0a
UserspaceEmulator: Make it possible to wrap PODs in ValueWithShadow
...
Instead of making it hold the shadow data as another `T`, make it hold
the data as a byte array, and allow it to read the byte array as `T`.
This makes it much easier to make a "read_typed" function in the MMU.
2022-03-04 20:07:05 +01:00
Hendiadyoin1
83f50a1507
UserspaceEmulator: Raise an error on FPU stack underflow
...
Accessing an unset part of the FPU stack should not be a simple warning,
but should trigger the FPU exception mechanism.
2021-11-07 22:42:23 +00:00
Hendiadyoin1
0d6d780183
UserspaceEmulator: Remove some unnecessary casting
2021-11-07 22:42:23 +00:00
Hendiadyoin1
d759175767
UserspaceEmulator: Stop overriding flags in FCOMI
...
We no longer override the flags we just set. We now also unset of, af,
and sf after the comparison.
This fixes the asin function for LibM!
2021-11-07 22:42:23 +00:00
Hendiadyoin1
f2eff767a0
UserspaceEmulator: Fix typos in SoftFPU.[cpp|h]
2021-11-07 22:42:23 +00:00
Hendiadyoin1
5d2a4bd18d
UserspaceEmulator: Check the right flags in FCMOV
...
Also make FCMOVNB do an actual CMOV and not a copy of FILD_m32
2021-11-07 22:42:23 +00:00
Hendiadyoin1
8108aaca39
UserspaceEmulator: Correct FSCALES rounding
...
We were rounding the wrong way, FSCALE is supposed to trunc internally,
while we were flooring.
Now LibM exponentials and related tests work :^)
2021-11-07 22:42:23 +00:00
Hendiadyoin1
fa02b46295
UserspaceEmulator: Always set C1 when rounding
2021-11-07 22:42:23 +00:00
Hendiadyoin1
7214b08f81
UserspaceEmulator: Simplify the definition of the FPU register stack
...
Long doubles are always at least 80 bits wide in memory and it suffices
if we can address these 80 bits, to mark the long double as NAN at the
end of an MMX instruction, so the additional magic using conditional
types is unnecessary.
2021-11-07 22:42:23 +00:00
Nico Weber
6c9bc18a79
Userland: Fix typos
2021-10-01 01:18:52 +01:00
Hendiadyoin1
45d0f84a27
UserspaceEmulator: Implement SoftFPU instructions
...
This implements almost all instructions related to the FPU, including
all MMX instructions as well.
A lot of these were copied and adjusted from the SoftCPU implementation.
The next big milestone would be QNan detection and ShadowValue handling.
2021-07-22 23:33:21 +02:00
Hendiadyoin1
09a1a0b319
UserspaceEmulator: Sketch out a SoftFPU interface
2021-07-22 23:33:21 +02:00