File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 66
77// CHECK-LABEL: @u32_index
88#[ 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 ] ;
1111
12- let index = c . ilog2 ( ) ;
12+ let index = 32 - c . leading_zeros ( ) ;
1313
1414 // CHECK: call core::panicking::panic
1515 array[ index as usize ] = true ;
@@ -19,14 +19,14 @@ pub fn u32_index(c: u32) -> [bool; 21] {
1919
2020// CHECK-LABEL: @char_as_u32_index
2121#[ no_mangle]
22- pub fn char_as_u32_index ( c : char ) -> [ bool ; 21 ] {
22+ pub fn char_as_u32_index ( c : char ) -> [ bool ; 22 ] {
2323 // CHECK: %[[B:.+]] = icmp ult i32 %c, 1114112
2424 // CHECK: call void @llvm.assume(i1 %[[B]])
2525 let c = c as u32 ;
2626
27- let mut array = [ false ; 21 ] ;
27+ let mut array = [ false ; 22 ] ;
2828
29- let index = c . ilog2 ( ) ;
29+ let index = 32 - c . leading_zeros ( ) ;
3030
3131 // CHECK-NOT: call core::panicking::panic
3232 array[ index as usize ] = true ;
You can’t perform that action at this time.
0 commit comments