Skip to content

Commit 2776bdf

Browse files
committedJan 15, 2025
Auto merge of #135525 - jhpratt:rollup-4gu2wpm, r=jhpratt
Rollup of 7 pull requests Successful merges: - #132397 (Make missing_abi lint warn-by-default.) - #133807 (ci: Enable opt-dist for dist-aarch64-linux builds) - #134143 (Convert `struct FromBytesWithNulError` into enum) - #134338 (Use a C-safe return type for `__rust_[ui]128_*` overflowing intrinsics) - #134678 (Update `ReadDir::next` in `std::sys::pal::unix::fs` to use `&raw const (*p).field` instead of `p.byte_offset().cast()`) - #135424 (Detect unstable lint docs that dont enable their feature) - #135520 (Make sure we actually use the right trivial lifetime substs when eagerly monomorphizing drop for ADTs) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 00ded39 + 8e91327 commit 2776bdf

File tree

81 files changed

+431
-317
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+431
-317
lines changed
 

‎compiler/rustc_codegen_cranelift/patches/0029-stdlib-Disable-f16-and-f128-in-compiler-builtins.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ index 7165c3e48af..968552ad435 100644
1616

1717
[dependencies]
1818
core = { path = "../core" }
19-
-compiler_builtins = { version = "=0.1.141", features = ['rustc-dep-of-std'] }
20-
+compiler_builtins = { version = "=0.1.141", features = ['rustc-dep-of-std', 'no-f16-f128'] }
19+
-compiler_builtins = { version = "=0.1.143", features = ['rustc-dep-of-std'] }
20+
+compiler_builtins = { version = "=0.1.143", features = ['rustc-dep-of-std', 'no-f16-f128'] }
2121

2222
[dev-dependencies]
2323
rand = { version = "0.8.5", default-features = false, features = ["alloc"] }

‎compiler/rustc_codegen_cranelift/src/codegen_i128.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,22 @@ pub(crate) fn maybe_codegen_mul_checked<'tcx>(
7676
}
7777

7878
let is_signed = type_sign(lhs.layout().ty);
79-
80-
let out_ty = Ty::new_tup(fx.tcx, &[lhs.layout().ty, fx.tcx.types.bool]);
81-
let out_place = CPlace::new_stack_slot(fx, fx.layout_of(out_ty));
79+
let oflow_out_place = CPlace::new_stack_slot(fx, fx.layout_of(fx.tcx.types.i32));
8280
let param_types = vec![
83-
AbiParam::special(fx.pointer_type, ArgumentPurpose::StructReturn),
8481
AbiParam::new(types::I128),
8582
AbiParam::new(types::I128),
83+
AbiParam::special(fx.pointer_type, ArgumentPurpose::Normal),
8684
];
87-
let args = [out_place.to_ptr().get_addr(fx), lhs.load_scalar(fx), rhs.load_scalar(fx)];
88-
fx.lib_call(
85+
let args = [lhs.load_scalar(fx), rhs.load_scalar(fx), oflow_out_place.to_ptr().get_addr(fx)];
86+
let ret = fx.lib_call(
8987
if is_signed { "__rust_i128_mulo" } else { "__rust_u128_mulo" },
9088
param_types,
91-
vec![],
89+
vec![AbiParam::new(types::I128)],
9290
&args,
9391
);
94-
Some(out_place.to_cvalue(fx))
92+
let mul = ret[0];
93+
let oflow = oflow_out_place.to_cvalue(fx).load_scalar(fx);
94+
let oflow = clif_intcast(fx, oflow, types::I8, false);
95+
let layout = fx.layout_of(Ty::new_tup(fx.tcx, &[lhs.layout().ty, fx.tcx.types.bool]));
96+
Some(CValue::by_val_pair(mul, oflow, layout))
9597
}

0 commit comments

Comments
 (0)