private static int Main() { int returnVal = Pass; if (VectorInitNTest.VectorInitN(0.5f, -0.5f, 0f, 1.0f) == Fail) { returnVal = Fail; } JitLog jitLog = new JitLog(); if (!jitLog.Check("System.Numerics.Vector2:.ctor(float,float)")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector3:.ctor(float,float,float)")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector4:.ctor(float,float,float,float)")) { returnVal = Fail; } jitLog.Dispose(); return(returnVal); }
static int Main(string[] args) { int returnVal = Pass; if (Vector2Ctors() != 100 || Vector3Ctors() != 100 || Vector4Ctors() != 100) { returnVal = Fail; } JitLog jitLog = new JitLog(); if (!jitLog.Check("System.Numerics.Vector2:.ctor(float,float)")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector3:.ctor(float,float,float)")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector4:.ctor(float,float,float,float)")) { returnVal = Fail; } jitLog.Dispose(); return(returnVal); }
static int Main(string[] args) { int returnVal = Pass; if (Vector2Ctors() != 100 || Vector3Ctors() != 100 || Vector4Ctors() != 100) { returnVal = Fail; } JitLog jitLog = new JitLog(); if (!jitLog.Check("System.Numerics.Vector2:.ctor(float,float)")) returnVal = Fail; if (!jitLog.Check("System.Numerics.Vector3:.ctor(float,float,float)")) returnVal = Fail; if (!jitLog.Check("System.Numerics.Vector4:.ctor(float,float,float,float)")) returnVal = Fail; jitLog.Dispose(); return returnVal; }
private static int Main() { int returnVal = Pass; if (VectorAddTest <float> .VectorAdd(1, 2, (float)(1 + 2)) != Pass) { returnVal = Fail; } if (VectorAddTest <double> .VectorAdd(1, 2, (double)(1 + 2)) != Pass) { returnVal = Fail; } if (VectorAddTest <int> .VectorAdd(1, 2, (int)(1 + 2)) != Pass) { returnVal = Fail; } if (VectorAddTest <long> .VectorAdd(1, 2, (long)(1 + 2)) != Pass) { returnVal = Fail; } if (Vector4Test.VectorAdd() != Pass) { returnVal = Fail; } if (Vector3Test.VectorAdd() != Pass) { returnVal = Fail; } if (Vector2Test.VectorAdd() != Pass) { returnVal = Fail; } if (VectorAddTest <ushort> .VectorAdd(1, 2, (ushort)(1 + 2)) != Pass) { returnVal = Fail; } if (VectorAddTest <byte> .VectorAdd(1, 2, (byte)(1 + 2)) != Pass) { returnVal = Fail; } if (VectorAddTest <short> .VectorAdd(-1, -2, (short)(-1 - 2)) != Pass) { returnVal = Fail; } if (VectorAddTest <sbyte> .VectorAdd(-1, -2, (sbyte)(-1 - 2)) != Pass) { returnVal = Fail; } if (VectorAddTest <uint> .VectorAdd(0x41000000u, 0x42000000u, 0x41000000u + 0x42000000u) != Pass) { returnVal = Fail; } if (VectorAddTest <ulong> .VectorAdd(0x4100000000000000ul, 0x4200000000000000ul, 0x4100000000000000ul + 0x4200000000000000ul) != Pass) { returnVal = Fail; } if (VectorAddTest <nint> .VectorAdd(1, 2, (nint)(1 + 2)) != Pass) { returnVal = Fail; } if (VectorAddTest <nuint> .VectorAdd(0x41000000u, 0x42000000u, 0x41000000u + 0x42000000u) != Pass) { returnVal = Fail; } JitLog jitLog = new JitLog(); if (!jitLog.Check("op_Addition", "Single")) { returnVal = Fail; } if (!jitLog.Check("op_Addition", "Double")) { returnVal = Fail; } if (!jitLog.Check("op_Addition", "Int32")) { returnVal = Fail; } if (!jitLog.Check("op_Addition", "Int64")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector4:op_Addition")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector3:op_Addition")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector2:op_Addition")) { returnVal = Fail; } if (!jitLog.Check("op_Addition", "UInt16")) { returnVal = Fail; } if (!jitLog.Check("op_Addition", "Byte")) { returnVal = Fail; } if (!jitLog.Check("op_Addition", "Int16")) { returnVal = Fail; } if (!jitLog.Check("op_Addition", "SByte")) { returnVal = Fail; } if (!jitLog.Check("op_Addition", "UInt32")) { returnVal = Fail; } if (!jitLog.Check("op_Addition", "UInt64")) { returnVal = Fail; } if (!jitLog.Check("op_Addition", "IntPtr")) { returnVal = Fail; } if (!jitLog.Check("op_Addition", "UIntPtr")) { returnVal = Fail; } jitLog.Dispose(); return(returnVal); }
private static int Main() { int returnVal = Pass; if (VectorGetTest <Double> .VectorGet(101D, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <Double> .VectorGet(100D, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <Double> .VectorGetIndexerOutOfRange(100D, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <Single> .VectorGet(101F, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <Single> .VectorGet(100F, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <Single> .VectorGetIndexerOutOfRange(100F, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <int> .VectorGet(101, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <int> .VectorGet(100, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <int> .VectorGetIndexerOutOfRange(100, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <long> .VectorGet(101, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <long> .VectorGet(100, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <long> .VectorGetIndexerOutOfRange(100, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <ushort> .VectorGet(101, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <ushort> .VectorGet(100, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <ushort> .VectorGetIndexerOutOfRange(100, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <byte> .VectorGet(101, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <byte> .VectorGet(100, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <byte> .VectorGetIndexerOutOfRange(100, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <short> .VectorGet(101, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <short> .VectorGet(-100, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <short> .VectorGetIndexerOutOfRange(-100, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <sbyte> .VectorGet(101, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <sbyte> .VectorGet(-100, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <sbyte> .VectorGetIndexerOutOfRange(-100, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <uint> .VectorGet(101, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <uint> .VectorGet(100, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <uint> .VectorGetIndexerOutOfRange(100, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <ulong> .VectorGet(101, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <ulong> .VectorGet(100, 1) == Fail) { returnVal = Fail; } if (VectorGetTest <ulong> .VectorGetIndexerOutOfRange(100, 1) == Fail) { returnVal = Fail; } JitLog jitLog = new JitLog(); if (!jitLog.Check("get_Item", "Double")) { returnVal = Fail; } if (!jitLog.Check("get_Count", "Double")) { returnVal = Fail; } if (!jitLog.Check("get_Item", "Single")) { returnVal = Fail; } if (!jitLog.Check("get_Count", "Single")) { returnVal = Fail; } if (!jitLog.Check("get_Item", "Int32")) { returnVal = Fail; } if (!jitLog.Check("get_Count", "Int32")) { returnVal = Fail; } if (!jitLog.Check("get_Item", "Int64")) { returnVal = Fail; } if (!jitLog.Check("get_Count", "Int64")) { returnVal = Fail; } if (!jitLog.Check("get_Item", "UInt16")) { returnVal = Fail; } if (!jitLog.Check("get_Count", "UInt16")) { returnVal = Fail; } if (!jitLog.Check("get_Item", "Byte")) { returnVal = Fail; } if (!jitLog.Check("get_Count", "Byte")) { returnVal = Fail; } if (!jitLog.Check("get_Item", "Int16")) { returnVal = Fail; } if (!jitLog.Check("get_Count", "Int16")) { returnVal = Fail; } if (!jitLog.Check("get_Item", "SByte")) { returnVal = Fail; } if (!jitLog.Check("get_Count", "SByte")) { returnVal = Fail; } if (!jitLog.Check("get_Item", "UInt32")) { returnVal = Fail; } if (!jitLog.Check("get_Count", "UInt32")) { returnVal = Fail; } if (!jitLog.Check("get_Item", "UInt64")) { returnVal = Fail; } if (!jitLog.Check("get_Count", "UInt64")) { returnVal = Fail; } jitLog.Dispose(); return(returnVal); }
private static int Main() { int returnVal = Pass; if (VectorMinTest <float> .VectorMin(2f, 3f, 2f) != Pass) { returnVal = Fail; } if (VectorMinTest <double> .VectorMin(2d, 3d, 2d) != Pass) { returnVal = Fail; } if (VectorMinTest <int> .VectorMin(2, 3, 2) != Pass) { returnVal = Fail; } if (VectorMinTest <long> .VectorMin(2, 3, 2) != Pass) { returnVal = Fail; } if (Vector4Test.VectorMin(2f, 3f, 2f) != Pass) { returnVal = Fail; } if (Vector3Test.VectorMin(2f, 3f, 2f) != Pass) { returnVal = Fail; } if (Vector2Test.VectorMin(2f, 3f, 2f) != Pass) { returnVal = Fail; } if (VectorMinTest <ushort> .VectorMin(2, 3, 2) != Pass) { returnVal = Fail; } if (VectorMinTest <byte> .VectorMin(2, 3, 2) != Pass) { returnVal = Fail; } if (VectorMinTest <short> .VectorMin(-2, -3, -3) != Pass) { returnVal = Fail; } if (VectorMinTest <sbyte> .VectorMin(-2, 3, -2) != Pass) { returnVal = Fail; } if (VectorMinTest <uint> .VectorMin(0x80000000u, 0x40000000u, 0x40000000u) != Pass) { returnVal = Fail; } if (VectorMinTest <ulong> .VectorMin(2ul, 3ul, 2ul) != Pass) { returnVal = Fail; } JitLog jitLog = new JitLog(); if (!jitLog.Check("Min", "Single")) { returnVal = Fail; } if (!jitLog.Check("Min", "Double")) { returnVal = Fail; } if (!jitLog.Check("Min", "Int32")) { returnVal = Fail; } if (!jitLog.Check("Min", "Int64")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector4:Min")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector3:Min")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector2:Min")) { returnVal = Fail; } if (!jitLog.Check("Min", "UInt16")) { returnVal = Fail; } if (!jitLog.Check("Min", "Byte")) { returnVal = Fail; } if (!jitLog.Check("Min", "Int16")) { returnVal = Fail; } if (!jitLog.Check("Min", "SByte")) { returnVal = Fail; } if (!jitLog.Check("Min", "UInt32")) { returnVal = Fail; } if (!jitLog.Check("Min", "UInt64")) { returnVal = Fail; } jitLog.Dispose(); return(returnVal); }
private static int Main() { int returnVal = Pass; if (VectorAbsTest <float> .VectorAbs(-1f, 1f) != Pass) { returnVal = Fail; } if (VectorAbsTest <Double> .VectorAbs(-1d, 1d) != Pass) { returnVal = Fail; } if (VectorAbsTest <int> .VectorAbs(-1, 1) != Pass) { returnVal = Fail; } if (VectorAbsTest <long> .VectorAbs(-1, 1) != Pass) { returnVal = Fail; } if (VectorAbsTest <short> .VectorAbs((short)-1, (short)1) != Pass) { returnVal = Fail; } if (VectorAbsTest <sbyte> .VectorAbs((sbyte)-1, (sbyte)1) != Pass) { returnVal = Fail; } if (Vector4Test.VectorAbs() != Pass) { returnVal = Fail; } if (Vector3Test.VectorAbs() != Pass) { returnVal = Fail; } if (Vector2Test.VectorAbs() != Pass) { returnVal = Fail; } if (VectorAbsTest <ushort> .VectorAbs((ushort)0xffff, (ushort)0xffff) != Pass) { returnVal = Fail; } if (VectorAbsTest <byte> .VectorAbs((byte)0xff, (byte)0xff) != Pass) { returnVal = Fail; } if (VectorAbsTest <uint> .VectorAbs(0x41000000u, 0x41000000u) != Pass) { returnVal = Fail; } if (VectorAbsTest <ulong> .VectorAbs(0x4100000000000000ul, 0x4100000000000000ul) != Pass) { returnVal = Fail; } if (VectorAbsTest <nint> .VectorAbs(-1, 1) != Pass) { returnVal = Fail; } if (VectorAbsTest <nuint> .VectorAbs(0x41000000u, 0x41000000u) != Pass) { returnVal = Fail; } JitLog jitLog = new JitLog(); if (!jitLog.Check("Abs", "Single")) { returnVal = Fail; } if (!jitLog.Check("Abs", "Double")) { returnVal = Fail; } if (!jitLog.Check("Abs", "Int64")) { returnVal = Fail; } if (!jitLog.Check("Abs", "Int32")) { returnVal = Fail; } if (!jitLog.Check("Abs", "Int16")) { returnVal = Fail; } if (!jitLog.Check("Abs", "SByte")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector4:Abs")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector3:Abs")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector2:Abs")) { returnVal = Fail; } if (!jitLog.Check("Abs", "UInt16")) { returnVal = Fail; } if (!jitLog.Check("Abs", "Byte")) { returnVal = Fail; } if (!jitLog.Check("Abs", "UInt32")) { returnVal = Fail; } if (!jitLog.Check("Abs", "UInt64")) { returnVal = Fail; } if (!jitLog.Check("Abs", "IntPtr")) { returnVal = Fail; } if (!jitLog.Check("Abs", "UIntPtr")) { returnVal = Fail; } jitLog.Dispose(); return(returnVal); }
private static int Main() { int returnVal = Pass; if (VectorMulTest <float> .VectorDiv(6f, 2f, 6f / 2f) != Pass) { returnVal = Fail; } if (VectorMulTest <double> .VectorDiv(8d, 4d, 8d / 4d) != Pass) { returnVal = Fail; } if (VectorMulTest <int> .VectorDiv(6, 3, 2) != Pass) { returnVal = Fail; } if (returnVal == Fail) { Console.WriteLine("Failed after int"); } if (VectorMulTest <long> .VectorDiv(8, 2, 4) != Pass) { returnVal = Fail; } if (returnVal == Fail) { Console.WriteLine("Failed after long"); } if (Vector4Test.VectorDiv(8f, 3f, 8f / 3f) != Pass) { Console.WriteLine("Vector4Test.VectorDiv failed"); returnVal = Fail; } if (Vector3Test.VectorDiv(8f, 3f, 8f / 3f) != Pass) { Console.WriteLine("Vector3Test.VectorDiv failed"); returnVal = Fail; } if (Vector2Test.VectorDiv(7f, 2f, 7f / 2f) != Pass) { Console.WriteLine("Vector2Test.VectorDiv failed"); returnVal = Fail; } if (VectorMulTest <ushort> .VectorDiv(6, 3, 2) != Pass) { returnVal = Fail; } if (VectorMulTest <byte> .VectorDiv(6, 3, 2) != Pass) { returnVal = Fail; } if (VectorMulTest <short> .VectorDiv(6, -3, -2) != Pass) { returnVal = Fail; } if (VectorMulTest <sbyte> .VectorDiv(6, -3, -2) != Pass) { returnVal = Fail; } if (VectorMulTest <uint> .VectorDiv(6u, 3u, 2u) != Pass) { returnVal = Fail; } if (VectorMulTest <ulong> .VectorDiv(8ul, 2ul, 4ul) != Pass) { returnVal = Fail; } if (VectorMulTest <nint> .VectorDiv(6, 3, 2) != Pass) { returnVal = Fail; } if (VectorMulTest <nuint> .VectorDiv(6u, 3u, 2u) != Pass) { returnVal = Fail; } JitLog jitLog = new JitLog(); // Division is only recognized as an intrinsic for floating point element types. if (!jitLog.Check("op_Division", "Single")) { returnVal = Fail; } if (!jitLog.Check("op_Division", "Double")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector4:op_Division")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector3:op_Division")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector2:op_Division")) { returnVal = Fail; } jitLog.Dispose(); return(returnVal); }
private static int Main() { int returnVal = Pass; if (VectorSumTest <float> .VectorSum(1, (float)Vector <float> .Count) != Pass) { returnVal = Fail; } if (VectorSumTest <double> .VectorSum(1, (double)Vector <double> .Count) != Pass) { returnVal = Fail; } if (VectorSumTest <int> .VectorSum(1, (int)Vector <int> .Count) != Pass) { returnVal = Fail; } if (VectorSumTest <long> .VectorSum(1, (long)Vector <long> .Count) != Pass) { returnVal = Fail; } if (VectorSumTest <ushort> .VectorSum(1, (ushort)Vector <ushort> .Count) != Pass) { returnVal = Fail; } if (VectorSumTest <byte> .VectorSum(1, (byte)Vector <byte> .Count) != Pass) { returnVal = Fail; } if (VectorSumTest <short> .VectorSum(-1, (short)(-Vector <short> .Count)) != Pass) { returnVal = Fail; } if (VectorSumTest <sbyte> .VectorSum(-1, (sbyte)(-Vector <sbyte> .Count)) != Pass) { returnVal = Fail; } if (VectorSumTest <uint> .VectorSum(0x41000000u, 0x41000000u * (uint)Vector <uint> .Count) != Pass) { returnVal = Fail; } if (VectorSumTest <ulong> .VectorSum(0x4100000000000000ul, 0x4100000000000000ul * (uint)Vector <ulong> .Count) != Pass) { returnVal = Fail; } if (VectorSumTest <nint> .VectorSum(1, (nint)Vector <nint> .Count) != Pass) { returnVal = Fail; } if (VectorSumTest <nuint> .VectorSum(0x41000000u, 0x41000000u * (nuint)(uint)Vector <nuint> .Count) != Pass) { returnVal = Fail; } JitLog jitLog = new JitLog(); if (Sse3.IsSupported || AdvSimd.IsSupported) { if (!jitLog.Check("Sum", "Single")) { returnVal = Fail; } if (!jitLog.Check("Sum", "Double")) { returnVal = Fail; } } if (Ssse3.IsSupported || AdvSimd.IsSupported) { if (!jitLog.Check("Sum", "Int16")) { returnVal = Fail; } if (!jitLog.Check("Sum", "Int32")) { returnVal = Fail; } if (!jitLog.Check("Sum", "UInt16")) { returnVal = Fail; } if (!jitLog.Check("Sum", "UInt32")) { returnVal = Fail; } } if (AdvSimd.IsSupported) { if (!jitLog.Check("Sum", "Byte")) { returnVal = Fail; } if (!jitLog.Check("Sum", "Int64")) { returnVal = Fail; } if (!jitLog.Check("Sum", "IntPtr")) { returnVal = Fail; } if (!jitLog.Check("Sum", "SByte")) { returnVal = Fail; } if (!jitLog.Check("Sum", "UInt64")) { returnVal = Fail; } if (!jitLog.Check("Sum", "UIntPtr")) { returnVal = Fail; } } jitLog.Dispose(); return(returnVal); }
static int Main() { int returnVal = Pass; for (int i = 0; i < 10; i++) { Vector <Single> singleVector = getRandomVector <Single>(singles); if (VectorConvertTest.VectorConvertSingleInt(singleVector) != Pass) { Console.WriteLine("Testing Converts Between Single and Int32 failed"); returnVal = Fail; } } for (int i = 0; i < 10; i++) { Vector <Single> singleVector = getRandomVector <Single>(singles); if (VectorConvertTest.VectorConvertSingleUInt(singleVector) != Pass) { Console.WriteLine("Testing Converts Between Single and UInt32 failed"); returnVal = Fail; } } for (int i = 0; i < 10; i++) { Vector <Double> doubleVector = getRandomVector <Double>(doubles); if (VectorConvertTest.VectorConvertDoubleInt64(doubleVector) != Pass) { Console.WriteLine("Testing Converts between Double and Int64 failed"); returnVal = Fail; } } for (int i = 0; i < 10; i++) { Vector <Double> doubleVector = getRandomVector <Double>(doubles); if (VectorConvertTest.VectorConvertDoubleUInt64(doubleVector) != Pass) { Console.WriteLine("Testing Converts between Double and UInt64 failed"); returnVal = Fail; } } for (int i = 0; i < 10; i++) { Vector <Double> doubleVector1 = getRandomVector <Double>(doubles); Vector <Double> doubleVector2 = getRandomVector <Double>(doubles); if (VectorConvertTest.VectorConvertDoubleSingle(doubleVector1, doubleVector2) != Pass) { Console.WriteLine("Testing Converts between Single and Double failed"); returnVal = Fail; } } for (int i = 0; i < 10; i++) { Vector <Int64> int64Vector1 = getRandomVector <Int64>(int64s); Vector <Int64> int64Vector2 = getRandomVector <Int64>(int64s); if (VectorConvertTest.VectorConvertInt64And32(int64Vector1, int64Vector2) != Pass) { Console.WriteLine("Testing Converts between Int64 and Int32 failed"); returnVal = Fail; } } for (int i = 0; i < 10; i++) { Vector <Int32> int32Vector1 = getRandomVector <Int32>(int32s); Vector <Int32> int32Vector2 = getRandomVector <Int32>(int32s); if (VectorConvertTest.VectorConvertInt32And16(int32Vector1, int32Vector2) != Pass) { Console.WriteLine("Testing Converts between Int32 and Int16 failed"); returnVal = Fail; } } for (int i = 0; i < 10; i++) { Vector <Int16> int16Vector1 = getRandomVector <Int16>(int16s); Vector <Int16> int16Vector2 = getRandomVector <Int16>(int16s); if (VectorConvertTest.VectorConvertInt16And8(int16Vector1, int16Vector2) != Pass) { Console.WriteLine("Testing Converts between Int16 and SByte failed"); returnVal = Fail; } } for (int i = 0; i < 10; i++) { Vector <UInt64> uint64Vector1 = getRandomVector <UInt64>(uint64s); Vector <UInt64> uint64Vector2 = getRandomVector <UInt64>(uint64s); if (VectorConvertTest.VectorConvertUInt64And32(uint64Vector1, uint64Vector2) != Pass) { Console.WriteLine("Testing Converts between UInt64 and UInt32 failed"); returnVal = Fail; } } for (int i = 0; i < 10; i++) { Vector <UInt32> uint32Vector1 = getRandomVector <UInt32>(uint32s); Vector <UInt32> uint32Vector2 = getRandomVector <UInt32>(uint32s); if (VectorConvertTest.VectorConvertUInt32And16(uint32Vector1, uint32Vector2) != Pass) { Console.WriteLine("Testing Converts between UInt32 and UInt16 failed"); returnVal = Fail; } } for (int i = 0; i < 10; i++) { Vector <UInt16> uint16Vector1 = getRandomVector <UInt16>(uint16s); Vector <UInt16> uint16Vector2 = getRandomVector <UInt16>(uint16s); if (VectorConvertTest.VectorConvertUInt16And8(uint16Vector1, uint16Vector2) != Pass) { Console.WriteLine("Testing Converts between UInt16 and Byte failed"); returnVal = Fail; } } JitLog jitLog = new JitLog(); if (!jitLog.Check("System.Numerics.Vector:ConvertToInt32(struct):struct")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector:ConvertToUInt32(struct):struct")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector:ConvertToSingle(struct):struct")) { returnVal = Fail; } // Note: SIMD Conversion to Int64/UInt64 is not supported on x86 #if !BIT32 if (!jitLog.Check("System.Numerics.Vector:ConvertToInt64(struct):struct")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector:ConvertToUInt64(struct):struct")) { returnVal = Fail; } #endif // !BIT32 if (!jitLog.Check("System.Numerics.Vector:ConvertToDouble(struct):struct")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector:Narrow(struct,struct):struct")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector:Widen(struct,byref,byref)")) { returnVal = Fail; } jitLog.Dispose(); return(returnVal); }
private static int Main() { int returnVal = Pass; if (VectorRelopTest <float> .VectorRelOp(3, 2) != Pass) { returnVal = Fail; } if (VectorRelopTest <double> .VectorRelOp(3, 2) != Pass) { returnVal = Fail; } if (VectorRelopTest <int> .VectorRelOp(3, 2) != Pass) { returnVal = Fail; } if (VectorRelopTest <long> .VectorRelOp(3, 2) != Pass) { returnVal = Fail; } if (VectorRelopTest <ushort> .VectorRelOp(3, 2) != Pass) { returnVal = Fail; } if (VectorRelopTest <byte> .VectorRelOp(3, 2) != Pass) { returnVal = Fail; } if (VectorRelopTest <short> .VectorRelOp(-2, -3) != Pass) { returnVal = Fail; } if (VectorRelopTest <sbyte> .VectorRelOp(-2, -3) != Pass) { returnVal = Fail; } if (VectorRelopTest <uint> .VectorRelOp(3u, 2u) != Pass) { returnVal = Fail; } if (VectorRelopTest <ulong> .VectorRelOp(3ul, 2ul) != Pass) { returnVal = Fail; } if (VectorRelopTest <nint> .VectorRelOp(3, 2) != Pass) { returnVal = Fail; } if (VectorRelopTest <nuint> .VectorRelOp(3u, 2u) != Pass) { returnVal = Fail; } JitLog jitLog = new JitLog(); // ConditionalSelect, LessThanOrEqual and GreaterThanOrEqual are defined // on the Vector type, so the overloads can't be distinguished. // if (!jitLog.Check("System.Numerics.Vector:ConditionalSelect(struct,struct,struct):struct")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector:LessThanOrEqual(struct,struct):struct")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector:GreaterThanOrEqual(struct,struct):struct")) { returnVal = Fail; } if (!jitLog.Check("Equals", "Single")) { returnVal = Fail; } if (!jitLog.Check("LessThan", "Single")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "Single")) { returnVal = Fail; } if (!jitLog.Check("op_BitwiseAnd", "Single")) { returnVal = Fail; } if (!jitLog.Check("op_ExclusiveOr", "Single")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "Single")) { returnVal = Fail; } // This relies on an implementation detail - i.e. that the One and Zero property are implemented // in the library by GetOneValue and GetZeroValue, respectively. if (!jitLog.Check("GetOneValue", "Single")) { returnVal = Fail; } if (!jitLog.Check("GetZeroValue", "Single")) { returnVal = Fail; } if (!jitLog.Check("Equals", "Double")) { returnVal = Fail; } if (!jitLog.Check("LessThan", "Double")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "Double")) { returnVal = Fail; } if (!jitLog.Check("op_BitwiseAnd", "Double")) { returnVal = Fail; } if (!jitLog.Check("op_ExclusiveOr", "Double")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "Double")) { returnVal = Fail; } // This relies on an implementation detail - i.e. that the One and Zero property are implemented // in the library by GetOneValue and GetZeroValue, respectively. if (!jitLog.Check("GetOneValue", "Double")) { returnVal = Fail; } if (!jitLog.Check("GetZeroValue", "Double")) { returnVal = Fail; } if (!jitLog.Check("Equals", "Int32")) { returnVal = Fail; } if (!jitLog.Check("LessThan", "Int32")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "Int32")) { returnVal = Fail; } if (!jitLog.Check("op_BitwiseAnd", "Int32")) { returnVal = Fail; } if (!jitLog.Check("op_ExclusiveOr", "Int32")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "Int32")) { returnVal = Fail; } // This relies on an implementation detail - i.e. that the One and Zero property are implemented // in the library by GetOneValue and GetZeroValue, respectively. if (!jitLog.Check("GetOneValue", "Int32")) { returnVal = Fail; } if (!jitLog.Check("GetZeroValue", "Int32")) { returnVal = Fail; } if (!jitLog.Check("Equals", "Int64")) { returnVal = Fail; } if (!jitLog.Check("LessThan", "Int64")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "Int64")) { returnVal = Fail; } if (!jitLog.Check("op_BitwiseAnd", "Int64")) { returnVal = Fail; } if (!jitLog.Check("op_ExclusiveOr", "Int64")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "Int64")) { returnVal = Fail; } // This relies on an implementation detail - i.e. that the One and Zero property are implemented // in the library by GetOneValue and GetZeroValue, respectively. if (!jitLog.Check("GetOneValue", "Int64")) { returnVal = Fail; } if (!jitLog.Check("GetZeroValue", "Int64")) { returnVal = Fail; } if (!jitLog.Check("Equals", "UInt16")) { returnVal = Fail; } if (!jitLog.Check("LessThan", "UInt16")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "UInt16")) { returnVal = Fail; } if (!jitLog.Check("op_BitwiseAnd", "UInt16")) { returnVal = Fail; } if (!jitLog.Check("op_ExclusiveOr", "UInt16")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "UInt16")) { returnVal = Fail; } // This relies on an implementation detail - i.e. that the One and Zero property are implemented // in the library by GetOneValue and GetZeroValue, respectively. if (!jitLog.Check("GetOneValue", "UInt16")) { returnVal = Fail; } if (!jitLog.Check("GetZeroValue", "UInt16")) { returnVal = Fail; } if (!jitLog.Check("Equals", "Byte")) { returnVal = Fail; } if (!jitLog.Check("LessThan", "Byte")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "Byte")) { returnVal = Fail; } if (!jitLog.Check("op_BitwiseAnd", "Byte")) { returnVal = Fail; } if (!jitLog.Check("op_ExclusiveOr", "Byte")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "Byte")) { returnVal = Fail; } // This relies on an implementation detail - i.e. that the One and Zero property are implemented // in the library by GetOneValue and GetZeroValue, respectively. if (!jitLog.Check("GetOneValue", "Byte")) { returnVal = Fail; } if (!jitLog.Check("GetZeroValue", "Byte")) { returnVal = Fail; } if (!jitLog.Check("Equals", "Int16")) { returnVal = Fail; } if (!jitLog.Check("LessThan", "Int16")) { returnVal = Fail; } if (!jitLog.Check("op_BitwiseAnd", "Int16")) { returnVal = Fail; } if (!jitLog.Check("op_ExclusiveOr", "Int16")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "Int16")) { returnVal = Fail; } // This relies on an implementation detail - i.e. that the One and Zero property are implemented // in the library by GetOneValue and GetZeroValue, respectively. if (!jitLog.Check("GetOneValue", "Int16")) { returnVal = Fail; } if (!jitLog.Check("GetZeroValue", "Int16")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "Int16")) { returnVal = Fail; } if (!jitLog.Check("Equals", "SByte")) { returnVal = Fail; } if (!jitLog.Check("LessThan", "SByte")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "SByte")) { returnVal = Fail; } if (!jitLog.Check("op_BitwiseAnd", "SByte")) { returnVal = Fail; } if (!jitLog.Check("op_ExclusiveOr", "SByte")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "SByte")) { returnVal = Fail; } // This relies on an implementation detail - i.e. that the One and Zero property are implemented // in the library by GetOneValue and GetZeroValue, respectively. if (!jitLog.Check("GetOneValue", "SByte")) { returnVal = Fail; } if (!jitLog.Check("GetZeroValue", "SByte")) { returnVal = Fail; } if (!jitLog.Check("Equals", "UInt32")) { returnVal = Fail; } if (!jitLog.Check("LessThan", "UInt32")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "UInt32")) { returnVal = Fail; } if (!jitLog.Check("op_BitwiseAnd", "UInt32")) { returnVal = Fail; } if (!jitLog.Check("op_ExclusiveOr", "UInt32")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "UInt32")) { returnVal = Fail; } // This relies on an implementation detail - i.e. that the One and Zero property are implemented // in the library by GetOneValue and GetZeroValue, respectively. if (!jitLog.Check("GetOneValue", "UInt32")) { returnVal = Fail; } if (!jitLog.Check("GetZeroValue", "UInt32")) { returnVal = Fail; } if (!jitLog.Check("Equals", "UInt64")) { returnVal = Fail; } if (!jitLog.Check("LessThan", "UInt64")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "UInt64")) { returnVal = Fail; } if (!jitLog.Check("op_BitwiseAnd", "UInt64")) { returnVal = Fail; } if (!jitLog.Check("op_ExclusiveOr", "UInt64")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "UInt64")) { returnVal = Fail; } // This relies on an implementation detail - i.e. that the One and Zero property are implemented // in the library by GetOneValue and GetZeroValue, respectively. if (!jitLog.Check("GetOneValue", "UInt64")) { returnVal = Fail; } if (!jitLog.Check("GetZeroValue", "UInt64")) { returnVal = Fail; } if (!jitLog.Check("Equals", "IntPtr")) { returnVal = Fail; } if (!jitLog.Check("LessThan", "IntPtr")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "IntPtr")) { returnVal = Fail; } if (!jitLog.Check("op_BitwiseAnd", "IntPtr")) { returnVal = Fail; } if (!jitLog.Check("op_ExclusiveOr", "IntPtr")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "IntPtr")) { returnVal = Fail; } // This relies on an implementation detail - i.e. that the One and Zero property are implemented // in the library by GetOneValue and GetZeroValue, respectively. if (!jitLog.Check("GetOneValue", "IntPtr")) { returnVal = Fail; } if (!jitLog.Check("GetZeroValue", "IntPtr")) { returnVal = Fail; } if (!jitLog.Check("Equals", "UIntPtr")) { returnVal = Fail; } if (!jitLog.Check("LessThan", "UIntPtr")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "UIntPtr")) { returnVal = Fail; } if (!jitLog.Check("op_BitwiseAnd", "UIntPtr")) { returnVal = Fail; } if (!jitLog.Check("op_ExclusiveOr", "UIntPtr")) { returnVal = Fail; } if (!jitLog.Check("GreaterThan", "UIntPtr")) { returnVal = Fail; } // This relies on an implementation detail - i.e. that the One and Zero property are implemented // in the library by GetOneValue and GetZeroValue, respectively. if (!jitLog.Check("GetOneValue", "UIntPtr")) { returnVal = Fail; } if (!jitLog.Check("GetZeroValue", "UIntPtr")) { returnVal = Fail; } jitLog.Dispose(); return(returnVal); }
private static int Main() { int returnVal = Pass; if (VectorInitNTest.VectorInitN(0.5f, -0.5f, 0f, 1.0f) == Fail) returnVal = Fail; JitLog jitLog = new JitLog(); if (!jitLog.Check("System.Numerics.Vector2:.ctor(float,float)")) returnVal = Fail; if (!jitLog.Check("System.Numerics.Vector3:.ctor(float,float,float)")) returnVal = Fail; if (!jitLog.Check("System.Numerics.Vector4:.ctor(float,float,float,float)")) returnVal = Fail; jitLog.Dispose(); return returnVal; }
private static int Main() { int returnVal = Pass; Random random = new Random(100); if (VectorCopyToArrayTest <Single> .VectorCopyToArray(17, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <Single> .VectorCopyToArray(12, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <Double> .VectorCopyToArray(12, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <Double> .VectorCopyToArray(17, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <int> .VectorCopyToArray(12, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <int> .VectorCopyToArray(17, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <long> .VectorCopyToArray(12, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <long> .VectorCopyToArray(17, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <ushort> .VectorCopyToArray(12, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <ushort> .VectorCopyToArray(17, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <byte> .VectorCopyToArray(12, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <byte> .VectorCopyToArray(17, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <short> .VectorCopyToArray(12, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <short> .VectorCopyToArray(17, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <sbyte> .VectorCopyToArray(12, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <sbyte> .VectorCopyToArray(17, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <uint> .VectorCopyToArray(12, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <uint> .VectorCopyToArray(17, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <ulong> .VectorCopyToArray(12, random) == Fail) { returnVal = Fail; } if (VectorCopyToArrayTest <ulong> .VectorCopyToArray(17, random) == Fail) { returnVal = Fail; } JitLog jitLog = new JitLog(); if (!jitLog.Check("CopyTo(ref)", "Single")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref,int)", "Single")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref)", "Double")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref,int)", "Double")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref)", "Int32")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref,int)", "Int32")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref)", "Int64")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref,int)", "Int64")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref)", "UInt16")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref,int)", "UInt16")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref)", "Byte")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref,int)", "Byte")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref)", "Int16")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref,int)", "Int16")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref)", "SByte")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref,int)", "SByte")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref)", "UInt32")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref,int)", "UInt32")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref)", "UInt64")) { returnVal = Fail; } if (!jitLog.Check("CopyTo(ref,int)", "UInt64")) { returnVal = Fail; } jitLog.Dispose(); return(returnVal); }
private static int Main() { int returnVal = Pass; try { if (VectorArrayTest <float> .VectorArray(1f) != Pass) { returnVal = Fail; } if (VectorArrayTest <double> .VectorArray(1d) != Pass) { returnVal = Fail; } if (VectorArrayTest <int> .VectorArray(1) != Pass) { returnVal = Fail; } if (VectorArrayTest <long> .VectorArray(1L) != Pass) { returnVal = Fail; } if (Vector4Test.VectorArray(1f) != Pass) { returnVal = Fail; } if (Vector3Test.VectorArray(1f) != Pass) { returnVal = Fail; } if (Vector2Test.VectorArray(1f) != Pass) { returnVal = Fail; } if (VectorArrayTest <ushort> .VectorArray(1) != Pass) { returnVal = Fail; } if (VectorArrayTest <byte> .VectorArray(1) != Pass) { returnVal = Fail; } if (VectorArrayTest <short> .VectorArray(1) != Pass) { returnVal = Fail; } if (VectorArrayTest <sbyte> .VectorArray(1) != Pass) { returnVal = Fail; } if (VectorArrayTest <uint> .VectorArray(1) != Pass) { returnVal = Fail; } if (VectorArrayTest <ulong> .VectorArray(1ul) != Pass) { returnVal = Fail; } JitLog jitLog = new JitLog(); if (!jitLog.Check("get_Item", "Single")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector`1[Single][System.Single]:.ctor(float)")) { returnVal = Fail; } if (!jitLog.Check("get_Item", "Double")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector`1[Double][System.Double]:.ctor(double)")) { returnVal = Fail; } if (!jitLog.Check("get_Item", "Int32")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector`1[Int32][System.Int32]:.ctor(int)")) { returnVal = Fail; } if (!jitLog.Check("get_Item", "Int64")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector`1[Int64][System.Int64]:.ctor(long)")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector4:.ctor(float)")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector3:.ctor(float)")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector2:.ctor(float)")) { returnVal = Fail; } if (!jitLog.Check("get_Item", "UInt16")) { returnVal = Fail; } // We are not currently recognizing the Vector<UInt16> constructor. if (!Vector.IsHardwareAccelerated) { if (!jitLog.Check("System.Numerics.Vector`1[UInt16][System.UInt16]:.ctor(char)")) { returnVal = Fail; } } if (!jitLog.Check("get_Item", "Byte")) { returnVal = Fail; } // We are not currently recognizing the Vector<Byte> constructor. if (!Vector.IsHardwareAccelerated) { if (!jitLog.Check("System.Numerics.Vector`1[Byte][System.Byte]:.ctor(ubyte)")) { returnVal = Fail; } } if (!jitLog.Check("get_Item", "Int16")) { returnVal = Fail; } // We are not currently recognizing the Vector<Int16> constructor. if (!Vector.IsHardwareAccelerated) { if (!jitLog.Check("System.Numerics.Vector`1[Int16][System.Int16]:.ctor(short)")) { returnVal = Fail; } } if (!jitLog.Check("get_Item", "SByte")) { returnVal = Fail; } // We are not currently recognizing the Vector<SByte> constructor. if (!Vector.IsHardwareAccelerated) { if (!jitLog.Check("System.Numerics.Vector`1[SByte][System.SByte]:.ctor(byte)")) { returnVal = Fail; } } if (!jitLog.Check("get_Item", "UInt32")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector`1[UInt32][System.UInt32]:.ctor(int)")) { returnVal = Fail; } if (!jitLog.Check("get_Item", "UInt64")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector`1[UInt64][System.UInt64]:.ctor(long)")) { returnVal = Fail; } jitLog.Dispose(); } catch (ArgumentException ex) { Console.WriteLine("Argument Exception was raised"); Console.WriteLine(ex.StackTrace); return(Fail); } return(returnVal); }
static int Main() { bool succeeded = true; succeeded &= ReportFailure(Test_Byte <Byte>()); succeeded &= ReportFailure(Test_SByte <Byte>()); succeeded &= ReportFailure(Test_UInt16 <Byte>()); succeeded &= ReportFailure(Test_Int16 <Byte>()); succeeded &= ReportFailure(Test_UInt32 <Byte>()); succeeded &= ReportFailure(Test_Int32 <Byte>()); succeeded &= ReportFailure(Test_UInt64 <Byte>()); succeeded &= ReportFailure(Test_Int64 <Byte>()); succeeded &= ReportFailure(Test_Single <Byte>()); succeeded &= ReportFailure(Test_Double <Byte>()); succeeded &= ReportFailure(Test_NUInt <Byte>()); succeeded &= ReportFailure(Test_NInt <Byte>()); succeeded &= ReportFailure(Test_Byte <SByte>()); succeeded &= ReportFailure(Test_SByte <SByte>()); succeeded &= ReportFailure(Test_UInt16 <SByte>()); succeeded &= ReportFailure(Test_Int16 <SByte>()); succeeded &= ReportFailure(Test_UInt32 <SByte>()); succeeded &= ReportFailure(Test_Int32 <SByte>()); succeeded &= ReportFailure(Test_UInt64 <SByte>()); succeeded &= ReportFailure(Test_Int64 <SByte>()); succeeded &= ReportFailure(Test_Single <SByte>()); succeeded &= ReportFailure(Test_Double <SByte>()); succeeded &= ReportFailure(Test_NUInt <SByte>()); succeeded &= ReportFailure(Test_NInt <SByte>()); succeeded &= ReportFailure(Test_Byte <UInt16>()); succeeded &= ReportFailure(Test_SByte <UInt16>()); succeeded &= ReportFailure(Test_UInt16 <UInt16>()); succeeded &= ReportFailure(Test_Int16 <UInt16>()); succeeded &= ReportFailure(Test_UInt32 <UInt16>()); succeeded &= ReportFailure(Test_Int32 <UInt16>()); succeeded &= ReportFailure(Test_UInt64 <UInt16>()); succeeded &= ReportFailure(Test_Int64 <UInt16>()); succeeded &= ReportFailure(Test_Single <UInt16>()); succeeded &= ReportFailure(Test_Double <UInt16>()); succeeded &= ReportFailure(Test_NUInt <UInt16>()); succeeded &= ReportFailure(Test_NInt <UInt16>()); succeeded &= ReportFailure(Test_Byte <Int16>()); succeeded &= ReportFailure(Test_SByte <Int16>()); succeeded &= ReportFailure(Test_UInt16 <Int16>()); succeeded &= ReportFailure(Test_Int16 <Int16>()); succeeded &= ReportFailure(Test_UInt32 <Int16>()); succeeded &= ReportFailure(Test_Int32 <Int16>()); succeeded &= ReportFailure(Test_UInt64 <Int16>()); succeeded &= ReportFailure(Test_Int64 <Int16>()); succeeded &= ReportFailure(Test_Single <Int16>()); succeeded &= ReportFailure(Test_Double <Int16>()); succeeded &= ReportFailure(Test_NUInt <Int16>()); succeeded &= ReportFailure(Test_NInt <Int16>()); succeeded &= ReportFailure(Test_Byte <UInt32>()); succeeded &= ReportFailure(Test_SByte <UInt32>()); succeeded &= ReportFailure(Test_UInt16 <UInt32>()); succeeded &= ReportFailure(Test_Int16 <UInt32>()); succeeded &= ReportFailure(Test_UInt32 <UInt32>()); succeeded &= ReportFailure(Test_Int32 <UInt32>()); succeeded &= ReportFailure(Test_UInt64 <UInt32>()); succeeded &= ReportFailure(Test_Int64 <UInt32>()); succeeded &= ReportFailure(Test_Single <UInt32>()); succeeded &= ReportFailure(Test_Double <UInt32>()); succeeded &= ReportFailure(Test_NUInt <UInt32>()); succeeded &= ReportFailure(Test_NInt <UInt32>()); succeeded &= ReportFailure(Test_Byte <Int32>()); succeeded &= ReportFailure(Test_SByte <Int32>()); succeeded &= ReportFailure(Test_UInt16 <Int32>()); succeeded &= ReportFailure(Test_Int16 <Int32>()); succeeded &= ReportFailure(Test_UInt32 <Int32>()); succeeded &= ReportFailure(Test_Int32 <Int32>()); succeeded &= ReportFailure(Test_UInt64 <Int32>()); succeeded &= ReportFailure(Test_Int64 <Int32>()); succeeded &= ReportFailure(Test_Single <Int32>()); succeeded &= ReportFailure(Test_Double <Int32>()); succeeded &= ReportFailure(Test_NUInt <Int32>()); succeeded &= ReportFailure(Test_NInt <Int32>()); succeeded &= ReportFailure(Test_Byte <UInt64>()); succeeded &= ReportFailure(Test_SByte <UInt64>()); succeeded &= ReportFailure(Test_UInt16 <UInt64>()); succeeded &= ReportFailure(Test_Int16 <UInt64>()); succeeded &= ReportFailure(Test_UInt32 <UInt64>()); succeeded &= ReportFailure(Test_Int32 <UInt64>()); succeeded &= ReportFailure(Test_UInt64 <UInt64>()); succeeded &= ReportFailure(Test_Int64 <UInt64>()); succeeded &= ReportFailure(Test_Single <UInt64>()); succeeded &= ReportFailure(Test_Double <UInt64>()); succeeded &= ReportFailure(Test_NUInt <UInt64>()); succeeded &= ReportFailure(Test_NInt <UInt64>()); succeeded &= ReportFailure(Test_Byte <Int64>()); succeeded &= ReportFailure(Test_SByte <Int64>()); succeeded &= ReportFailure(Test_UInt16 <Int64>()); succeeded &= ReportFailure(Test_Int16 <Int64>()); succeeded &= ReportFailure(Test_UInt32 <Int64>()); succeeded &= ReportFailure(Test_Int32 <Int64>()); succeeded &= ReportFailure(Test_UInt64 <Int64>()); succeeded &= ReportFailure(Test_Int64 <Int64>()); succeeded &= ReportFailure(Test_Single <Int64>()); succeeded &= ReportFailure(Test_Double <Int64>()); succeeded &= ReportFailure(Test_NUInt <Int64>()); succeeded &= ReportFailure(Test_NInt <Int64>()); succeeded &= ReportFailure(Test_Byte <Single>()); succeeded &= ReportFailure(Test_SByte <Single>()); succeeded &= ReportFailure(Test_UInt16 <Single>()); succeeded &= ReportFailure(Test_Int16 <Single>()); succeeded &= ReportFailure(Test_UInt32 <Single>()); succeeded &= ReportFailure(Test_Int32 <Single>()); succeeded &= ReportFailure(Test_UInt64 <Single>()); succeeded &= ReportFailure(Test_Int64 <Single>()); succeeded &= ReportFailure(Test_Single <Single>()); succeeded &= ReportFailure(Test_Double <Single>()); succeeded &= ReportFailure(Test_NUInt <Single>()); succeeded &= ReportFailure(Test_NInt <Single>()); succeeded &= ReportFailure(Test_Byte <Double>()); succeeded &= ReportFailure(Test_SByte <Double>()); succeeded &= ReportFailure(Test_UInt16 <Double>()); succeeded &= ReportFailure(Test_Int16 <Double>()); succeeded &= ReportFailure(Test_UInt32 <Double>()); succeeded &= ReportFailure(Test_Int32 <Double>()); succeeded &= ReportFailure(Test_UInt64 <Double>()); succeeded &= ReportFailure(Test_Int64 <Double>()); succeeded &= ReportFailure(Test_Single <Double>()); succeeded &= ReportFailure(Test_Double <Double>()); succeeded &= ReportFailure(Test_NUInt <Double>()); succeeded &= ReportFailure(Test_NInt <Double>()); succeeded &= ReportFailure(Test_Byte <nuint>()); succeeded &= ReportFailure(Test_SByte <nuint>()); succeeded &= ReportFailure(Test_UInt16 <nuint>()); succeeded &= ReportFailure(Test_Int16 <nuint>()); succeeded &= ReportFailure(Test_UInt32 <nuint>()); succeeded &= ReportFailure(Test_Int32 <nuint>()); succeeded &= ReportFailure(Test_UInt64 <nuint>()); succeeded &= ReportFailure(Test_Int64 <nuint>()); succeeded &= ReportFailure(Test_Single <nuint>()); succeeded &= ReportFailure(Test_Double <nuint>()); succeeded &= ReportFailure(Test_NUInt <nuint>()); succeeded &= ReportFailure(Test_NInt <nuint>()); succeeded &= ReportFailure(Test_Byte <nint>()); succeeded &= ReportFailure(Test_SByte <nint>()); succeeded &= ReportFailure(Test_UInt16 <nint>()); succeeded &= ReportFailure(Test_Int16 <nint>()); succeeded &= ReportFailure(Test_UInt32 <nint>()); succeeded &= ReportFailure(Test_Int32 <nint>()); succeeded &= ReportFailure(Test_UInt64 <nint>()); succeeded &= ReportFailure(Test_Int64 <nint>()); succeeded &= ReportFailure(Test_Single <nint>()); succeeded &= ReportFailure(Test_Double <nint>()); succeeded &= ReportFailure(Test_NUInt <nint>()); succeeded &= ReportFailure(Test_NInt <nint>()); using (JitLog jitLog = new JitLog()) { succeeded &= ReportFailure(jitLog.Check("op_Explicit", "Byte")); succeeded &= ReportFailure(jitLog.Check("op_Explicit", "SByte")); succeeded &= ReportFailure(jitLog.Check("op_Explicit", "UInt16")); succeeded &= ReportFailure(jitLog.Check("op_Explicit", "Int16")); succeeded &= ReportFailure(jitLog.Check("op_Explicit", "UInt32")); succeeded &= ReportFailure(jitLog.Check("op_Explicit", "Int32")); succeeded &= ReportFailure(jitLog.Check("op_Explicit", "UInt64")); succeeded &= ReportFailure(jitLog.Check("op_Explicit", "Int64")); succeeded &= ReportFailure(jitLog.Check("op_Explicit", "Single")); succeeded &= ReportFailure(jitLog.Check("op_Explicit", "Double")); succeeded &= ReportFailure(jitLog.Check("op_Explicit", "IntPtr")); succeeded &= ReportFailure(jitLog.Check("op_Explicit", "UIntPtr")); } return(succeeded ? Pass : Fail); }
private static int Main() { int returnVal = Pass; if (VectorDotTest <float> .VectorDot(3f, 2f, 6f * Vector <float> .Count) != Pass) { returnVal = Fail; } if (VectorDotTest <double> .VectorDot(3d, 2d, 6d * Vector <double> .Count) != Pass) { returnVal = Fail; } if (VectorDotTest <int> .VectorDot(3, 2, 6 * Vector <int> .Count) != Pass) { returnVal = Fail; } if (VectorDotTest <long> .VectorDot(3, 2, (long)(6 * Vector <long> .Count)) != Pass) { returnVal = Fail; } if (Vector4Test.VectorDot(3f, 2f, 24f) != Pass) { returnVal = Fail; } if (Vector3Test.VectorDot(3f, 2f, 18f) != Pass) { returnVal = Fail; } if (Vector2Test.VectorDot(3f, 2f, 12f) != Pass) { returnVal = Fail; } if (VectorDotTest <ushort> .VectorDot(3, 2, (ushort)(6 * Vector <ushort> .Count)) != Pass) { returnVal = Fail; } if (VectorDotTest <byte> .VectorDot(3, 2, (byte)(6 * Vector <byte> .Count)) != Pass) { returnVal = Fail; } if (VectorDotTest <short> .VectorDot(3, 2, (short)(6 * Vector <short> .Count)) != Pass) { returnVal = Fail; } if (VectorDotTest <sbyte> .VectorDot(3, 2, (sbyte)(6 * Vector <sbyte> .Count)) != Pass) { returnVal = Fail; } if (VectorDotTest <uint> .VectorDot(3u, 2u, (uint)(6 * Vector <uint> .Count)) != Pass) { returnVal = Fail; } if (VectorDotTest <ulong> .VectorDot(3ul, 2ul, 6ul * (ulong)Vector <ulong> .Count) != Pass) { returnVal = Fail; } JitLog jitLog = new JitLog(); // Dot is only recognized as an intrinsic for floating point element types // and Vector<int> on AVX. if (!jitLog.Check("Dot", "Single")) { returnVal = Fail; } if (!jitLog.Check("Dot", "Double")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector4:Dot")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector3:Dot")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector2:Dot")) { returnVal = Fail; } if (Vector <int> .Count == 8) { if (!jitLog.Check("Dot", "Int32")) { returnVal = Fail; } } jitLog.Dispose(); return(returnVal); }
private static int Main() { int returnVal = Pass; if (VectorMulTest <float> .VectorMul(2, 3, (float)(2 * 3), (float)(2 * 3) * (2 * 3), (float)(3 * 3)) != Pass) { returnVal = Fail; } if (VectorMulTest <double> .VectorMul(2, 3, (double)(2 * 3), (double)(2 * 3) * (2 * 3), (double)(3 * 3)) != Pass) { returnVal = Fail; } if (VectorMulTest <int> .VectorMul(2, 3, (2 * 3), (2 * 3) * (2 * 3), (3 * 3)) != Pass) { returnVal = Fail; } if (VectorMulTest <long> .VectorMul(2, 3, (long)(2 * 3), (long)(2 * 3) * (2 * 3), (long)(3 * 3)) != Pass) { returnVal = Fail; } if (Vector4Test.VectorMul(2, 3, (float)(2 * 3)) != Pass) { returnVal = Fail; } if (Vector3Test.VectorMul(2, 3, (float)(2 * 3)) != Pass) { returnVal = Fail; } if (Vector2Test.VectorMul(2, 3, (float)(2 * 3)) != Pass) { returnVal = Fail; } if (VectorMulTest <ushort> .VectorMul(2, 3, (ushort)(2 * 3), (ushort)(2 * 3) * (2 * 3), (ushort)(3 * 3)) != Pass) { returnVal = Fail; } if (VectorMulTest <byte> .VectorMul(2, 3, (byte)(2 * 3), (byte)(2 * 3) * (2 * 3), (byte)(3 * 3)) != Pass) { returnVal = Fail; } if (VectorMulTest <short> .VectorMul(2, 3, (short)(2 * 3), (short)(2 * 3) * (2 * 3), (short)(3 * 3)) != Pass) { returnVal = Fail; } if (VectorMulTest <sbyte> .VectorMul(2, 3, (sbyte)(2 * 3), (sbyte)(2 * 3) * (2 * 3), (sbyte)(3 * 3)) != Pass) { returnVal = Fail; } if (VectorMulTest <uint> .VectorMul(2u, 3u, 2u * 3u, (2u * 3u) * (2u * 3u), (3u * 3u)) != Pass) { returnVal = Fail; } if (VectorMulTest <ulong> .VectorMul(2ul, 3ul, 2ul * 3ul, (2ul * 3ul) * (2ul * 3ul), (3ul * 3ul)) != Pass) { returnVal = Fail; } if (VectorMulTest <nint> .VectorMul(2, 3, (2 * 3), (2 * 3) * (2 * 3), (3 * 3)) != Pass) { returnVal = Fail; } if (VectorMulTest <nuint> .VectorMul(2u, 3u, 2u * 3u, (2u * 3u) * (2u * 3u), (3u * 3u)) != Pass) { returnVal = Fail; } JitLog jitLog = new JitLog(); // Multiply is supported only for float, double, int and short if (!jitLog.Check("op_Multiply", "Single")) { returnVal = Fail; } if (!jitLog.Check("op_Multiply", "Double")) { returnVal = Fail; } if (!jitLog.Check("op_Multiply", "Int32")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector4:op_Multiply")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector3:op_Multiply")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector2:op_Multiply")) { returnVal = Fail; } if (!jitLog.Check("op_Multiply", "Int16")) { returnVal = Fail; } jitLog.Dispose(); return(returnVal); }
private static int Main() { int returnVal = Pass; if (VectorAbsTest <float> .VectorAbs(-1f, 1f) != Pass) { returnVal = Fail; } if (VectorAbsTest <Double> .VectorAbs(-1d, 1d) != Pass) { returnVal = Fail; } if (VectorAbsTest <int> .VectorAbs(-1, 1) != Pass) { returnVal = Fail; } if (VectorAbsTest <long> .VectorAbs(-1, 1) != Pass) { returnVal = Fail; } if (VectorAbsTest <short> .VectorAbs((short)-1, (short)1) != Pass) { returnVal = Fail; } if (VectorAbsTest <sbyte> .VectorAbs((sbyte)-1, (sbyte)1) != Pass) { returnVal = Fail; } if (Vector4Test.VectorAbs() != Pass) { returnVal = Fail; } if (Vector3Test.VectorAbs() != Pass) { returnVal = Fail; } if (Vector2Test.VectorAbs() != Pass) { returnVal = Fail; } if (VectorAbsTest <ushort> .VectorAbs((ushort)0xffff, (ushort)0xffff) != Pass) { returnVal = Fail; } if (VectorAbsTest <byte> .VectorAbs((byte)0xff, (byte)0xff) != Pass) { returnVal = Fail; } if (VectorAbsTest <uint> .VectorAbs(0x41000000u, 0x41000000u) != Pass) { returnVal = Fail; } if (VectorAbsTest <ulong> .VectorAbs(0x4100000000000000ul, 0x4100000000000000ul) != Pass) { returnVal = Fail; } JitLog jitLog = new JitLog(); if (!jitLog.Check("Abs", "Single")) { returnVal = Fail; } if (!jitLog.Check("Abs", "Double")) { returnVal = Fail; } // SSE2: Abs is not an intrinsic for Int32 and Int64, but IS for UInt32 and UInt64 // SSE3_4: Abs is not an intrinsic for Int64 alone. // Since right now there is no way to know SIMD instruction set used by JIT, // we will check conservatively on SSE3_4 targets. if (!jitLog.Check("System.Numerics.Vector4:Abs")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector3:Abs")) { returnVal = Fail; } if (!jitLog.Check("System.Numerics.Vector2:Abs")) { returnVal = Fail; } if (!jitLog.Check("Abs", "UInt16")) { returnVal = Fail; } if (!jitLog.Check("Abs", "Byte")) { returnVal = Fail; } if (!jitLog.Check("Abs", "UInt32")) { returnVal = Fail; } if (!jitLog.Check("Abs", "UInt64")) { returnVal = Fail; } // AVX: Abs is not an intrinsic for Int64 alone. if (Vector <int> .Count == 8) { if (!jitLog.Check("Abs", "Int32")) { returnVal = Fail; } if (!jitLog.Check("Abs", "Int16")) { returnVal = Fail; } if (!jitLog.Check("Abs", "SByte")) { returnVal = Fail; } } jitLog.Dispose(); return(returnVal); }