3 #ifndef CDSLIB_COMPILER_GCC_IA64_BITOP_H
4 #define CDSLIB_COMPILER_GCC_IA64_BITOP_H
8 namespace bitop { namespace platform { namespace gcc { namespace ia64 {
10 // MSB - return index (1..32) of most significant bit in x. If x == 0 return 0
11 # define cds_bitop_msb32_DEFINED
12 static inline int msb32( uint32_t nArg )
24 asm __volatile__( "popcnt %0=%1\n\t" : "=r" (nRes) : "r" (x) );
28 // It is not compiled on HP-UX. Why?..
29 #if CDS_OS_TYPE != CDS_OS_HPUX
30 // MSB - return index (0..31) of most significant bit in nArg.
32 # define cds_bitop_msb32nz_DEFINED
33 static inline int msb32nz( uint32_t nArg )
38 asm __volatile__("getf.exp %0=%1\n\t" : "=r"(nExp) : "f"(d));
39 return (int) (nExp - 0xffff);
42 // MSB - return index (0..63) of most significant bit in nArg.
44 # define cds_bitop_msb64nz_DEFINED
45 static inline int msb64nz( atomic64u_t nArg )
50 asm __volatile__("getf.exp %0=%1\n\t" : "=r" (nExp) : "f" (d));
51 return (int) (nExp - 0xffff);
53 #endif // #if CDS_OS_TYPE != CDS_OS_HPUX
55 }} // namespace gcc::ia64
57 using namespace gcc::ia64;
59 }}} // namespace cds::bitop::platform
62 #endif // #ifndef CDSLIB_COMPILER_GCC_IA64_BITOP_H