File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 6
6
7
7
// CHECK-LABEL: @u32_index
8
8
#[ no_mangle]
9
- pub fn u32_index ( c : u32 ) -> [ bool ; 21 ] {
10
- let mut array = [ false ; 21 ] ;
9
+ pub fn u32_index ( c : u32 ) -> [ bool ; 22 ] {
10
+ let mut array = [ false ; 22 ] ;
11
11
12
- let index = c . ilog2 ( ) ;
12
+ let index = 32 - c . leading_zeros ( ) ;
13
13
14
14
// CHECK: call core::panicking::panic
15
15
array[ index as usize ] = true ;
@@ -19,14 +19,14 @@ pub fn u32_index(c: u32) -> [bool; 21] {
19
19
20
20
// CHECK-LABEL: @char_as_u32_index
21
21
#[ no_mangle]
22
- pub fn char_as_u32_index ( c : char ) -> [ bool ; 21 ] {
22
+ pub fn char_as_u32_index ( c : char ) -> [ bool ; 22 ] {
23
23
// CHECK: %[[B:.+]] = icmp ult i32 %c, 1114112
24
24
// CHECK: call void @llvm.assume(i1 %[[B]])
25
25
let c = c as u32 ;
26
26
27
- let mut array = [ false ; 21 ] ;
27
+ let mut array = [ false ; 22 ] ;
28
28
29
- let index = c . ilog2 ( ) ;
29
+ let index = 32 - c . leading_zeros ( ) ;
30
30
31
31
// CHECK-NOT: call core::panicking::panic
32
32
array[ index as usize ] = true ;
You can’t perform that action at this time.
0 commit comments