diff --git a/ChocolArm64/Instructions/CryptoHelper.cs b/ChocolArm64/Instructions/CryptoHelper.cs index e9b6ed5fb2..d0aabcf1e3 100644 --- a/ChocolArm64/Instructions/CryptoHelper.cs +++ b/ChocolArm64/Instructions/CryptoHelper.cs @@ -317,11 +317,6 @@ namespace ChocolArm64.Instructions private unsafe static void FromByteArrayToVector(byte[] state, ref Vector128 op) { - if (!Sse2.IsSupported) - { - throw new PlatformNotSupportedException(); - } - fixed (byte* ptr = &state[0]) { op = Sse.StaticCast(Sse2.LoadVector128(ptr)); diff --git a/ChocolArm64/Memory/MemoryManager.cs b/ChocolArm64/Memory/MemoryManager.cs index 5354fc7fd0..2585f704a4 100644 --- a/ChocolArm64/Memory/MemoryManager.cs +++ b/ChocolArm64/Memory/MemoryManager.cs @@ -239,21 +239,7 @@ namespace ChocolArm64.Memory } } - public Vector128 ReadVector8(long position) - { - if (Sse2.IsSupported) - { - return Vector128.Create(ReadByte(position), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0).As(); - } - else - { - Vector128 value = VectorHelper.VectorSingleZero(); - - value = VectorHelper.VectorInsertInt(ReadByte(position), value, 0, 0); - - return value; - } - } + public Vector128 ReadVector8(long position) => Vector128.Create(ReadByte(position), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0).As(); [MethodImpl(MethodImplOptions.AggressiveInlining)] public Vector128 ReadVector16(long position) diff --git a/Ryujinx.Tests/Cpu/CpuTest.cs b/Ryujinx.Tests/Cpu/CpuTest.cs index 9f4d6c7e67..940ce5a0ae 100644 --- a/Ryujinx.Tests/Cpu/CpuTest.cs +++ b/Ryujinx.Tests/Cpu/CpuTest.cs @@ -430,35 +430,11 @@ namespace Ryujinx.Tests.Cpu bool IsNormalOrSubnormalD(double d) => double.IsNormal(d) || double.IsSubnormal(d); } - protected static Vector128 MakeVectorE0(double e0) - { - if (!Sse2.IsSupported) - { - throw new PlatformNotSupportedException(); - } + protected static Vector128 MakeVectorE0(double e0) => Vector128.Create(BitConverter.DoubleToInt64Bits(e0), 0).As(); - return Vector128.Create(BitConverter.DoubleToInt64Bits(e0), 0).As(); - } + protected static Vector128 MakeVectorE0E1(double e0, double e1) => Vector128.Create(BitConverter.DoubleToInt64Bits(e0), BitConverter.DoubleToInt64Bits(e1)).As(); - protected static Vector128 MakeVectorE0E1(double e0, double e1) - { - if (!Sse2.IsSupported) - { - throw new PlatformNotSupportedException(); - } - - return Vector128.Create(BitConverter.DoubleToInt64Bits(e0), BitConverter.DoubleToInt64Bits(e1)).As(); - } - - protected static Vector128 MakeVectorE1(double e1) - { - if (!Sse2.IsSupported) - { - throw new PlatformNotSupportedException(); - } - - return Vector128.Create(0, BitConverter.DoubleToInt64Bits(e1)).As(); - } + protected static Vector128 MakeVectorE1(double e1) => Vector128.Create(0, BitConverter.DoubleToInt64Bits(e1)).As(); protected static float VectorExtractSingle(Vector128 vector, byte index) { @@ -484,35 +460,11 @@ namespace Ryujinx.Tests.Cpu return BitConverter.Int64BitsToDouble(value); } - protected static Vector128 MakeVectorE0(ulong e0) - { - if (!Sse2.IsSupported) - { - throw new PlatformNotSupportedException(); - } + protected static Vector128 MakeVectorE0(ulong e0) => Vector128.Create(e0, 0).As(); - return Vector128.Create(e0, 0).As(); - } + protected static Vector128 MakeVectorE0E1(ulong e0, ulong e1) => Vector128.Create(e0, e1).As(); - protected static Vector128 MakeVectorE0E1(ulong e0, ulong e1) - { - if (!Sse2.IsSupported) - { - throw new PlatformNotSupportedException(); - } - - return Vector128.Create(e0, e1).As(); - } - - protected static Vector128 MakeVectorE1(ulong e1) - { - if (!Sse2.IsSupported) - { - throw new PlatformNotSupportedException(); - } - - return Vector128.Create(0, e1).As(); - } + protected static Vector128 MakeVectorE1(ulong e1) => Vector128.Create(0, e1).As(); protected static ulong GetVectorE0(Vector128 vector) {