Пример #1
0
        //[GlobalSetup]
        public CodeGenTests()
        {
            var rnd1 = new Random(1);

            for (int i = 0; i < arr.Length; i++)
            {
                arr[i] = new MyVector4((float)rnd1.NextDouble(), (float)rnd1.NextDouble(), (float)rnd1.NextDouble(), (float)rnd1.NextDouble());
            }
        }
Пример #2
0
        static unsafe float Length_Sse_V2_Helper(MyVector4 vec)
        {
            var ptr = (float *)&vec;
            var mmx = Sse.LoadVector128(ptr);

            mmx = Sse41.DotProduct(mmx, mmx, 0xF1);
            var l2 = mmx.GetElement(0);

            return(MathF.Sqrt(l2));
        }