Update ASoftFallback.cs
This commit is contained in:
parent
c187c00e1a
commit
8224cdd4bd
1 changed files with 20 additions and 4 deletions
|
@ -30,6 +30,14 @@ namespace ChocolArm64.Instruction
|
|||
return (ulong)Size;
|
||||
}
|
||||
|
||||
public static int CountSetBits8(byte Value)
|
||||
{
|
||||
return ((Value >> 0) & 1) + ((Value >> 1) & 1) +
|
||||
((Value >> 2) & 1) + ((Value >> 3) & 1) +
|
||||
((Value >> 4) & 1) + ((Value >> 5) & 1) +
|
||||
((Value >> 6) & 1) + (Value >> 7);
|
||||
}
|
||||
|
||||
private const uint Crc32RevPoly = 0xedb88320;
|
||||
private const uint Crc32cRevPoly = 0x82f63b78;
|
||||
|
||||
|
@ -89,6 +97,14 @@ namespace ChocolArm64.Instruction
|
|||
return Crc;
|
||||
}
|
||||
|
||||
public static uint ReverseBits8(uint Value)
|
||||
{
|
||||
Value = ((Value & 0xaa) >> 1) | ((Value & 0x55) << 1);
|
||||
Value = ((Value & 0xcc) >> 2) | ((Value & 0x33) << 2);
|
||||
|
||||
return (Value >> 4) | ((Value & 0x0f) << 4);
|
||||
}
|
||||
|
||||
public static uint ReverseBits32(uint Value)
|
||||
{
|
||||
Value = ((Value & 0xaaaaaaaa) >> 1) | ((Value & 0x55555555) << 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue