コミットグラフ

29 コミット

作成者 SHA1 メッセージ 日付
Luke Usher 804e6699a4 fix build after updating deps 2024-05-27 10:22:16 +01:00
invertego e369049d0a
nall, libco: add support for risc-v arch (#1249)
Tested with qemu-system-riscv64 and Ubuntu as the guest OS.
2023-10-02 08:45:43 +01:00
invertego 8ed4af8b57
recompiler: avoid overallocation in code buffer (#1247)
sljit performs a single (potentially) oversized executable memory
allocation before generating code. Instead of reserving the requested
amount of space, we can reserve only the used amount and eliminate some
dead space between code blocks.

In some cases sljit may write extra data beyond the generated code.
Because of this, it is no longer safe to assume the remainder of the
code cache is zero initialized. In practice, this assumption only
affected pools which can easily zeroed on demand. This also saves time
on code cache flushes, as we no longer zero the entire cache at once.
2023-09-29 14:14:32 +01:00
invertego 46ddcac339
recompiler: revert "avoid overallocation in code buffer" (#1241)
Turns out the overallocation was masking some bugs in sljit. Will take
this upstream and revert the ares change in the meantime.
2023-09-27 10:08:47 +01:00
invertego 1349d45a51
recompiler: avoid overallocation in code buffer (#1239)
sljit performs a single (potentially) oversized executable memory
allocation before generating code. Instead of reserving the requested
amount of space, we can reserve only the used amount and eliminate some
dead space between code blocks.
2023-09-26 22:22:55 +01:00
invertego 4cfa728413 sh2: fold cached interpreter into recompiler 2023-03-29 06:37:34 +00:00
invertego b178d3d51a build: support 32-bit x86, arm 2023-03-13 11:21:26 +00:00
invertego b872687145 build: avoid use of operator name keywords 2023-03-13 11:21:26 +00:00
Adrian Siekierka c03099fa51 nall, sh2, n64: update to latest sljit 2023-02-07 21:26:32 +00:00
invertego 5866a1b9f1 recompiler: implement masked shifts 2022-12-06 03:34:24 +00:00
invertego 5e8277b290 recompiler: implement bit rotates 2022-12-06 03:34:24 +00:00
invertego 6bd57e790e recompiler: simplify carry flag usage
Using the host carry flag is a bit tricky because on ARM64 (and most
other non-x86 architectures) the meaning of the flag is inverted for
subtraction. There were some helpers in the recompiler to deal with this
but they performed explicit architecture checks which ran counter to the
goals of a generic recompiler.

Reading back the carry flag is now handled directly by sljit. This
feature had been removed from sljit but was recently added back. It
internally tracks whether the setting operation was an add or a subtract
so that x86 semantics are observed on all architectures.

Loading the carry flag is now handled with an explicit add or subtract
that matches the subsequent usage. This results in expected behavior on
all architectures.
2022-11-15 16:06:55 +00:00
invertego 38a7c74f28 build: qualify std::move/forward calls 2022-09-13 09:44:41 +01:00
invertego 8759a7d3e8 n64: precise rsp block invalidation
- The primary lookup table is direct addressed
- The secondary lookup table is indexed by hash of code block contents
- IMEM invalidation is tracked at 64-byte granularity and used to
  evict primary lookup table entries
- The secondary lookup table is only pruned on a full code cache flush
- Only executed instructions are hashed, so the code cache no longer
  experiences unbounded growth
- Code blocks can now wrap around the end of IMEM
- generic::recompiler now supports aborting recompilation (required by
  by an earlier version of this change)
2022-08-30 09:28:37 +01:00
invertego e5d1f2dfea recompiler: update to latest SLJIT API 2022-05-13 18:48:45 +01:00
invertego a8e35d0299 recompiler: rewrite for machine-independence 2021-12-14 09:02:52 +00:00
invertego 3ca1f9ebb4 recompiler: directly emit code for target ABI
Previously, the recompilers in ares would assume the System V calling
convention, then emit extra moves on Windows to handle the differences
in register usage. Now, they directly populate the registers used by the
target system for passing parameters to functions. This is achieved
with register aliases set for the appropriate ABI at compile time.

Furthermore, registers that are nonvolatile only on Windows - rsi and
rdi - are no longer used as temporaries, removing the need to save and
restore them in recompiled code blocks.

This accounts for roughly a 10% reduction in recompiled code size on
Windows while making functionally no difference to other systems.
2021-10-02 10:14:00 +01:00
invertego 394da44a09 recompiler: add label API to simplify emitting branches 2021-09-27 10:41:24 +01:00
invertego 9b99a961f5 recompiler: emit one epilog per block 2021-09-27 10:41:24 +01:00
invertego d17a5ea045 recompiler: use IP-relative direct branches when possible 2021-09-27 10:41:24 +01:00
Luke Usher 1e4683fbac nall:: speed up recompiler codegen
agressive inlining allows for a slight performance increase when
emitting code.
2021-07-16 21:01:49 +01:00
Near 1b574d0bb5 Update to ares v119r16 release.
- Mega Drive: VDP scanline renderer compiles once more
  - Nintendo 64: improved dynamic recompiler
  - PlayStation: began adapting CPU cached interpreter into a dynamic
    recompiler
  - lucia: allow mapping analog axes separately (allows mapping sticks to
    the keyboard)

All that's left now is fixing the call() function in the N64/PS1 to support >3
(4) arguments on Windows and we can release v120
2021-05-05 03:10:00 +00:00
Near 25771ba202 Update to ares v119r15 release.
- Nintendo 64: began adapting CPU cached interpreter into a dynamic
    recompiler
  - Nintendo 64: began adapting RSP cached interpreter into a dynamic
    recompiler
  - Nintendo 64: added 64-bit addressing and TLB supporting
  - Nintendo 64: added endian support to [LS][WD][LR] instructions

I could really use a hand with my CPU dynarec, n64/cpu/recompiler.cpp line 1335.

When calling an FPU instruction without SCC coprocessor 1 enabled, it throws an
exception.

If I call the exception function, the emulator crashes hard and I don't
understand why at all.

The stack is aligned, but it seems if I modify rbx/rbp/r13 as I do with the
RSP+SH2 just fine, it seems to die. Yet even if I make that code restore
rbx/rbp/r13 before calling the coprocessor exception function, it still dies.
Really at a loss >_>

Also, this will only work on Linux/BSD at the moment. The RSP vector functions
pass four parameters, and my Windows call wrapper can only handle 3 arguments
because after that the argument has to go on the stack. I'll fix that later.
2021-05-04 08:31:00 +00:00
Near b3aeb41ee5 Update to ares v119 release.
I'm releasing ares v119 today, which includes very preliminary Sega 32X
emulation support. Compatibility is currently at around 50% with the dynamic
recompiler, probably closer to 75% with the cached interpreter, and since the
system requirements were a bit too steep (on account of my Mega Drive core being
cycle/dot-accurate), I downclocked the SH2s a bit until I can speed up the
emulator more. You'll currently need about a Ryzen 5 2600 to hit 60fps reliably.
With the underclock, my Ryzen 7 5800X hits 120fps, and without it, 85fps.

Although the compatibility for the new 32X core is a bit low, this is mostly due
to pesky CPU bugs. The accuracy is quite high and I've emulated as much of the
32X and SH7604 peripheral functions as possible. I pass all 161 tests from the
Mars Check Program. It should not take much more work to reach 98% compatibility
in the future. Sega CD 32X emulation support is present, but is likely not
functional, as I haven't tested it yet.

Other major features in this release include Sega SVP support for Virtua Racing,
plus improved Nintendo 64, Mega Drive, and Mega CD emulation compatibility.

I'm going to start working on Sega Saturn emulation now, while Luke Usher works
on Neo Geo emulation. No promises as to when or if these cores will become
playable, I'm just giving you all a heads up since you'll see the skeletons for
these systems in the source code now.

Changelog:

  - Nintendo 64: improved Expansion Pak detection
  - Nintendo 64: fixed swapped L and R buttons [simer]
  - Nintendo 64: emulated the RST bit for gamepads
  - ruby: added library detection support for the Linux and BSD targets
  - lucia: gained support for game paks (custom file dialog only)
  - Super Famicom: added support for Super Game Boy, Sufami Turbo, and BS
    Memory packs
  - hiro: made SourceEdit optional for gtk2 and gtk3 targets (disabled
    for ares)
  - Nintendo 64: emulated 2048-byte EEPROM identifier and transfer protocol
  - Super Famicom: corrected ppu-performance widths table indexing to consider
    overscan
  - Mega CD: fixed a bug in register $ff8003; allows Popful Mail to boot
    [TascoDLX]
  - Mega Drive: fixed a bug with 256-width video modes
  - Mega Drive: improved VDP DMA emulation which should fix many games
  - Mega Drive: added SVP emulation
  - Mega Drive: added 32X emulation
  - Mega CD: fixed a bit-masking bug in register $ff8004; fixes Radical Rex
    [TascoDLX]
  - Nintendo 64: fixed C implementation of RSP VMACU instruction
  - Nintendo 64: use correct NTSC and PAL PIF ROM images based on the region
  - Mega Drive: fixed reset logic, Z80 interrupt timing + prefix timing +
    bus control [TascoDLX]
  - Mega CD: fixed word RAM access and CDC DMA word RAM transfers [TascoDLX]
  - Nintendo 64: improved RSP VMOV emulation [Rasky]
  - Nintendo 64: fixed RSP DMEM DMA alignment (&~7, not &~3) [Rasky]
  - Nintendo 64: upgraded to the latest version of ParaLLEl-RDP
  - nall: greatly expanded recompiler/amd64's supported intrinsics
  - mia: substantial refactoring around a new virtual filesystem implementation
    from nall
2021-03-31 04:38:00 +00:00
Near d0258c76e6 Update to ares v118r16 release.
My latest ares WIP hooked up 128KB VRAM mode to my fast SNES PPU.
2021-03-27 20:22:00 +00:00
Near 7656765f30 Update to ares v117 release.
[No official changelog available for this version. -Ed.]
2021-02-08 09:11:00 +00:00
Near 4af59c63f1 Update to ares v116r07 release.
[No official changelog available for this version. -Ed.]
2021-01-14 21:00:00 +00:00
Near 70cdb5b199 Update to ares v115a release.
[No official changelog available for this version. -Ed.]
2020-07-26 17:29:00 +00:00
Near 6cd757dae8 Update to ares v114r03 release.
- nall: added bump_allocator class
  - Nintendo 64: restructured dynamic recompilers to be cleaner
2020-06-13 20:40:00 +00:00