コード例 #1
0
 static int Main(string[] args)
 {
     Vector4Test.RunTests();
     Vector3Test.RunTests();
     Vector2Test.RunTests();
     FuncEvalTest.RunTests();
     return(100);
 }
コード例 #2
0
    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;
        }
        return(returnVal);
    }
コード例 #3
0
    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;
        }
        return(returnVal);
    }
コード例 #4
0
    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;
        }
        return(returnVal);
    }
コード例 #5
0
    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;
        }
        return(returnVal);
    }
コード例 #6
0
ファイル: VectorUnused.cs プロジェクト: zwei222/coreclr
    private static int Main()
    {
        int returnVal = Pass;

        if (VectorUnusedTest <float> .VectorUnused(3f, 2f) != Pass)
        {
            returnVal = Fail;
        }
        if (VectorUnusedTest <double> .VectorUnused(3, 2) != Pass)
        {
            returnVal = Fail;
        }
        if (VectorUnusedTest <int> .VectorUnused(3, 2) != Pass)
        {
            returnVal = Fail;
        }
        if (VectorUnusedTest <long> .VectorUnused(3, 2) != Pass)
        {
            returnVal = Fail;
        }
        if (VectorUnusedTest <ushort> .VectorUnused(3, 2) != Pass)
        {
            returnVal = Fail;
        }
        if (VectorUnusedTest <byte> .VectorUnused(3, 2) != Pass)
        {
            returnVal = Fail;
        }
        if (VectorUnusedTest <short> .VectorUnused(3, 2) != Pass)
        {
            returnVal = Fail;
        }
        if (VectorUnusedTest <sbyte> .VectorUnused(3, 2) != Pass)
        {
            returnVal = Fail;
        }
        if (VectorUnusedTest <uint> .VectorUnused(3, 2) != Pass)
        {
            returnVal = Fail;
        }
        if (VectorUnusedTest <ulong> .VectorUnused(3, 2) != Pass)
        {
            returnVal = Fail;
        }
        if (Vector4Test.VectorUnused() != Pass)
        {
            returnVal = Fail;
        }
        if (Vector3Test.VectorUnused() != Pass)
        {
            returnVal = Fail;
        }
        if (Vector2Test.VectorUnused() != Pass)
        {
            returnVal = Fail;
        }
        return(returnVal);
    }
コード例 #7
0
ファイル: VectorAbs.cs プロジェクト: wyrover/coreclr
    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 (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;
        }
        return(returnVal);
    }
コード例 #8
0
ファイル: VectorDot.cs プロジェクト: Fredo-Q/dotnet-coreclr
    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);
    }
コード例 #9
0
ファイル: VectorAdd.cs プロジェクト: z77ma/runtime
    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);
    }
コード例 #10
0
    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);
    }
コード例 #11
0
ファイル: VectorAbs.cs プロジェクト: z77ma/runtime
    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);
    }
コード例 #12
0
    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;
            }
        }
        catch (ArgumentException ex)
        {
            Console.WriteLine("Argument Exception was raised");
            Console.WriteLine(ex.StackTrace);
            return(Fail);
        }
        return(returnVal);
    }
コード例 #13
0
ファイル: VectorDiv.cs プロジェクト: wyrover/coreclr
    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;
        }
        return(returnVal);
    }
コード例 #14
0
    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);
    }
コード例 #15
0
    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);
    }
コード例 #16
0
    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);
    }
コード例 #17
0
ファイル: VectorAbs.cs プロジェクト: darxis/coreclr
    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);
    }