about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2024-12-15 11:03:37 +0000
committerTrevor Gross <tmgross@umich.edu>2025-01-15 03:49:39 +0000
commita911da13ddbfbe8cc9c7dec367cba715b6fb7f87 (patch)
tree800a202f697c010750d2000e7d77947c81a3f5a7 /compiler/rustc_codegen_gcc/src/intrinsic/mod.rs
parentdd333ca66f20edafdda2d9f405ffa1acdc958821 (diff)
downloadrust-a911da13ddbfbe8cc9c7dec367cba715b6fb7f87.tar.gz
rust-a911da13ddbfbe8cc9c7dec367cba715b6fb7f87.zip
Use a C-safe return type for `__rust_[ui]128_*` overflowing intrinsics
Combined with [1], this will change the overflowing multiplication
operations to return an `extern "C"`-safe type.

Link: https://github.com/rust-lang/compiler-builtins/pull/735 [1]
Diffstat (limited to 'compiler/rustc_codegen_gcc/src/intrinsic/mod.rs')
-rw-r--r--compiler/rustc_codegen_gcc/src/intrinsic/mod.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs b/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs
index 42d189d1b7d..48606f5f91c 100644
--- a/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs
+++ b/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs
@@ -1001,7 +1001,8 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
                     128 => "__rust_i128_addo",
                     _ => unreachable!(),
                 };
-                let (int_result, overflow) = self.operation_with_overflow(func_name, lhs, rhs);
+                let (int_result, overflow) =
+                    self.operation_with_overflow(func_name, lhs, rhs, width);
                 self.llbb().add_assignment(self.location, res, int_result);
                 overflow
             };
@@ -1071,7 +1072,8 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
                     128 => "__rust_i128_subo",
                     _ => unreachable!(),
                 };
-                let (int_result, overflow) = self.operation_with_overflow(func_name, lhs, rhs);
+                let (int_result, overflow) =
+                    self.operation_with_overflow(func_name, lhs, rhs, width);
                 self.llbb().add_assignment(self.location, res, int_result);
                 overflow
             };