mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-10 02:56:52 +00:00
Stop implementing _with_overflow intrinsics in codegen backends.
This commit is contained in:
parent
39068eb1cc
commit
8996171e88
@ -493,20 +493,6 @@ fn codegen_regular_intrinsic_call<'tcx>(
|
||||
let res = crate::num::codegen_int_binop(fx, bin_op, x, y);
|
||||
ret.write_cvalue(fx, res);
|
||||
}
|
||||
sym::add_with_overflow | sym::sub_with_overflow | sym::mul_with_overflow => {
|
||||
intrinsic_args!(fx, args => (x, y); intrinsic);
|
||||
|
||||
assert_eq!(x.layout().ty, y.layout().ty);
|
||||
let bin_op = match intrinsic {
|
||||
sym::add_with_overflow => BinOp::Add,
|
||||
sym::sub_with_overflow => BinOp::Sub,
|
||||
sym::mul_with_overflow => BinOp::Mul,
|
||||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
let res = crate::num::codegen_checked_int_binop(fx, bin_op, x, y);
|
||||
ret.write_cvalue(fx, res);
|
||||
}
|
||||
sym::saturating_add | sym::saturating_sub => {
|
||||
intrinsic_args!(fx, args => (lhs, rhs); intrinsic);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user