Implement float_to_int_unchecked intrinsic

This commit is contained in:
bjorn3 2020-05-10 18:17:58 +02:00
parent c674a32ab8
commit eb89a2c092

View File

@ -999,6 +999,16 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
}, x, y);
ret.write_cvalue(fx, res);
};
float_to_int_unchecked, (v f) {
let res = crate::cast::clif_int_or_float_cast(
fx,
f,
false,
fx.clif_type(ret.layout().ty).unwrap(),
type_sign(ret.layout().ty),
);
ret.write_cvalue(fx, CValue::by_val(res, ret.layout()));
};
}
if let Some((_, dest)) = destination {