diff options
Diffstat (limited to 'Ryujinx.Common/Utilities/BitUtils.cs')
-rw-r--r-- | Ryujinx.Common/Utilities/BitUtils.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Ryujinx.Common/Utilities/BitUtils.cs b/Ryujinx.Common/Utilities/BitUtils.cs index 5f70f742..4ce7da6b 100644 --- a/Ryujinx.Common/Utilities/BitUtils.cs +++ b/Ryujinx.Common/Utilities/BitUtils.cs @@ -4,6 +4,11 @@ namespace Ryujinx.Common { private static readonly byte[] ClzNibbleTbl = { 4, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 }; + public static uint AlignUp(uint value, int size) + { + return (uint)AlignUp((int)value, size); + } + public static int AlignUp(int value, int size) { return (value + (size - 1)) & -size; @@ -19,6 +24,11 @@ namespace Ryujinx.Common return (value + (size - 1)) & -(long)size; } + public static uint AlignDown(uint value, int size) + { + return (uint)AlignDown((int)value, size); + } + public static int AlignDown(int value, int size) { return value & -size; |