Ryan Houdek
cc635a54f8
IR: Implements support for prefetch operation
2024-03-12 21:19:50 -07:00
Ryan Houdek
217d9d8c50
ARMEmitter: Fixes prfm with negative or unaligned offsets
2024-03-12 21:18:23 -07:00
Tony Wasserka
a047ac1699
Allocator: Test CollectMemoryGaps instead of StealMemoryRegions and restore the original interfaces
2024-03-12 10:49:31 +01:00
Tony Wasserka
bb0b114fc8
Allocator: Miscellaneous cleanups
2024-03-12 10:49:30 +01:00
Tony Wasserka
ccd6c15316
Allocator: Use std::from_chars instead of parsing digits manually
2024-03-12 10:49:30 +01:00
Tony Wasserka
0a1fe1c8c2
Allocator: Parse process mappings per-line instead of per-character
2024-03-12 10:49:30 +01:00
Tony Wasserka
f43fe5fd63
Allocator: Stop parsing more eagerly
...
This is a soft-revert of eaf83aa . That change is no longer needed, since the
stack special case is handled externally now.
2024-03-12 10:49:30 +01:00
Tony Wasserka
dce9f651fd
Allocator: Split off memory gap collection to a separate function
...
This function can be unit-tested more easily, and the stack special is more
cleanly handled as a post-collection step.
There is a minor functional change: The stack special case didn't trigger
previously if the range end was within the stack mapping. This is now fixed.
2024-03-12 10:49:30 +01:00
Tony Wasserka
0d71f169d0
Allocator: Adopt a more testable interface for StealMemoryRegions
2024-03-12 10:49:30 +01:00
Tony Wasserka
430ac0f70a
Allocator: Fix format strings
2024-03-12 10:49:30 +01:00
Alyssa Rosenzweig
7629007cfa
OpcodeDispatcher: allow upper garbage on STOS
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-03-11 18:50:31 -04:00
Alyssa Rosenzweig
03c6abdad4
OpcodeDispatcher: optimize DF add
...
fuse the shift the right way
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-03-11 18:50:31 -04:00
Alyssa Rosenzweig
c99cbe6d0a
JIT: switch DF representation
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-03-11 18:50:31 -04:00
Alyssa Rosenzweig
e3ee65e491
OpcodeDispatcher: use transformed DF for memset/memcpy
...
Use the 1/-1 representation instead of 0/1. This will be better by the end of
the series.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-03-11 18:50:31 -04:00
Alyssa Rosenzweig
aee00f524c
OpcodeDispatcher: use DF retrieval helpers
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-03-11 18:50:31 -04:00
Alyssa Rosenzweig
a76321c6c1
OpcodeDispatcher: add DF retrieval helpers
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-03-11 18:50:31 -04:00
Ryan Houdek
c37a12e806
Merge pull request #3490 from Sonicadvance1/disable_assert
...
Disable assert in release
2024-03-11 15:48:18 -07:00
Alyssa Rosenzweig
92f31648b9
RCLSE: optimize out pointless stores
...
can help a lot of x86 code because x86 is 2-address and a64 is 3-address, so x86
ends up with piles of movs that end up dead after translation
It's not a win across the board because our RA isn't aware of tied registers so
sometimes we regress moves. But it's a win on average, and the RA bits can be
improved with time.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-03-11 18:41:23 -04:00
Alyssa Rosenzweig
85f8ad3842
JIT: fix sha256msg1 encoding
...
botched move in the !tied reg case.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-03-11 18:41:23 -04:00
Ryan Houdek
54403e2146
Disable assert in release
...
Arguments and conditional doesn't get optimized out in release builds
for the inline function call versus the define.
Was showing up an annoying amount of time when testing.
2024-03-10 22:01:50 -07:00
Paulo Matos
a86f2d3e2c
Improve 32bit constant usage in memory addressing
...
Folds reg+const memory address into addressing mode,
if the constant is within 16Kb.
Update instcountci files.
Add test 32Bit_ASM/FEX_bugs/SubAddrBug.asm
2024-03-05 14:01:32 +00:00
Alyssa Rosenzweig
11880459a5
OpcodeDispatcher: use SETF for DEC
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-03-01 19:40:53 -04:00
Alyssa Rosenzweig
0ef0bb2c97
OpcodeDispatcher: use SETF for INC
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-03-01 19:40:53 -04:00
Alyssa Rosenzweig
72edee7c6f
IR: add SETF8/SETF16 ir ops
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-03-01 19:40:53 -04:00
Ryan Houdek
009ae55ff0
Merge pull request #3475 from alyssarosenzweig/opt/lock-dec
...
Optimize lock dec
2024-02-29 08:44:24 -08:00
Ryan Houdek
98572b9e23
Merge pull request #3473 from Sonicadvance1/remove_mov_swap
...
Arm64: Stop moving source in atomic swap
2024-02-29 08:44:16 -08:00
Alyssa Rosenzweig
fed5e6d546
OpcodeDispatcher: use fetchadd for atomic DEC
...
Avoids a NEG.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-02-29 09:28:21 -04:00
Alyssa Rosenzweig
f27e2246e2
Merge pull request #3468 from alyssarosenzweig/opt/miscs
...
Misc little opts
2024-02-29 09:18:17 -04:00
Ryan Houdek
eaf83aa6b4
Fix reserving range check
...
Fixes an issue where TestHarnessRunner was managing to reserve the space
below stack again, resulting in stack growth breaking. Would typically
only show up when using the vixl simulator under gdb for some reason.
This is likely the last bandage on this code before it gets completely
rewritten to be more readable.
2024-02-29 04:02:05 -08:00
Ryan Houdek
c318947695
Arm64: Stop moving source in atomic swap
...
ldswpal doesn't overwrite the source register and only reads the bits
required for the sized operation.
Not sure exactly why we were doing a copy here.
Removing it means improving Skyrim's hottest code block, as seen in #3472
2024-02-29 03:07:05 -08:00
Alyssa Rosenzweig
811487ad98
OpcodeDispatcher: use real branch for INT
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-02-28 10:35:12 -04:00
Alyssa Rosenzweig
4f4e38ace2
OpcodeDispatcher: use real branch for rep cmps
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-02-28 10:35:12 -04:00
Alyssa Rosenzweig
edd6becc56
OpcodeDispatcher: use real branch for rep scas
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-02-28 10:35:12 -04:00
Alyssa Rosenzweig
e47a94cae7
OpcodeDispatcher: skip mask with shld
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-02-28 10:18:29 -04:00
Alyssa Rosenzweig
cc82dba1ca
OpcodeDispatcher: use mvn for AF with constants
...
This reduces pointless constant usage. For now, it's no net change to
instcountci, but it should make it easier to get wins later. Hopefully.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-02-28 10:18:28 -04:00
Alyssa Rosenzweig
8232669b22
OpcodeDispatcher: simplify
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-02-28 10:00:13 -04:00
Alyssa Rosenzweig
28936073c4
OpcodeDispatcher: allow upper garbage on NEG
...
like SUB.
due to RA silliness, this is a loss for inst count but a win for cycles.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-02-28 09:59:57 -04:00
Alyssa Rosenzweig
ef2559d911
OpcodeDispatcher: allow garbage with SCAS
...
it's just feeding SUB flags which allow it
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-02-28 09:16:08 -04:00
Ryan Houdek
f346f89678
OpcodeDispatcher: Don't use AddShift with no shift
...
This accidentally removed optimizations elsewhere that was only checking
for Add.
2024-02-27 19:56:12 -08:00
Ryan Houdek
139367d248
Merge pull request #3463 from Sonicadvance1/update_xxhash
...
Update xxhash to v0.8.2
2024-02-27 16:39:38 -08:00
Alyssa Rosenzweig
49e798ab2b
Merge pull request #3461 from alyssarosenzweig/opt/sbc
...
Optimize SBC
2024-02-27 11:29:45 -04:00
Ryan Houdek
78a362581d
Update xxhash to v0.8.2
...
Switches to using upstream cmake files.
2024-02-26 23:57:25 -08:00
Ryan Houdek
946c805d84
Merge pull request #3459 from Sonicadvance1/fix_591
...
Capture a 64-bit process trying to jump to 32-bit syscall handler
2024-02-26 21:57:03 -08:00
Ryan Houdek
0b34035085
Merge pull request #3439 from Sonicadvance1/allocate_first_4gb_of_64bit
...
FEXLoader: Allocate the second 4GB of virtual memory when executing 32-bit
2024-02-26 18:46:22 -08:00
Alyssa Rosenzweig
12cc980603
OpcodeDispatcher: shuffle adc flag order
...
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-02-26 16:48:07 -04:00
Alyssa Rosenzweig
f3d55dd721
OpcodeDispatcher: shuffle SBC flag order
...
avoids clobbering nzcv
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-02-26 16:48:07 -04:00
Alyssa Rosenzweig
91cef6b76f
OpcodeDispatcher: use native ADC even for 8/16-bit
...
we mask off the upper bits, and they agree in the lower bits.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-02-26 16:48:07 -04:00
Alyssa Rosenzweig
270cbf39b5
OpcodeDispatcher: specialize SALC
...
this gets rid of the awkward non-flag SBB case, which streamlines SBB. while
getting better codegen for the demon opcode (-:
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-02-26 16:33:41 -04:00
Alyssa Rosenzweig
2e0be0a5e7
OpcodeDispatcher: allow more upper garbage with adc
...
missed this last series.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-02-26 15:42:13 -04:00
Alyssa Rosenzweig
d60c089697
OpcodeDispatcher: allow upper garbage with sbb
...
for the usual reasons
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io >
2024-02-26 15:35:14 -04:00