Update Pseudocode.cs

This commit is contained in:
LDj3SNuD 2018-06-25 01:08:38 +02:00 committed by GitHub
parent 5071bbc6c7
commit 80ea57860f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -586,6 +586,24 @@ namespace Ryujinx.Tests.Cpu.Tester
return (x >= 0 ? x : -x);
}
// shared_pseudocode.html#impl-shared.BitCount.1
public static int BitCount(Bits x)
{
int N = x.Count;
int result = 0;
for (int i = 0; i <= N - 1; i++)
{
if (x[i])
{
result = result + 1;
}
}
return result;
}
// shared_pseudocode.html#impl-shared.CountLeadingSignBits.1
public static int CountLeadingSignBits(Bits x)
{