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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [openrisc/] [arch/] [current/] [src/] [hal_misc.c] - Diff between revs 786 and 790

Show entire file | Details | Blame | View Log

Rev 786 Rev 790
Line 173... Line 173...
 
 
} // cyg_hal_invoke_constructors()
} // cyg_hal_invoke_constructors()
 
 
/*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*/
/* Determine the index of the ls bit of the supplied mask.                */
/* Determine the index of the ls bit of the supplied mask.                */
 
//TODO can we use l.ff1 ?
cyg_uint32 hal_lsbit_index(cyg_uint32 mask)
cyg_uint32 hal_lsbit_index(cyg_uint32 mask)
{
{
    cyg_uint32 n = mask;
    cyg_uint32 n = mask;
 
 
    static const signed char tab[64] =
    static const signed char tab[64] =
Line 195... Line 195...
    return tab[n>>26];
    return tab[n>>26];
}
}
 
 
/*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*/
/* Determine the index of the ms bit of the supplied mask.                */
/* Determine the index of the ms bit of the supplied mask.                */
 
//TODO can we use l.fl1 ?
cyg_uint32 hal_msbit_index(cyg_uint32 mask)
cyg_uint32 hal_msbit_index(cyg_uint32 mask)
{
{
    cyg_uint32 x = mask;
    cyg_uint32 x = mask;
    cyg_uint32 w;
    cyg_uint32 w;
 
 

powered by: WebSVN 2.1.0

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