Lioncache
2f5fae7677
OpcodeDispatcher: Remove unnecessary moves from AVX register shifts
...
Zero-extension will occur automatically when necessary upon storing.
2023-08-22 23:06:53 -04:00
Lioncache
8f8062eb4e
OpcodeDispatcher: Remove redundant moves from AVX immediate shifts
...
These zero-extensions will occur automatically when applicable.
2023-08-22 22:50:10 -04:00
Lioncache
e5f5629ffc
OpcodeDispatcher: Remove unnecessary moves from AVX conversion operations
...
These zero-extensions will already happen automatically if necessary.
2023-08-22 22:20:13 -04:00
Ryan Houdek
ead141fd90
Merge pull request #2962 from lioncash/variable
...
OpcodeDispatcher: Remove unnecessary moves from AVXVariableShiftImpl
2023-08-22 18:52:47 -07:00
Lioncache
2b071e282e
OpcodeDispatcher: Remove unnecessary moves from AVXVariableShiftImpl
...
We already zero-extend on a store if necessary.
2023-08-22 21:20:34 -04:00
Ryan Houdek
14144523f7
Merge pull request #2961 from lioncash/minpos
...
OpcodeDispatcher: Remove unnecessary move from VPHMINPOSUW
2023-08-22 18:19:46 -07:00
Ryan Houdek
1f2c5fc6c6
Merge pull request #2960 from lioncash/index
...
Arm64: Optimize SVE VInsElement
2023-08-22 18:19:13 -07:00
Lioncache
fa17d9fae9
OpcodeDispatcher: Remove unnecessary move from VPHMINPOSUW
...
We already do a zero-extend if necessary in StoreResult.
This also lets us unify both the SSE and AVX handling code.
2023-08-22 20:59:56 -04:00
Lioncache
398a70312e
Arm64: Optimize SVE VInsElement
...
This can be done without storing any data to memory and also
compressing the amount of instructions being used.
Thanks to @dougallj for the optimization suggestions.
2023-08-22 20:36:29 -04:00
Ryan Houdek
d3ed9766e8
X86Tables: Optimize MOVLPD stores
...
Just use the full register size and store the lower bits.
2023-08-22 17:33:34 -07:00
Ryan Houdek
c795d42d21
OpcodeDispatcher: Optimize phminposuw
...
I would now consider the XMM version of this to be optimal.
Thanks to @rygorous for giving the idea for how to optimize this!
2023-08-22 16:29:06 -07:00
Ryan Houdek
bbf9cb9d52
IR: Implements new VRev32 and LoadNamedVectorConstant ops
...
VRev32 matches Arm64 semantics directly.
LoadNamedVectorConstant allows FEX to quickly load "named constants".
This will allow us to have specific hardcoded vector constant values
that we can load with a ldr(State)+ldr(Value) and will be more abused in
the future.
This also allows us to do a very simple optimization in the future where
we can optimize away redundant loads of these loads if they are used
multiple times in the same block. (Not implemented here).
2023-08-22 16:29:06 -07:00
Mai
6c7933e7b1
Merge pull request #2957 from Sonicadvance1/optimize_pfnacc
...
OpcodeDispatcher: Optimize PFNACC
2023-08-22 10:10:11 -04:00
Ryan Houdek
364f084604
Merge pull request #2956 from Sonicadvance1/optimize_hsubp
...
OpcodeDispatcher: Optimize hsubp
2023-08-21 20:47:50 -07:00
Ryan Houdek
ffa8f1e3dc
Merge pull request #2955 from lioncash/sign
...
OpcodeDispatcher: Remove redundant move from VPSIGN
2023-08-21 20:47:41 -07:00
Ryan Houdek
ad6738939b
OpcodeDispatcher: Optimize PFNACC
...
Turns out this can be even more optimal.
2023-08-21 20:38:18 -07:00
Ryan Houdek
dcb3e4ee86
OpcodeDispatcher: Optimize hsubp
...
This makes the SSE version optimal.
This dramatically improves the AVX version as well.
2023-08-21 20:22:14 -07:00
Lioncache
dbbe6288de
OpcodeDispatcher: Remove redundant move from VPSIGN
...
StoreResult will already zero-extend if the vector is 128-bit.
2023-08-21 23:11:07 -04:00
Ryan Houdek
1563398d2c
OpcodeDispatcher: Optimize pmuludq
...
MMX version was already optimal, SSE version is now also.
AVX version is significantly improved.
2023-08-21 20:07:35 -07:00
Lioncache
920a0fb132
OpcodeDispatcher: Remove redundant move in AVXVectorScalarALUOpImpl
...
Our store will already zero-extend if the vector is 128-bit.
2023-08-21 22:39:07 -04:00
Lioncache
ce8169794f
OpcodeDispatcher: Remove redundant moves in AVXVectorALUOp
...
We already zero-extend on a store if we have 256-bit vectors and the stored
vector is 128-bit.
2023-08-21 22:13:29 -04:00
Mai
185e3bfcb6
Merge pull request #2950 from Sonicadvance1/optimize_pmaddwd
...
OpcodeDispatcher: Optimize pmaddwd
2023-08-21 21:39:30 -04:00
Mai
3c49b3238a
Merge pull request #2949 from Sonicadvance1/optimize_phsub
...
OpcodeDispatcher: Optimize phsub
2023-08-21 21:39:02 -04:00
Ryan Houdek
2d7a3a578e
Merge pull request #2931 from Sonicadvance1/optimize_psign
...
Optimize PSIGN and VBSL
2023-08-21 18:30:55 -07:00
Ryan Houdek
3a2a576c35
Merge pull request #2951 from lioncash/shift
...
OpcodeDispatcher: Handle zero immediate shifts better
2023-08-21 18:20:18 -07:00
Ryan Houdek
869136b907
OpcodeDispatcher: Optimize pmaddwd
...
This is actually fairly trivial looking at it.
2023-08-21 17:53:32 -07:00
Lioncache
af8b6766d8
OpcodeDispatcher: Handle zero immediate shifts better
...
In the SSE and lower cases, we don't need to do anything,
since the value is already in the destination.
2023-08-21 20:46:41 -04:00
Ryan Houdek
30e9beba51
JIT64: Fixes i32v2 unzips
...
This has just been broken since it was implemented. Turns out we had
never used these with XMM operations before today.
2023-08-21 17:38:24 -07:00
Ryan Houdek
a29076244f
OpcodeDispatcher: Optimizes mpsadbw
...
Two optimizations here:
1) The final VInsElement was generating three instructions
- This itself could have been change to vzip, which would have
removed two instructions.
2) Optimize how the pairwise elements are calculated to shave one
instruction off the calculation.
- addp odd elements and even elemnts first
- Then transpose those elements
- Then use one final addp to generate the result in the correct
order.
The ext+uabdl+addp pairs of operations could be reordered to shave off
one temporary register usage if we really care later.
2023-08-21 16:56:41 -07:00
Ryan Houdek
445c43792b
OpcodeDispatcher: Optimize phsub
...
This was...surprisingly bad. I blame myself entirely.
2023-08-21 16:54:35 -07:00
Ryan Houdek
b35f4df798
OpcodeDispatcher: Optimize SSE pmaddubsw
...
Can be slightly more optimal with a slightly change algorithm but will
require implementing some IR ops which can be put off. It's only about
an instruction savings.
2023-08-21 16:21:01 -07:00
Lioncache
f1d020ce95
Interpreter: Tie SSA data elements to supported vector width
...
Now, if we ever increase our vector sizes, the allocated data elements
will follow suit without needing to remember to handle this as well.
2023-08-21 14:41:00 -04:00
Lioncache
a9a7cbce21
Interpreter: Use alias for temporary vector data
...
Lets us extract the size into one location for easy size
changes in the future if necessary.
2023-08-21 14:12:55 -04:00
Ryan Houdek
a3bf952f2b
IR: Implements support for wide scalar shifts
...
This matches x86 vector shift behaviour closely for ps{rl,ra,ll}{w,d,q}
where the vector is shifted by a scalar value that is 64-bits wide.
Anything larger than the element size will set that element to zero.
With SVE we have some new wide element shifts that match this behaviour
exactly (except supports wide shift sources rather than scalar).
This is a significant improvement even on platforms that only support
128-bit SVE.
2023-08-20 19:16:40 -07:00
Ryan Houdek
ac77986c44
IR: Implements support for saturating/rounding vector shifts
2023-08-20 13:38:23 -07:00
Ryan Houdek
c5f5a03c68
OpcodeDispatcher: Optimize PSIGN
...
This dramatically improves the performance of the PSIGN instructions.
2023-08-20 13:38:23 -07:00
Ryan Houdek
1ed9ec63be
Arm64: Optimize BSL when possible.
...
With ASIMD FEX would never optimize BSL out of fear if some registers
overlapped it would break things. So it had previously always moved to a
temporary first and then moved the result back out when done.
Now instead check upfront if any of the source registers overlap the
destination. If the destination register overlaps any of the three
sources we can bsl, bit, or bif depending on which register gets
overlapped.
Worst case the destination doesn't overlap any of the source registers
and still needs these moves.
2023-08-20 13:38:23 -07:00
Ryan Houdek
a523858f66
Merge pull request #2923 from Sonicadvance1/nonnull_legacy_segment_telemetry
...
FEXCore: Adds telemetry around legacy segment register setting
2023-08-20 10:27:56 -07:00
Ryan Houdek
9e4888c6a1
Merge pull request #2930 from Sonicadvance1/support_push
...
OpcodeDispatcher: Implement support for push IR operation
2023-08-20 10:25:26 -07:00
Lioncache
8167626a07
x86_64/VectorOps: Properly handle VExtr element sizes other than bytes
...
We need to convert the index into a byte index.
2023-08-20 13:03:27 -04:00
Lioncache
c3778a9729
OpcodeDispatcher: Improve SHA1MSG1 output
...
We can simplify these inserts down to a single EXT
2023-08-20 12:50:07 -04:00
Ryan Houdek
34722348e8
Merge pull request #2912 from Sonicadvance1/optimize_flag_clearing
...
OpcodeDispatcher: Minor optimization around clearing flags
2023-08-19 23:03:40 -07:00
Lioncache
1fbf193739
Arm64/EncryptionOps: Use MOVI reg, #0 to zero vectors
...
This is a little more optimal than XORing the vector by itself.
2023-08-19 23:20:36 -04:00
Ryan Houdek
92c3014aaa
OpcodeDispatcher: Minor optimization around clearing flags
...
When clearing multiple flags it is more optimal to load the mask
constant in to a register and then clear with a single and/bic.
Back to back bfi is actually less optimal due to dependency tracking.
With #2911 , this is a total win since this hits an edge case with
constant loading that #2911 fixes.
2023-08-19 20:14:37 -07:00
Mai
affbcd2241
Merge pull request #2928 from Sonicadvance1/remove_x18_saving
...
Arm64Emitter: Stop saving and restoring platform register
2023-08-19 23:11:44 -04:00
Ryan Houdek
b973c193be
Merge pull request #2939 from lioncash/round
...
OpcodeDispatcher: Eliminate redundant moves in {AVX}VectorRound
2023-08-19 19:29:01 -07:00
Ryan Houdek
4c409ea47d
Merge pull request #2938 from lioncash/fcmp
...
OpcodeDispatcher: Eliminate unnecessary moves in {AVX}VFCMPOp
2023-08-19 19:27:24 -07:00
Ryan Houdek
ac53913c37
Merge pull request #2937 from lioncash/scalarunary
...
OpcodeDispatcher: Remove unnecessary moves in {AVX}VectorUnaryOp
2023-08-19 19:22:10 -07:00
Ryan Houdek
2224c23c79
Merge pull request #2934 from lioncash/scalarfp
...
OpcodeDispatcher: Remove extraneous moves in {V}CVTSD2SS/{V}CVTSS2SD
2023-08-19 19:20:20 -07:00
Ryan Houdek
6ce380d7a9
Merge pull request #2936 from lioncash/scalaralu
...
OpcodeDispatcher: Remove unnecessary moves in {AVX}VectorScalarALUOp
2023-08-19 19:09:06 -07:00