parent
944308089f
commit
6d6c574289
@ -84,6 +84,7 @@ fn main() {
|
||||
assert_eq!(houndred_i128 as f64, 100.0);
|
||||
assert_eq!(houndred_f32 as i128, 100);
|
||||
assert_eq!(houndred_f64 as i128, 100);
|
||||
assert_eq!(1u128.rotate_left(2), 4);
|
||||
|
||||
// Test signed 128bit comparing
|
||||
let max = usize::MAX as i128;
|
||||
|
@ -632,11 +632,21 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
|
||||
};
|
||||
rotate_left, <T>(v x, v y) {
|
||||
let layout = fx.layout_of(T);
|
||||
let y = if fx.bcx.func.dfg.value_type(y) == types::I128 {
|
||||
fx.bcx.ins().ireduce(types::I64, y)
|
||||
} else {
|
||||
y
|
||||
};
|
||||
let res = fx.bcx.ins().rotl(x, y);
|
||||
ret.write_cvalue(fx, CValue::by_val(res, layout));
|
||||
};
|
||||
rotate_right, <T>(v x, v y) {
|
||||
let layout = fx.layout_of(T);
|
||||
let y = if fx.bcx.func.dfg.value_type(y) == types::I128 {
|
||||
fx.bcx.ins().ireduce(types::I64, y)
|
||||
} else {
|
||||
y
|
||||
};
|
||||
let res = fx.bcx.ins().rotr(x, y);
|
||||
ret.write_cvalue(fx, CValue::by_val(res, layout));
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user