aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Tests.Unicorn/SimdValue.cs
diff options
context:
space:
mode:
authorTSRBerry <20988865+TSRBerry@users.noreply.github.com>2023-06-25 18:03:08 +0200
committerGitHub <noreply@github.com>2023-06-25 18:03:08 +0200
commitbddb2a148355ef2ce326d47e8e5217bd8af36a98 (patch)
tree0f6c1b76179df90c2085ced298b831e8bd2cb4c7 /src/Ryujinx.Tests.Unicorn/SimdValue.cs
parente3bacfa77481738aabee5f8b8be3f8ff91132c43 (diff)
[Ryujinx.Tests.Unicorn] Address dotnet-format issues (#5391)
* dotnet format style --severity info Some changes were manually reverted. * Restore a few unused methods and variables * Address most dotnet format whitespace warnings * Apply dotnet format whitespace formatting A few of them have been manually reverted and the corresponding warning was silenced * Add comments to disabled warnings * Simplify properties and array initialization, Use const when possible, Remove trailing commas * Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas" This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e. * dotnet format whitespace after rebase * Final dotnet format pass and fix naming rule violations
Diffstat (limited to 'src/Ryujinx.Tests.Unicorn/SimdValue.cs')
-rw-r--r--src/Ryujinx.Tests.Unicorn/SimdValue.cs32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/Ryujinx.Tests.Unicorn/SimdValue.cs b/src/Ryujinx.Tests.Unicorn/SimdValue.cs
index ce9e178c..0401c693 100644
--- a/src/Ryujinx.Tests.Unicorn/SimdValue.cs
+++ b/src/Ryujinx.Tests.Unicorn/SimdValue.cs
@@ -2,7 +2,7 @@ using System;
namespace Ryujinx.Tests.Unicorn
{
- public struct SimdValue : IEquatable<SimdValue>
+ public readonly struct SimdValue : IEquatable<SimdValue>
{
private readonly ulong _e0;
private readonly ulong _e1;
@@ -39,31 +39,29 @@ namespace Ryujinx.Tests.Unicorn
return BitConverter.Int64BitsToDouble(GetInt64(index));
}
- public int GetInt32(int index) => (int)GetUInt32(index);
+ public int GetInt32(int index) => (int)GetUInt32(index);
public long GetInt64(int index) => (long)GetUInt64(index);
public uint GetUInt32(int index)
{
- switch (index)
+ return index switch
{
- case 0: return (uint)(_e0 >> 0);
- case 1: return (uint)(_e0 >> 32);
- case 2: return (uint)(_e1 >> 0);
- case 3: return (uint)(_e1 >> 32);
- }
-
- throw new ArgumentOutOfRangeException(nameof(index));
+ 0 => (uint)(_e0 >> 0),
+ 1 => (uint)(_e0 >> 32),
+ 2 => (uint)(_e1 >> 0),
+ 3 => (uint)(_e1 >> 32),
+ _ => throw new ArgumentOutOfRangeException(nameof(index)),
+ };
}
public ulong GetUInt64(int index)
{
- switch (index)
+ return index switch
{
- case 0: return _e0;
- case 1: return _e1;
- }
-
- throw new ArgumentOutOfRangeException(nameof(index));
+ 0 => _e0,
+ 1 => _e1,
+ _ => throw new ArgumentOutOfRangeException(nameof(index)),
+ };
}
public byte[] ToArray()
@@ -109,4 +107,4 @@ namespace Ryujinx.Tests.Unicorn
return $"0x{_e1:X16}{_e0:X16}";
}
}
-} \ No newline at end of file
+}