X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=blobdiff_plain;f=cds%2Falgo%2Fbit_reversal.h;h=b094f8d63fdf2b323a8130a2ac9ac4c59b74c58d;hp=b102bfea8a3d130f66cd5a7a99ce0aca0dd0a629;hb=9bcb21890d7175dcc634120dac455516fa35dadd;hpb=c127b1780d72d0fb14460e939d323875432e5244 diff --git a/cds/algo/bit_reversal.h b/cds/algo/bit_reversal.h index b102bfea..b094f8d6 100644 --- a/cds/algo/bit_reversal.h +++ b/cds/algo/bit_reversal.h @@ -54,8 +54,8 @@ namespace cds { namespace algo { /// 64bit uint64_t operator()( uint64_t x ) const { - return ( static_cast( operator()( static_cast( x )) ) << 32 ) // low 32bit - | ( static_cast( operator()( static_cast( x >> 32 )) )); // high 32bit + return ( static_cast( operator()( static_cast( x ))) << 32 ) // low 32bit + | ( static_cast( operator()( static_cast( x >> 32 )))); // high 32bit } }; @@ -93,8 +93,8 @@ namespace cds { namespace algo { /// 64bit uint64_t operator()( uint64_t x ) const { - return ( static_cast( operator()( static_cast( x )) ) << 32 ) | - static_cast( operator()( static_cast( x >> 32 )) ); + return ( static_cast( operator()( static_cast( x ))) << 32 ) | + static_cast( operator()( static_cast( x >> 32 ))); } }; @@ -117,43 +117,43 @@ namespace cds { namespace algo { // for 32bit architecture static uint32_t muldiv32( uint32_t x ) { - return static_cast( muldiv32_byte( static_cast( x >> 24 )) ) - | ( static_cast( muldiv32_byte( static_cast( x >> 16 )) ) << 8 ) - | ( static_cast( muldiv32_byte( static_cast( x >> 8 )) ) << 16 ) - | ( static_cast( muldiv32_byte( static_cast( x )) ) << 24 ); + return static_cast( muldiv32_byte( static_cast( x >> 24 ))) + | ( static_cast( muldiv32_byte( static_cast( x >> 16 ))) << 8 ) + | ( static_cast( muldiv32_byte( static_cast( x >> 8 ))) << 16 ) + | ( static_cast( muldiv32_byte( static_cast( x ))) << 24 ); } static uint64_t muldiv32( uint64_t x ) { - return static_cast( muldiv32_byte( static_cast( x >> 56 )) ) - | ( static_cast( muldiv32_byte( static_cast( x >> 48 )) ) << 8 ) - | ( static_cast( muldiv32_byte( static_cast( x >> 40 )) ) << 16 ) - | ( static_cast( muldiv32_byte( static_cast( x >> 32 )) ) << 24 ) - | ( static_cast( muldiv32_byte( static_cast( x >> 24 )) ) << 32 ) - | ( static_cast( muldiv32_byte( static_cast( x >> 16 )) ) << 40 ) - | ( static_cast( muldiv32_byte( static_cast( x >> 8 )) ) << 48 ) - | ( static_cast( muldiv32_byte( static_cast( x )) ) << 56 ); + return static_cast( muldiv32_byte( static_cast( x >> 56 ))) + | ( static_cast( muldiv32_byte( static_cast( x >> 48 ))) << 8 ) + | ( static_cast( muldiv32_byte( static_cast( x >> 40 ))) << 16 ) + | ( static_cast( muldiv32_byte( static_cast( x >> 32 ))) << 24 ) + | ( static_cast( muldiv32_byte( static_cast( x >> 24 ))) << 32 ) + | ( static_cast( muldiv32_byte( static_cast( x >> 16 ))) << 40 ) + | ( static_cast( muldiv32_byte( static_cast( x >> 8 ))) << 48 ) + | ( static_cast( muldiv32_byte( static_cast( x ))) << 56 ); } /// for 64bit architectire static uint32_t muldiv64( uint32_t x ) { - return static_cast( muldiv64_byte( static_cast( x >> 24 )) ) - | ( static_cast( muldiv64_byte( static_cast( x >> 16 )) ) << 8 ) - | ( static_cast( muldiv64_byte( static_cast( x >> 8 )) ) << 16 ) - | ( static_cast( muldiv64_byte( static_cast( x )) ) << 24 ); + return static_cast( muldiv64_byte( static_cast( x >> 24 ))) + | ( static_cast( muldiv64_byte( static_cast( x >> 16 ))) << 8 ) + | ( static_cast( muldiv64_byte( static_cast( x >> 8 ))) << 16 ) + | ( static_cast( muldiv64_byte( static_cast( x ))) << 24 ); } static uint64_t muldiv64( uint64_t x ) { - return static_cast( muldiv64_byte( static_cast( x >> 56 )) ) - | ( static_cast( muldiv64_byte( static_cast( x >> 48 )) ) << 8 ) - | ( static_cast( muldiv64_byte( static_cast( x >> 40 )) ) << 16 ) - | ( static_cast( muldiv64_byte( static_cast( x >> 32 )) ) << 24 ) - | ( static_cast( muldiv64_byte( static_cast( x >> 24 )) ) << 32 ) - | ( static_cast( muldiv64_byte( static_cast( x >> 16 )) ) << 40 ) - | ( static_cast( muldiv64_byte( static_cast( x >> 8 )) ) << 48 ) - | ( static_cast( muldiv64_byte( static_cast( x )) ) << 56 ); + return static_cast( muldiv64_byte( static_cast( x >> 56 ))) + | ( static_cast( muldiv64_byte( static_cast( x >> 48 ))) << 8 ) + | ( static_cast( muldiv64_byte( static_cast( x >> 40 ))) << 16 ) + | ( static_cast( muldiv64_byte( static_cast( x >> 32 ))) << 24 ) + | ( static_cast( muldiv64_byte( static_cast( x >> 24 ))) << 32 ) + | ( static_cast( muldiv64_byte( static_cast( x >> 16 ))) << 40 ) + | ( static_cast( muldiv64_byte( static_cast( x >> 8 ))) << 48 ) + | ( static_cast( muldiv64_byte( static_cast( x ))) << 56 ); } //@endcond