Skip to content

Commit bb933d2

Browse files
committed
Fix abi for checked multiplication
1 parent 4991d08 commit bb933d2

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

example/std_example.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ fn main() {
5858
assert_eq!(0b0000000000000000000000000010000000000000000000000000000000000000_0000000000000000000000000000000000001000000000000000000010000000u128.trailing_zeros(), 7);
5959
assert_eq!(core::intrinsics::saturating_sub(0, -170141183460469231731687303715884105728i128), 170141183460469231731687303715884105727i128);
6060

61+
std::hint::black_box(std::hint::black_box(7571400400375753350092698930310845914i128) * 10);
6162
assert!(0i128.checked_div(2i128).is_some());
6263
assert!(0u128.checked_div(2u128).is_some());
6364
assert_eq!(1u128 + 2, 3);

src/codegen_i128.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub(crate) fn maybe_codegen<'tcx>(
4646
let lhs = lhs.load_scalar(fx);
4747
let rhs = rhs.load_scalar(fx);
4848
let oflow_ptr = oflow.to_ptr().get_addr(fx);
49-
let res = fx.lib_call(
49+
let res = fx.lib_call_unadjusted(
5050
"__muloti4",
5151
vec![
5252
AbiParam::new(types::I128),

src/compiler_builtins.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ builtin_functions! {
3939

4040
// integers
4141
fn __multi3(a: i128, b: i128) -> i128;
42+
fn __muloti4(n: i128, d: i128, oflow: &mut i32) -> i128;
4243
fn __udivti3(n: u128, d: u128) -> u128;
4344
fn __divti3(n: i128, d: i128) -> i128;
4445
fn __umodti3(n: u128, d: u128) -> u128;

0 commit comments

Comments
 (0)