This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ fn main() {
84
84
assert_eq ! ( houndred_i128 as f64 , 100.0 ) ;
85
85
assert_eq ! ( houndred_f32 as i128 , 100 ) ;
86
86
assert_eq ! ( houndred_f64 as i128 , 100 ) ;
87
+ assert_eq ! ( 1u128 . rotate_left( 2 ) , 4 ) ;
87
88
88
89
// Test signed 128bit comparing
89
90
let max = usize:: MAX as i128 ;
Original file line number Diff line number Diff line change @@ -632,11 +632,21 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
632
632
} ;
633
633
rotate_left, <T >( v x, v y) {
634
634
let layout = fx. layout_of( T ) ;
635
+ let y = if fx. bcx. func. dfg. value_type( y) == types:: I128 {
636
+ fx. bcx. ins( ) . ireduce( types:: I64 , y)
637
+ } else {
638
+ y
639
+ } ;
635
640
let res = fx. bcx. ins( ) . rotl( x, y) ;
636
641
ret. write_cvalue( fx, CValue :: by_val( res, layout) ) ;
637
642
} ;
638
643
rotate_right, <T >( v x, v y) {
639
644
let layout = fx. layout_of( T ) ;
645
+ let y = if fx. bcx. func. dfg. value_type( y) == types:: I128 {
646
+ fx. bcx. ins( ) . ireduce( types:: I64 , y)
647
+ } else {
648
+ y
649
+ } ;
640
650
let res = fx. bcx. ins( ) . rotr( x, y) ;
641
651
ret. write_cvalue( fx, CValue :: by_val( res, layout) ) ;
642
652
} ;
You can’t perform that action at this time.
0 commit comments