@@ -27,12 +27,6 @@ mod inst {
27
27
#[ inline( always) ]
28
28
fn bits ( ) -> uint { 64 }
29
29
30
- // fallback if we don't have access to the current word size
31
- #[ cfg( not( target_word_size = "32" ) ,
32
- not( target_word_size = "64" ) ) ]
33
- #[ inline( always) ]
34
- fn bits ( ) -> uint { :: sys:: size_of :: < int > ( ) * 8 }
35
-
36
30
#[ inline( always) ]
37
31
fn bytes ( ) -> uint { Primitive :: bits :: < int > ( ) / 8 }
38
32
}
@@ -69,41 +63,6 @@ mod inst {
69
63
fn trailing_zeros ( & self ) -> int { ( * self as i32 ) . trailing_zeros ( ) as int }
70
64
}
71
65
72
- // fallback if we don't have access to the current word size
73
- #[ cfg( not( target_word_size = "32" ) ,
74
- not( target_word_size = "64" ) ) ]
75
- impl BitCount for int {
76
- /// Counts the number of bits set.
77
- #[ inline( always) ]
78
- fn population_count ( & self ) -> int {
79
- match :: sys:: size_of :: < int > ( ) {
80
- 8 => ( * self as i64 ) . population_count ( ) as int ,
81
- 4 => ( * self as i32 ) . population_count ( ) as int ,
82
- s => fail ! ( fmt!( "unsupported word size: %?" , s) ) ,
83
- }
84
- }
85
-
86
- /// Counts the number of leading zeros.
87
- #[ inline( always) ]
88
- fn leading_zeros ( & self ) -> int {
89
- match :: sys:: size_of :: < int > ( ) {
90
- 8 => ( * self as i64 ) . leading_zeros ( ) as int ,
91
- 4 => ( * self as i32 ) . leading_zeros ( ) as int ,
92
- s => fail ! ( fmt!( "unsupported word size: %?" , s) ) ,
93
- }
94
- }
95
-
96
- /// Counts the number of trailing zeros.
97
- #[ inline( always) ]
98
- fn trailing_zeros ( & self ) -> int {
99
- match :: sys:: size_of :: < int > ( ) {
100
- 8 => ( * self as i64 ) . trailing_zeros ( ) as int ,
101
- 4 => ( * self as i32 ) . trailing_zeros ( ) as int ,
102
- s => fail ! ( fmt!( "unsupported word size: %?" , s) ) ,
103
- }
104
- }
105
- }
106
-
107
66
/// Returns `base` raised to the power of `exponent`
108
67
pub fn pow ( base : int , exponent : uint ) -> int {
109
68
if exponent == 0 u {
0 commit comments