예제 #1
0
        private static uint Multiply(DelegateDispatchedUInt32Divisor divisor, uint value)
        {
            ulong rax = value;
            uint  eax;
            ulong multiplier = divisor.Multiplier;
            int   shift      = divisor.Shift;

            rax *= multiplier;
            eax  = (uint)(rax >> shift);
            return(eax);
        }
예제 #2
0
        private static uint MultiplyAdd(DelegateDispatchedUInt32Divisor divisor, uint value)
        {
            ulong rax = value;
            uint  eax;
            ulong multiplier = divisor.Multiplier;
            int   shift      = divisor.Shift;

            rax    *= multiplier;
            eax     = (uint)(rax >> 32);
            value  -= eax;
            value >>= 1;
            eax    += value;
            eax   >>= shift;
            return(eax);
        }
예제 #3
0
#pragma warning restore S1172   // Unused method parameters should be removed
#pragma warning restore IDE0060 // 未使用のパラメーターを削除します

        private static uint ShiftOnly(DelegateDispatchedUInt32Divisor divisor, uint value) => value >> divisor.Shift;
예제 #4
0
#pragma warning disable IDE0060 // 未使用のパラメーターを削除します
#pragma warning disable S1172   // Unused method parameters should be removed

        private static uint Echo(DelegateDispatchedUInt32Divisor divisor, uint value) => value;