Alyssa Rosenzweig
50a3ca0d6d
IR: introduce dedicated PF/AF instructions
...
this makes reasoning about them a little easier, e.g. for flags. about 1% win
in nodejs.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-09-07 10:59:05 -04:00
Alyssa Rosenzweig
8745455a5b
IR: track whether parity is read
...
so we can gate optimizations efficiently
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-09-07 08:26:04 -04:00
Alyssa Rosenzweig
e9ab514962
IR: push parity evaluation down
...
so we can optimize it globally
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-09-07 08:26:04 -04:00
Alyssa Rosenzweig
4eb0948451
IR: push down AXFLAG lowering
...
so we can get the new axflag optimizations on billy's x13s.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-09-07 08:26:04 -04:00
Alyssa Rosenzweig
8d9f19bd73
IR: add TestZ op
...
more optimized than TestNZ if we don't care about the sign bit.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-09-07 08:26:04 -04:00
Alyssa Rosenzweig
6d4693cbc1
IR: fix scalar FMA tied sources
...
needs to be modelled explicitly or else we lose information when translating
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-09-04 07:42:44 -04:00
Alyssa Rosenzweig
ce8e6e5c0c
OpcodeDispatcher: optimize adc 0
...
clang generates this.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-22 10:51:06 -04:00
Alyssa Rosenzweig
d53e689e22
IR: model tbz/tbnz
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-21 17:52:22 -04:00
Alyssa Rosenzweig
d0e040514f
IR: add LoadContextPair
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-20 18:31:19 -04:00
Alyssa Rosenzweig
850c027d52
IR: add AllocateFPR
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-20 18:31:19 -04:00
Alyssa Rosenzweig
5df90563e2
IR: add LoadMemPair
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-20 18:31:19 -04:00
Alyssa Rosenzweig
7a489d18c6
IR: add StoreMemPair
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-20 18:31:19 -04:00
Alyssa Rosenzweig
1db092e96f
IR: add StoreContextPair
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-20 18:31:19 -04:00
Alyssa Rosenzweig
7de6a5cb07
OpcodeDispatcher: optimize rotate flags
...
introduce an IR op for it so we can reason about flags across rotate
instructions easily.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-19 10:40:53 -04:00
Alyssa Rosenzweig
200c6c054f
IR: introduce POP operation
...
rmw on a source, kind of terrible.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-14 09:37:06 -04:00
Alyssa Rosenzweig
64a45c0d29
IR: remove pairs
...
They're now unused. And won't be missed.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-14 09:37:06 -04:00
Alyssa Rosenzweig
cab02be637
IR: remove unused pair create/extract
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-14 09:37:06 -04:00
Alyssa Rosenzweig
74f341bc0e
IR: remove pair from cpuid
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-14 09:37:06 -04:00
Alyssa Rosenzweig
feaa1af1a8
IR: remove pair from XGetBV
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-14 09:37:06 -04:00
Alyssa Rosenzweig
d59d040b4e
IR: add design doc breadcrumb
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-14 09:17:23 -04:00
Alyssa Rosenzweig
a9c26cbf71
IR: add coalescing heuristics for pair replacements
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-14 09:17:23 -04:00
Alyssa Rosenzweig
13974df204
IR: drop CASPair pair result
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-14 09:17:23 -04:00
Alyssa Rosenzweig
fa6fe9bf06
IR: drop cmppairz pairs
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-14 09:17:23 -04:00
Alyssa Rosenzweig
746be0824e
IR: drop CASPair source pairs
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-14 09:17:23 -04:00
Alyssa Rosenzweig
93120cabbb
IR: drop pair from memcpy
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-14 09:17:23 -04:00
Alyssa Rosenzweig
04ae05f4ce
IR: add hack for multiple destinations
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-14 09:17:23 -04:00
Alyssa Rosenzweig
83773dddc7
IR: fix size for cmppairz
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-14 09:17:23 -04:00
Alyssa Rosenzweig
d9c779289c
OpcodeDispatcher: simplify RDRAND
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-10 15:18:00 -04:00
Alyssa Rosenzweig
5631ff4fd5
OpcodeDispatcher: optimize variable shifts
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-10 13:06:43 -04:00
Alyssa Rosenzweig
3b8cd44ca4
IR: add NZCVSelectIncrement
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-08-10 13:06:43 -04:00
Ryan Houdek
3c5b59d985
AVX128: Implement support for scalar FMA with AFP
...
Now that I have AFP supporting hardware I felt better implementing this
since I can run unit tests.
Fixes #3793
2024-07-22 12:58:19 -07:00
Alyssa Rosenzweig
587b924de9
json_ir_generator: stop prefixing arguments
...
stop prefixing the arguments when we generate allocate ops (in particular), this
is more convenient and simpler. in exchange we need to prefix Op to avoid a
collision on fcmpscalarinsert which has an argument named Op, but that's a local
change at least.
came up when experimenting with new IR, but I think this is probably a win by
itself.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-07-22 13:50:21 -04:00
Alyssa Rosenzweig
d20b46e46f
IR: drop LoadFlag/StoreFlag ops
...
pointless, we can just load/store the context now.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-07-21 15:49:09 -04:00
Ryan Houdek
b78da2e5ad
Arm64: Implements support for DAZ using AFP.FIZ
...
When AFP is supported then we can actually support DAZ. This might also
fix the audio corruption in Animal Well but I can't test it until Steam
is running on Oryon. Requires a bit of plumbing for MXCSR which we were
hacking around before but now we actually want to store the value.
Fixes #3856
2024-07-20 15:34:54 -07:00
Alyssa Rosenzweig
e7d5a01c5f
IR: remove F80Cmp flags
...
nothing is optimizing around this, it's just adding pointless complexity. if we
want to actually optimize F80Cmp, the right way would be to lift the
implementation into the OpcodeDispatcher or JIT. it wouldn't be terribly
difficult. This kludge doesn't get us closer there.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-07-16 14:53:58 -04:00
Alyssa Rosenzweig
0c3a8d0bc8
IR: remove GetHostFlag
...
it doesn't get host flags, it's just an extra Bfe used in x87. pointless and
confusing!
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-07-16 14:44:34 -04:00
Paulo Matos
8d89adef2e
Add IR stack operations
...
These IR operations deal implicitly with the x87 stack and are removed
by the x87 stack optimization pass.
2024-07-16 09:07:35 +02:00
Alyssa Rosenzweig
476ee0cd7d
IR: track whether x87 is used in header
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-07-16 09:07:35 +02:00
Ryan Houdek
4c21aa2604
Arm64: Implement support for NT Loads with ASIMD fallback
2024-07-10 23:06:46 -07:00
Mai
af6a0be832
Merge pull request #3842 from Sonicadvance1/fix_f64_to_i32
...
VCVT{T,}PD2DQ fixes and optimization
2024-07-09 03:49:31 -04:00
Ryan Houdek
d3d76aa8ce
IR: Adds new F64 -> I32 operation that changes behaviour depending on SVE
...
SVE added the ability to do F64 -> I32 conversions directly without an
fcvtn inbetween. So maybe sure to support them.
2024-07-09 00:38:47 -07:00
Ryan Houdek
c5a0ae7b34
IR: Adds new QPS gather load variant!
2024-07-08 17:19:18 -07:00
Ryan Houdek
c168ee6940
Arm64: Implements VSSHLL{,2} IR ops
2024-07-06 18:32:35 -07:00
Ryan Houdek
ba04da87e5
Merge pull request #3780 from Sonicadvance1/optimize_gathers
...
Optimize gathers slightly
2024-07-02 10:58:38 -07:00
Ryan Houdek
2b4cec8385
Arm64: Implement support for non-temporal vector stores
2024-06-29 22:03:17 -07:00
Ryan Houdek
47fd73f6cf
Arm64: Optimize non-SVE gather load
...
When FEX hits the optimal case that the destination isn't one of the
incoming sources (other than the incomingDest source) then we can
optimize out two moves per 128-bit lane.
Cuts 256-bit non-SVE gather loads from 50 instructions down to 46.
2024-06-29 13:02:10 -07:00
Ryan Houdek
f6a0866fbb
IR: Split Vector_FToF2 in to VFCVTL2 and VCVTFN2
...
I forgot in the narrowing case we need to be careful about insert. No IR
op used Vector_FToF2 with narrowing.
2024-06-26 14:03:41 -07:00
Ryan Houdek
756fa2ecc5
Merge pull request #3766 from alyssarosenzweig/opt/f16c-round
...
Optimize vcvtps2ph
2024-06-26 14:03:24 -07:00
Alyssa Rosenzweig
d2324f4a93
OpcodeDispatcher: optimize vcvtps2ph
...
We can avoid a LOT of pointless work with some dedicated IR ops for specifically
overriding the round mode.
Small behaviour change here: we no longer reset FTZ. I think this is a bug fix?
But if it's not it's not hard to fix.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-06-26 16:46:21 -04:00
Ryan Houdek
5472d1cc04
Arm64: Implement VLoadVectorGatherMasked operation
...
This does a gather load three ways, SVE256, SVE128, and ASIMD.
This operation is a bit special since it it can't quite handle all
gather loadstores in the 256-bit case and requires the frontend to
decompose the operation in the case that the striding hits a mode that
SVE doesn't support!
The 128-bit case is a lot simpler since both support all the cases where
stride doesn't match. I find this to be a nice compromise while there
aren't any SVE256 products on the market.
In the 128-bit case there is an SVE path which is utilized if the passed
in stride supports what SVE understands, otherwise it falls back to an
ASIMD implementation which manually emulates everything that is
necessary.
This instruction is very explicitly doing basically exactly what AVX
gather instructions want, because it's complex enough that we don't want
to try and make this a generic solution.
2024-06-26 16:00:53 -04:00