OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [or1ksim/] [support/] [misc.c] - Diff between revs 1555 and 1594

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 1555 Rev 1594
Line 28... Line 28...
  return c;
  return c;
}
}
 
 
int is_power2 (int x)
int is_power2 (int x)
{
{
 
  if(!x)
 
    return 0;
  while (!(x & 1))
  while (!(x & 1))
    x >>= 1;
    x >>= 1;
  return x == 1;
  return x == 1;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.