diff options
author | Berkan Diler <b.diler@gmx.de> | 2022-02-18 02:35:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-18 02:35:23 +0100 |
commit | 98c838b24c464fd627ad09078250e4801db8967e (patch) | |
tree | ff1fcd0371d55255bcd39876cc2d685a7fe7485b /Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs | |
parent | 63c9c64196465bd97abacceb1d83fa53de358d23 (diff) |
Use BitOperations methods and delete now unused BitUtils methods (#3134)1.1.42
Replaces BitUtils.CountTrailingZeros/CountLeadingZeros/IsPowerOfTwo with BitOperations methods
Diffstat (limited to 'Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs')
-rw-r--r-- | Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs b/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs index f35a3c36..43e3e820 100644 --- a/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs +++ b/Ryujinx.HLE/HOS/Kernel/Memory/KMemoryRegionManager.cs @@ -1,6 +1,7 @@ using Ryujinx.Common; using Ryujinx.HLE.HOS.Kernel.Common; using System.Diagnostics; +using System.Numerics; namespace Ryujinx.HLE.HOS.Kernel.Memory { @@ -259,11 +260,11 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory if (backwards) { - index = (index * 64 + 63) - BitUtils.CountLeadingZeros64(mask); + index = (index * 64 + 63) - BitOperations.LeadingZeroCount((ulong)mask); } else { - index = index * 64 + BitUtils.CountLeadingZeros64(BitUtils.ReverseBits64(mask)); + index = index * 64 + BitOperations.LeadingZeroCount((ulong)BitUtils.ReverseBits64(mask)); } } @@ -312,11 +313,11 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory if (backwards) { - index = index * 64 + BitUtils.CountLeadingZeros64(BitUtils.ReverseBits64(mask)); + index = index * 64 + BitOperations.LeadingZeroCount((ulong)BitUtils.ReverseBits64(mask)); } else { - index = (index * 64 + 63) - BitUtils.CountLeadingZeros64(mask); + index = (index * 64 + 63) - BitOperations.LeadingZeroCount((ulong)mask); } } |