Update ASoftFallback.cs
This commit is contained in:
parent
6d127abdaa
commit
38b021410c
1 changed files with 18 additions and 34 deletions
|
@ -406,14 +406,6 @@ namespace ChocolArm64.Instruction
|
|||
private static readonly byte[] ClzNibbleTbl = { 4, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
public static ulong CountLeadingZeros(ulong Value, int Size) // Size is 8, 16, 32 or 64 (SIMD&FP or Base Inst.).
|
||||
{
|
||||
if (Lzcnt.IsSupported && Size >= 32)
|
||||
{
|
||||
return Size == 32
|
||||
? (ulong)Lzcnt.LeadingZeroCount((uint)Value)
|
||||
: Lzcnt.LeadingZeroCount(Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Value == 0ul)
|
||||
{
|
||||
|
@ -433,15 +425,8 @@ namespace ChocolArm64.Instruction
|
|||
|
||||
return (ulong)Count;
|
||||
}
|
||||
}
|
||||
|
||||
public static ulong CountSetBits8(ulong Value) // "Size" is 8 (SIMD&FP Inst.).
|
||||
{
|
||||
if (Popcnt.IsSupported)
|
||||
{
|
||||
return (ulong)Popcnt.PopCount(Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Value == 0xfful)
|
||||
{
|
||||
|
@ -453,7 +438,6 @@ namespace ChocolArm64.Instruction
|
|||
|
||||
return (Value >> 4) + (Value & 0x0ful);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region "Crc32"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue