public void RunStructFldScenario(SimpleBinaryOpConvTest__ConvertScalarToVector128DoubleDouble testClass)
            {
                var result = Sse2.ConvertScalarToVector128Double(_fld1, _fld2);

                Unsafe.Write(testClass._dataTable.outArrayPtr, result);
                testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
            }
        static unsafe int Main(string[] args)
        {
            int testResult = Pass;

            if (Sse2.IsSupported)
            {
                using (TestTable <double> doubleTable = new TestTable <double>(new double[2] {
                    1, -5
                }, new double[2]))
                    using (TestTable <float> floatTable = new TestTable <float>(new float[4] {
                        3, -11, 7, 49
                    }, new float[4]))
                    {
                        var vd0 = Unsafe.Read <Vector128 <double> >(doubleTable.inArrayPtr);
                        var vf1 = Unsafe.Read <Vector128 <float> >(floatTable.inArrayPtr);
                        var vf2 = Sse2.ConvertScalarToVector128Double(vd0, vf1);
                        Unsafe.Write(doubleTable.outArrayPtr, vf2);

                        if (!doubleTable.CheckResult((x, y) => (y[0] == 3) && (y[1] == x[1])))
                        {
                            Console.WriteLine("SSE2 ConvertScalarToVector128Double failed on float:");
                            foreach (var item in doubleTable.outArray)
                            {
                                Console.Write(item + ", ");
                            }
                            Console.WriteLine();
                            testResult = Fail;
                        }
                    }
            }

            return(testResult);
        }
        public void RunClassFldScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));

            var result = Sse2.ConvertScalarToVector128Double(_fld1, _fld2);

            Unsafe.Write(_dataTable.outArrayPtr, result);
            ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
        }
        public void RunStructLclFldScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));

            var test   = TestStruct.Create();
            var result = Sse2.ConvertScalarToVector128Double(test._fld1, test._fld2);

            Unsafe.Write(_dataTable.outArrayPtr, result);
            ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
        }
        public void RunClassLclFldScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));

            var test   = new SimpleBinaryOpConvTest__ConvertScalarToVector128DoubleDouble();
            var result = Sse2.ConvertScalarToVector128Double(test._fld1, test._fld2);

            Unsafe.Write(_dataTable.outArrayPtr, result);
            ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
        }
        public void RunLclVarScenario_LoadAligned()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_LoadAligned));

            var left   = Sse2.LoadAlignedVector128((Double *)(_dataTable.inArray1Ptr));
            var right  = _dataTable.inData2;
            var result = Sse2.ConvertScalarToVector128Double(left, right);

            Unsafe.Write(_dataTable.outArrayPtr, result);
            ValidateResult(left, right, _dataTable.outArrayPtr);
        }
        public void RunBasicScenario_Load()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));

            var result = Sse2.ConvertScalarToVector128Double(
                Sse2.LoadVector128((Double *)(_dataTable.inArray1Ptr)),
                _dataTable.inData2
                );

            Unsafe.Write(_dataTable.outArrayPtr, result);
            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inData2, _dataTable.outArrayPtr);
        }