Exemple #1
0
        public void RunStructLclFldScenario()
        {
            var test   = TestStruct.Create();
            var result = Bmi1.AndNot(test._fld1, test._fld2);

            ValidateResult(test._fld1, test._fld2, result);
        }
        public void RunStructLclFldScenario()
        {
            var test   = TestStruct.Create();
            var result = Bmi1.ExtractLowestSetBit(test._fld);

            ValidateResult(test._fld, result);
        }
Exemple #3
0
        public void RunLclFldScenario()
        {
            var test   = new ScalarUnaryOpTest__ResetLowestSetBitUInt32();
            var result = Bmi1.ResetLowestSetBit(test._fld);

            ValidateResult(test._fld, result);
        }
        public void RunLclVarScenario_UnsafeRead()
        {
            var data   = Unsafe.ReadUnaligned <UInt64>(ref Unsafe.As <UInt64, byte>(ref _data));
            var result = Bmi1.TrailingZeroCount(data);

            ValidateResult(data, result);
        }
        public void RunClassLclFldScenario()
        {
            var test   = new ScalarUnaryOpTest__TrailingZeroCountUInt64();
            var result = Bmi1.TrailingZeroCount(test._fld);

            ValidateResult(test._fld, result);
        }
        public void RunClassLclFldScenario()
        {
            var test   = new ScalarUnaryOpTest__GetMaskUpToLowestSetBitUInt32();
            var result = Bmi1.GetMaskUpToLowestSetBit(test._fld);

            ValidateResult(test._fld, result);
        }
        public void RunLclVarScenario_UnsafeRead()
        {
            var data   = Unsafe.ReadUnaligned <UInt64>(ref Unsafe.As <UInt64, byte>(ref _data));
            var result = Bmi1.ExtractLowestSetBit(data);

            ValidateResult(data, result);
        }
        public void RunLclVarScenario_UnsafeRead()
        {
            var data   = Unsafe.ReadUnaligned <UInt32>(ref Unsafe.As <UInt32, byte>(ref _data));
            var result = Bmi1.GetMaskUpToLowestSetBit(data);

            ValidateResult(data, result);
        }
        public void RunClassLclFldScenario()
        {
            var test   = new ScalarUnaryOpTest__ExtractLowestSetBitUInt64();
            var result = Bmi1.ExtractLowestSetBit(test._fld);

            ValidateResult(test._fld, result);
        }
Exemple #10
0
        public void RunClassLclFldScenario()
        {
            var test   = new ScalarBinaryOpTest__AndNotUInt64();
            var result = Bmi1.AndNot(test._fld1, test._fld2);

            ValidateResult(test._fld1, test._fld2, result);
        }
        public void RunStructLclFldScenario()
        {
            var test   = TestStruct.Create();
            var result = Bmi1.TrailingZeroCount(test._fld);

            ValidateResult(test._fld, result);
        }
Exemple #12
0
        public void RunLclVarScenario_UnsafeRead()
        {
            var data1  = Unsafe.ReadUnaligned <UInt64>(ref Unsafe.As <UInt64, byte>(ref _data1));
            var data2  = Unsafe.ReadUnaligned <UInt64>(ref Unsafe.As <UInt64, byte>(ref _data2));
            var result = Bmi1.AndNot(data1, data2);

            ValidateResult(data1, data2, result);
        }
Exemple #13
0
        public void RunBasicScenario_UnsafeRead()
        {
            var result = Bmi1.ExtractLowestSetBit(
                Unsafe.ReadUnaligned <UInt32>(ref Unsafe.As <UInt32, byte>(ref _data))
                );

            ValidateResult(_data, result);
        }
Exemple #14
0
        public void RunClassFldScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));

            var result = Bmi1.BitFieldExtract(_fld1, _fld2, _fld3);

            ValidateResult(_fld1, _fld2, _fld3, result);
        }
Exemple #15
0
        public void RunClassFldScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));

            var result = Bmi1.AndNot(_fld1, _fld2);

            ValidateResult(_fld1, _fld2, result);
        }
        public void RunClsVarScenario()
        {
            var result = Bmi1.TrailingZeroCount(
                _clsVar
                );

            ValidateResult(_clsVar, result);
        }
Exemple #17
0
        public void RunClassFldScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));

            var result = Bmi1.ExtractLowestSetBit(_fld);

            ValidateResult(_fld, result);
        }
        public void RunClassFldScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));

            var result = Bmi1.TrailingZeroCount(_fld);

            ValidateResult(_fld, result);
        }
        public void RunBasicScenario_UnsafeRead()
        {
            var result = Bmi1.TrailingZeroCount(
                Unsafe.ReadUnaligned <UInt32>(ref Unsafe.As <UInt32, byte>(ref _data))
                );

            ValidateResult(_data, result);
        }
 public static int ExtractLowestSetBit(int n)
 {
     if (Bmi1.IsSupported)
     {
         return((int)Bmi1.ExtractLowestSetBit((uint)n));
     }
     return(n & -n);
 }
Exemple #21
0
 public static uint AndNot(uint left, uint right)
 {
     if (Bmi1.IsSupported)
     {
         return(Bmi1.AndNot(left, right));
     }
     return(~left & right);
 }
        public void RunClsVarScenario()
        {
            var result = Bmi1.ExtractLowestSetBit(
                _clsVar
                );

            ValidateResult(_clsVar, result);
        }
Exemple #23
0
        public void RunClsVarScenario()
        {
            var result = Bmi1.GetMaskUpToLowestSetBit(
                _clsVar
                );

            ValidateResult(_clsVar, result);
        }
Exemple #24
0
        public void RunBasicScenario_UnsafeRead()
        {
            var result = Bmi1.GetMaskUpToLowestSetBit(
                Unsafe.ReadUnaligned <UInt64>(ref Unsafe.As <UInt64, byte>(ref _data))
                );

            ValidateResult(_data, result);
        }
Exemple #25
0
        public void RunBasicScenario_UnsafeRead()
        {
            var result = Bmi1.AndNot(
                Unsafe.ReadUnaligned <UInt64>(ref Unsafe.As <UInt64, byte>(ref _data1)),
                Unsafe.ReadUnaligned <UInt64>(ref Unsafe.As <UInt64, byte>(ref _data2))
                );

            ValidateResult(_data1, _data2, result);
        }
Exemple #26
0
        public void RunClassLclFldScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));

            var test   = new ScalarUnaryOpTest__ExtractLowestSetBitUInt32();
            var result = Bmi1.ExtractLowestSetBit(test._fld);

            ValidateResult(test._fld, result);
        }
Exemple #27
0
        public void RunStructLclFldScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));

            var test   = TestStruct.Create();
            var result = Bmi1.ExtractLowestSetBit(test._fld);

            ValidateResult(test._fld, result);
        }
Exemple #28
0
        public void RunClassLclFldScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));

            var test   = new ScalarTernOpTest__BitFieldExtractUInt32();
            var result = Bmi1.BitFieldExtract(test._fld1, test._fld2, test._fld3);

            ValidateResult(test._fld1, test._fld2, test._fld3, result);
        }
Exemple #29
0
        public void RunStructLclFldScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));

            var test   = TestStruct.Create();
            var result = Bmi1.BitFieldExtract(test._fld1, test._fld2, test._fld3);

            ValidateResult(test._fld1, test._fld2, test._fld3, result);
        }
Exemple #30
0
        public void RunClsVarScenario()
        {
            var result = Bmi1.AndNot(
                _clsVar1,
                _clsVar2
                );

            ValidateResult(_clsVar1, _clsVar2, result);
        }