Compare commits

...

63 Commits

Author SHA1 Message Date
Evan Husted
fe43c32e60 UI: The argument to Play Report value formatters is now a struct containing the current ApplicationMetadata & the BoxedValue that was the only argument previously.
This allows for the title of Mario Kart to be localized when one of the value checkers doesn't match.
2025-02-02 20:47:42 -06:00
Evan Husted
8117e160c2 misc: chore: [ci skip] Move the play report analyzer definition into a PlayReport static class to avoid polluting the Discord integration module 2025-02-02 20:32:01 -06:00
Piplup
bf713a80d6 PlayReportAnalyzer: Added Games (#614)
Added Super Mario Odyssey, Super Mario Odyssey (China), Super Mario 3D
World + Bowser's Fury, Mario Kart 8 Deluxe and Mario Kart 8 Deluxe
(China)
2025-02-02 20:29:00 -06:00
Evan Husted
b38b5a1e70 docs: compat: Saints Row IV: Playable -> Ingame
Deadlock label added.

Game sometimes just stops loading in loading screens. Game continues like its doing something but you'll be sitting there for minutes wondering why nothing is happening.

Considering the game isn't crashing, this might be an emulator-side mutex issue. I've seen that before.
2025-02-02 16:59:06 -06:00
Evan Husted
2d7700949c UI: Play Report Analysis V2
Support for multiple keys per game, and provide an order of resolution via Priority.

(Currently) functionally identical to before, as only BOTW Master Mode is supported.
2025-02-02 16:07:30 -06:00
Evan Husted
ea2287af03 misc: chore: Rewrite play report checker to use a simple loop instead of Gommon Optionals
(I love how a class that's supposed to guard against null values entering your code still allows them thats so cool)
2025-02-02 13:17:31 -06:00
Evan Husted
37af8c70aa UI: RPC: Add the ability for the DiscordIntegrationModule to inspect values in Play Reports and dynamically show different gameplay values, depending on a predefined map of values and formatters.
Currently only BOTW Master Mode is supported.
Open to PRs!
2025-02-02 02:21:33 -06:00
Evan Husted
50cee3fd19 feature: HorizonStatic PlayReportPrinted event 2025-02-02 02:20:14 -06:00
Evan Husted
a46aacf2e2 gpu: Switch the 500ms timeout back to 1s
It seemed like it was waiting for 1 second no matter what; might as well have the log & syncpoint map match reality.
2025-02-01 19:21:19 -06:00
Evan Husted
ad9d6588e8 misc: chore: Collapse HLE swkbd character validation utils into a single class 2025-02-01 14:11:35 -06:00
Evan Husted
38ef65aae0 misc: chore: Move all GeneratedRegex methods into one static class with static instance accessors. 2025-02-01 14:07:32 -06:00
Evan Husted
9f94aa1c79 misc: chore: gpu: Lower default Syncpoint wait timeout from 1 second to 500ms 2025-02-01 03:30:13 -06:00
Evan Husted
2c9a26c11c misc: chore: Regular Architecture bool properties in RunningPlatform without OS constraint 2025-02-01 03:29:24 -06:00
Evan Husted
a4a15a4c80 misc: chore: simplify graphics backend selection logic in RendererHost constructor 2025-02-01 03:28:49 -06:00
Evan Husted
cc3b95eee1 misc: chore: More descriptive error for trying to create a Metal EmbeddedWindow on non-ARM Mac 2025-02-01 03:28:26 -06:00
Evan Husted
2ab806f759 UI: [ci skip] Fix ContentDialog symbols being backwards for right-to-left languages 2025-02-01 01:42:12 -06:00
Evan Husted
6d75410bd2 UI: Use the dynamic Ryujinx/Ryujinx Canary for dialog titles 2025-01-30 21:57:03 -06:00
Evan Husted
196b2eaf66 misc: chore: [ci skip] Remove needless fs integrity checks get in aoc extractor 2025-01-30 20:54:08 -06:00
Evan Husted
82fe519766 misc: chore: [ci skip] fix log on AOC extraction failure 2025-01-30 20:52:12 -06:00
Evan Husted
ff05e03cc8 misc: chore: Remove unused using directives across entire solution. 2025-01-30 20:27:17 -06:00
Evan Husted
e18c6d90c4 misc: chore: Strip extension in GetNameForApplicationId instead of requiring the caller to do it 2025-01-30 20:22:11 -06:00
Evan Husted
9075a3960b misc: chore: Prefix OS, CPU, and RAM lines with the same method name as other system info prints. 2025-01-30 20:18:26 -06:00
Evan Husted
3cf54987d2 misc: chore: More ObservableProperty usage 2025-01-30 20:16:30 -06:00
Evan Husted
9c12f52805 UI: Pretty Atmosphère mod names (#601)
Changes the mods from the Atmosphère folder to show a pretty name
instead of just the name of the folder they're in, because those names
are always just a title ID.

NOTE: The DLC names are from the file names, not retrieved from the
content file itself like the main applications.
2025-01-30 17:41:25 -06:00
Otozinclus
059fc83d4d Add more games to Metal Auto list (#592)
ARMS: Tested every character and every Map, played a cup as well. It
works flawless in my testing. (If it freezes, that is caused by the
Hypervisor, not Metal. You need to disable the Hypervisor for this game)

Luigi's Mansion 2 HD: I tested every world a bit and had no issue. Isaac
said he specifically worked on it as well

Following games were flawless in my testing, but I only tested earlier
parts of the game so far, a late game part might have an issue,
therefore I will further test these in the future:

- Astral Chain
- Bayonetta Origins
- New Pokemon Snap
2025-01-30 17:22:00 -06:00
Evan Husted
04ce7fb764 misc: chore: [ci skip] VSync progression as an extension 2025-01-30 16:54:05 -06:00
Evan Husted
359852b5c0 UI: Change order of VSync mode changing
VSync -> VSync Off -> Custom
is now
VSync -> Custom -> VSync Off

Note that Custom only appears if it's enabled in settings. This has no change if you aren't using custom VSync.
2025-01-30 16:47:40 -06:00
Evan Husted
796674d9cf UI: Allow more freedom changing the Speed value & clamp the visible number to a sane amount of trailing digits 2025-01-30 03:30:50 -06:00
Evan Husted
4efe24a3bc misc: chore: [ci skip] forgot to make that a locale entry 2025-01-30 03:21:42 -06:00
Evan Husted
1a42d1396c UI: Rainbow cycling speed settings
Note: this setting is global, even though it appears in the settings for the individual gamepad. This is simply for consistency; you access all the rainbow stuff in one place.
2025-01-30 03:18:34 -06:00
Evan Husted
11f29361eb misc: chore: [ci skip] Log errors from TaskScheduler.UnobservedTaskException 2025-01-29 21:07:43 -06:00
Evan Husted
71d8cfd232 misc: chore: Pass rainbow color by reference in the event instead of passing around a packed int. 2025-01-29 20:51:55 -06:00
Evan Husted
023bd5f00f UI: Enable Rainbow cycling in the Settings window 2025-01-29 20:27:01 -06:00
Evan Husted
0ed7fd14ba misc: chore: [ci skip] Collapse CheckboxMenuItemStyle into the main Styles.xaml. 2025-01-29 18:59:17 -06:00
Evan Husted
a624fe64b9 UI: Scanning for mods on DLC content 2025-01-29 13:33:34 -06:00
Vladimir Sokolov
e02ef52069 Added --backend-threading arg for CommandLineState (#599)
Added the `--backend-threading` arg so that you can launch games via
a shortcut with modifications to this setting.
2025-01-29 12:49:36 -06:00
Evan Husted
707c9ef748 misc: chore: slightly improve PTC init log line 2025-01-28 22:25:01 -06:00
Evan Husted
2acc43e968 misc: chore: Use string.Empty in more places where it's snuck back 2025-01-28 22:17:11 -06:00
Evan Husted
191e158289 misc: chore: Use static instances of converters instead of using control resources 2025-01-28 22:11:48 -06:00
Evan Husted
a469f3d710 UI: Remove empty StackPanel in UserSelectorDialog 2025-01-28 21:47:29 -06:00
shinyoyo
1b3656bca9 LED Color & LED settings header (zh_CN) (#590) 2025-01-28 21:29:06 -06:00
Evan Husted
502ce98b3a UI: [ci skip] Make cheat window larger by default 2025-01-28 21:27:51 -06:00
LotP1
7085bafa60 PPTC Profiles (#370)
Added functionality that allows ExeFS mods to compile to their own PPTC
Profile and therefore store PTC data between sessions.
The feature calculates the hash of the currently loaded ExeFS mods and
stores the PPTC data in a profile that matches said hash, so you can
have multiple ExeFS loadouts without causing issues. This includes
different versions of the same mod as their hashes will be different.
Using this PR should be seamless as the JIT Sparse PR already laid the
groundwork for PPTC Profiles and this PR just allows ExeFS mods to load
and store their own profiles besides the `default` profile.

 **WARNING!** 
**This will update your PPTC profile version, which means the
PPTC profile will be invalidated if you try to run a PR/Build/Branch
that does not include this change!**
**This is only relevant for the default PPTC Profile, as any other profiles do not exist to older versions!**
2025-01-28 20:36:58 -06:00
Evan Husted
9d28af935d headless: Enable Rainbow cycling if any input configs have UseRainbow enabled 2025-01-28 20:16:41 -06:00
Evan Husted
cdf4016c25 Update README.md 2025-01-27 15:04:57 -06:00
Evan Husted
082c718f5d fix canary URL 2025-01-27 15:04:14 -06:00
Josh
31de0bf8c6 Increase NAT discovery timeout to 5000ms (#589)
1000ms was too fast on some slower networks. It would lead to an early
cancellation before device could be found.
2025-01-26 19:40:10 -06:00
Evan Husted
f3942968f9 UI: Convert the various options for LED into a popup window similar to motion & rumble config. 2025-01-26 17:18:27 -06:00
Evan Husted
ac838aa81d misc: chore: Use collection expressions everywhere else (except VP9) 2025-01-26 15:59:11 -06:00
Evan Husted
0f857400b6 misc: chore: Use collection expressions in Common project 2025-01-26 15:53:31 -06:00
Evan Husted
95f9e548ca misc: chore: Use collection expressions in Shader project 2025-01-26 15:50:50 -06:00
Evan Husted
a5dbcb75d0 misc: chore: Use collection expressions in OpenGL project 2025-01-26 15:50:22 -06:00
Evan Husted
aa0cb50c5d misc: chore: Use collection expressions in Gpu project 2025-01-26 15:49:22 -06:00
Evan Husted
ae90db2040 misc: chore: Use collection expressions in Avalonia project 2025-01-26 15:47:11 -06:00
Evan Husted
46a5cafaa8 misc: chore: Use collection expressions in Memory project 2025-01-26 15:46:58 -06:00
Evan Husted
2853f5b426 misc: chore: Use collection expressions in Generator projects 2025-01-26 15:45:43 -06:00
Evan Husted
45125c16cf misc: chore: Use collection expressions in Input projects 2025-01-26 15:43:58 -06:00
Evan Husted
9f3eac7f26 misc: chore: Use collection expressions in Horizon project 2025-01-26 15:43:27 -06:00
Evan Husted
70b767ef60 misc: chore: Use collection expressions in HLE project 2025-01-26 15:43:02 -06:00
Evan Husted
3c2f283ec7 misc: chore: Use collection expressions in Audio project 2025-01-26 15:41:47 -06:00
Evan Husted
3e12865f51 misc: chore: Use collection expressions in Cpu 2025-01-26 15:41:05 -06:00
Evan Husted
ed2590a8ac misc: chore: Use collection expressions in Vulkan project 2025-01-26 15:32:25 -06:00
Evan Husted
9cb3b40ffc misc: chore: Use collection expressions in ARMeilleure 2025-01-26 15:31:44 -06:00
576 changed files with 7588 additions and 6744 deletions

View File

@@ -11,7 +11,7 @@
[![Latest release](https://img.shields.io/github/v/release/GreemDev/Ryujinx)](https://github.com/Ryubing/Ryujinx/releases/latest)
<br>
[![Canary workflow](https://github.com/Ryubing/Ryujinx/actions/workflows/canary.yml/badge.svg)](https://github.com/Ryubing/Ryujinx/actions/workflows/canary.yml)
[![Latest canary release](https://img.shields.io/github/v/release/GreemDev/Ryujinx-Canary?label=canary)](https://github.com/Ryubing/Ryujinx-Canary/releases/latest)
[![Latest canary release](https://img.shields.io/github/v/release/Ryubing/Canary-Releases?label=canary)](https://github.com/Ryubing/Canary-Releases/releases/latest)
</td>
</tr>
</table>
@@ -64,7 +64,7 @@ Canary builds are compiled automatically for each commit on the `master` branch.
While we strive to ensure optimal stability and performance prior to pushing an update, these builds **may be unstable or completely broken**.
These canary builds are only recommended for experienced users.
You can find the latest canary release [here](https://github.com/Ryubing/Ryujinx-Canary/releases/latest).
You can find the latest canary release [here](https://github.com/Ryubing/Canary-Releases/releases/latest).
## Documentation

View File

@@ -2483,7 +2483,7 @@
0100A5200C2E0000,"Safety First!",,playable,2021-01-06 09:05:23
0100A51013530000,"SaGa Frontier Remastered",nvdec,playable,2022-11-03 13:54:56
010003A00D0B4000,"SaGa SCARLET GRACE: AMBITIONS™",,playable,2022-10-06 13:20:31
01008D100D43E000,"Saints Row IV®: Re-Elected™",ldn-untested;LAN,playable,2023-12-04 18:33:37
01008D100D43E000,"Saints Row IV®: Re-Elected™",ldn-untested;LAN;deadlock,ingame,2025-02-02 16:57:53
0100DE600BEEE000,"SAINTS ROW®: THE THIRD™ - THE FULL PACKAGE",slow;LAN,playable,2023-08-24 02:40:58
01007F000EB36000,"Sakai and...",nvdec,playable,2022-12-15 13:53:19
0100B1400E8FE000,"Sakuna: Of Rice and Ruin",,playable,2023-07-24 13:47:13
1 title_id game_name labels status last_updated
2483 0100A5200C2E0000 Safety First! playable 2021-01-06 09:05:23
2484 0100A51013530000 SaGa Frontier Remastered nvdec playable 2022-11-03 13:54:56
2485 010003A00D0B4000 SaGa SCARLET GRACE: AMBITIONS™ playable 2022-10-06 13:20:31
2486 01008D100D43E000 Saints Row IV®: Re-Elected™ ldn-untested;LAN ldn-untested;LAN;deadlock playable ingame 2023-12-04 18:33:37 2025-02-02 16:57:53
2487 0100DE600BEEE000 SAINTS ROW®: THE THIRD™ - THE FULL PACKAGE slow;LAN playable 2023-08-24 02:40:58
2488 01007F000EB36000 Sakai and... nvdec playable 2022-12-15 13:53:19
2489 0100B1400E8FE000 Sakuna: Of Rice and Ruin playable 2023-07-24 13:47:13

View File

@@ -42,7 +42,7 @@ namespace ARMeilleure.CodeGen.Arm64
{
Offset = offset;
Symbol = symbol;
LdrOffsets = new List<(Operand, int)>();
LdrOffsets = [];
}
}
@@ -266,7 +266,7 @@ namespace ARMeilleure.CodeGen.Arm64
}
else
{
relocInfo = new RelocInfo(Array.Empty<RelocEntry>());
relocInfo = new RelocInfo([]);
}
return (code, relocInfo);

View File

@@ -1079,7 +1079,7 @@ namespace ARMeilleure.CodeGen.Arm64
private static UnwindInfo WritePrologue(CodeGenContext context)
{
List<UnwindPushEntry> pushEntries = new();
List<UnwindPushEntry> pushEntries = [];
Operand rsp = Register(SpRegister);

View File

@@ -140,8 +140,8 @@ namespace ARMeilleure.CodeGen.Arm64
return false;
}
private static readonly string[] _sysctlNames = new string[]
{
private static readonly string[] _sysctlNames =
[
"hw.optional.floatingpoint",
"hw.optional.AdvSIMD",
"hw.optional.arm.FEAT_FP16",
@@ -150,8 +150,8 @@ namespace ARMeilleure.CodeGen.Arm64
"hw.optional.arm.FEAT_LSE",
"hw.optional.armv8_crc32",
"hw.optional.arm.FEAT_SHA1",
"hw.optional.arm.FEAT_SHA256",
};
"hw.optional.arm.FEAT_SHA256"
];
[Flags]
public enum MacOsFeatureFlags

View File

@@ -261,10 +261,10 @@ namespace ARMeilleure.CodeGen.Arm64
Operand dest = operation.Destination;
List<Operand> sources = new()
{
operation.GetSource(0),
};
List<Operand> sources =
[
operation.GetSource(0)
];
int argsCount = operation.SourcesCount - 1;
@@ -365,10 +365,10 @@ namespace ARMeilleure.CodeGen.Arm64
Operation node,
Operation operation)
{
List<Operand> sources = new()
{
operation.GetSource(0),
};
List<Operand> sources =
[
operation.GetSource(0)
];
int argsCount = operation.SourcesCount - 1;
@@ -468,8 +468,8 @@ namespace ARMeilleure.CodeGen.Arm64
// Update the sources and destinations with split 64-bit halfs of the whole 128-bit values.
// We also need a additional registers that will be used to store temporary information.
operation.SetDestinations(new[] { actualLow, actualHigh, Local(OperandType.I64), Local(OperandType.I64) });
operation.SetSources(new[] { address, expectedLow, expectedHigh, desiredLow, desiredHigh });
operation.SetDestinations([actualLow, actualHigh, Local(OperandType.I64), Local(OperandType.I64)]);
operation.SetSources([address, expectedLow, expectedHigh, desiredLow, desiredHigh]);
// Add some dummy uses of the input operands, as the CAS operation will be a loop,
// so they can't be used as destination operand.
@@ -486,7 +486,7 @@ namespace ARMeilleure.CodeGen.Arm64
else
{
// We need a additional register where the store result will be written to.
node.SetDestinations(new[] { node.Destination, Local(OperandType.I32) });
node.SetDestinations([node.Destination, Local(OperandType.I32)]);
// Add some dummy uses of the input operands, as the CAS operation will be a loop,
// so they can't be used as destination operand.

View File

@@ -1,7 +1,6 @@
using ARMeilleure.CodeGen.Linking;
using ARMeilleure.CodeGen.Unwinding;
using ARMeilleure.Translation.Cache;
using System;
using System.Runtime.InteropServices;
namespace ARMeilleure.CodeGen

View File

@@ -31,7 +31,7 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
public ParallelCopy()
{
_copies = new List<Copy>();
_copies = [];
}
public void AddCopy(Register dest, Register source, OperandType type)
@@ -218,7 +218,7 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
public Operation[] Sequence()
{
List<Operation> sequence = new();
List<Operation> sequence = [];
if (_spillQueue != null)
{

View File

@@ -799,8 +799,8 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
private void NumberLocals(ControlFlowGraph cfg, int registersCount)
{
_operationNodes = new List<(IntrusiveList<Operation>, Operation)>();
_intervals = new List<LiveInterval>();
_operationNodes = [];
_intervals = [];
for (int index = 0; index < registersCount; index++)
{
@@ -980,7 +980,7 @@ namespace ARMeilleure.CodeGen.RegisterAllocators
_blockLiveIn = blkLiveIn;
_blockEdges = new HashSet<int>();
_blockEdges = [];
// Compute lifetime intervals.
int operationPos = _operationsCount;

View File

@@ -75,9 +75,9 @@ namespace ARMeilleure.CodeGen.X86
{
_stream = stream;
_labels = new Dictionary<Operand, long>();
_jumps = new List<Jump>();
_jumps = [];
_relocs = relocatable ? new List<Reloc>() : null;
_relocs = relocatable ? [] : null;
}
public void MarkLabel(Operand label)
@@ -1419,7 +1419,7 @@ namespace ARMeilleure.CodeGen.X86
int relocOffset = 0;
RelocEntry[] relocEntries = hasRelocs
? new RelocEntry[relocs.Length]
: Array.Empty<RelocEntry>();
: [];
for (int i = 0; i < jumps.Length; i++)
{

View File

@@ -1748,7 +1748,7 @@ namespace ARMeilleure.CodeGen.X86
private static UnwindInfo WritePrologue(CodeGenContext context)
{
List<UnwindPushEntry> pushEntries = new();
List<UnwindPushEntry> pushEntries = [];
Operand rsp = Register(X86Register.Rsp);

View File

@@ -40,12 +40,12 @@ namespace ARMeilleure.CodeGen.X86
return 0;
}
ReadOnlySpan<byte> asmGetXcr0 = new byte[]
{
ReadOnlySpan<byte> asmGetXcr0 =
[
0x31, 0xc9, // xor ecx, ecx
0xf, 0x01, 0xd0, // xgetbv
0xc3, // ret
};
0xc3 // ret
];
using MemoryBlock memGetXcr0 = new((ulong)asmGetXcr0.Length);

View File

@@ -124,13 +124,13 @@ namespace ARMeilleure.CodeGen.X86
{
int stackOffset = stackAlloc.Allocate(OperandType.I32);
node.SetSources(new Operand[] { Const(stackOffset), node.GetSource(0) });
node.SetSources([Const(stackOffset), node.GetSource(0)]);
}
else if (node.Intrinsic == Intrinsic.X86Stmxcsr)
{
int stackOffset = stackAlloc.Allocate(OperandType.I32);
node.SetSources(new Operand[] { Const(stackOffset) });
node.SetSources([Const(stackOffset)]);
}
break;
}
@@ -253,8 +253,8 @@ namespace ARMeilleure.CodeGen.X86
node = nodes.AddAfter(node, Operation(Instruction.VectorCreateScalar, dest, rax));
nodes.AddAfter(node, Operation(Instruction.VectorInsert, dest, dest, rdx, Const(1)));
operation.SetDestinations(new Operand[] { rdx, rax });
operation.SetSources(new Operand[] { operation.GetSource(0), rdx, rax, rcx, rbx });
operation.SetDestinations([rdx, rax]);
operation.SetSources([operation.GetSource(0), rdx, rax, rcx, rbx]);
}
else
{
@@ -274,7 +274,7 @@ namespace ARMeilleure.CodeGen.X86
nodes.AddBefore(node, Operation(Instruction.Copy, temp, newValue));
node.SetSources(new Operand[] { node.GetSource(0), rax, temp });
node.SetSources([node.GetSource(0), rax, temp]);
nodes.AddAfter(node, Operation(Instruction.Copy, dest, rax));
@@ -303,7 +303,7 @@ namespace ARMeilleure.CodeGen.X86
nodes.AddAfter(node, Operation(Instruction.Copy, dest, rax));
node.SetSources(new Operand[] { rdx, rax, node.GetSource(1) });
node.SetSources([rdx, rax, node.GetSource(1)]);
node.Destination = rax;
}
@@ -348,7 +348,7 @@ namespace ARMeilleure.CodeGen.X86
nodes.AddAfter(node, Operation(Instruction.Copy, dest, rdx));
node.SetDestinations(new Operand[] { rdx, rax });
node.SetDestinations([rdx, rax]);
break;
}

View File

@@ -14,10 +14,10 @@ namespace ARMeilleure.CodeGen.X86
{
Operand dest = node.Destination;
List<Operand> sources = new()
{
node.GetSource(0),
};
List<Operand> sources =
[
node.GetSource(0)
];
int argsCount = node.SourcesCount - 1;
@@ -117,10 +117,10 @@ namespace ARMeilleure.CodeGen.X86
public static void InsertTailcallCopies(IntrusiveList<Operation> nodes, Operation node)
{
List<Operand> sources = new()
{
node.GetSource(0),
};
List<Operand> sources =
[
node.GetSource(0)
];
int argsCount = node.SourcesCount - 1;

View File

@@ -321,7 +321,7 @@ namespace ARMeilleure.CodeGen.X86
nodes.AddBefore(node, retCopyOp);
}
node.SetSources(Array.Empty<Operand>());
node.SetSources([]);
}
}
}

View File

@@ -3,52 +3,46 @@ namespace ARMeilleure.Common
public static class AddressTablePresets
{
private static readonly AddressTableLevel[] _levels64Bit =
new AddressTableLevel[]
{
new(31, 17),
[
new(31, 17),
new(23, 8),
new(15, 8),
new( 7, 8),
new( 2, 5),
};
new( 2, 5)
];
private static readonly AddressTableLevel[] _levels32Bit =
new AddressTableLevel[]
{
new(31, 17),
[
new(31, 17),
new(23, 8),
new(15, 8),
new( 7, 8),
new( 1, 6),
};
new( 1, 6)
];
private static readonly AddressTableLevel[] _levels64BitSparseTiny =
new AddressTableLevel[]
{
new( 11, 28),
new( 2, 9),
};
[
new( 11, 28),
new( 2, 9)
];
private static readonly AddressTableLevel[] _levels32BitSparseTiny =
new AddressTableLevel[]
{
new( 10, 22),
new( 1, 9),
};
[
new( 10, 22),
new( 1, 9)
];
private static readonly AddressTableLevel[] _levels64BitSparseGiant =
new AddressTableLevel[]
{
new( 38, 1),
new( 2, 36),
};
[
new( 38, 1),
new( 2, 36)
];
private static readonly AddressTableLevel[] _levels32BitSparseGiant =
new AddressTableLevel[]
{
new( 31, 1),
new( 1, 30),
};
[
new( 31, 1),
new( 1, 30)
];
//high power will run worse on DDR3 systems and some DDR4 systems due to the higher ram utilization
//low power will never run worse than non-sparse, but for most systems it won't be necessary

View File

@@ -5,7 +5,7 @@ namespace ARMeilleure.Common
{
static class BitUtils
{
private static ReadOnlySpan<sbyte> HbsNibbleLut => new sbyte[] { -1, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3 };
private static ReadOnlySpan<sbyte> HbsNibbleLut => [-1, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3];
public static long FillWithOnes(int bits)
{

View File

@@ -17,7 +17,7 @@ namespace ARMeilleure.Decoders
public Block()
{
OpCodes = new List<OpCode>();
OpCodes = [];
}
public Block(ulong address) : this()

View File

@@ -20,7 +20,7 @@ namespace ARMeilleure.Decoders
public static Block[] Decode(IMemoryManager memory, ulong address, ExecutionMode mode, bool highCq, DecoderMode dMode)
{
List<Block> blocks = new();
List<Block> blocks = [];
Queue<Block> workQueue = new();

View File

@@ -5,12 +5,12 @@ namespace ARMeilleure.Decoders
class OpCode32SimdMemPair : OpCode32, IOpCode32Simd
{
private static readonly int[] _regsMap =
{
[
1, 1, 4, 2,
1, 1, 3, 1,
1, 1, 2, 1,
1, 1, 1, 1,
};
1, 1, 1, 1
];
public int Vd { get; }
public int Rn { get; }

View File

@@ -12,7 +12,7 @@ namespace ARMeilleure.Decoders
public OpCodeT16IfThen(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode)
{
List<Condition> conds = new();
List<Condition> conds = [];
int cond = (opCode >> 4) & 0xf;
int mask = opCode & 0xf;

View File

@@ -29,9 +29,9 @@ namespace ARMeilleure.Decoders
}
}
private static readonly List<InstInfo> _allInstA32 = new();
private static readonly List<InstInfo> _allInstT32 = new();
private static readonly List<InstInfo> _allInstA64 = new();
private static readonly List<InstInfo> _allInstA32 = [];
private static readonly List<InstInfo> _allInstT32 = [];
private static readonly List<InstInfo> _allInstA64 = [];
private static readonly InstInfo[][] _instA32FastLookup = new InstInfo[FastLookupSize][];
private static readonly InstInfo[][] _instT32FastLookup = new InstInfo[FastLookupSize][];
@@ -1330,7 +1330,7 @@ namespace ARMeilleure.Decoders
for (int index = 0; index < temp.Length; index++)
{
temp[index] = new List<InstInfo>();
temp[index] = [];
}
foreach (InstInfo inst in allInsts)

View File

@@ -29,7 +29,7 @@ namespace ARMeilleure.Diagnostics
static Symbols()
{
_symbols = new ConcurrentDictionary<ulong, string>();
_rangedSymbols = new List<RangedSymbol>();
_rangedSymbols = [];
}
public static string Get(ulong address)

View File

@@ -9,8 +9,8 @@ namespace ARMeilleure.Instructions
{
#region "LookUp Tables"
#pragma warning disable IDE1006 // Naming rule violation
private static ReadOnlySpan<byte> _sBox => new byte[]
{
private static ReadOnlySpan<byte> _sBox =>
[
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
@@ -26,11 +26,11 @@ namespace ARMeilleure.Instructions
0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16,
};
0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
];
private static ReadOnlySpan<byte> _invSBox => new byte[]
{
private static ReadOnlySpan<byte> _invSBox =>
[
0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb,
0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb,
0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e,
@@ -46,11 +46,11 @@ namespace ARMeilleure.Instructions
0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f,
0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef,
0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61,
0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d,
};
0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
];
private static ReadOnlySpan<byte> _gfMul02 => new byte[]
{
private static ReadOnlySpan<byte> _gfMul02 =>
[
0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e,
0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e,
0x40, 0x42, 0x44, 0x46, 0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e,
@@ -66,11 +66,11 @@ namespace ARMeilleure.Instructions
0x9b, 0x99, 0x9f, 0x9d, 0x93, 0x91, 0x97, 0x95, 0x8b, 0x89, 0x8f, 0x8d, 0x83, 0x81, 0x87, 0x85,
0xbb, 0xb9, 0xbf, 0xbd, 0xb3, 0xb1, 0xb7, 0xb5, 0xab, 0xa9, 0xaf, 0xad, 0xa3, 0xa1, 0xa7, 0xa5,
0xdb, 0xd9, 0xdf, 0xdd, 0xd3, 0xd1, 0xd7, 0xd5, 0xcb, 0xc9, 0xcf, 0xcd, 0xc3, 0xc1, 0xc7, 0xc5,
0xfb, 0xf9, 0xff, 0xfd, 0xf3, 0xf1, 0xf7, 0xf5, 0xeb, 0xe9, 0xef, 0xed, 0xe3, 0xe1, 0xe7, 0xe5,
};
0xfb, 0xf9, 0xff, 0xfd, 0xf3, 0xf1, 0xf7, 0xf5, 0xeb, 0xe9, 0xef, 0xed, 0xe3, 0xe1, 0xe7, 0xe5
];
private static ReadOnlySpan<byte> _gfMul03 => new byte[]
{
private static ReadOnlySpan<byte> _gfMul03 =>
[
0x00, 0x03, 0x06, 0x05, 0x0c, 0x0f, 0x0a, 0x09, 0x18, 0x1b, 0x1e, 0x1d, 0x14, 0x17, 0x12, 0x11,
0x30, 0x33, 0x36, 0x35, 0x3c, 0x3f, 0x3a, 0x39, 0x28, 0x2b, 0x2e, 0x2d, 0x24, 0x27, 0x22, 0x21,
0x60, 0x63, 0x66, 0x65, 0x6c, 0x6f, 0x6a, 0x69, 0x78, 0x7b, 0x7e, 0x7d, 0x74, 0x77, 0x72, 0x71,
@@ -86,11 +86,11 @@ namespace ARMeilleure.Instructions
0x5b, 0x58, 0x5d, 0x5e, 0x57, 0x54, 0x51, 0x52, 0x43, 0x40, 0x45, 0x46, 0x4f, 0x4c, 0x49, 0x4a,
0x6b, 0x68, 0x6d, 0x6e, 0x67, 0x64, 0x61, 0x62, 0x73, 0x70, 0x75, 0x76, 0x7f, 0x7c, 0x79, 0x7a,
0x3b, 0x38, 0x3d, 0x3e, 0x37, 0x34, 0x31, 0x32, 0x23, 0x20, 0x25, 0x26, 0x2f, 0x2c, 0x29, 0x2a,
0x0b, 0x08, 0x0d, 0x0e, 0x07, 0x04, 0x01, 0x02, 0x13, 0x10, 0x15, 0x16, 0x1f, 0x1c, 0x19, 0x1a,
};
0x0b, 0x08, 0x0d, 0x0e, 0x07, 0x04, 0x01, 0x02, 0x13, 0x10, 0x15, 0x16, 0x1f, 0x1c, 0x19, 0x1a
];
private static ReadOnlySpan<byte> _gfMul09 => new byte[]
{
private static ReadOnlySpan<byte> _gfMul09 =>
[
0x00, 0x09, 0x12, 0x1b, 0x24, 0x2d, 0x36, 0x3f, 0x48, 0x41, 0x5a, 0x53, 0x6c, 0x65, 0x7e, 0x77,
0x90, 0x99, 0x82, 0x8b, 0xb4, 0xbd, 0xa6, 0xaf, 0xd8, 0xd1, 0xca, 0xc3, 0xfc, 0xf5, 0xee, 0xe7,
0x3b, 0x32, 0x29, 0x20, 0x1f, 0x16, 0x0d, 0x04, 0x73, 0x7a, 0x61, 0x68, 0x57, 0x5e, 0x45, 0x4c,
@@ -106,11 +106,11 @@ namespace ARMeilleure.Instructions
0x9a, 0x93, 0x88, 0x81, 0xbe, 0xb7, 0xac, 0xa5, 0xd2, 0xdb, 0xc0, 0xc9, 0xf6, 0xff, 0xe4, 0xed,
0x0a, 0x03, 0x18, 0x11, 0x2e, 0x27, 0x3c, 0x35, 0x42, 0x4b, 0x50, 0x59, 0x66, 0x6f, 0x74, 0x7d,
0xa1, 0xa8, 0xb3, 0xba, 0x85, 0x8c, 0x97, 0x9e, 0xe9, 0xe0, 0xfb, 0xf2, 0xcd, 0xc4, 0xdf, 0xd6,
0x31, 0x38, 0x23, 0x2a, 0x15, 0x1c, 0x07, 0x0e, 0x79, 0x70, 0x6b, 0x62, 0x5d, 0x54, 0x4f, 0x46,
};
0x31, 0x38, 0x23, 0x2a, 0x15, 0x1c, 0x07, 0x0e, 0x79, 0x70, 0x6b, 0x62, 0x5d, 0x54, 0x4f, 0x46
];
private static ReadOnlySpan<byte> _gfMul0B => new byte[]
{
private static ReadOnlySpan<byte> _gfMul0B =>
[
0x00, 0x0b, 0x16, 0x1d, 0x2c, 0x27, 0x3a, 0x31, 0x58, 0x53, 0x4e, 0x45, 0x74, 0x7f, 0x62, 0x69,
0xb0, 0xbb, 0xa6, 0xad, 0x9c, 0x97, 0x8a, 0x81, 0xe8, 0xe3, 0xfe, 0xf5, 0xc4, 0xcf, 0xd2, 0xd9,
0x7b, 0x70, 0x6d, 0x66, 0x57, 0x5c, 0x41, 0x4a, 0x23, 0x28, 0x35, 0x3e, 0x0f, 0x04, 0x19, 0x12,
@@ -126,11 +126,11 @@ namespace ARMeilleure.Instructions
0x01, 0x0a, 0x17, 0x1c, 0x2d, 0x26, 0x3b, 0x30, 0x59, 0x52, 0x4f, 0x44, 0x75, 0x7e, 0x63, 0x68,
0xb1, 0xba, 0xa7, 0xac, 0x9d, 0x96, 0x8b, 0x80, 0xe9, 0xe2, 0xff, 0xf4, 0xc5, 0xce, 0xd3, 0xd8,
0x7a, 0x71, 0x6c, 0x67, 0x56, 0x5d, 0x40, 0x4b, 0x22, 0x29, 0x34, 0x3f, 0x0e, 0x05, 0x18, 0x13,
0xca, 0xc1, 0xdc, 0xd7, 0xe6, 0xed, 0xf0, 0xfb, 0x92, 0x99, 0x84, 0x8f, 0xbe, 0xb5, 0xa8, 0xa3,
};
0xca, 0xc1, 0xdc, 0xd7, 0xe6, 0xed, 0xf0, 0xfb, 0x92, 0x99, 0x84, 0x8f, 0xbe, 0xb5, 0xa8, 0xa3
];
private static ReadOnlySpan<byte> _gfMul0D => new byte[]
{
private static ReadOnlySpan<byte> _gfMul0D =>
[
0x00, 0x0d, 0x1a, 0x17, 0x34, 0x39, 0x2e, 0x23, 0x68, 0x65, 0x72, 0x7f, 0x5c, 0x51, 0x46, 0x4b,
0xd0, 0xdd, 0xca, 0xc7, 0xe4, 0xe9, 0xfe, 0xf3, 0xb8, 0xb5, 0xa2, 0xaf, 0x8c, 0x81, 0x96, 0x9b,
0xbb, 0xb6, 0xa1, 0xac, 0x8f, 0x82, 0x95, 0x98, 0xd3, 0xde, 0xc9, 0xc4, 0xe7, 0xea, 0xfd, 0xf0,
@@ -146,11 +146,11 @@ namespace ARMeilleure.Instructions
0xb7, 0xba, 0xad, 0xa0, 0x83, 0x8e, 0x99, 0x94, 0xdf, 0xd2, 0xc5, 0xc8, 0xeb, 0xe6, 0xf1, 0xfc,
0x67, 0x6a, 0x7d, 0x70, 0x53, 0x5e, 0x49, 0x44, 0x0f, 0x02, 0x15, 0x18, 0x3b, 0x36, 0x21, 0x2c,
0x0c, 0x01, 0x16, 0x1b, 0x38, 0x35, 0x22, 0x2f, 0x64, 0x69, 0x7e, 0x73, 0x50, 0x5d, 0x4a, 0x47,
0xdc, 0xd1, 0xc6, 0xcb, 0xe8, 0xe5, 0xf2, 0xff, 0xb4, 0xb9, 0xae, 0xa3, 0x80, 0x8d, 0x9a, 0x97,
};
0xdc, 0xd1, 0xc6, 0xcb, 0xe8, 0xe5, 0xf2, 0xff, 0xb4, 0xb9, 0xae, 0xa3, 0x80, 0x8d, 0x9a, 0x97
];
private static ReadOnlySpan<byte> _gfMul0E => new byte[]
{
private static ReadOnlySpan<byte> _gfMul0E =>
[
0x00, 0x0e, 0x1c, 0x12, 0x38, 0x36, 0x24, 0x2a, 0x70, 0x7e, 0x6c, 0x62, 0x48, 0x46, 0x54, 0x5a,
0xe0, 0xee, 0xfc, 0xf2, 0xd8, 0xd6, 0xc4, 0xca, 0x90, 0x9e, 0x8c, 0x82, 0xa8, 0xa6, 0xb4, 0xba,
0xdb, 0xd5, 0xc7, 0xc9, 0xe3, 0xed, 0xff, 0xf1, 0xab, 0xa5, 0xb7, 0xb9, 0x93, 0x9d, 0x8f, 0x81,
@@ -166,18 +166,18 @@ namespace ARMeilleure.Instructions
0xec, 0xe2, 0xf0, 0xfe, 0xd4, 0xda, 0xc8, 0xc6, 0x9c, 0x92, 0x80, 0x8e, 0xa4, 0xaa, 0xb8, 0xb6,
0x0c, 0x02, 0x10, 0x1e, 0x34, 0x3a, 0x28, 0x26, 0x7c, 0x72, 0x60, 0x6e, 0x44, 0x4a, 0x58, 0x56,
0x37, 0x39, 0x2b, 0x25, 0x0f, 0x01, 0x13, 0x1d, 0x47, 0x49, 0x5b, 0x55, 0x7f, 0x71, 0x63, 0x6d,
0xd7, 0xd9, 0xcb, 0xc5, 0xef, 0xe1, 0xf3, 0xfd, 0xa7, 0xa9, 0xbb, 0xb5, 0x9f, 0x91, 0x83, 0x8d,
};
0xd7, 0xd9, 0xcb, 0xc5, 0xef, 0xe1, 0xf3, 0xfd, 0xa7, 0xa9, 0xbb, 0xb5, 0x9f, 0x91, 0x83, 0x8d
];
private static ReadOnlySpan<byte> _srPerm => new byte[]
{
0, 13, 10, 7, 4, 1, 14, 11, 8, 5, 2, 15, 12, 9, 6, 3,
};
private static ReadOnlySpan<byte> _srPerm =>
[
0, 13, 10, 7, 4, 1, 14, 11, 8, 5, 2, 15, 12, 9, 6, 3
];
private static ReadOnlySpan<byte> _isrPerm => new byte[]
{
0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 1, 6, 11,
};
private static ReadOnlySpan<byte> _isrPerm =>
[
0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 1, 6, 11
];
#pragma warning restore IDE1006
#endregion

View File

@@ -245,8 +245,8 @@ namespace ARMeilleure.Instructions
string name = nameof(Math.Round);
MethodInfo info = (op.Size & 1) == 0
? typeof(MathF).GetMethod(name, new Type[] { typeof(float), typeof(MidpointRounding) })
: typeof(Math).GetMethod(name, new Type[] { typeof(double), typeof(MidpointRounding) });
? typeof(MathF).GetMethod(name, [typeof(float), typeof(MidpointRounding)])
: typeof(Math).GetMethod(name, [typeof(double), typeof(MidpointRounding)]);
return context.Call(info, n, Const((int)roundMode));
}

View File

@@ -18,19 +18,19 @@ namespace ARMeilleure.Instructions
static class InstEmitSimdHelper
{
#region "Masks"
public static readonly long[] EvenMasks = new long[]
{
public static readonly long[] EvenMasks =
[
14L << 56 | 12L << 48 | 10L << 40 | 08L << 32 | 06L << 24 | 04L << 16 | 02L << 8 | 00L << 0, // B
13L << 56 | 12L << 48 | 09L << 40 | 08L << 32 | 05L << 24 | 04L << 16 | 01L << 8 | 00L << 0, // H
11L << 56 | 10L << 48 | 09L << 40 | 08L << 32 | 03L << 24 | 02L << 16 | 01L << 8 | 00L << 0, // S
};
11L << 56 | 10L << 48 | 09L << 40 | 08L << 32 | 03L << 24 | 02L << 16 | 01L << 8 | 00L << 0 // S
];
public static readonly long[] OddMasks = new long[]
{
public static readonly long[] OddMasks =
[
15L << 56 | 13L << 48 | 11L << 40 | 09L << 32 | 07L << 24 | 05L << 16 | 03L << 8 | 01L << 0, // B
15L << 56 | 14L << 48 | 11L << 40 | 10L << 32 | 07L << 24 | 06L << 16 | 03L << 8 | 02L << 0, // H
15L << 56 | 14L << 48 | 13L << 40 | 12L << 32 | 07L << 24 | 06L << 16 | 05L << 8 | 04L << 0, // S
};
15L << 56 | 14L << 48 | 13L << 40 | 12L << 32 | 07L << 24 | 06L << 16 | 05L << 8 | 04L << 0 // S
];
public const long ZeroMask = 128L << 56 | 128L << 48 | 128L << 40 | 128L << 32 | 128L << 24 | 128L << 16 | 128L << 8 | 128L << 0;
@@ -44,118 +44,118 @@ namespace ARMeilleure.Instructions
#endregion
#region "X86 SSE Intrinsics"
public static readonly Intrinsic[] X86PaddInstruction = new Intrinsic[]
{
public static readonly Intrinsic[] X86PaddInstruction =
[
Intrinsic.X86Paddb,
Intrinsic.X86Paddw,
Intrinsic.X86Paddd,
Intrinsic.X86Paddq,
};
Intrinsic.X86Paddq
];
public static readonly Intrinsic[] X86PcmpeqInstruction = new Intrinsic[]
{
public static readonly Intrinsic[] X86PcmpeqInstruction =
[
Intrinsic.X86Pcmpeqb,
Intrinsic.X86Pcmpeqw,
Intrinsic.X86Pcmpeqd,
Intrinsic.X86Pcmpeqq,
};
Intrinsic.X86Pcmpeqq
];
public static readonly Intrinsic[] X86PcmpgtInstruction = new Intrinsic[]
{
public static readonly Intrinsic[] X86PcmpgtInstruction =
[
Intrinsic.X86Pcmpgtb,
Intrinsic.X86Pcmpgtw,
Intrinsic.X86Pcmpgtd,
Intrinsic.X86Pcmpgtq,
};
Intrinsic.X86Pcmpgtq
];
public static readonly Intrinsic[] X86PmaxsInstruction = new Intrinsic[]
{
public static readonly Intrinsic[] X86PmaxsInstruction =
[
Intrinsic.X86Pmaxsb,
Intrinsic.X86Pmaxsw,
Intrinsic.X86Pmaxsd,
};
Intrinsic.X86Pmaxsd
];
public static readonly Intrinsic[] X86PmaxuInstruction = new Intrinsic[]
{
public static readonly Intrinsic[] X86PmaxuInstruction =
[
Intrinsic.X86Pmaxub,
Intrinsic.X86Pmaxuw,
Intrinsic.X86Pmaxud,
};
Intrinsic.X86Pmaxud
];
public static readonly Intrinsic[] X86PminsInstruction = new Intrinsic[]
{
public static readonly Intrinsic[] X86PminsInstruction =
[
Intrinsic.X86Pminsb,
Intrinsic.X86Pminsw,
Intrinsic.X86Pminsd,
};
Intrinsic.X86Pminsd
];
public static readonly Intrinsic[] X86PminuInstruction = new Intrinsic[]
{
public static readonly Intrinsic[] X86PminuInstruction =
[
Intrinsic.X86Pminub,
Intrinsic.X86Pminuw,
Intrinsic.X86Pminud,
};
Intrinsic.X86Pminud
];
public static readonly Intrinsic[] X86PmovsxInstruction = new Intrinsic[]
{
public static readonly Intrinsic[] X86PmovsxInstruction =
[
Intrinsic.X86Pmovsxbw,
Intrinsic.X86Pmovsxwd,
Intrinsic.X86Pmovsxdq,
};
Intrinsic.X86Pmovsxdq
];
public static readonly Intrinsic[] X86PmovzxInstruction = new Intrinsic[]
{
public static readonly Intrinsic[] X86PmovzxInstruction =
[
Intrinsic.X86Pmovzxbw,
Intrinsic.X86Pmovzxwd,
Intrinsic.X86Pmovzxdq,
};
Intrinsic.X86Pmovzxdq
];
public static readonly Intrinsic[] X86PsllInstruction = new Intrinsic[]
{
public static readonly Intrinsic[] X86PsllInstruction =
[
0,
Intrinsic.X86Psllw,
Intrinsic.X86Pslld,
Intrinsic.X86Psllq,
};
Intrinsic.X86Psllq
];
public static readonly Intrinsic[] X86PsraInstruction = new Intrinsic[]
{
public static readonly Intrinsic[] X86PsraInstruction =
[
0,
Intrinsic.X86Psraw,
Intrinsic.X86Psrad,
};
Intrinsic.X86Psrad
];
public static readonly Intrinsic[] X86PsrlInstruction = new Intrinsic[]
{
public static readonly Intrinsic[] X86PsrlInstruction =
[
0,
Intrinsic.X86Psrlw,
Intrinsic.X86Psrld,
Intrinsic.X86Psrlq,
};
Intrinsic.X86Psrlq
];
public static readonly Intrinsic[] X86PsubInstruction = new Intrinsic[]
{
public static readonly Intrinsic[] X86PsubInstruction =
[
Intrinsic.X86Psubb,
Intrinsic.X86Psubw,
Intrinsic.X86Psubd,
Intrinsic.X86Psubq,
};
Intrinsic.X86Psubq
];
public static readonly Intrinsic[] X86PunpckhInstruction = new Intrinsic[]
{
public static readonly Intrinsic[] X86PunpckhInstruction =
[
Intrinsic.X86Punpckhbw,
Intrinsic.X86Punpckhwd,
Intrinsic.X86Punpckhdq,
Intrinsic.X86Punpckhqdq,
};
Intrinsic.X86Punpckhqdq
];
public static readonly Intrinsic[] X86PunpcklInstruction = new Intrinsic[]
{
public static readonly Intrinsic[] X86PunpcklInstruction =
[
Intrinsic.X86Punpcklbw,
Intrinsic.X86Punpcklwd,
Intrinsic.X86Punpckldq,
Intrinsic.X86Punpcklqdq,
};
Intrinsic.X86Punpcklqdq
];
#endregion
public static void EnterArmFpMode(EmitterContext context, Func<FPState, Operand> getFpFlag)
@@ -460,8 +460,8 @@ namespace ARMeilleure.Instructions
IOpCodeSimd op = (IOpCodeSimd)context.CurrOp;
MethodInfo info = (op.Size & 1) == 0
? typeof(MathHelperF).GetMethod(name, new Type[] { typeof(float) })
: typeof(MathHelper).GetMethod(name, new Type[] { typeof(double) });
? typeof(MathHelperF).GetMethod(name, [typeof(float)])
: typeof(MathHelper).GetMethod(name, [typeof(double)]);
return context.Call(info, n);
}
@@ -473,8 +473,8 @@ namespace ARMeilleure.Instructions
string name = nameof(MathHelper.Round);
MethodInfo info = (op.Size & 1) == 0
? typeof(MathHelperF).GetMethod(name, new Type[] { typeof(float), typeof(int) })
: typeof(MathHelper).GetMethod(name, new Type[] { typeof(double), typeof(int) });
? typeof(MathHelperF).GetMethod(name, [typeof(float), typeof(int)])
: typeof(MathHelper).GetMethod(name, [typeof(double), typeof(int)]);
return context.Call(info, n, Const((int)roundMode));
}

View File

@@ -12,17 +12,17 @@ namespace ARMeilleure.Instructions
static partial class InstEmit
{
#region "Masks"
private static readonly long[] _masksE0_Uzp = new long[]
{
private static readonly long[] _masksE0_Uzp =
[
13L << 56 | 09L << 48 | 05L << 40 | 01L << 32 | 12L << 24 | 08L << 16 | 04L << 8 | 00L << 0,
11L << 56 | 10L << 48 | 03L << 40 | 02L << 32 | 09L << 24 | 08L << 16 | 01L << 8 | 00L << 0,
};
11L << 56 | 10L << 48 | 03L << 40 | 02L << 32 | 09L << 24 | 08L << 16 | 01L << 8 | 00L << 0
];
private static readonly long[] _masksE1_Uzp = new long[]
{
private static readonly long[] _masksE1_Uzp =
[
15L << 56 | 11L << 48 | 07L << 40 | 03L << 32 | 14L << 24 | 10L << 16 | 06L << 8 | 02L << 0,
15L << 56 | 14L << 48 | 07L << 40 | 06L << 32 | 13L << 24 | 12L << 16 | 05L << 8 | 04L << 0,
};
15L << 56 | 14L << 48 | 07L << 40 | 06L << 32 | 13L << 24 | 12L << 16 | 05L << 8 | 04L << 0
];
#endregion
public static void Dup_Gp(ArmEmitterContext context)
@@ -601,7 +601,7 @@ namespace ARMeilleure.Instructions
{
Operand d = GetVec(op.Rd);
List<Operand> args = new();
List<Operand> args = [];
if (!isTbl)
{

View File

@@ -13,17 +13,17 @@ namespace ARMeilleure.Instructions
{
#region "Masks"
// Same as InstEmitSimdMove, as the instructions do the same thing.
private static readonly long[] _masksE0_Uzp = new long[]
{
private static readonly long[] _masksE0_Uzp =
[
13L << 56 | 09L << 48 | 05L << 40 | 01L << 32 | 12L << 24 | 08L << 16 | 04L << 8 | 00L << 0,
11L << 56 | 10L << 48 | 03L << 40 | 02L << 32 | 09L << 24 | 08L << 16 | 01L << 8 | 00L << 0,
};
11L << 56 | 10L << 48 | 03L << 40 | 02L << 32 | 09L << 24 | 08L << 16 | 01L << 8 | 00L << 0
];
private static readonly long[] _masksE1_Uzp = new long[]
{
private static readonly long[] _masksE1_Uzp =
[
15L << 56 | 11L << 48 | 07L << 40 | 03L << 32 | 14L << 24 | 10L << 16 | 06L << 8 | 02L << 0,
15L << 56 | 14L << 48 | 07L << 40 | 06L << 32 | 13L << 24 | 12L << 16 | 05L << 8 | 04L << 0,
};
15L << 56 | 14L << 48 | 07L << 40 | 06L << 32 | 13L << 24 | 12L << 16 | 05L << 8 | 04L << 0
];
#endregion
public static void Vmov_I(ArmEmitterContext context)

View File

@@ -17,10 +17,10 @@ namespace ARMeilleure.Instructions
static partial class InstEmit
{
#region "Masks"
private static readonly long[] _masks_SliSri = new long[] // Replication masks.
{
0x0101010101010101L, 0x0001000100010001L, 0x0000000100000001L, 0x0000000000000001L,
};
private static readonly long[] _masks_SliSri =
[
0x0101010101010101L, 0x0001000100010001L, 0x0000000100000001L, 0x0000000000000001L
];
#endregion
public static void Rshrn_V(ArmEmitterContext context)

View File

@@ -211,7 +211,7 @@ namespace ARMeilleure.Instructions
return (ulong)(size - 1);
}
private static ReadOnlySpan<byte> ClzNibbleTbl => new byte[] { 4, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
private static ReadOnlySpan<byte> ClzNibbleTbl => [4, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0];
[UnmanagedCallersOnly]
public static ulong CountLeadingZeros(ulong value, int size) // size is 8, 16, 32 or 64 (SIMD&FP or Base Inst.).

View File

@@ -27,7 +27,7 @@ namespace ARMeilleure.IntermediateRepresentation
{
get
{
_domFrontiers ??= new HashSet<BasicBlock>();
_domFrontiers ??= [];
return _domFrontiers;
}
@@ -38,7 +38,7 @@ namespace ARMeilleure.IntermediateRepresentation
public BasicBlock(int index)
{
Operations = new IntrusiveList<Operation>();
Predecessors = new List<BasicBlock>();
Predecessors = [];
Index = index;
}

View File

@@ -1,4 +1,3 @@
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;

View File

@@ -1,4 +1,3 @@
using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;

View File

@@ -198,7 +198,7 @@ namespace ARMeilleure.Signal
ControlFlowGraph cfg = context.GetControlFlowGraph();
OperandType[] argTypes = new OperandType[] { OperandType.I32, OperandType.I64, OperandType.I64 };
OperandType[] argTypes = [OperandType.I32, OperandType.I64, OperandType.I64];
return Compiler.Compile(cfg, argTypes, OperandType.None, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Code;
}
@@ -252,7 +252,7 @@ namespace ARMeilleure.Signal
ControlFlowGraph cfg = context.GetControlFlowGraph();
OperandType[] argTypes = new OperandType[] { OperandType.I64 };
OperandType[] argTypes = [OperandType.I64];
return Compiler.Compile(cfg, argTypes, OperandType.I32, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Code;
}

View File

@@ -1,6 +1,5 @@
using ARMeilleure.IntermediateRepresentation;
using ARMeilleure.Translation;
using System;
using System.Runtime.InteropServices;
using static ARMeilleure.IntermediateRepresentation.Operand.Factory;
@@ -30,7 +29,7 @@ namespace ARMeilleure.Signal
ControlFlowGraph cfg = context.GetControlFlowGraph();
OperandType[] argTypes = new OperandType[] { OperandType.I64 };
OperandType[] argTypes = [OperandType.I64];
return Compiler.Compile(cfg, argTypes, OperandType.I32, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<DebugPartialUnmap>();
}
@@ -47,7 +46,7 @@ namespace ARMeilleure.Signal
ControlFlowGraph cfg = context.GetControlFlowGraph();
OperandType[] argTypes = new OperandType[] { OperandType.I64 };
OperandType[] argTypes = [OperandType.I64];
return Compiler.Compile(cfg, argTypes, OperandType.I32, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<DebugThreadLocalMapGetOrReserve>();
}
@@ -76,7 +75,7 @@ namespace ARMeilleure.Signal
ControlFlowGraph cfg = context.GetControlFlowGraph();
OperandType[] argTypes = new OperandType[] { OperandType.I64 };
OperandType[] argTypes = [OperandType.I64];
return Compiler.Compile(cfg, argTypes, OperandType.None, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<DebugNativeWriteLoop>();
}

View File

@@ -1,7 +1,6 @@
using ARMeilleure.IntermediateRepresentation;
using ARMeilleure.Translation;
using Ryujinx.Common.Memory.PartialUnmaps;
using System;
using System.Runtime.InteropServices;
using static ARMeilleure.IntermediateRepresentation.Operand.Factory;

View File

@@ -1,5 +1,4 @@
using ARMeilleure.Memory;
using System;
namespace ARMeilleure.State
{

View File

@@ -6,7 +6,6 @@ using ARMeilleure.Instructions;
using ARMeilleure.IntermediateRepresentation;
using ARMeilleure.Memory;
using ARMeilleure.State;
using System;
using System.Collections.Generic;
using System.Reflection;
using static ARMeilleure.IntermediateRepresentation.Operand.Factory;
@@ -55,7 +54,7 @@ namespace ARMeilleure.Translation
public Aarch32Mode Mode { get; }
private int _ifThenBlockStateIndex = 0;
private Condition[] _ifThenBlockState = Array.Empty<Condition>();
private Condition[] _ifThenBlockState = [];
public bool IsInIfThenBlock => _ifThenBlockStateIndex < _ifThenBlockState.Length;
public Condition CurrentIfThenBlockCond => _ifThenBlockState[_ifThenBlockStateIndex];

View File

@@ -23,7 +23,7 @@ namespace ARMeilleure.Translation.Cache
}
}
private readonly List<MemoryBlock> _blocks = new();
private readonly List<MemoryBlock> _blocks = [];
public CacheMemoryAllocator(int capacity)
{

View File

@@ -25,7 +25,7 @@ namespace ARMeilleure.Translation.Cache
private static CacheMemoryAllocator _cacheAllocator;
private static readonly List<CacheEntry> _cacheEntries = new();
private static readonly List<CacheEntry> _cacheEntries = [];
private static readonly Lock _lock = new();
private static bool _initialized;

View File

@@ -1,13 +1,12 @@
using ARMeilleure.Memory;
using System;
using System.Runtime.InteropServices;
namespace ARMeilleure.Translation.Cache
{
class JitCacheInvalidation
{
private static readonly int[] _invalidationCode = new int[]
{
private static readonly int[] _invalidationCode =
[
unchecked((int)0xd53b0022), // mrs x2, ctr_el0
unchecked((int)0xd3504c44), // ubfx x4, x2, #16, #4
unchecked((int)0x52800083), // mov w3, #0x4
@@ -35,8 +34,8 @@ namespace ARMeilleure.Translation.Cache
unchecked((int)0x54ffffa8), // b.hi 54 <ic_clear_loop>
unchecked((int)0xd5033b9f), // dsb ish
unchecked((int)0xd5033fdf), // isb
unchecked((int)0xd65f03c0), // ret
};
unchecked((int)0xd65f03c0) // ret
];
private delegate void InvalidateCache(ulong start, ulong end);

View File

@@ -47,7 +47,7 @@ namespace ARMeilleure.Translation
{
RemoveUnreachableBlocks(Blocks);
HashSet<BasicBlock> visited = new();
HashSet<BasicBlock> visited = [];
Stack<BasicBlock> blockStack = new();
Array.Resize(ref _postOrderBlocks, Blocks.Count);
@@ -88,7 +88,7 @@ namespace ARMeilleure.Translation
private void RemoveUnreachableBlocks(IntrusiveList<BasicBlock> blocks)
{
HashSet<BasicBlock> visited = new();
HashSet<BasicBlock> visited = [];
Queue<BasicBlock> workQueue = new();
visited.Add(Entry);

View File

@@ -1,5 +1,3 @@
using System;
namespace ARMeilleure.Translation
{
class DelegateInfo

View File

@@ -1,5 +1,3 @@
using System;
namespace ARMeilleure.Translation
{
delegate void DispatcherFunction(nint nativeContext, ulong startAddress);

View File

@@ -1,5 +1,3 @@
using System;
namespace ARMeilleure.Translation
{
delegate ulong GuestFunction(nint nativeContextPtr);

View File

@@ -108,7 +108,7 @@ namespace ARMeilleure.Translation
/// <returns>A list of all values sorted by Key Order</returns>
public List<TV> AsList()
{
List<TV> list = new();
List<TV> list = [];
AddToList(_root, list);

View File

@@ -3,6 +3,8 @@ using ARMeilleure.CodeGen.Linking;
using ARMeilleure.CodeGen.Unwinding;
using ARMeilleure.Common;
using ARMeilleure.Memory;
using ARMeilleure.State;
using Humanizer;
using Ryujinx.Common;
using Ryujinx.Common.Configuration;
using Ryujinx.Common.Logging;
@@ -30,8 +32,8 @@ namespace ARMeilleure.Translation.PTC
{
private const string OuterHeaderMagicString = "PTCohd\0\0";
private const string InnerHeaderMagicString = "PTCihd\0\0";
private const uint InternalVersion = 6998; //! To be incremented manually for each change to the ARMeilleure project.
private const uint InternalVersion = 7007; //! To be incremented manually for each change to the ARMeilleure project.
private const string ActualDir = "0";
private const string BackupDir = "1";
@@ -154,7 +156,7 @@ namespace ARMeilleure.Translation.PTC
private void InitializeCarriers()
{
_infosStream = MemoryStreamManager.Shared.GetStream();
_codesList = new List<byte[]>();
_codesList = [];
_relocsStream = MemoryStreamManager.Shared.GetStream();
_unwindInfosStream = MemoryStreamManager.Shared.GetStream();
}
@@ -184,6 +186,36 @@ namespace ARMeilleure.Translation.PTC
InitializeCarriers();
}
private bool ContainsBlacklistedFunctions()
{
List<ulong> blacklist = Profiler.GetBlacklistedFunctions();
bool containsBlacklistedFunctions = false;
_infosStream.Seek(0L, SeekOrigin.Begin);
bool foundBadFunction = false;
for (int index = 0; index < GetEntriesCount(); index++)
{
InfoEntry infoEntry = DeserializeStructure<InfoEntry>(_infosStream);
foreach (ulong address in blacklist)
{
if (infoEntry.Address == address)
{
containsBlacklistedFunctions = true;
Logger.Warning?.Print(LogClass.Ptc, "PPTC cache invalidated: Found blacklisted functions in PPTC cache");
foundBadFunction = true;
break;
}
}
if (foundBadFunction)
{
break;
}
}
return containsBlacklistedFunctions;
}
private void PreLoad()
{
string fileNameActual = $"{CachePathActual}.cache";
@@ -532,7 +564,7 @@ namespace ARMeilleure.Translation.PTC
public void LoadTranslations(Translator translator)
{
if (AreCarriersEmpty())
if (AreCarriersEmpty() || ContainsBlacklistedFunctions())
{
return;
}
@@ -765,7 +797,7 @@ namespace ARMeilleure.Translation.PTC
private void StubCode(int index)
{
_codesList[index] = Array.Empty<byte>();
_codesList[index] = [];
}
private void StubReloc(int relocEntriesCount)
@@ -835,10 +867,18 @@ namespace ARMeilleure.Translation.PTC
while (profiledFuncsToTranslate.TryDequeue(out (ulong address, PtcProfiler.FuncProfile funcProfile) item))
{
ulong address = item.address;
ExecutionMode executionMode = item.funcProfile.Mode;
bool highCq = item.funcProfile.HighCq;
Debug.Assert(Profiler.IsAddressInStaticCodeRange(address));
TranslatedFunction func = translator.Translate(address, item.funcProfile.Mode, item.funcProfile.HighCq);
TranslatedFunction func = translator.Translate(address, executionMode, highCq);
if (func == null)
{
Profiler.UpdateEntry(address, executionMode, true, true);
continue;
}
bool isAddressUnique = translator.Functions.TryAdd(address, func.GuestSize, func);
@@ -884,8 +924,11 @@ namespace ARMeilleure.Translation.PTC
sw.Stop();
PtcStateChanged?.Invoke(PtcLoadingState.Loaded, _translateCount, _translateTotalCount);
Logger.Info?.Print(LogClass.Ptc, $"{_translateCount} of {_translateTotalCount} functions translated | Thread count: {degreeOfParallelism} in {sw.Elapsed.TotalSeconds} s");
Logger.Info?.Print(LogClass.Ptc,
$"{_translateCount} of {_translateTotalCount} functions translated in {sw.Elapsed.TotalSeconds} seconds " +
$"| {"function".ToQuantity(_translateTotalCount - _translateCount)} blacklisted " +
$"| Thread count: {degreeOfParallelism}");
Thread preSaveThread = new(PreSave)
{

View File

@@ -50,7 +50,7 @@ namespace ARMeilleure.Translation.PTC
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static List<T> DeserializeList<T>(Stream stream) where T : struct
{
List<T> list = new();
List<T> list = [];
int count = DeserializeStructure<int>(stream);

View File

@@ -24,11 +24,13 @@ namespace ARMeilleure.Translation.PTC
{
private const string OuterHeaderMagicString = "Pohd\0\0\0\0";
private const uint InternalVersion = 5518; //! Not to be incremented manually for each change to the ARMeilleure project.
private const uint InternalVersion = 7007; //! Not to be incremented manually for each change to the ARMeilleure project.
private static readonly uint[] _migrateInternalVersions = {
private static readonly uint[] _migrateInternalVersions =
[
1866,
};
5518,
];
private const int SaveInterval = 30; // Seconds.
@@ -76,20 +78,30 @@ namespace ARMeilleure.Translation.PTC
private void TimerElapsed(object _, ElapsedEventArgs __)
=> new Thread(PreSave) { Name = "Ptc.DiskWriter" }.Start();
public void AddEntry(ulong address, ExecutionMode mode, bool highCq)
public void AddEntry(ulong address, ExecutionMode mode, bool highCq, bool blacklist = false)
{
if (IsAddressInStaticCodeRange(address))
{
Debug.Assert(!highCq);
lock (_lock)
if (blacklist)
{
ProfiledFuncs.TryAdd(address, new FuncProfile(mode, highCq: false));
lock (_lock)
{
ProfiledFuncs[address] = new FuncProfile(mode, highCq: false, true);
}
}
else
{
lock (_lock)
{
ProfiledFuncs.TryAdd(address, new FuncProfile(mode, highCq: false, false));
}
}
}
}
public void UpdateEntry(ulong address, ExecutionMode mode, bool highCq)
public void UpdateEntry(ulong address, ExecutionMode mode, bool highCq, bool? blacklist = null)
{
if (IsAddressInStaticCodeRange(address))
{
@@ -99,7 +111,7 @@ namespace ARMeilleure.Translation.PTC
{
Debug.Assert(ProfiledFuncs.ContainsKey(address));
ProfiledFuncs[address] = new FuncProfile(mode, highCq: true);
ProfiledFuncs[address] = new FuncProfile(mode, highCq: true, blacklist ?? ProfiledFuncs[address].Blacklist);
}
}
}
@@ -115,7 +127,7 @@ namespace ARMeilleure.Translation.PTC
foreach (KeyValuePair<ulong, FuncProfile> profiledFunc in ProfiledFuncs)
{
if (!funcs.ContainsKey(profiledFunc.Key))
if (!funcs.ContainsKey(profiledFunc.Key) && !profiledFunc.Value.Blacklist)
{
profiledFuncsToTranslate.Enqueue((profiledFunc.Key, profiledFunc.Value));
}
@@ -130,6 +142,24 @@ namespace ARMeilleure.Translation.PTC
ProfiledFuncs.TrimExcess();
}
public List<ulong> GetBlacklistedFunctions()
{
List<ulong> funcs = new List<ulong>();
foreach (var profiledFunc in ProfiledFuncs)
{
if (profiledFunc.Value.Blacklist)
{
if (!funcs.Contains(profiledFunc.Key))
{
funcs.Add(profiledFunc.Key);
}
}
}
return funcs;
}
public void PreLoad()
{
_lastHash = default;
@@ -220,13 +250,18 @@ namespace ARMeilleure.Translation.PTC
return false;
}
Func<ulong, FuncProfile, (ulong, FuncProfile)> migrateEntryFunc = null;
switch (outerHeader.InfoFileVersion)
{
case InternalVersion:
ProfiledFuncs = Deserialize(stream);
break;
case 1866:
ProfiledFuncs = Deserialize(stream, (address, profile) => (address + 0x500000UL, profile));
migrateEntryFunc = (address, profile) => (address + 0x500000UL, profile);
goto case 5518;
case 5518:
ProfiledFuncs = DeserializeAddBlacklist(stream, migrateEntryFunc);
break;
default:
Logger.Error?.Print(LogClass.Ptc, $"No migration path for {nameof(outerHeader.InfoFileVersion)} '{outerHeader.InfoFileVersion}'. Discarding cache.");
@@ -256,6 +291,16 @@ namespace ARMeilleure.Translation.PTC
return DeserializeDictionary<ulong, FuncProfile>(stream, DeserializeStructure<FuncProfile>);
}
private static Dictionary<ulong, FuncProfile> DeserializeAddBlacklist(Stream stream, Func<ulong, FuncProfile, (ulong, FuncProfile)> migrateEntryFunc = null)
{
if (migrateEntryFunc != null)
{
return DeserializeAndUpdateDictionary(stream, (Stream stream) => { return new FuncProfile(DeserializeStructure<FuncProfilePreBlacklist>(stream)); }, migrateEntryFunc);
}
return DeserializeDictionary<ulong, FuncProfile>(stream, (Stream stream) => { return new FuncProfile(DeserializeStructure<FuncProfilePreBlacklist>(stream)); });
}
private static ReadOnlySpan<byte> GetReadOnlySpan(MemoryStream memoryStream)
{
return new(memoryStream.GetBuffer(), (int)memoryStream.Position, (int)memoryStream.Length - (int)memoryStream.Position);
@@ -387,13 +432,35 @@ namespace ARMeilleure.Translation.PTC
}
}
[StructLayout(LayoutKind.Sequential, Pack = 1/*, Size = 5*/)]
[StructLayout(LayoutKind.Sequential, Pack = 1/*, Size = 6*/)]
public struct FuncProfile
{
public ExecutionMode Mode;
public bool HighCq;
public bool Blacklist;
public FuncProfile(ExecutionMode mode, bool highCq)
public FuncProfile(ExecutionMode mode, bool highCq, bool blacklist)
{
Mode = mode;
HighCq = highCq;
Blacklist = blacklist;
}
public FuncProfile(FuncProfilePreBlacklist fp)
{
Mode = fp.Mode;
HighCq = fp.HighCq;
Blacklist = false;
}
}
[StructLayout(LayoutKind.Sequential, Pack = 1/*, Size = 5*/)]
public struct FuncProfilePreBlacklist
{
public ExecutionMode Mode;
public bool HighCq;
public FuncProfilePreBlacklist(ExecutionMode mode, bool highCq)
{
Mode = mode;
HighCq = highCq;

View File

@@ -1,5 +1,4 @@
using ARMeilleure.Common;
using System;
namespace ARMeilleure.Translation
{

View File

@@ -5,7 +5,6 @@ using ARMeilleure.Diagnostics;
using ARMeilleure.Instructions;
using ARMeilleure.IntermediateRepresentation;
using ARMeilleure.Memory;
using ARMeilleure.Signal;
using ARMeilleure.State;
using ARMeilleure.Translation.Cache;
using ARMeilleure.Translation.PTC;
@@ -249,6 +248,11 @@ namespace ARMeilleure.Translation
ControlFlowGraph cfg = EmitAndGetCFG(context, blocks, out Range funcRange, out Counter<uint> counter);
if (cfg == null)
{
return null;
}
ulong funcSize = funcRange.End - funcRange.Start;
Logger.EndPass(PassName.Translation, cfg);
@@ -260,7 +264,7 @@ namespace ARMeilleure.Translation
Logger.EndPass(PassName.RegisterUsage);
OperandType retType = OperandType.I64;
OperandType[] argTypes = new OperandType[] { OperandType.I64 };
OperandType[] argTypes = [OperandType.I64];
CompilerOptions options = highCq ? CompilerOptions.HighCq : CompilerOptions.None;
@@ -407,6 +411,11 @@ namespace ARMeilleure.Translation
if (opCode.Instruction.Emitter != null)
{
opCode.Instruction.Emitter(context);
if (opCode.Instruction.Name == InstName.Und && blkIndex == 0)
{
range = new Range(rangeStart, rangeEnd);
return null;
}
}
else
{
@@ -478,7 +487,7 @@ namespace ARMeilleure.Translation
public void InvalidateJitCacheRegion(ulong address, ulong size)
{
ulong[] overlapAddresses = Array.Empty<ulong>();
ulong[] overlapAddresses = [];
int overlapsCount = Functions.GetOverlaps(address, size, ref overlapAddresses);

View File

@@ -36,7 +36,7 @@ namespace ARMeilleure.Translation
Sync = new object();
_requests = new Stack<RejitRequest>();
_requestAddresses = new HashSet<ulong>();
_requestAddresses = [];
}
/// <summary>

View File

@@ -4,7 +4,6 @@ using ARMeilleure.IntermediateRepresentation;
using ARMeilleure.State;
using ARMeilleure.Translation.Cache;
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using static ARMeilleure.IntermediateRepresentation.Operand.Factory;
@@ -187,7 +186,7 @@ namespace ARMeilleure.Translation
ControlFlowGraph cfg = context.GetControlFlowGraph();
OperandType retType = OperandType.I64;
OperandType[] argTypes = new[] { OperandType.I64 };
OperandType[] argTypes = [OperandType.I64];
GuestFunction func = Compiler.Compile(cfg, argTypes, retType, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<GuestFunction>();
@@ -212,7 +211,7 @@ namespace ARMeilleure.Translation
ControlFlowGraph cfg = context.GetControlFlowGraph();
OperandType retType = OperandType.I64;
OperandType[] argTypes = new[] { OperandType.I64 };
OperandType[] argTypes = [OperandType.I64];
GuestFunction func = Compiler.Compile(cfg, argTypes, retType, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<GuestFunction>();
@@ -281,7 +280,7 @@ namespace ARMeilleure.Translation
ControlFlowGraph cfg = context.GetControlFlowGraph();
OperandType retType = OperandType.None;
OperandType[] argTypes = new[] { OperandType.I64, OperandType.I64 };
OperandType[] argTypes = [OperandType.I64, OperandType.I64];
return Compiler.Compile(cfg, argTypes, retType, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<DispatcherFunction>();
}
@@ -305,7 +304,7 @@ namespace ARMeilleure.Translation
ControlFlowGraph cfg = context.GetControlFlowGraph();
OperandType retType = OperandType.I64;
OperandType[] argTypes = new[] { OperandType.I64, OperandType.I64 };
OperandType[] argTypes = [OperandType.I64, OperandType.I64];
return Compiler.Compile(cfg, argTypes, retType, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<WrapperFunction>();
}

View File

@@ -139,7 +139,7 @@ namespace ARMeilleure.Translation
ControlFlowGraph cfg = context.GetControlFlowGraph();
OperandType[] argTypes = new OperandType[] { OperandType.I64 };
OperandType[] argTypes = [OperandType.I64];
return Compiler.Compile(cfg, argTypes, OperandType.I32, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<FpFlagsPInvokeTest>();
}

View File

@@ -4,7 +4,6 @@ using Ryujinx.Common.Logging;
using Ryujinx.Common.Memory;
using Ryujinx.Memory;
using System;
using System.Buffers;
using System.Collections.Concurrent;
using System.Threading;

View File

@@ -1,5 +1,4 @@
using Ryujinx.Common.Memory;
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View File

@@ -1,4 +1,3 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using static Ryujinx.Audio.Backends.SoundIo.Native.SoundIo;

View File

@@ -4,7 +4,6 @@ using Ryujinx.Audio.Common;
using Ryujinx.Common.Memory;
using Ryujinx.Memory;
using System;
using System.Buffers;
using System.Collections.Concurrent;
using System.Runtime.CompilerServices;
using System.Threading;

View File

@@ -1,7 +1,6 @@
using Ryujinx.Common;
using Ryujinx.Common.Memory;
using System;
using System.Buffers;
using System.Threading;
namespace Ryujinx.Audio.Backends.Common

View File

@@ -31,19 +31,19 @@ namespace Ryujinx.Audio.Backends.CompatLayer
private const int Minus6dBInQ15 = (int)(0.501f * RawQ15One);
private const int Minus12dBInQ15 = (int)(0.251f * RawQ15One);
private static readonly long[] _defaultSurroundToStereoCoefficients = new long[4]
{
private static readonly long[] _defaultSurroundToStereoCoefficients =
[
RawQ15One,
Minus3dBInQ15,
Minus12dBInQ15,
Minus3dBInQ15,
};
Minus3dBInQ15
];
private static readonly long[] _defaultStereoToMonoCoefficients = new long[2]
{
private static readonly long[] _defaultStereoToMonoCoefficients =
[
Minus6dBInQ15,
Minus6dBInQ15,
};
Minus6dBInQ15
];
private const int SurroundChannelCount = 6;
private const int StereoChannelCount = 2;

View File

@@ -164,12 +164,12 @@ namespace Ryujinx.Audio
/// <summary>
/// The default coefficients used for standard 5.1 surround to stereo downmixing.
/// </summary>
public static readonly float[] DefaultSurroundToStereoCoefficients = new float[4]
{
public static readonly float[] DefaultSurroundToStereoCoefficients =
[
1.0f,
0.707f,
0.251f,
0.707f,
};
0.707f
];
}
}

View File

@@ -173,7 +173,7 @@ namespace Ryujinx.Audio.Input
// TODO: Detect if the driver supports audio input
}
return new[] { Constants.DefaultDeviceInputName };
return [Constants.DefaultDeviceInputName];
}
/// <summary>

View File

@@ -167,7 +167,7 @@ namespace Ryujinx.Audio.Output
/// <returns>The list of all audio outputs name</returns>
public string[] ListAudioOuts()
{
return new[] { Constants.DefaultDeviceOutputName };
return [Constants.DefaultDeviceOutputName];
}
/// <summary>

View File

@@ -10,14 +10,14 @@ namespace Ryujinx.Audio.Renderer.Device
/// <summary>
/// All the defined virtual devices.
/// </summary>
public static readonly VirtualDevice[] Devices = new VirtualDevice[5]
{
public static readonly VirtualDevice[] Devices =
[
new("AudioStereoJackOutput", 2, true),
new("AudioBuiltInSpeakerOutput", 2, false),
new("AudioTvOutput", 6, false),
new("AudioUsbDeviceOutput", 2, true),
new("AudioExternalOutput", 6, true),
};
new("AudioExternalOutput", 6, true)
];
/// <summary>
/// The name of the <see cref="VirtualDevice"/>.

View File

@@ -46,7 +46,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
SampleRate = sampleRate;
BufferCount = mixBufferCount + voiceChannelCountMax;
Buffers = mixBuffer;
Commands = new List<ICommand>();
Commands = [];
MemoryManager = memoryManager;
_buffersEntryCount = Buffers.Length;

View File

@@ -9,21 +9,29 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
{
public class Reverb3dCommand : ICommand
{
private static readonly int[] _outputEarlyIndicesTableMono = new int[20] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
private static readonly int[] _targetEarlyDelayLineIndicesTableMono = new int[20] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
private static readonly int[] _targetOutputFeedbackIndicesTableMono = new int[1] { 0 };
private static readonly int[] _outputEarlyIndicesTableMono = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
];
private static readonly int[] _targetEarlyDelayLineIndicesTableMono = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
];
private static readonly int[] _targetOutputFeedbackIndicesTableMono = [0];
private static readonly int[] _outputEarlyIndicesTableStereo = new int[20] { 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1 };
private static readonly int[] _targetEarlyDelayLineIndicesTableStereo = new int[20] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
private static readonly int[] _targetOutputFeedbackIndicesTableStereo = new int[2] { 0, 1 };
private static readonly int[] _outputEarlyIndicesTableStereo = [0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1
];
private static readonly int[] _targetEarlyDelayLineIndicesTableStereo = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
];
private static readonly int[] _targetOutputFeedbackIndicesTableStereo = [0, 1];
private static readonly int[] _outputEarlyIndicesTableQuadraphonic = new int[20] { 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 0, 0, 0, 0, 3, 3, 3 };
private static readonly int[] _targetEarlyDelayLineIndicesTableQuadraphonic = new int[20] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
private static readonly int[] _targetOutputFeedbackIndicesTableQuadraphonic = new int[4] { 0, 1, 2, 3 };
private static readonly int[] _outputEarlyIndicesTableQuadraphonic = [0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 0, 0, 0, 0, 3, 3, 3
];
private static readonly int[] _targetEarlyDelayLineIndicesTableQuadraphonic = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
];
private static readonly int[] _targetOutputFeedbackIndicesTableQuadraphonic = [0, 1, 2, 3];
private static readonly int[] _outputEarlyIndicesTableSurround = new int[40] { 4, 5, 0, 5, 0, 5, 1, 5, 1, 5, 1, 5, 1, 5, 2, 5, 2, 5, 2, 5, 1, 5, 1, 5, 1, 5, 0, 5, 0, 5, 0, 5, 0, 5, 3, 5, 3, 5, 3, 5 };
private static readonly int[] _targetEarlyDelayLineIndicesTableSurround = new int[40] { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19 };
private static readonly int[] _targetOutputFeedbackIndicesTableSurround = new int[6] { 0, 1, 2, 3, -1, 3 };
private static readonly int[] _outputEarlyIndicesTableSurround = [4, 5, 0, 5, 0, 5, 1, 5, 1, 5, 1, 5, 1, 5, 2, 5, 2, 5, 2, 5, 1, 5, 1, 5, 1, 5, 0, 5, 0, 5, 0, 5, 0, 5, 3, 5, 3, 5, 3, 5
];
private static readonly int[] _targetEarlyDelayLineIndicesTableSurround = [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19
];
private static readonly int[] _targetOutputFeedbackIndicesTableSurround = [0, 1, 2, 3, -1, 3];
public bool Enabled { get; set; }

View File

@@ -9,25 +9,27 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command
{
public class ReverbCommand : ICommand
{
private static readonly int[] _outputEarlyIndicesTableMono = new int[10] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
private static readonly int[] _targetEarlyDelayLineIndicesTableMono = new int[10] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
private static readonly int[] _outputIndicesTableMono = new int[4] { 0, 0, 0, 0 };
private static readonly int[] _targetOutputFeedbackIndicesTableMono = new int[4] { 0, 1, 2, 3 };
private static readonly int[] _outputEarlyIndicesTableMono = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
private static readonly int[] _targetEarlyDelayLineIndicesTableMono = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
private static readonly int[] _outputIndicesTableMono = [0, 0, 0, 0];
private static readonly int[] _targetOutputFeedbackIndicesTableMono = [0, 1, 2, 3];
private static readonly int[] _outputEarlyIndicesTableStereo = new int[10] { 0, 0, 1, 1, 0, 1, 0, 0, 1, 1 };
private static readonly int[] _targetEarlyDelayLineIndicesTableStereo = new int[10] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
private static readonly int[] _outputIndicesTableStereo = new int[4] { 0, 0, 1, 1 };
private static readonly int[] _targetOutputFeedbackIndicesTableStereo = new int[4] { 2, 0, 3, 1 };
private static readonly int[] _outputEarlyIndicesTableStereo = [0, 0, 1, 1, 0, 1, 0, 0, 1, 1];
private static readonly int[] _targetEarlyDelayLineIndicesTableStereo = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
private static readonly int[] _outputIndicesTableStereo = [0, 0, 1, 1];
private static readonly int[] _targetOutputFeedbackIndicesTableStereo = [2, 0, 3, 1];
private static readonly int[] _outputEarlyIndicesTableQuadraphonic = new int[10] { 0, 0, 1, 1, 0, 1, 2, 2, 3, 3 };
private static readonly int[] _targetEarlyDelayLineIndicesTableQuadraphonic = new int[10] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
private static readonly int[] _outputIndicesTableQuadraphonic = new int[4] { 0, 1, 2, 3 };
private static readonly int[] _targetOutputFeedbackIndicesTableQuadraphonic = new int[4] { 0, 1, 2, 3 };
private static readonly int[] _outputEarlyIndicesTableQuadraphonic = [0, 0, 1, 1, 0, 1, 2, 2, 3, 3];
private static readonly int[] _targetEarlyDelayLineIndicesTableQuadraphonic = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
private static readonly int[] _outputIndicesTableQuadraphonic = [0, 1, 2, 3];
private static readonly int[] _targetOutputFeedbackIndicesTableQuadraphonic = [0, 1, 2, 3];
private static readonly int[] _outputEarlyIndicesTableSurround = new int[20] { 0, 5, 0, 5, 1, 5, 1, 5, 4, 5, 4, 5, 2, 5, 2, 5, 3, 5, 3, 5 };
private static readonly int[] _targetEarlyDelayLineIndicesTableSurround = new int[20] { 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9 };
private static readonly int[] _outputIndicesTableSurround = new int[Constants.ChannelCountMax] { 0, 1, 2, 3, 4, 5 };
private static readonly int[] _targetOutputFeedbackIndicesTableSurround = new int[Constants.ChannelCountMax] { 0, 1, 2, 3, -1, 3 };
private static readonly int[] _outputEarlyIndicesTableSurround = [0, 5, 0, 5, 1, 5, 1, 5, 4, 5, 4, 5, 2, 5, 2, 5, 3, 5, 3, 5
];
private static readonly int[] _targetEarlyDelayLineIndicesTableSurround = [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9
];
private static readonly int[] _outputIndicesTableSurround = [0, 1, 2, 3, 4, 5];
private static readonly int[] _targetOutputFeedbackIndicesTableSurround = [0, 1, 2, 3, -1, 3];
public bool Enabled { get; set; }

View File

@@ -10,7 +10,8 @@ namespace Ryujinx.Audio.Renderer.Dsp
public static class ResamplerHelper
{
#region "Default Quality Lookup Tables"
private static readonly short[] _normalCurveLut0 = {
private static readonly short[] _normalCurveLut0 =
[
6600, 19426, 6722, 3, 6479, 19424, 6845, 9, 6359, 19419, 6968, 15, 6239, 19412, 7093, 22,
6121, 19403, 7219, 28, 6004, 19391, 7345, 34, 5888, 19377, 7472, 41, 5773, 19361, 7600, 48,
5659, 19342, 7728, 55, 5546, 19321, 7857, 62, 5434, 19298, 7987, 69, 5323, 19273, 8118, 77,
@@ -42,10 +43,11 @@ namespace Ryujinx.Audio.Renderer.Dsp
109, 8646, 19148, 4890, 101, 8513, 19183, 4997, 92, 8381, 19215, 5104, 84, 8249, 19245, 5213,
77, 8118, 19273, 5323, 69, 7987, 19298, 5434, 62, 7857, 19321, 5546, 55, 7728, 19342, 5659,
48, 7600, 19361, 5773, 41, 7472, 19377, 5888, 34, 7345, 19391, 6004, 28, 7219, 19403, 6121,
22, 7093, 19412, 6239, 15, 6968, 19419, 6359, 9, 6845, 19424, 6479, 3, 6722, 19426, 6600,
};
22, 7093, 19412, 6239, 15, 6968, 19419, 6359, 9, 6845, 19424, 6479, 3, 6722, 19426, 6600
];
private static readonly short[] _normalCurveLut1 = {
private static readonly short[] _normalCurveLut1 =
[
-68, 32639, 69, -5, -200, 32630, 212, -15, -328, 32613, 359, -26, -450, 32586, 512, -36,
-568, 32551, 669, -47, -680, 32507, 832, -58, -788, 32454, 1000, -69, -891, 32393, 1174, -80,
-990, 32323, 1352, -92, -1084, 32244, 1536, -103, -1173, 32157, 1724, -115, -1258, 32061, 1919, -128,
@@ -77,10 +79,11 @@ namespace Ryujinx.Audio.Renderer.Dsp
-180, 2747, 31593, -1554, -167, 2532, 31723, -1486, -153, 2322, 31844, -1414, -140, 2118, 31956, -1338,
-128, 1919, 32061, -1258, -115, 1724, 32157, -1173, -103, 1536, 32244, -1084, -92, 1352, 32323, -990,
-80, 1174, 32393, -891, -69, 1000, 32454, -788, -58, 832, 32507, -680, -47, 669, 32551, -568,
-36, 512, 32586, -450, -26, 359, 32613, -328, -15, 212, 32630, -200, -5, 69, 32639, -68,
};
-36, 512, 32586, -450, -26, 359, 32613, -328, -15, 212, 32630, -200, -5, 69, 32639, -68
];
private static readonly short[] _normalCurveLut2 = {
private static readonly short[] _normalCurveLut2 =
[
3195, 26287, 3329, -32, 3064, 26281, 3467, -34, 2936, 26270, 3608, -38, 2811, 26253, 3751, -42,
2688, 26230, 3897, -46, 2568, 26202, 4046, -50, 2451, 26169, 4199, -54, 2338, 26130, 4354, -58,
2227, 26085, 4512, -63, 2120, 26035, 4673, -67, 2015, 25980, 4837, -72, 1912, 25919, 5004, -76,
@@ -112,12 +115,13 @@ namespace Ryujinx.Audio.Renderer.Dsp
-98, 5701, 25621, 1531, -92, 5522, 25704, 1622, -87, 5347, 25780, 1716, -81, 5174, 25852, 1813,
-76, 5004, 25919, 1912, -72, 4837, 25980, 2015, -67, 4673, 26035, 2120, -63, 4512, 26085, 2227,
-58, 4354, 26130, 2338, -54, 4199, 26169, 2451, -50, 4046, 26202, 2568, -46, 3897, 26230, 2688,
-42, 3751, 26253, 2811, -38, 3608, 26270, 2936, -34, 3467, 26281, 3064, -32, 3329, 26287, 3195,
};
-42, 3751, 26253, 2811, -38, 3608, 26270, 2936, -34, 3467, 26281, 3064, -32, 3329, 26287, 3195
];
#endregion
#region "High Quality Lookup Tables"
private static readonly short[] _highCurveLut0 = {
private static readonly short[] _highCurveLut0 =
[
-582, -23, 8740, 16386, 8833, 8, -590, 0, -573, -54, 8647, 16385, 8925, 40, -598, -1,
-565, -84, 8555, 16383, 9018, 72, -606, -1, -557, -113, 8462, 16379, 9110, 105, -614, -2,
-549, -142, 8370, 16375, 9203, 139, -622, -2, -541, -170, 8277, 16369, 9295, 173, -630, -3,
@@ -181,10 +185,11 @@ namespace Ryujinx.Audio.Renderer.Dsp
-5, -646, 244, 9480, 16354, 8093, -225, -525, -4, -638, 208, 9387, 16362, 8185, -198, -533,
-3, -630, 173, 9295, 16369, 8277, -170, -541, -2, -622, 139, 9203, 16375, 8370, -142, -549,
-2, -614, 105, 9110, 16379, 8462, -113, -557, -1, -606, 72, 9018, 16383, 8555, -84, -565,
-1, -598, 40, 8925, 16385, 8647, -54, -573, 0, -590, 8, 8833, 16386, 8740, -23, -582,
};
-1, -598, 40, 8925, 16385, 8647, -54, -573, 0, -590, 8, 8833, 16386, 8740, -23, -582
];
private static readonly short[] _highCurveLut1 = {
private static readonly short[] _highCurveLut1 =
[
-12, 47, -134, 32767, 81, -16, 2, 0, -26, 108, -345, 32760, 301, -79, 17, -1,
-40, 168, -552, 32745, 526, -144, 32, -2, -53, 226, -753, 32723, 755, -210, 47, -3,
-66, 284, -950, 32694, 989, -277, 63, -5, -78, 340, -1143, 32658, 1226, -346, 79, -6,
@@ -248,10 +253,11 @@ namespace Ryujinx.Audio.Renderer.Dsp
-9, 113, -486, 1715, 32564, -1514, 447, -101, -8, 96, -415, 1469, 32615, -1331, 394, -90,
-6, 79, -346, 1226, 32658, -1143, 340, -78, -5, 63, -277, 989, 32694, -950, 284, -66,
-3, 47, -210, 755, 32723, -753, 226, -53, -2, 32, -144, 526, 32745, -552, 168, -40,
-1, 17, -79, 301, 32760, -345, 108, -26, 0, 2, -16, 81, 32767, -134, 47, -12,
};
-1, 17, -79, 301, 32760, -345, 108, -26, 0, 2, -16, 81, 32767, -134, 47, -12
];
private static readonly short[] _highCurveLut2 = {
private static readonly short[] _highCurveLut2 =
[
418, -2538, 6118, 24615, 6298, -2563, 417, 0, 420, -2512, 5939, 24611, 6479, -2588, 415, 1,
421, -2485, 5761, 24605, 6662, -2612, 412, 2, 422, -2458, 5585, 24595, 6846, -2635, 409, 3,
423, -2430, 5410, 24582, 7030, -2658, 406, 4, 423, -2402, 5236, 24565, 7216, -2680, 403, 5,
@@ -315,8 +321,8 @@ namespace Ryujinx.Audio.Renderer.Dsp
7, 395, -2721, 7591, 24523, 4893, -2343, 423, 6, 399, -2701, 7403, 24546, 5064, -2373, 423,
5, 403, -2680, 7216, 24565, 5236, -2402, 423, 4, 406, -2658, 7030, 24582, 5410, -2430, 423,
3, 409, -2635, 6846, 24595, 5585, -2458, 422, 2, 412, -2612, 6662, 24605, 5761, -2485, 421,
1, 415, -2588, 6479, 24611, 5939, -2512, 420, 0, 417, -2563, 6298, 24615, 6118, -2538, 418,
};
1, 415, -2588, 6479, 24611, 5939, -2512, 420, 0, 417, -2563, 6298, 24615, 6118, -2538, 418
];
#endregion
private static readonly float[] _normalCurveLut0F;

View File

@@ -6,12 +6,14 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
{
public struct Reverb3dState
{
private readonly float[] _fdnDelayMinTimes = new float[4] { 5.0f, 6.0f, 13.0f, 14.0f };
private readonly float[] _fdnDelayMaxTimes = new float[4] { 45.704f, 82.782f, 149.94f, 271.58f };
private readonly float[] _decayDelayMaxTimes1 = new float[4] { 17.0f, 13.0f, 9.0f, 7.0f };
private readonly float[] _decayDelayMaxTimes2 = new float[4] { 19.0f, 11.0f, 10.0f, 6.0f };
private readonly float[] _earlyDelayTimes = new float[20] { 0.017136f, 0.059154f, 0.16173f, 0.39019f, 0.42526f, 0.45541f, 0.68974f, 0.74591f, 0.83384f, 0.8595f, 0.0f, 0.075024f, 0.16879f, 0.2999f, 0.33744f, 0.3719f, 0.59901f, 0.71674f, 0.81786f, 0.85166f };
public readonly float[] EarlyGain = new float[20] { 0.67096f, 0.61027f, 1.0f, 0.35680f, 0.68361f, 0.65978f, 0.51939f, 0.24712f, 0.45945f, 0.45021f, 0.64196f, 0.54879f, 0.92925f, 0.38270f, 0.72867f, 0.69794f, 0.5464f, 0.24563f, 0.45214f, 0.44042f };
private readonly float[] _fdnDelayMinTimes = [5.0f, 6.0f, 13.0f, 14.0f];
private readonly float[] _fdnDelayMaxTimes = [45.704f, 82.782f, 149.94f, 271.58f];
private readonly float[] _decayDelayMaxTimes1 = [17.0f, 13.0f, 9.0f, 7.0f];
private readonly float[] _decayDelayMaxTimes2 = [19.0f, 11.0f, 10.0f, 6.0f];
private readonly float[] _earlyDelayTimes = [0.017136f, 0.059154f, 0.16173f, 0.39019f, 0.42526f, 0.45541f, 0.68974f, 0.74591f, 0.83384f, 0.8595f, 0.0f, 0.075024f, 0.16879f, 0.2999f, 0.33744f, 0.3719f, 0.59901f, 0.71674f, 0.81786f, 0.85166f
];
public readonly float[] EarlyGain = [0.67096f, 0.61027f, 1.0f, 0.35680f, 0.68361f, 0.65978f, 0.51939f, 0.24712f, 0.45945f, 0.45021f, 0.64196f, 0.54879f, 0.92925f, 0.38270f, 0.72867f, 0.69794f, 0.5464f, 0.24563f, 0.45214f, 0.44042f
];
public IDelayLine[] FdnDelayLines { get; }
public DecayDelay[] DecayDelays1 { get; }

View File

@@ -7,8 +7,8 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
{
public struct ReverbState
{
private static readonly float[] _fdnDelayTimes = new float[20]
{
private static readonly float[] _fdnDelayTimes =
[
// Room
53.953247f, 79.192566f, 116.238770f, 130.615295f,
// Hall
@@ -18,11 +18,11 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
// Cathedral
47.03f, 71f, 103f, 170f,
// Max delay (Hall is the one with the highest values so identical to Hall)
53.953247f, 79.192566f, 116.238770f, 170.615295f,
};
53.953247f, 79.192566f, 116.238770f, 170.615295f
];
private static readonly float[] _decayDelayTimes = new float[20]
{
private static readonly float[] _decayDelayTimes =
[
// Room
7f, 9f, 13f, 17f,
// Hall
@@ -32,11 +32,11 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
// Cathedral
7f, 7f, 13f, 9f,
// Max delay (Hall is the one with the highest values so identical to Hall)
7f, 9f, 13f, 17f,
};
7f, 9f, 13f, 17f
];
private static readonly float[] _earlyDelayTimes = new float[50]
{
private static readonly float[] _earlyDelayTimes =
[
// Room
0.0f, 3.5f, 2.8f, 3.9f, 2.7f, 13.4f, 7.9f, 8.4f, 9.9f, 12.0f,
// Chamber
@@ -46,11 +46,11 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
// Cathedral
33.1f, 43.3f, 22.8f, 37.9f, 14.9f, 35.3f, 17.9f, 34.2f, 0.0f, 43.3f,
// Disabled
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
};
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f
];
private static readonly float[] _earlyGainBase = new float[50]
{
private static readonly float[] _earlyGainBase =
[
// Room
0.70f, 0.68f, 0.70f, 0.68f, 0.70f, 0.68f, 0.70f, 0.68f, 0.68f, 0.68f,
// Chamber
@@ -60,11 +60,11 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
// Cathedral
0.93f, 0.92f, 0.87f, 0.86f, 0.94f, 0.81f, 0.80f, 0.77f, 0.76f, 0.65f,
// Disabled
0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f,
};
0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f, 0.00f
];
private static readonly float[] _preDelayTimes = new float[5]
{
private static readonly float[] _preDelayTimes =
[
// Room
12.5f,
// Chamber
@@ -74,8 +74,8 @@ namespace Ryujinx.Audio.Renderer.Dsp.State
// Cathedral
50.0f,
// Disabled
0.0f,
};
0.0f
];
public DelayLine[] FdnDelayLines { get; }
public DecayDelay[] DecayDelays { get; }

View File

@@ -1,4 +1,3 @@
using System;
using System.Runtime.InteropServices;
using CpuAddress = System.UInt64;
using DspAddress = System.UInt64;

View File

@@ -106,7 +106,7 @@ namespace Ryujinx.Common.Collections
/// <returns>A list of all RangeNodes sorted by Key Order</returns>
public List<RangeNode<TKey, TValue>> AsList()
{
List<RangeNode<TKey, TValue>> list = new();
List<RangeNode<TKey, TValue>> list = [];
AddToList(Root, list);

View File

@@ -139,7 +139,7 @@ namespace Ryujinx.Common.Collections
/// <param name="list">List to add the tree pairs into</param>
public List<KeyValuePair<TKey, TValue>> AsLevelOrderList()
{
List<KeyValuePair<TKey, TValue>> list = new();
List<KeyValuePair<TKey, TValue>> list = [];
Queue<Node<TKey, TValue>> nodes = new();
@@ -168,7 +168,7 @@ namespace Ryujinx.Common.Collections
/// <returns>A list of all KeyValuePairs sorted by Key Order</returns>
public List<KeyValuePair<TKey, TValue>> AsList()
{
List<KeyValuePair<TKey, TValue>> list = new();
List<KeyValuePair<TKey, TValue>> list = [];
AddToList(Root, list);

View File

@@ -8,7 +8,7 @@ namespace Ryujinx.Common.Configuration
public ModMetadata()
{
Mods = new List<Mod>();
Mods = [];
}
}
}

View File

@@ -6,4 +6,16 @@ namespace Ryujinx.Common.Configuration
Unbounded,
Custom
}
public static class VSyncModeExtensions
{
public static VSyncMode Next(this VSyncMode vsync, bool customEnabled = false) =>
vsync switch
{
VSyncMode.Switch => customEnabled ? VSyncMode.Custom : VSyncMode.Unbounded,
VSyncMode.Unbounded => VSyncMode.Switch,
VSyncMode.Custom => VSyncMode.Unbounded,
_ => VSyncMode.Switch
};
}
}

View File

@@ -1,5 +1,4 @@
using Microsoft.Win32;
using Ryujinx.Common;
using Ryujinx.Common.Logging;
using System;
using System.Diagnostics;

View File

@@ -1,4 +1,3 @@
using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;

View File

@@ -0,0 +1,118 @@
using System.Text.RegularExpressions;
namespace Ryujinx.Common.Helper
{
public static partial class Patterns
{
#region Accessors
public static readonly Regex Numeric = NumericRegex();
public static readonly Regex AmdGcn = AmdGcnRegex();
public static readonly Regex NvidiaConsumerClass = NvidiaConsumerClassRegex();
public static readonly Regex DomainLp1Ns = DomainLp1NsRegex();
public static readonly Regex DomainLp1Lp1Npln = DomainLp1Lp1NplnRegex();
public static readonly Regex DomainLp1Znc = DomainLp1ZncRegex();
public static readonly Regex DomainSbApi = DomainSbApiRegex();
public static readonly Regex DomainSbAccounts = DomainSbAccountsRegex();
public static readonly Regex DomainAccounts = DomainAccountsRegex();
public static readonly Regex Module = ModuleRegex();
public static readonly Regex FsSdk = FsSdkRegex();
public static readonly Regex SdkMw = SdkMwRegex();
// ReSharper disable once InconsistentNaming
public static readonly Regex CJK = CJKRegex();
public static readonly Regex LdnPassphrase = LdnPassphraseRegex();
public static readonly Regex CleanText = CleanTextRegex();
#endregion
#region Generated pattern stubs
#region Numeric validation
[GeneratedRegex("[0-9]|.")]
internal static partial Regex NumericRegex();
#endregion
#region GPU names
[GeneratedRegex(
"Radeon (((HD|R(5|7|9|X)) )?((M?[2-6]\\d{2}(\\D|$))|([7-8]\\d{3}(\\D|$))|Fury|Nano))|(Pro Duo)")]
internal static partial Regex AmdGcnRegex();
[GeneratedRegex("NVIDIA GeForce (R|G)?TX? (\\d{3}\\d?)M?")]
internal static partial Regex NvidiaConsumerClassRegex();
#endregion
#region DNS blocking
public static readonly Regex[] BlockedHosts =
[
DomainLp1Ns,
DomainLp1Lp1Npln,
DomainLp1Znc,
DomainSbApi,
DomainSbAccounts,
DomainAccounts
];
const RegexOptions DnsRegexOpts =
RegexOptions.CultureInvariant | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture;
[GeneratedRegex(@"^(.*)\-lp1\.(n|s)\.n\.srv\.nintendo\.net$", DnsRegexOpts)]
internal static partial Regex DomainLp1NsRegex();
[GeneratedRegex(@"^(.*)\-lp1\.lp1\.t\.npln\.srv\.nintendo\.net$", DnsRegexOpts)]
internal static partial Regex DomainLp1Lp1NplnRegex();
[GeneratedRegex(@"^(.*)\-lp1\.(znc|p)\.srv\.nintendo\.net$", DnsRegexOpts)]
internal static partial Regex DomainLp1ZncRegex();
[GeneratedRegex(@"^(.*)\-sb\-api\.accounts\.nintendo\.com$", DnsRegexOpts)]
internal static partial Regex DomainSbApiRegex();
[GeneratedRegex(@"^(.*)\-sb\.accounts\.nintendo\.com$", DnsRegexOpts)]
internal static partial Regex DomainSbAccountsRegex();
[GeneratedRegex(@"^accounts\.nintendo\.com$", DnsRegexOpts)]
internal static partial Regex DomainAccountsRegex();
#endregion
#region Executable information
[GeneratedRegex(@"[a-z]:[\\/][ -~]{5,}\.nss", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant)]
internal static partial Regex ModuleRegex();
[GeneratedRegex(@"sdk_version: ([0-9.]*)")]
internal static partial Regex FsSdkRegex();
[GeneratedRegex(@"SDK MW[ -~]*")]
internal static partial Regex SdkMwRegex();
#endregion
#region CJK
[GeneratedRegex(
"\\p{IsHangulJamo}|\\p{IsCJKRadicalsSupplement}|\\p{IsCJKSymbolsandPunctuation}|\\p{IsEnclosedCJKLettersandMonths}|\\p{IsCJKCompatibility}|\\p{IsCJKUnifiedIdeographsExtensionA}|\\p{IsCJKUnifiedIdeographs}|\\p{IsHangulSyllables}|\\p{IsCJKCompatibilityForms}")]
private static partial Regex CJKRegex();
#endregion
[GeneratedRegex("Ryujinx-[0-9a-f]{8}")]
private static partial Regex LdnPassphraseRegex();
[GeneratedRegex(@"[^\u0000\u0009\u000A\u000D\u0020-\uFFFF]..")]
private static partial Regex CleanTextRegex();
#endregion
}
}

View File

@@ -0,0 +1,58 @@
using Gommon;
using System.Collections.Generic;
using System.Threading;
namespace Ryujinx.Common.Helper
{
public class RefEvent<T>
{
public delegate void Handler(ref T arg);
private readonly Lock _subLock = new();
private readonly List<Handler> _subscriptions = [];
public bool HasSubscribers
{
get
{
lock (_subLock)
return _subscriptions.Count != 0;
}
}
public IReadOnlyList<Handler> Subscriptions
{
get
{
lock (_subLock)
return _subscriptions;
}
}
public void Add(Handler subscriber)
{
Guard.Require(subscriber, nameof(subscriber));
lock (_subLock)
_subscriptions.Add(subscriber);
}
public void Remove(Handler subscriber)
{
Guard.Require(subscriber, nameof(subscriber));
lock (_subLock)
_subscriptions.Remove(subscriber);
}
public void Clear()
{
lock (_subLock)
_subscriptions.Clear();
}
public void Call(ref T arg)
{
foreach (Handler subscription in Subscriptions)
subscription(ref arg);
}
}
}

View File

@@ -10,14 +10,18 @@ namespace Ryujinx.Common.Helper
public static bool IsMacOS => OperatingSystem.IsMacOS();
public static bool IsWindows => OperatingSystem.IsWindows();
public static bool IsLinux => OperatingSystem.IsLinux();
public static bool IsArm => RuntimeInformation.OSArchitecture is Architecture.Arm64;
public static bool IsX64 => RuntimeInformation.OSArchitecture is Architecture.X64;
public static bool IsIntelMac => IsMacOS && RuntimeInformation.OSArchitecture is Architecture.X64;
public static bool IsArmMac => IsMacOS && RuntimeInformation.OSArchitecture is Architecture.Arm64;
public static bool IsIntelMac => IsMacOS && IsX64;
public static bool IsArmMac => IsMacOS && IsArm;
public static bool IsX64Windows => IsWindows && (RuntimeInformation.OSArchitecture is Architecture.X64);
public static bool IsArmWindows => IsWindows && (RuntimeInformation.OSArchitecture is Architecture.Arm64);
public static bool IsX64Windows => IsWindows && IsX64;
public static bool IsArmWindows => IsWindows && IsArm;
public static bool IsX64Linux => IsLinux && (RuntimeInformation.OSArchitecture is Architecture.X64);
public static bool IsArmLinux => IsLinux && (RuntimeInformation.OSArchitecture is Architecture.Arm64);
public static bool IsX64Linux => IsLinux && IsX64;
public static bool IsArmLinux => IsLinux && IsArmMac;
}
}

View File

@@ -132,7 +132,7 @@ namespace Ryujinx.Common.Logging
_enabledClasses[index] = true;
}
_logTargets = new List<ILogTarget>();
_logTargets = [];
_time = Stopwatch.StartNew();
@@ -203,7 +203,7 @@ namespace Ryujinx.Common.Logging
public static IReadOnlyCollection<LogLevel> GetEnabledLevels()
{
Log?[] logs = new[] { Debug, Info, Warning, Error, Guest, AccessLog, Stub, Trace };
Log?[] logs = [Debug, Info, Warning, Error, Guest, AccessLog, Stub, Trace];
List<LogLevel> levels = new(logs.Length);
foreach (Log? log in logs)
{

View File

@@ -125,8 +125,8 @@ namespace Ryujinx.Common.PreciseSleep
}
private readonly Lock _lock = new();
private readonly List<NanosleepThread> _threads = new();
private readonly List<NanosleepThread> _active = new();
private readonly List<NanosleepThread> _threads = [];
private readonly List<NanosleepThread> _active = [];
private readonly Stack<NanosleepThread> _free = new();
private readonly AutoResetEvent _signalTarget;

View File

@@ -51,7 +51,7 @@ namespace Ryujinx.Common.SystemInterop
private long _lastId;
private readonly Lock _lock = new();
private readonly List<WaitingObject> _waitingObjects = new();
private readonly List<WaitingObject> _waitingObjects = [];
private WindowsGranularTimer()
{

View File

@@ -3,7 +3,6 @@ using Ryujinx.Common.Configuration;
using Ryujinx.Common.Helper;
using System;
using System.Linq;
using System.Runtime.InteropServices;
namespace Ryujinx.Common
{
@@ -30,10 +29,11 @@ namespace Ryujinx.Common
public static readonly string[] GreatMetalTitles =
[
"010076f0049a2000", // Bayonetta
"01009b500007c000", // ARMS
"0100a5c00d162000", // Cuphead
"010023800d64a000", // Deltarune
"01003a30012c0000", // LEGO City Undercover
"010048701995e000", // Luigi's Manion 2 HD
"010028600EBDA000", // Mario 3D World
"0100152000022000", // Mario Kart 8 Deluxe
"010075a016a3a000", // Persona 4 Arena Ultimax
@@ -48,10 +48,14 @@ namespace Ryujinx.Common
"01009bf0072d4000", // Captain Toad: Treasure Tracker
"01009510001ca000", // Fast RMX
"01005CA01580E000", // Persona 5 Royale
"010015100b514000", // Super Mario Bros. Wonder
"0100000000010000", // Super Mario Odyssey
//Isaac claims it has a issue in level 2, but I am not able to replicate it on my M3. More testing would be appreciated:
"010015100b514000", // Super Mario Bros. Wonder
// Further testing is appreciated, I did not test the entire game:
"01007300020fa000", // Astral Chain
"010076f0049a2000", // Bayonetta
"0100cf5010fec000", // Bayonetta Origins: Cereza and the Lost Demon
"0100f4300bf2c000", // New Pokemon Snap
];
public static string GetDiscordGameAsset(string titleId)

View File

@@ -1,4 +1,5 @@
using Gommon;
using Ryujinx.Common.Helper;
using System;
using System.Drawing;
using System.Threading;
@@ -55,7 +56,7 @@ namespace Ryujinx.Common.Utilities
{
_color = HsbToRgb((_color.GetHue() + Speed) / 360);
_updatedHandler.Call(_color.ToArgb());
_updatedHandler.Call(ref _color);
}
}
@@ -67,13 +68,13 @@ namespace Ryujinx.Common.Utilities
_color = Color.Blue;
}
public static event Action<int> Updated
public static event RefEvent<Color>.Handler Updated
{
add => _updatedHandler.Add(value);
remove => _updatedHandler.Remove(value);
}
private static readonly Event<int> _updatedHandler = new();
private static readonly RefEvent<Color> _updatedHandler = new();
private static Color HsbToRgb(float hue, float saturation = 1, float brightness = 1)
{

View File

@@ -164,7 +164,7 @@ namespace ARMeilleure.Common
_fillBottomLevel = new SparseMemoryBlock(bottomLevelSize, null, _sparseFill);
_fillBottomLevelPtr = (TEntry*)_fillBottomLevel.Block.Pointer;
_sparseReserved = new List<TableSparseBlock>();
_sparseReserved = [];
_sparseLock = new ReaderWriterLockSlim();
_sparseBlockSize = bottomLevelSize;

View File

@@ -1,6 +1,5 @@
using ARMeilleure.State;
using Ryujinx.Memory;
using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;

View File

@@ -5,7 +5,6 @@ using Ryujinx.Memory.Tracking;
using System;
using System.Buffers;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;

View File

@@ -1,5 +1,4 @@
using Ryujinx.Memory;
using System;
using System.Runtime.Versioning;
using System.Threading;

View File

@@ -21,7 +21,7 @@ namespace Ryujinx.Cpu.Jit.HostTracked
public AddressSpacePartitioned(MemoryTracking tracking, MemoryBlock backingMemory, NativePageTable nativePageTable, bool useProtectionMirrors)
{
_backingMemory = backingMemory;
_partitions = new();
_partitions = [];
_asAllocator = new(tracking, nativePageTable.Read, _partitions);
_updatePtCallback = nativePageTable.Update;
_useProtectionMirrors = useProtectionMirrors;

View File

@@ -2,7 +2,6 @@ using ARMeilleure.Common;
using ARMeilleure.Memory;
using ARMeilleure.Translation;
using Ryujinx.Cpu.Signal;
using Ryujinx.Memory;
namespace Ryujinx.Cpu.Jit
{

View File

@@ -5,7 +5,6 @@ using Ryujinx.Memory.Tracking;
using System;
using System.Buffers;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;

View File

@@ -340,7 +340,7 @@ namespace Ryujinx.Cpu.Jit
{
int pages = GetPagesCount(va, (uint)size, out va);
List<MemoryRange> regions = new();
List<MemoryRange> regions = [];
ulong regionStart = GetPhysicalAddressChecked(va);
ulong regionSize = PageSize;

View File

@@ -8,7 +8,6 @@ using Ryujinx.Memory.Tracking;
using System;
using System.Buffers;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Ryujinx.Cpu.Jit
@@ -443,7 +442,7 @@ namespace Ryujinx.Cpu.Jit
return null;
}
List<HostMemoryRange> regions = new();
List<HostMemoryRange> regions = [];
ulong endVa = va + size;
try

View File

@@ -3,7 +3,6 @@ using ARMeilleure.Memory;
using Ryujinx.Cpu.LightningJit.Arm32;
using Ryujinx.Cpu.LightningJit.Arm64;
using Ryujinx.Cpu.LightningJit.State;
using System;
using System.Runtime.InteropServices;
namespace Ryujinx.Cpu.LightningJit

View File

@@ -36,7 +36,7 @@ namespace Ryujinx.Cpu.LightningJit.Arm32
RegisterAllocator = registerAllocator;
MemoryManagerType = mmType;
_itConditions = new ArmCondition[4];
_pendingBranches = new();
_pendingBranches = [];
IsThumb = isThumb;
}

View File

@@ -10,8 +10,8 @@ namespace Ryujinx.Cpu.LightningJit.Arm32
{
public static MultiBlock DecodeMulti(CpuPreset cpuPreset, IMemoryManager memoryManager, ulong address, bool isThumb)
{
List<Block> blocks = new();
List<ulong> branchTargets = new();
List<Block> blocks = [];
List<ulong> branchTargets = [];
while (true)
{
@@ -202,7 +202,7 @@ namespace Ryujinx.Cpu.LightningJit.Arm32
{
ulong startAddress = address;
List<InstInfo> insts = new();
List<InstInfo> insts = [];
uint encoding;
InstMeta meta;

View File

@@ -9,494 +9,494 @@ namespace Ryujinx.Cpu.LightningJit.Arm32
static InstTableA32()
{
InstEncoding[] condConstraints = new InstEncoding[]
{
new(0xF0000000, 0xF0000000),
};
InstEncoding[] condConstraints =
[
new(0xF0000000, 0xF0000000)
];
InstEncoding[] condRnsRnConstraints = new InstEncoding[]
{
InstEncoding[] condRnsRnConstraints =
[
new(0xF0000000, 0xF0000000),
new(0x000F0000, 0x001F0000),
new(0x000D0000, 0x000F0000),
};
new(0x000D0000, 0x000F0000)
];
InstEncoding[] condRnConstraints = new InstEncoding[]
{
InstEncoding[] condRnConstraints =
[
new(0xF0000000, 0xF0000000),
new(0x000D0000, 0x000F0000),
};
new(0x000D0000, 0x000F0000)
];
InstEncoding[] vdVmConstraints = new InstEncoding[]
{
InstEncoding[] vdVmConstraints =
[
new(0x00001000, 0x00001000),
new(0x00000001, 0x00000001),
};
new(0x00000001, 0x00000001)
];
InstEncoding[] condRnConstraints2 = new InstEncoding[]
{
InstEncoding[] condRnConstraints2 =
[
new(0xF0000000, 0xF0000000),
new(0x0000000F, 0x0000000F),
};
new(0x0000000F, 0x0000000F)
];
InstEncoding[] optionConstraints = new InstEncoding[]
{
new(0x00000000, 0x0000000F),
};
InstEncoding[] optionConstraints =
[
new(0x00000000, 0x0000000F)
];
InstEncoding[] condPuwPwPuwPuwConstraints = new InstEncoding[]
{
InstEncoding[] condPuwPwPuwPuwConstraints =
[
new(0xF0000000, 0xF0000000),
new(0x00000000, 0x01A00000),
new(0x01000000, 0x01200000),
new(0x00200000, 0x01A00000),
new(0x01A00000, 0x01A00000),
};
new(0x01A00000, 0x01A00000)
];
InstEncoding[] condRnPuwConstraints = new InstEncoding[]
{
InstEncoding[] condRnPuwConstraints =
[
new(0xF0000000, 0xF0000000),
new(0x000F0000, 0x000F0000),
new(0x00000000, 0x01A00000),
};
new(0x00000000, 0x01A00000)
];
InstEncoding[] condPuwConstraints = new InstEncoding[]
{
InstEncoding[] condPuwConstraints =
[
new(0xF0000000, 0xF0000000),
new(0x00000000, 0x01A00000),
};
new(0x00000000, 0x01A00000)
];
InstEncoding[] condRnPwConstraints = new InstEncoding[]
{
InstEncoding[] condRnPwConstraints =
[
new(0xF0000000, 0xF0000000),
new(0x000F0000, 0x000F0000),
new(0x00200000, 0x01200000),
};
new(0x00200000, 0x01200000)
];
InstEncoding[] condPwConstraints = new InstEncoding[]
{
InstEncoding[] condPwConstraints =
[
new(0xF0000000, 0xF0000000),
new(0x00200000, 0x01200000),
};
new(0x00200000, 0x01200000)
];
InstEncoding[] condRnConstraints3 = new InstEncoding[]
{
InstEncoding[] condRnConstraints3 =
[
new(0xF0000000, 0xF0000000),
new(0x000F0000, 0x000F0000),
};
new(0x000F0000, 0x000F0000)
];
InstEncoding[] condMaskrConstraints = new InstEncoding[]
{
InstEncoding[] condMaskrConstraints =
[
new(0xF0000000, 0xF0000000),
new(0x00000000, 0x004F0000),
};
new(0x00000000, 0x004F0000)
];
InstEncoding[] rnConstraints = new InstEncoding[]
{
new(0x000F0000, 0x000F0000),
};
InstEncoding[] rnConstraints =
[
new(0x000F0000, 0x000F0000)
];
InstEncoding[] vdVnVmConstraints = new InstEncoding[]
{
InstEncoding[] vdVnVmConstraints =
[
new(0x00001000, 0x00001000),
new(0x00010000, 0x00010000),
new(0x00000001, 0x00000001),
};
new(0x00000001, 0x00000001)
];
InstEncoding[] condRaConstraints = new InstEncoding[]
{
InstEncoding[] condRaConstraints =
[
new(0xF0000000, 0xF0000000),
new(0x0000F000, 0x0000F000),
};
new(0x0000F000, 0x0000F000)
];
InstEncoding[] sizeQvdQvnQvmConstraints = new InstEncoding[]
{
InstEncoding[] sizeQvdQvnQvmConstraints =
[
new(0x00300000, 0x00300000),
new(0x00001040, 0x00001040),
new(0x00010040, 0x00010040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] sizeVdConstraints = new InstEncoding[]
{
InstEncoding[] sizeVdConstraints =
[
new(0x00300000, 0x00300000),
new(0x00001000, 0x00001000),
};
new(0x00001000, 0x00001000)
];
InstEncoding[] qvdQvnQvmConstraints = new InstEncoding[]
{
InstEncoding[] qvdQvnQvmConstraints =
[
new(0x00001040, 0x00001040),
new(0x00010040, 0x00010040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] sizeQvdQvmConstraints = new InstEncoding[]
{
InstEncoding[] sizeQvdQvmConstraints =
[
new(0x000C0000, 0x000C0000),
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] sizeVnVmConstraints = new InstEncoding[]
{
InstEncoding[] sizeVnVmConstraints =
[
new(0x00300000, 0x00300000),
new(0x00010000, 0x00010000),
new(0x00000001, 0x00000001),
};
new(0x00000001, 0x00000001)
];
InstEncoding[] sizeVdOpvnConstraints = new InstEncoding[]
{
InstEncoding[] sizeVdOpvnConstraints =
[
new(0x00300000, 0x00300000),
new(0x00001000, 0x00001000),
new(0x00010100, 0x00010100),
};
new(0x00010100, 0x00010100)
];
InstEncoding[] cmodeCmodeQvdConstraints = new InstEncoding[]
{
InstEncoding[] cmodeCmodeQvdConstraints =
[
new(0x00000000, 0x00000100),
new(0x00000C00, 0x00000C00),
new(0x00001040, 0x00001040),
};
new(0x00001040, 0x00001040)
];
InstEncoding[] qvdQvnQvmOpConstraints = new InstEncoding[]
{
InstEncoding[] qvdQvnQvmOpConstraints =
[
new(0x00001040, 0x00001040),
new(0x00010040, 0x00010040),
new(0x00000041, 0x00000041),
new(0x00000000, 0x00300000),
};
new(0x00000000, 0x00300000)
];
InstEncoding[] qvdQvnQvmSizeConstraints = new InstEncoding[]
{
InstEncoding[] qvdQvnQvmSizeConstraints =
[
new(0x00001040, 0x00001040),
new(0x00010040, 0x00010040),
new(0x00000041, 0x00000041),
new(0x00300000, 0x00300000),
};
new(0x00300000, 0x00300000)
];
InstEncoding[] qvdQvnConstraints = new InstEncoding[]
{
InstEncoding[] qvdQvnConstraints =
[
new(0x00001040, 0x00001040),
new(0x00010040, 0x00010040),
};
new(0x00010040, 0x00010040)
];
InstEncoding[] qvdQvmConstraints = new InstEncoding[]
{
InstEncoding[] qvdQvmConstraints =
[
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] sizeConstraints = new InstEncoding[]
{
new(0x00000000, 0x00000300),
};
InstEncoding[] sizeConstraints =
[
new(0x00000000, 0x00000300)
];
InstEncoding[] vmConstraints = new InstEncoding[]
{
new(0x00000001, 0x00000001),
};
InstEncoding[] vmConstraints =
[
new(0x00000001, 0x00000001)
];
InstEncoding[] opvdOpvmConstraints = new InstEncoding[]
{
InstEncoding[] opvdOpvmConstraints =
[
new(0x00001100, 0x00001100),
new(0x00000001, 0x00000101),
};
new(0x00000001, 0x00000101)
];
InstEncoding[] imm6Opimm6Imm6QvdQvmConstraints = new InstEncoding[]
{
InstEncoding[] imm6Opimm6Imm6QvdQvmConstraints =
[
new(0x00000000, 0x00380000),
new(0x00200000, 0x00300200),
new(0x00000000, 0x00200000),
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] condQvdEbConstraints = new InstEncoding[]
{
InstEncoding[] condQvdEbConstraints =
[
new(0xF0000000, 0xF0000000),
new(0x00210000, 0x00210000),
new(0x00400020, 0x00400020),
};
new(0x00400020, 0x00400020)
];
InstEncoding[] imm4QvdConstraints = new InstEncoding[]
{
InstEncoding[] imm4QvdConstraints =
[
new(0x00000000, 0x00070000),
new(0x00001040, 0x00001040),
};
new(0x00001040, 0x00001040)
];
InstEncoding[] qvdQvnQvmQimm4Constraints = new InstEncoding[]
{
InstEncoding[] qvdQvnQvmQimm4Constraints =
[
new(0x00001040, 0x00001040),
new(0x00010040, 0x00010040),
new(0x00000041, 0x00000041),
new(0x00000800, 0x00000840),
};
new(0x00000800, 0x00000840)
];
InstEncoding[] qvdConstraints = new InstEncoding[]
{
new(0x00001040, 0x00001040),
};
InstEncoding[] qvdConstraints =
[
new(0x00001040, 0x00001040)
];
InstEncoding[] vdVnConstraints = new InstEncoding[]
{
InstEncoding[] vdVnConstraints =
[
new(0x00001000, 0x00001000),
new(0x00010000, 0x00010000),
};
new(0x00010000, 0x00010000)
];
InstEncoding[] sizeConstraints2 = new InstEncoding[]
{
new(0x00000C00, 0x00000C00),
};
InstEncoding[] sizeConstraints2 =
[
new(0x00000C00, 0x00000C00)
];
InstEncoding[] sizeIndexAlignIndexAlignConstraints = new InstEncoding[]
{
InstEncoding[] sizeIndexAlignIndexAlignConstraints =
[
new(0x00000C00, 0x00000C00),
new(0x00000010, 0x00000030),
new(0x00000020, 0x00000030),
};
new(0x00000020, 0x00000030)
];
InstEncoding[] sizeSizeaConstraints = new InstEncoding[]
{
InstEncoding[] sizeSizeaConstraints =
[
new(0x000000C0, 0x000000C0),
new(0x00000010, 0x000000D0),
};
new(0x00000010, 0x000000D0)
];
InstEncoding[] alignConstraints = new InstEncoding[]
{
new(0x00000020, 0x00000020),
};
InstEncoding[] alignConstraints =
[
new(0x00000020, 0x00000020)
];
InstEncoding[] alignConstraints2 = new InstEncoding[]
{
InstEncoding[] alignConstraints2 =
[
new(0x00000030, 0x00000030)
];
InstEncoding[] sizeConstraints3 =
[
new(0x000000C0, 0x000000C0)
];
InstEncoding[] alignSizeConstraints =
[
new(0x00000030, 0x00000030),
};
new(0x000000C0, 0x000000C0)
];
InstEncoding[] sizeConstraints3 = new InstEncoding[]
{
InstEncoding[] sizeAConstraints =
[
new(0x000000C0, 0x000000C0),
};
new(0x00000010, 0x00000010)
];
InstEncoding[] alignSizeConstraints = new InstEncoding[]
{
new(0x00000030, 0x00000030),
InstEncoding[] sizeAlignConstraints =
[
new(0x000000C0, 0x000000C0),
};
new(0x00000020, 0x00000020)
];
InstEncoding[] sizeAConstraints = new InstEncoding[]
{
new(0x000000C0, 0x000000C0),
new(0x00000010, 0x00000010),
};
InstEncoding[] sizeAlignConstraints = new InstEncoding[]
{
new(0x000000C0, 0x000000C0),
new(0x00000020, 0x00000020),
};
InstEncoding[] sizeIndexAlignConstraints = new InstEncoding[]
{
InstEncoding[] sizeIndexAlignConstraints =
[
new(0x00000C00, 0x00000C00),
new(0x00000030, 0x00000030),
};
new(0x00000030, 0x00000030)
];
InstEncoding[] sizeaConstraints = new InstEncoding[]
{
new(0x000000C0, 0x000000D0),
};
InstEncoding[] sizeaConstraints =
[
new(0x000000C0, 0x000000D0)
];
InstEncoding[] sizeSizeVdConstraints = new InstEncoding[]
{
InstEncoding[] sizeSizeVdConstraints =
[
new(0x00300000, 0x00300000),
new(0x00000000, 0x00300000),
new(0x00001000, 0x00001000),
};
new(0x00001000, 0x00001000)
];
InstEncoding[] sizeQvdQvnConstraints = new InstEncoding[]
{
InstEncoding[] sizeQvdQvnConstraints =
[
new(0x00300000, 0x00300000),
new(0x01001000, 0x01001000),
new(0x01010000, 0x01010000),
};
new(0x01010000, 0x01010000)
];
InstEncoding[] imm3hImm3hImm3hImm3hImm3hVdConstraints = new InstEncoding[]
{
InstEncoding[] imm3hImm3hImm3hImm3hImm3hVdConstraints =
[
new(0x00000000, 0x00380000),
new(0x00180000, 0x00380000),
new(0x00280000, 0x00380000),
new(0x00300000, 0x00380000),
new(0x00380000, 0x00380000),
new(0x00001000, 0x00001000),
};
new(0x00001000, 0x00001000)
];
InstEncoding[] sizeVmConstraints = new InstEncoding[]
{
InstEncoding[] sizeVmConstraints =
[
new(0x000C0000, 0x000C0000),
new(0x00000001, 0x00000001),
};
new(0x00000001, 0x00000001)
];
InstEncoding[] condOpc1opc2Constraints = new InstEncoding[]
{
InstEncoding[] condOpc1opc2Constraints =
[
new(0xF0000000, 0xF0000000),
new(0x00000040, 0x00400060),
};
new(0x00000040, 0x00400060)
];
InstEncoding[] condUopc1opc2Uopc1opc2Constraints = new InstEncoding[]
{
InstEncoding[] condUopc1opc2Uopc1opc2Constraints =
[
new(0xF0000000, 0xF0000000),
new(0x00800000, 0x00C00060),
new(0x00000040, 0x00400060),
};
new(0x00000040, 0x00400060)
];
InstEncoding[] sizeOpuOpsizeVdConstraints = new InstEncoding[]
{
InstEncoding[] sizeOpuOpsizeVdConstraints =
[
new(0x00300000, 0x00300000),
new(0x01000200, 0x01000200),
new(0x00100200, 0x00300200),
new(0x00001000, 0x00001000),
};
new(0x00001000, 0x00001000)
];
InstEncoding[] sizeOpsizeOpsizeQvdQvnQvmConstraints = new InstEncoding[]
{
InstEncoding[] sizeOpsizeOpsizeQvdQvnQvmConstraints =
[
new(0x00300000, 0x00300000),
new(0x01100000, 0x01300000),
new(0x01200000, 0x01300000),
new(0x00001040, 0x00001040),
new(0x00010040, 0x00010040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] cmodeQvdConstraints = new InstEncoding[]
{
InstEncoding[] cmodeQvdConstraints =
[
new(0x00000E00, 0x00000E00),
new(0x00001040, 0x00001040),
};
new(0x00001040, 0x00001040)
];
InstEncoding[] qConstraints = new InstEncoding[]
{
new(0x00000040, 0x00000040),
};
InstEncoding[] qConstraints =
[
new(0x00000040, 0x00000040)
];
InstEncoding[] sizeQConstraints = new InstEncoding[]
{
InstEncoding[] sizeQConstraints =
[
new(0x00300000, 0x00300000),
new(0x00000040, 0x00000040),
};
new(0x00000040, 0x00000040)
];
InstEncoding[] sizeConstraints4 = new InstEncoding[]
{
new(0x00300000, 0x00300000),
};
InstEncoding[] sizeConstraints4 =
[
new(0x00300000, 0x00300000)
];
InstEncoding[] qvdQvnQvmSizeSizeConstraints = new InstEncoding[]
{
InstEncoding[] qvdQvnQvmSizeSizeConstraints =
[
new(0x00001040, 0x00001040),
new(0x00010040, 0x00010040),
new(0x00000041, 0x00000041),
new(0x00000000, 0x00300000),
new(0x00300000, 0x00300000),
};
new(0x00300000, 0x00300000)
];
InstEncoding[] sizeSizeQvdQvnConstraints = new InstEncoding[]
{
InstEncoding[] sizeSizeQvdQvnConstraints =
[
new(0x00300000, 0x00300000),
new(0x00000000, 0x00300000),
new(0x01001000, 0x01001000),
new(0x01010000, 0x01010000),
};
new(0x01010000, 0x01010000)
];
InstEncoding[] opSizeVmConstraints = new InstEncoding[]
{
InstEncoding[] opSizeVmConstraints =
[
new(0x00000000, 0x000000C0),
new(0x000C0000, 0x000C0000),
new(0x00000001, 0x00000001),
};
new(0x00000001, 0x00000001)
];
InstEncoding[] qvdQvmQvnConstraints = new InstEncoding[]
{
InstEncoding[] qvdQvmQvnConstraints =
[
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
new(0x00010040, 0x00010040),
};
new(0x00010040, 0x00010040)
];
InstEncoding[] imm6UopVmConstraints = new InstEncoding[]
{
InstEncoding[] imm6UopVmConstraints =
[
new(0x00000000, 0x00380000),
new(0x00000000, 0x01000100),
new(0x00000001, 0x00000001),
};
new(0x00000001, 0x00000001)
];
InstEncoding[] imm6lUopQvdQvmConstraints = new InstEncoding[]
{
InstEncoding[] imm6lUopQvdQvmConstraints =
[
new(0x00000000, 0x00380080),
new(0x00000000, 0x01000100),
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] qvdQvmSizeSizeConstraints = new InstEncoding[]
{
InstEncoding[] qvdQvmSizeSizeConstraints =
[
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
new(0x00000000, 0x000C0000),
new(0x000C0000, 0x000C0000),
};
new(0x000C0000, 0x000C0000)
];
InstEncoding[] sizeSizeSizeQvdQvmConstraints = new InstEncoding[]
{
InstEncoding[] sizeSizeSizeQvdQvmConstraints =
[
new(0x00040000, 0x000C0000),
new(0x00080000, 0x000C0000),
new(0x000C0000, 0x000C0000),
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] sizeSizeQvdQvmConstraints = new InstEncoding[]
{
InstEncoding[] sizeSizeQvdQvmConstraints =
[
new(0x00080000, 0x000C0000),
new(0x000C0000, 0x000C0000),
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] imm6lQvdQvmConstraints = new InstEncoding[]
{
InstEncoding[] imm6lQvdQvmConstraints =
[
new(0x00000000, 0x00380080),
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] imm6VmConstraints = new InstEncoding[]
{
InstEncoding[] imm6VmConstraints =
[
new(0x00000000, 0x00380000),
new(0x00000001, 0x00000001),
};
new(0x00000001, 0x00000001)
];
InstEncoding[] imm6VdImm6Imm6Imm6Constraints = new InstEncoding[]
{
InstEncoding[] imm6VdImm6Imm6Imm6Constraints =
[
new(0x00000000, 0x00380000),
new(0x00001000, 0x00001000),
new(0x00080000, 0x003F0000),
new(0x00100000, 0x003F0000),
new(0x00200000, 0x003F0000),
};
new(0x00200000, 0x003F0000)
];
InstEncoding[] sizeVdConstraints2 = new InstEncoding[]
{
InstEncoding[] sizeVdConstraints2 =
[
new(0x000C0000, 0x000C0000),
new(0x00001000, 0x00001000),
};
new(0x00001000, 0x00001000)
];
InstEncoding[] sizeQsizeQvdQvmConstraints = new InstEncoding[]
{
InstEncoding[] sizeQsizeQvdQvmConstraints =
[
new(0x000C0000, 0x000C0000),
new(0x00080000, 0x000C0040),
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
List<InstInfoForTable> insts = new()
{
List<InstInfoForTable> insts =
[
new(0x02A00000, 0x0FE00000, condConstraints, InstName.AdcI, T.AdcIA1, IsaVersion.v80, InstFlags.CondRd),
new(0x00A00000, 0x0FE00010, condConstraints, InstName.AdcR, T.AdcRA1, IsaVersion.v80, InstFlags.CondRd),
new(0x00A00010, 0x0FE00090, condConstraints, InstName.AdcRr, T.AdcRrA1, IsaVersion.v80, InstFlags.CondRd),
@@ -1176,7 +1176,7 @@ namespace Ryujinx.Cpu.LightningJit.Arm32
new(0x0320F002, 0x0FFFFFFF, condConstraints, InstName.Wfe, T.WfeA1, IsaVersion.v80, InstFlags.Cond),
new(0x0320F003, 0x0FFFFFFF, condConstraints, InstName.Wfi, T.WfiA1, IsaVersion.v80, InstFlags.Cond),
new(0x0320F001, 0x0FFFFFFF, condConstraints, InstName.Yield, T.YieldA1, IsaVersion.v80, InstFlags.Cond),
};
];
_table = new(insts);
}

View File

@@ -9,48 +9,49 @@ namespace Ryujinx.Cpu.LightningJit.Arm32
static InstTableT16()
{
InstEncoding[] rmRdndnConstraints = new InstEncoding[]
{
InstEncoding[] rmRdndnConstraints =
[
new(0x00680000, 0x00780000),
new(0x00850000, 0x00870000),
};
new(0x00850000, 0x00870000)
];
InstEncoding[] rmConstraints = new InstEncoding[]
{
new(0x00680000, 0x00780000),
};
InstEncoding[] rmConstraints =
[
new(0x00680000, 0x00780000)
];
InstEncoding[] condCondConstraints = new InstEncoding[]
{
InstEncoding[] condCondConstraints =
[
new(0x0E000000, 0x0F000000),
new(0x0F000000, 0x0F000000),
};
new(0x0F000000, 0x0F000000)
];
InstEncoding[] maskConstraints = new InstEncoding[]
{
new(0x00000000, 0x000F0000),
};
InstEncoding[] maskConstraints =
[
new(0x00000000, 0x000F0000)
];
InstEncoding[] opConstraints = new InstEncoding[]
{
new(0x18000000, 0x18000000),
};
InstEncoding[] opConstraints =
[
new(0x18000000, 0x18000000)
];
InstEncoding[] opOpOpOpConstraints = new InstEncoding[]
{
InstEncoding[] opOpOpOpConstraints =
[
new(0x00000000, 0x03C00000),
new(0x00400000, 0x03C00000),
new(0x01400000, 0x03C00000),
new(0x01800000, 0x03C00000),
};
new(0x01800000, 0x03C00000)
];
List<InstInfoForTable> insts = new()
{
List<InstInfoForTable> insts =
[
new(0x41400000, 0xFFC00000, InstName.AdcR, T.AdcRT1, IsaVersion.v80, InstFlags.Rdn),
new(0x1C000000, 0xFE000000, InstName.AddI, T.AddIT1, IsaVersion.v80, InstFlags.Rd),
new(0x30000000, 0xF8000000, InstName.AddI, T.AddIT2, IsaVersion.v80, InstFlags.Rdn),
new(0x18000000, 0xFE000000, InstName.AddR, T.AddRT1, IsaVersion.v80, InstFlags.Rd),
new(0x44000000, 0xFF000000, rmRdndnConstraints, InstName.AddR, T.AddRT2, IsaVersion.v80, InstFlags.RdnDn),
new(0x44000000, 0xFF000000, rmRdndnConstraints, InstName.AddR, T.AddRT2, IsaVersion.v80,
InstFlags.RdnDn),
new(0xA8000000, 0xF8000000, InstName.AddSpI, T.AddSpIT1, IsaVersion.v80, InstFlags.RdRd16),
new(0xB0000000, 0xFF800000, InstName.AddSpI, T.AddSpIT2, IsaVersion.v80, InstFlags.None),
new(0x44680000, 0xFF780000, InstName.AddSpR, T.AddSpRT1, IsaVersion.v80, InstFlags.None),
@@ -86,7 +87,8 @@ namespace Ryujinx.Cpu.LightningJit.Arm32
new(0x20000000, 0xF8000000, InstName.MovI, T.MovIT1, IsaVersion.v80, InstFlags.RdRd16),
new(0x46000000, 0xFF000000, InstName.MovR, T.MovRT1, IsaVersion.v80, InstFlags.Rd),
new(0x00000000, 0xE0000000, opConstraints, InstName.MovR, T.MovRT2, IsaVersion.v80, InstFlags.Rd),
new(0x40000000, 0xFE000000, opOpOpOpConstraints, InstName.MovRr, T.MovRrT1, IsaVersion.v80, InstFlags.None),
new(0x40000000, 0xFE000000, opOpOpOpConstraints, InstName.MovRr, T.MovRrT1, IsaVersion.v80,
InstFlags.None),
new(0x43400000, 0xFFC00000, InstName.Mul, T.MulT1, IsaVersion.v80, InstFlags.None),
new(0x43C00000, 0xFFC00000, InstName.MvnR, T.MvnRT1, IsaVersion.v80, InstFlags.Rd),
new(0xBF000000, 0xFFFF0000, InstName.Nop, T.NopT1, IsaVersion.v80, InstFlags.None),
@@ -99,7 +101,8 @@ namespace Ryujinx.Cpu.LightningJit.Arm32
new(0x42400000, 0xFFC00000, InstName.RsbI, T.RsbIT1, IsaVersion.v80, InstFlags.Rd),
new(0x41800000, 0xFFC00000, InstName.SbcR, T.SbcRT1, IsaVersion.v80, InstFlags.Rdn),
new(0xB6500000, 0xFFF70000, InstName.Setend, T.SetendT1, IsaVersion.v80, InstFlags.None),
new(0xB6100000, 0xFFF70000, InstName.Setpan, T.SetpanT1, IsaVersion.v81, IsaFeature.FeatPan, InstFlags.None),
new(0xB6100000, 0xFFF70000, InstName.Setpan, T.SetpanT1, IsaVersion.v81, IsaFeature.FeatPan,
InstFlags.None),
new(0xBF400000, 0xFFFF0000, InstName.Sev, T.SevT1, IsaVersion.v80, InstFlags.None),
new(0xBF500000, 0xFFFF0000, InstName.Sevl, T.SevlT1, IsaVersion.v80, InstFlags.None),
new(0xC0000000, 0xF8000000, InstName.Stm, T.StmT1, IsaVersion.v80, InstFlags.RlistRead),
@@ -123,8 +126,8 @@ namespace Ryujinx.Cpu.LightningJit.Arm32
new(0xB2800000, 0xFFC00000, InstName.Uxth, T.UxthT1, IsaVersion.v80, InstFlags.Rd),
new(0xBF200000, 0xFFFF0000, InstName.Wfe, T.WfeT1, IsaVersion.v80, InstFlags.None),
new(0xBF300000, 0xFFFF0000, InstName.Wfi, T.WfiT1, IsaVersion.v80, InstFlags.None),
new(0xBF100000, 0xFFFF0000, InstName.Yield, T.YieldT1, IsaVersion.v80, InstFlags.None),
};
new(0xBF100000, 0xFFFF0000, InstName.Yield, T.YieldT1, IsaVersion.v80, InstFlags.None)
];
_table = new(insts);
}

View File

@@ -9,525 +9,525 @@ namespace Ryujinx.Cpu.LightningJit.Arm32
static InstTableT32()
{
InstEncoding[] rnRdsConstraints = new InstEncoding[]
{
InstEncoding[] rnRdsConstraints =
[
new(0x000D0000, 0x000F0000),
new(0x00100F00, 0x00100F00),
};
new(0x00100F00, 0x00100F00)
];
InstEncoding[] rnRnConstraints = new InstEncoding[]
{
InstEncoding[] rnRnConstraints =
[
new(0x000D0000, 0x000F0000),
new(0x000F0000, 0x000F0000),
};
new(0x000F0000, 0x000F0000)
];
InstEncoding[] rdsConstraints = new InstEncoding[]
{
new(0x00100F00, 0x00100F00),
};
InstEncoding[] rdsConstraints =
[
new(0x00100F00, 0x00100F00)
];
InstEncoding[] vdVmConstraints = new InstEncoding[]
{
InstEncoding[] vdVmConstraints =
[
new(0x00001000, 0x00001000),
new(0x00000001, 0x00000001),
};
new(0x00000001, 0x00000001)
];
InstEncoding[] condCondCondConstraints = new InstEncoding[]
{
InstEncoding[] condCondCondConstraints =
[
new(0x03800000, 0x03C00000),
new(0x03C00000, 0x03C00000),
new(0x03800000, 0x03800000),
};
new(0x03800000, 0x03800000)
];
InstEncoding[] rnConstraints = new InstEncoding[]
{
new(0x000F0000, 0x000F0000),
};
InstEncoding[] rnConstraints =
[
new(0x000F0000, 0x000F0000)
];
InstEncoding[] hConstraints = new InstEncoding[]
{
new(0x00000001, 0x00000001),
};
InstEncoding[] hConstraints =
[
new(0x00000001, 0x00000001)
];
InstEncoding[] imodmConstraints = new InstEncoding[]
{
new(0x00000000, 0x00000700),
};
InstEncoding[] imodmConstraints =
[
new(0x00000000, 0x00000700)
];
InstEncoding[] optionConstraints = new InstEncoding[]
{
new(0x00000000, 0x0000000F),
};
InstEncoding[] optionConstraints =
[
new(0x00000000, 0x0000000F)
];
InstEncoding[] puwPwPuwPuwConstraints = new InstEncoding[]
{
InstEncoding[] puwPwPuwPuwConstraints =
[
new(0x00000000, 0x01A00000),
new(0x01000000, 0x01200000),
new(0x00200000, 0x01A00000),
new(0x01A00000, 0x01A00000),
};
new(0x01A00000, 0x01A00000)
];
InstEncoding[] rnPuwConstraints = new InstEncoding[]
{
InstEncoding[] rnPuwConstraints =
[
new(0x000F0000, 0x000F0000),
new(0x00000000, 0x01A00000),
};
new(0x00000000, 0x01A00000)
];
InstEncoding[] puwConstraints = new InstEncoding[]
{
new(0x00000000, 0x01A00000),
};
InstEncoding[] puwConstraints =
[
new(0x00000000, 0x01A00000)
];
InstEncoding[] rnRtConstraints = new InstEncoding[]
{
InstEncoding[] rnRtConstraints =
[
new(0x000F0000, 0x000F0000),
new(0x0000F000, 0x0000F000),
};
new(0x0000F000, 0x0000F000)
];
InstEncoding[] rnRtpuwPuwPwConstraints = new InstEncoding[]
{
InstEncoding[] rnRtpuwPuwPwConstraints =
[
new(0x000F0000, 0x000F0000),
new(0x0000F400, 0x0000F700),
new(0x00000600, 0x00000700),
new(0x00000000, 0x00000500),
};
new(0x00000000, 0x00000500)
];
InstEncoding[] rtConstraints = new InstEncoding[]
{
new(0x0000F000, 0x0000F000),
};
InstEncoding[] rtConstraints =
[
new(0x0000F000, 0x0000F000)
];
InstEncoding[] rnPwConstraints = new InstEncoding[]
{
InstEncoding[] rnPwConstraints =
[
new(0x000F0000, 0x000F0000),
new(0x00000000, 0x01200000),
};
new(0x00000000, 0x01200000)
];
InstEncoding[] pwConstraints = new InstEncoding[]
{
new(0x00000000, 0x01200000),
};
InstEncoding[] pwConstraints =
[
new(0x00000000, 0x01200000)
];
InstEncoding[] rnPuwPwConstraints = new InstEncoding[]
{
InstEncoding[] rnPuwPwConstraints =
[
new(0x000F0000, 0x000F0000),
new(0x00000600, 0x00000700),
new(0x00000000, 0x00000500),
};
new(0x00000000, 0x00000500)
];
InstEncoding[] raConstraints = new InstEncoding[]
{
new(0x0000F000, 0x0000F000),
};
InstEncoding[] raConstraints =
[
new(0x0000F000, 0x0000F000)
];
InstEncoding[] sTConstraints = new InstEncoding[]
{
InstEncoding[] sTConstraints =
[
new(0x00100000, 0x00100000),
new(0x00000010, 0x00000010),
};
new(0x00000010, 0x00000010)
];
InstEncoding[] vdVnVmConstraints = new InstEncoding[]
{
InstEncoding[] vdVnVmConstraints =
[
new(0x00001000, 0x00001000),
new(0x00010000, 0x00010000),
new(0x00000001, 0x00000001),
};
new(0x00000001, 0x00000001)
];
InstEncoding[] shimm2imm3Constraints = new InstEncoding[]
{
new(0x00200000, 0x002070C0),
};
InstEncoding[] shimm2imm3Constraints =
[
new(0x00200000, 0x002070C0)
];
InstEncoding[] rnimm8Constraints = new InstEncoding[]
{
new(0x000E0000, 0x000F00FF),
};
InstEncoding[] rnimm8Constraints =
[
new(0x000E0000, 0x000F00FF)
];
InstEncoding[] sizeQvdQvnQvmConstraints = new InstEncoding[]
{
InstEncoding[] sizeQvdQvnQvmConstraints =
[
new(0x00300000, 0x00300000),
new(0x00001040, 0x00001040),
new(0x00010040, 0x00010040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] sizeVdConstraints = new InstEncoding[]
{
InstEncoding[] sizeVdConstraints =
[
new(0x00300000, 0x00300000),
new(0x00001000, 0x00001000),
};
new(0x00001000, 0x00001000)
];
InstEncoding[] qvdQvnQvmConstraints = new InstEncoding[]
{
InstEncoding[] qvdQvnQvmConstraints =
[
new(0x00001040, 0x00001040),
new(0x00010040, 0x00010040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] sizeQvdQvmConstraints = new InstEncoding[]
{
InstEncoding[] sizeQvdQvmConstraints =
[
new(0x000C0000, 0x000C0000),
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] sizeVnVmConstraints = new InstEncoding[]
{
InstEncoding[] sizeVnVmConstraints =
[
new(0x00300000, 0x00300000),
new(0x00010000, 0x00010000),
new(0x00000001, 0x00000001),
};
new(0x00000001, 0x00000001)
];
InstEncoding[] sizeVdOpvnConstraints = new InstEncoding[]
{
InstEncoding[] sizeVdOpvnConstraints =
[
new(0x00300000, 0x00300000),
new(0x00001000, 0x00001000),
new(0x00010100, 0x00010100),
};
new(0x00010100, 0x00010100)
];
InstEncoding[] cmodeCmodeQvdConstraints = new InstEncoding[]
{
InstEncoding[] cmodeCmodeQvdConstraints =
[
new(0x00000000, 0x00000100),
new(0x00000C00, 0x00000C00),
new(0x00001040, 0x00001040),
};
new(0x00001040, 0x00001040)
];
InstEncoding[] qvdQvnQvmOpConstraints = new InstEncoding[]
{
InstEncoding[] qvdQvnQvmOpConstraints =
[
new(0x00001040, 0x00001040),
new(0x00010040, 0x00010040),
new(0x00000041, 0x00000041),
new(0x00000000, 0x00300000),
};
new(0x00000000, 0x00300000)
];
InstEncoding[] qvdQvnQvmSizeConstraints = new InstEncoding[]
{
InstEncoding[] qvdQvnQvmSizeConstraints =
[
new(0x00001040, 0x00001040),
new(0x00010040, 0x00010040),
new(0x00000041, 0x00000041),
new(0x00300000, 0x00300000),
};
new(0x00300000, 0x00300000)
];
InstEncoding[] qvdQvnConstraints = new InstEncoding[]
{
InstEncoding[] qvdQvnConstraints =
[
new(0x00001040, 0x00001040),
new(0x00010040, 0x00010040),
};
new(0x00010040, 0x00010040)
];
InstEncoding[] qvdQvmConstraints = new InstEncoding[]
{
InstEncoding[] qvdQvmConstraints =
[
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] sizeConstraints = new InstEncoding[]
{
new(0x00000000, 0x00000300),
};
InstEncoding[] sizeConstraints =
[
new(0x00000000, 0x00000300)
];
InstEncoding[] vmConstraints = new InstEncoding[]
{
new(0x00000001, 0x00000001),
};
InstEncoding[] vmConstraints =
[
new(0x00000001, 0x00000001)
];
InstEncoding[] opvdOpvmConstraints = new InstEncoding[]
{
InstEncoding[] opvdOpvmConstraints =
[
new(0x00001100, 0x00001100),
new(0x00000001, 0x00000101),
};
new(0x00000001, 0x00000101)
];
InstEncoding[] imm6Opimm6Imm6QvdQvmConstraints = new InstEncoding[]
{
InstEncoding[] imm6Opimm6Imm6QvdQvmConstraints =
[
new(0x00000000, 0x00380000),
new(0x00200000, 0x00300200),
new(0x00000000, 0x00200000),
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] qvdEbConstraints = new InstEncoding[]
{
InstEncoding[] qvdEbConstraints =
[
new(0x00210000, 0x00210000),
new(0x00400020, 0x00400020),
};
new(0x00400020, 0x00400020)
];
InstEncoding[] imm4QvdConstraints = new InstEncoding[]
{
InstEncoding[] imm4QvdConstraints =
[
new(0x00000000, 0x00070000),
new(0x00001040, 0x00001040),
};
new(0x00001040, 0x00001040)
];
InstEncoding[] qvdQvnQvmQimm4Constraints = new InstEncoding[]
{
InstEncoding[] qvdQvnQvmQimm4Constraints =
[
new(0x00001040, 0x00001040),
new(0x00010040, 0x00010040),
new(0x00000041, 0x00000041),
new(0x00000800, 0x00000840),
};
new(0x00000800, 0x00000840)
];
InstEncoding[] qvdConstraints = new InstEncoding[]
{
new(0x00001040, 0x00001040),
};
InstEncoding[] qvdConstraints =
[
new(0x00001040, 0x00001040)
];
InstEncoding[] vdVnConstraints = new InstEncoding[]
{
InstEncoding[] vdVnConstraints =
[
new(0x00001000, 0x00001000),
new(0x00010000, 0x00010000),
};
new(0x00010000, 0x00010000)
];
InstEncoding[] sizeConstraints2 = new InstEncoding[]
{
new(0x00000C00, 0x00000C00),
};
InstEncoding[] sizeConstraints2 =
[
new(0x00000C00, 0x00000C00)
];
InstEncoding[] sizeIndexAlignIndexAlignConstraints = new InstEncoding[]
{
InstEncoding[] sizeIndexAlignIndexAlignConstraints =
[
new(0x00000C00, 0x00000C00),
new(0x00000010, 0x00000030),
new(0x00000020, 0x00000030),
};
new(0x00000020, 0x00000030)
];
InstEncoding[] sizeSizeaConstraints = new InstEncoding[]
{
InstEncoding[] sizeSizeaConstraints =
[
new(0x000000C0, 0x000000C0),
new(0x00000010, 0x000000D0),
};
new(0x00000010, 0x000000D0)
];
InstEncoding[] alignConstraints = new InstEncoding[]
{
new(0x00000020, 0x00000020),
};
InstEncoding[] alignConstraints =
[
new(0x00000020, 0x00000020)
];
InstEncoding[] alignConstraints2 = new InstEncoding[]
{
InstEncoding[] alignConstraints2 =
[
new(0x00000030, 0x00000030)
];
InstEncoding[] sizeConstraints3 =
[
new(0x000000C0, 0x000000C0)
];
InstEncoding[] alignSizeConstraints =
[
new(0x00000030, 0x00000030),
};
new(0x000000C0, 0x000000C0)
];
InstEncoding[] sizeConstraints3 = new InstEncoding[]
{
InstEncoding[] sizeAConstraints =
[
new(0x000000C0, 0x000000C0),
};
new(0x00000010, 0x00000010)
];
InstEncoding[] alignSizeConstraints = new InstEncoding[]
{
new(0x00000030, 0x00000030),
InstEncoding[] sizeAlignConstraints =
[
new(0x000000C0, 0x000000C0),
};
new(0x00000020, 0x00000020)
];
InstEncoding[] sizeAConstraints = new InstEncoding[]
{
new(0x000000C0, 0x000000C0),
new(0x00000010, 0x00000010),
};
InstEncoding[] sizeAlignConstraints = new InstEncoding[]
{
new(0x000000C0, 0x000000C0),
new(0x00000020, 0x00000020),
};
InstEncoding[] sizeIndexAlignConstraints = new InstEncoding[]
{
InstEncoding[] sizeIndexAlignConstraints =
[
new(0x00000C00, 0x00000C00),
new(0x00000030, 0x00000030),
};
new(0x00000030, 0x00000030)
];
InstEncoding[] sizeaConstraints = new InstEncoding[]
{
new(0x000000C0, 0x000000D0),
};
InstEncoding[] sizeaConstraints =
[
new(0x000000C0, 0x000000D0)
];
InstEncoding[] sizeSizeVdConstraints = new InstEncoding[]
{
InstEncoding[] sizeSizeVdConstraints =
[
new(0x00300000, 0x00300000),
new(0x00000000, 0x00300000),
new(0x00001000, 0x00001000),
};
new(0x00001000, 0x00001000)
];
InstEncoding[] sizeQvdQvnConstraints = new InstEncoding[]
{
InstEncoding[] sizeQvdQvnConstraints =
[
new(0x00300000, 0x00300000),
new(0x10001000, 0x10001000),
new(0x10010000, 0x10010000),
};
new(0x10010000, 0x10010000)
];
InstEncoding[] imm3hImm3hImm3hImm3hImm3hVdConstraints = new InstEncoding[]
{
InstEncoding[] imm3hImm3hImm3hImm3hImm3hVdConstraints =
[
new(0x00000000, 0x00380000),
new(0x00180000, 0x00380000),
new(0x00280000, 0x00380000),
new(0x00300000, 0x00380000),
new(0x00380000, 0x00380000),
new(0x00001000, 0x00001000),
};
new(0x00001000, 0x00001000)
];
InstEncoding[] sizeVmConstraints = new InstEncoding[]
{
InstEncoding[] sizeVmConstraints =
[
new(0x000C0000, 0x000C0000),
new(0x00000001, 0x00000001),
};
new(0x00000001, 0x00000001)
];
InstEncoding[] opc1opc2Constraints = new InstEncoding[]
{
new(0x00000040, 0x00400060),
};
InstEncoding[] opc1opc2Constraints =
[
new(0x00000040, 0x00400060)
];
InstEncoding[] uopc1opc2Uopc1opc2Constraints = new InstEncoding[]
{
InstEncoding[] uopc1opc2Uopc1opc2Constraints =
[
new(0x00800000, 0x00C00060),
new(0x00000040, 0x00400060),
};
new(0x00000040, 0x00400060)
];
InstEncoding[] sizeOpuOpsizeVdConstraints = new InstEncoding[]
{
InstEncoding[] sizeOpuOpsizeVdConstraints =
[
new(0x00300000, 0x00300000),
new(0x10000200, 0x10000200),
new(0x00100200, 0x00300200),
new(0x00001000, 0x00001000),
};
new(0x00001000, 0x00001000)
];
InstEncoding[] sizeOpsizeOpsizeQvdQvnQvmConstraints = new InstEncoding[]
{
InstEncoding[] sizeOpsizeOpsizeQvdQvnQvmConstraints =
[
new(0x00300000, 0x00300000),
new(0x10100000, 0x10300000),
new(0x10200000, 0x10300000),
new(0x00001040, 0x00001040),
new(0x00010040, 0x00010040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] cmodeQvdConstraints = new InstEncoding[]
{
InstEncoding[] cmodeQvdConstraints =
[
new(0x00000E00, 0x00000E00),
new(0x00001040, 0x00001040),
};
new(0x00001040, 0x00001040)
];
InstEncoding[] qConstraints = new InstEncoding[]
{
new(0x00000040, 0x00000040),
};
InstEncoding[] qConstraints =
[
new(0x00000040, 0x00000040)
];
InstEncoding[] sizeQConstraints = new InstEncoding[]
{
InstEncoding[] sizeQConstraints =
[
new(0x00300000, 0x00300000),
new(0x00000040, 0x00000040),
};
new(0x00000040, 0x00000040)
];
InstEncoding[] sizeConstraints4 = new InstEncoding[]
{
new(0x00300000, 0x00300000),
};
InstEncoding[] sizeConstraints4 =
[
new(0x00300000, 0x00300000)
];
InstEncoding[] qvdQvnQvmSizeSizeConstraints = new InstEncoding[]
{
InstEncoding[] qvdQvnQvmSizeSizeConstraints =
[
new(0x00001040, 0x00001040),
new(0x00010040, 0x00010040),
new(0x00000041, 0x00000041),
new(0x00000000, 0x00300000),
new(0x00300000, 0x00300000),
};
new(0x00300000, 0x00300000)
];
InstEncoding[] sizeSizeQvdQvnConstraints = new InstEncoding[]
{
InstEncoding[] sizeSizeQvdQvnConstraints =
[
new(0x00300000, 0x00300000),
new(0x00000000, 0x00300000),
new(0x10001000, 0x10001000),
new(0x10010000, 0x10010000),
};
new(0x10010000, 0x10010000)
];
InstEncoding[] opSizeVmConstraints = new InstEncoding[]
{
InstEncoding[] opSizeVmConstraints =
[
new(0x00000000, 0x000000C0),
new(0x000C0000, 0x000C0000),
new(0x00000001, 0x00000001),
};
new(0x00000001, 0x00000001)
];
InstEncoding[] qvdQvmQvnConstraints = new InstEncoding[]
{
InstEncoding[] qvdQvmQvnConstraints =
[
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
new(0x00010040, 0x00010040),
};
new(0x00010040, 0x00010040)
];
InstEncoding[] imm6UopVmConstraints = new InstEncoding[]
{
InstEncoding[] imm6UopVmConstraints =
[
new(0x00000000, 0x00380000),
new(0x00000000, 0x10000100),
new(0x00000001, 0x00000001),
};
new(0x00000001, 0x00000001)
];
InstEncoding[] imm6lUopQvdQvmConstraints = new InstEncoding[]
{
InstEncoding[] imm6lUopQvdQvmConstraints =
[
new(0x00000000, 0x00380080),
new(0x00000000, 0x10000100),
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] qvdQvmSizeSizeConstraints = new InstEncoding[]
{
InstEncoding[] qvdQvmSizeSizeConstraints =
[
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
new(0x00000000, 0x000C0000),
new(0x000C0000, 0x000C0000),
};
new(0x000C0000, 0x000C0000)
];
InstEncoding[] sizeSizeSizeQvdQvmConstraints = new InstEncoding[]
{
InstEncoding[] sizeSizeSizeQvdQvmConstraints =
[
new(0x00040000, 0x000C0000),
new(0x00080000, 0x000C0000),
new(0x000C0000, 0x000C0000),
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] sizeSizeQvdQvmConstraints = new InstEncoding[]
{
InstEncoding[] sizeSizeQvdQvmConstraints =
[
new(0x00080000, 0x000C0000),
new(0x000C0000, 0x000C0000),
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] imm6lQvdQvmConstraints = new InstEncoding[]
{
InstEncoding[] imm6lQvdQvmConstraints =
[
new(0x00000000, 0x00380080),
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
InstEncoding[] imm6VmConstraints = new InstEncoding[]
{
InstEncoding[] imm6VmConstraints =
[
new(0x00000000, 0x00380000),
new(0x00000001, 0x00000001),
};
new(0x00000001, 0x00000001)
];
InstEncoding[] imm6VdImm6Imm6Imm6Constraints = new InstEncoding[]
{
InstEncoding[] imm6VdImm6Imm6Imm6Constraints =
[
new(0x00000000, 0x00380000),
new(0x00001000, 0x00001000),
new(0x00080000, 0x003F0000),
new(0x00100000, 0x003F0000),
new(0x00200000, 0x003F0000),
};
new(0x00200000, 0x003F0000)
];
InstEncoding[] sizeVdConstraints2 = new InstEncoding[]
{
InstEncoding[] sizeVdConstraints2 =
[
new(0x000C0000, 0x000C0000),
new(0x00001000, 0x00001000),
};
new(0x00001000, 0x00001000)
];
InstEncoding[] sizeQsizeQvdQvmConstraints = new InstEncoding[]
{
InstEncoding[] sizeQsizeQvdQvmConstraints =
[
new(0x000C0000, 0x000C0000),
new(0x00080000, 0x000C0040),
new(0x00001040, 0x00001040),
new(0x00000041, 0x00000041),
};
new(0x00000041, 0x00000041)
];
List<InstInfoForTable> insts = new()
{
List<InstInfoForTable> insts =
[
new(0xF1400000, 0xFBE08000, InstName.AdcI, T.AdcIT1, IsaVersion.v80, InstFlags.Rd),
new(0xEB400000, 0xFFE08000, InstName.AdcR, T.AdcRT2, IsaVersion.v80, InstFlags.Rd),
new(0xF1000000, 0xFBE08000, rnRdsConstraints, InstName.AddI, T.AddIT3, IsaVersion.v80, InstFlags.Rd),
@@ -1190,7 +1190,7 @@ namespace Ryujinx.Cpu.LightningJit.Arm32
new(0xF3AF8002, 0xFFFFFFFF, InstName.Wfe, T.WfeT2, IsaVersion.v80, InstFlags.None),
new(0xF3AF8003, 0xFFFFFFFF, InstName.Wfi, T.WfiT2, IsaVersion.v80, InstFlags.None),
new(0xF3AF8001, 0xFFFFFFFF, InstName.Yield, T.YieldT2, IsaVersion.v80, InstFlags.None),
};
];
_table = new(insts);
}

Some files were not shown because too many files have changed in this diff Show More