about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2016-12-22 12:06:30 +0100
committerest31 <MTest31@outlook.com>2016-12-30 15:17:30 +0100
commitee6256b1ffd213d1e07390e4d66f57e6e463020f (patch)
tree4149f24c5672bfa6daf05402744366adbbda51c2 /src
parent9842d27e9cbb95fc3472cf17a2696d864acf0a8c (diff)
downloadrust-ee6256b1ffd213d1e07390e4d66f57e6e463020f.tar.gz
rust-ee6256b1ffd213d1e07390e4d66f57e6e463020f.zip
More windows fixes
Diffstat (limited to 'src')
-rw-r--r--src/libcompiler_builtins/lib.rs22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/libcompiler_builtins/lib.rs b/src/libcompiler_builtins/lib.rs
index 40ac32875e6..1c625ea9855 100644
--- a/src/libcompiler_builtins/lib.rs
+++ b/src/libcompiler_builtins/lib.rs
@@ -378,13 +378,13 @@ pub mod reimpls {
                 if b != 0 && b != 1 {
                     *overflow = 1;
                 }
-                return result.to_ret();
+                return result;
             }
             if b == <$ty>::min_value() {
                 if a != 0 && a != 1 {
                     *overflow = 1;
                 }
-                return result.to_ret();
+                return result;
             }
 
             let sa = a.signum();
@@ -392,7 +392,7 @@ pub mod reimpls {
             let sb = b.signum();
             let abs_b = b.iabs();
             if abs_a < 2 || abs_b < 2 {
-                return result.to_ret();
+                return result;
             }
             unsafe {
             if sa == sb {
@@ -405,13 +405,14 @@ pub mod reimpls {
                 }
             }
             }
-            result.to_ret()
+            result
         }}
     }
 
     // FIXME: i32 here should be c_int.
-    #[export_name="__muloti4"]
-    pub extern "C" fn i128_mul_oflow(a: i128_, b: i128_, o: &mut i32) -> i128ret {
+    #[cfg_attr(not(all(windows, target_pointer_width="64", not(stage0))),
+               export_name="__muloti4")]
+    pub extern "C" fn i128_mul_oflow(a: i128_, b: i128_, o: &mut i32) -> i128 {
         mulo!(a, b, o, i128_)
     }
 
@@ -696,7 +697,14 @@ pub mod reimpls {
     #[cfg(all(windows, target_pointer_width="64"))]
     mod windows_64_workarounds {
         use super::{i128_, u128_, LargeInt};
-        use super::{i128_as_f64, i128_as_f32, u128_as_f64, u128_as_f32};
+        use super::{i128_as_f64, i128_as_f32, u128_as_f64, u128_as_f32, i128_mul_oflow};
+
+        #[export_name="__muloti4"]
+        pub extern "C" fn i128_mul_oflow_win(alow: u64, ahigh: i64,
+                                             blow: u64, bhigh: i64, o: &mut i32) -> i128 {
+            i128_mul_oflow(i128_::from_parts(alow, ahigh), i128_::from_parts(blow, bhigh), o)
+        }
+
         #[export_name="__floattidf"]
         pub extern "C" fn i128_as_f64_win(alow: u64, ahigh: i64) -> f64 {
             i128_as_f64(i128_::from_parts(alow, ahigh))