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() {
8484 assert_eq ! ( houndred_i128 as f64 , 100.0 ) ;
8585 assert_eq ! ( houndred_f32 as i128 , 100 ) ;
8686 assert_eq ! ( houndred_f64 as i128 , 100 ) ;
87+ assert_eq ! ( 1u128 . rotate_left( 2 ) , 4 ) ;
8788
8889 // Test signed 128bit comparing
8990 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>(
632632 } ;
633633 rotate_left, <T >( v x, v y) {
634634 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+ } ;
635640 let res = fx. bcx. ins( ) . rotl( x, y) ;
636641 ret. write_cvalue( fx, CValue :: by_val( res, layout) ) ;
637642 } ;
638643 rotate_right, <T >( v x, v y) {
639644 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+ } ;
640650 let res = fx. bcx. ins( ) . rotr( x, y) ;
641651 ret. write_cvalue( fx, CValue :: by_val( res, layout) ) ;
642652 } ;
You can’t perform that action at this time.
0 commit comments