Subversion Repositories HelenOS

Rev

Rev 1867 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1867 Rev 2082
Line 1567... Line 1567...
1567
    I = 0;\
1567
    I = 0;\
1568
  else if (X > 0xFFFF)\
1568
  else if (X > 0xFFFF)\
1569
    I = NTREEBINS-1;\
1569
    I = NTREEBINS-1;\
1570
  else {\
1570
  else {\
1571
    unsigned int K;\
1571
    unsigned int K;\
1572
    __asm__("bsrl %1,%0\n\t" : "=r" (K) : "rm"  (X));\
1572
    asm("bsrl %1,%0\n\t" : "=r" (K) : "rm"  (X));\
1573
    I =  (bindex_t)((K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1)));\
1573
    I =  (bindex_t)((K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1)));\
1574
  }\
1574
  }\
1575
}
1575
}
1576
#else /* GNUC */
1576
#else /* GNUC */
1577
#define compute_tree_index(S, I)\
1577
#define compute_tree_index(S, I)\
Line 1626... Line 1626...
1626
 
1626
 
1627
#if defined(__GNUC__) && defined(i386)
1627
#if defined(__GNUC__) && defined(i386)
1628
#define compute_bit2idx(X, I)\
1628
#define compute_bit2idx(X, I)\
1629
{\
1629
{\
1630
  unsigned int J;\
1630
  unsigned int J;\
1631
  __asm__("bsfl %1,%0\n\t" : "=r" (J) : "rm" (X));\
1631
  asm("bsfl %1,%0\n\t" : "=r" (J) : "rm" (X));\
1632
  I = (bindex_t)J;\
1632
  I = (bindex_t)J;\
1633
}
1633
}
1634
 
1634
 
1635
#else /* GNUC */
1635
#else /* GNUC */
1636
#if  USE_BUILTIN_FFS
1636
#if  USE_BUILTIN_FFS