Example #1
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);
    }
Example #2
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);
    }
Example #3
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);
    }
Example #4
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;
        }
        return(returnVal);
    }