예제 #1
0
 public void VerifyNegate()
 {
     VerifyOp(AsmOps.Negate <sbyte>(), math.negate, SampleSize);
     VerifyOp(AsmOps.Negate <byte>(), math.negate, SampleSize);
     VerifyOp(AsmOps.Negate <short>(), math.negate, SampleSize);
     VerifyOp(AsmOps.Negate <ushort>(), math.negate, SampleSize);
     VerifyOp(AsmOps.Negate <int>(), math.negate, SampleSize);
     VerifyOp(AsmOps.Negate <uint>(), math.negate, SampleSize);
     VerifyOp(AsmOps.Negate <long>(), math.negate, SampleSize);
     VerifyOp(AsmOps.Negate <ulong>(), math.negate, SampleSize);
     VerifyOp(AsmOps.Negate <float>(), math.negate, SampleSize);
     VerifyOp(AsmOps.Negate <double>(), math.negate, SampleSize);
 }
예제 #2
0
파일: tasm_add.cs 프로젝트: 0xCM/arrows
        void add_check <T>()
            where T : unmanaged
        {
            var asmop = AsmOps.Add <T>();

            for (var i = 0; i < SampleSize; i++)
            {
                var a      = Random.Next <T>();
                var b      = Random.Next <T>();
                var expect = gmath.add(a, b);
                var actual = asmop(a, b);
                Claim.eq(expect, actual);
            }
        }
예제 #3
0
파일: tasm_add.cs 프로젝트: 0xCM/arrows
        void add_bench <T>(SystemCounter subject = default, SystemCounter compare = default)
            where T : unmanaged
        {
            var last  = default(T);
            var asmop = AsmOps.Add <T>();

            for (var i = 0; i < OpCount; i++)
            {
                var a = Random.Next <T>();
                var b = Random.Next <T>();
                subject.Start();
                last = asmop(a, b);
                subject.Stop();

                compare.Start();
                last = gmath.add(a, b);
                compare.Stop();
            }

            Benchmark($"add{moniker<T>()}_asm", subject);
            Benchmark($"add{moniker<T>()}", compare);
        }
예제 #4
0
파일: tasm_add.cs 프로젝트: 0xCM/arrows
 public void add64f_check()
 => VerifyOp(AsmOps.Add <double>(), fmath.add);
예제 #5
0
파일: tasm_add.cs 프로젝트: 0xCM/arrows
 public void add64u_check()
 => VerifyOp(AsmOps.Add <ulong>(), math.add);
예제 #6
0
파일: tasm_add.cs 프로젝트: 0xCM/arrows
 public void add32u_check()
 => VerifyOp(AsmOps.Add <uint>(), math.add);
예제 #7
0
파일: tasm_add.cs 프로젝트: 0xCM/arrows
 public void add16u_check()
 => VerifyOp(AsmOps.Add <ushort>(), math.add);
예제 #8
0
파일: tasm_add.cs 프로젝트: 0xCM/arrows
 public void add8u_check()
 => VerifyOp(AsmOps.Add <byte>(), math.add);