aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/clrs8.h
blob: f6f8298799f1c1eadb7f9460fab0e371bafd1764 (plain)
1
2
3
4
5
6
7
8
9
10
11
P_ONE_LOOP(8, {
  pd = 0;
  if (ps1 < 0) ps1 = ~ps1;
  if (!ps1) pd = 8;
  else {
    if ((ps1 & 0xF0) == 0) { pd += 4; ps1 <<= 4; }
    if ((ps1 & 0xC0) == 0) { pd += 2; ps1 <<= 2; }
    if ((ps1 & 0x80) == 0) { pd += 1; }
  }
  pd -= 1;
})