diff options
| author | LDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com> | 2018-03-24 02:06:05 +0100 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-03-23 22:06:05 -0300 |
| commit | 873a7cd112d2f1cc84b628344c0ecc426573f636 (patch) | |
| tree | 868ed5f2918b6f6be0bf0312fc171337ed952e25 /ChocolArm64/Instruction/ASoftFallback.cs | |
| parent | 0d2f07315248a38febec3b015673e3421a787c49 (diff) | |
Add Cls Instruction. (#67)
* Update AInstEmitAlu.cs
* Update ASoftFallback.cs
* Update AOpCodeTable.cs
Diffstat (limited to 'ChocolArm64/Instruction/ASoftFallback.cs')
| -rw-r--r-- | ChocolArm64/Instruction/ASoftFallback.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ChocolArm64/Instruction/ASoftFallback.cs b/ChocolArm64/Instruction/ASoftFallback.cs index 705ca4a2..c0594413 100644 --- a/ChocolArm64/Instruction/ASoftFallback.cs +++ b/ChocolArm64/Instruction/ASoftFallback.cs @@ -20,6 +20,14 @@ namespace ChocolArm64.Instruction Context.EmitCall(typeof(ASoftFallback), MthdName); } + public static uint CountLeadingSigns32(uint Value) => (uint)CountLeadingSigns(Value, 32); + public static ulong CountLeadingSigns64(ulong Value) => (ulong)CountLeadingSigns(Value, 64); + + private static ulong CountLeadingSigns(ulong Value, int Size) + { + return CountLeadingZeros((Value >> 1) ^ Value, Size - 1); + } + public static uint CountLeadingZeros32(uint Value) => (uint)CountLeadingZeros(Value, 32); public static ulong CountLeadingZeros64(ulong Value) => (ulong)CountLeadingZeros(Value, 64); @@ -398,4 +406,4 @@ namespace ChocolArm64.Instruction throw new ArgumentOutOfRangeException(nameof(Size)); } } -}
\ No newline at end of file +} |
