Update Pseudocode.cs
This commit is contained in:
parent
5071bbc6c7
commit
80ea57860f
1 changed files with 18 additions and 0 deletions
|
@ -586,6 +586,24 @@ namespace Ryujinx.Tests.Cpu.Tester
|
||||||
return (x >= 0 ? x : -x);
|
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
|
// shared_pseudocode.html#impl-shared.CountLeadingSignBits.1
|
||||||
public static int CountLeadingSignBits(Bits x)
|
public static int CountLeadingSignBits(Bits x)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue