Removed more unnecessary sse checks

This commit is contained in:
Andy Adshead 2019-01-22 19:40:01 +00:00
parent 2b8c76121c
commit dfb1caff1d
3 changed files with 7 additions and 74 deletions

View file

@ -313,11 +313,6 @@ namespace ChocolArm64.Instructions
private static void FromByteArrayToVector(byte[] state, ref Vector128<float> op)
{
if (!Sse2.IsSupported)
{
throw new PlatformNotSupportedException();
}
op = Vector128.Create(
state[0], state[1], state[2], state[3],
state[4], state[5], state[6], state[7],

View file

@ -239,21 +239,7 @@ namespace ChocolArm64.Memory
}
}
public Vector128<float> 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<float>();
}
else
{
Vector128<float> value = VectorHelper.VectorSingleZero();
value = VectorHelper.VectorInsertInt(ReadByte(position), value, 0, 0);
return value;
}
}
public Vector128<float> ReadVector8(long position) => Vector128.Create(ReadByte(position), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0).As<float>();
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Vector128<float> ReadVector16(long position)

View file

@ -427,35 +427,11 @@ namespace Ryujinx.Tests.Cpu
bool IsNormalOrSubnormalD(double d) => double.IsNormal(d) || double.IsSubnormal(d);
}
protected static Vector128<float> MakeVectorE0(double e0)
{
if (!Sse2.IsSupported)
{
throw new PlatformNotSupportedException();
}
protected static Vector128<float> MakeVectorE0(double e0) => Vector128.Create(BitConverter.DoubleToInt64Bits(e0), 0).As<float>();
return Vector128.Create(BitConverter.DoubleToInt64Bits(e0), 0).As<float>();
}
protected static Vector128<float> MakeVectorE0E1(double e0, double e1) => Vector128.Create(BitConverter.DoubleToInt64Bits(e0), BitConverter.DoubleToInt64Bits(e1)).As<float>();
protected static Vector128<float> MakeVectorE0E1(double e0, double e1)
{
if (!Sse2.IsSupported)
{
throw new PlatformNotSupportedException();
}
return Vector128.Create(BitConverter.DoubleToInt64Bits(e0), BitConverter.DoubleToInt64Bits(e1)).As<float>();
}
protected static Vector128<float> MakeVectorE1(double e1)
{
if (!Sse2.IsSupported)
{
throw new PlatformNotSupportedException();
}
return Vector128.Create(0, BitConverter.DoubleToInt64Bits(e1)).As<float>();
}
protected static Vector128<float> MakeVectorE1(double e1) => Vector128.Create(0, BitConverter.DoubleToInt64Bits(e1)).As<float>();
protected static float VectorExtractSingle(Vector128<float> vector, byte index)
{
@ -481,35 +457,11 @@ namespace Ryujinx.Tests.Cpu
return BitConverter.Int64BitsToDouble(value);
}
protected static Vector128<float> MakeVectorE0(ulong e0)
{
if (!Sse2.IsSupported)
{
throw new PlatformNotSupportedException();
}
protected static Vector128<float> MakeVectorE0(ulong e0) => Vector128.Create(e0, 0).As<float>();
return Vector128.Create(e0, 0).As<float>();
}
protected static Vector128<float> MakeVectorE0E1(ulong e0, ulong e1) => Vector128.Create(e0, e1).As<float>();
protected static Vector128<float> MakeVectorE0E1(ulong e0, ulong e1)
{
if (!Sse2.IsSupported)
{
throw new PlatformNotSupportedException();
}
return Vector128.Create(e0, e1).As<float>();
}
protected static Vector128<float> MakeVectorE1(ulong e1)
{
if (!Sse2.IsSupported)
{
throw new PlatformNotSupportedException();
}
return Vector128.Create(0, e1).As<float>();
}
protected static Vector128<float> MakeVectorE1(ulong e1) => Vector128.Create(0, e1).As<float>();
protected static ulong GetVectorE0(Vector128<float> vector)
{