Last active
August 14, 2020 14:15
-
-
Save maxaudron/99938c42833a55865d06bfbf5eec1df8 to your computer and use it in GitHub Desktop.
patch -p1 in $HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git c/src/int/mod.rs w/src/int/mod.rs | |
index 8a469d9..128fdfd 100644 | |
--- c/src/int/mod.rs | |
+++ w/src/int/mod.rs | |
@@ -188,6 +188,7 @@ macro_rules! int_impl { | |
}; | |
} | |
+int_impl!(i16, u16, 16); | |
int_impl!(i32, u32, 32); | |
int_impl!(i64, u64, 64); | |
int_impl!(i128, u128, 128); | |
@@ -229,6 +230,8 @@ macro_rules! large_int { | |
}; | |
} | |
+large_int!(u32, u16, u16, 16); | |
+large_int!(i32, u16, i16, 16); | |
large_int!(u64, u32, u32, 32); | |
large_int!(i64, u32, i32, 32); | |
large_int!(u128, u64, u64, 64); | |
diff --git c/src/int/shift.rs w/src/int/shift.rs | |
index 408f8f3..521d02a 100644 | |
--- c/src/int/shift.rs | |
+++ w/src/int/shift.rs | |
@@ -20,6 +20,7 @@ trait Ashl: Int + LargeInt { | |
} | |
} | |
+impl Ashl for u32 {} | |
impl Ashl for u64 {} | |
impl Ashl for u128 {} | |
@@ -47,6 +48,7 @@ trait Ashr: Int + LargeInt { | |
} | |
} | |
+impl Ashr for i32 {} | |
impl Ashr for i64 {} | |
impl Ashr for i128 {} | |
@@ -70,10 +72,15 @@ trait Lshr: Int + LargeInt { | |
} | |
} | |
+impl Lshr for u32 {} | |
impl Lshr for u64 {} | |
impl Lshr for u128 {} | |
intrinsics! { | |
+ pub extern "C" fn __ashlsi3(a: u32, b: u32) -> u32 { | |
+ a.ashl(b) | |
+ } | |
+ | |
#[maybe_use_optimized_c_shim] | |
#[arm_aeabi_alias = __aeabi_llsl] | |
pub extern "C" fn __ashldi3(a: u64, b: u32) -> u64 { | |
@@ -84,6 +91,10 @@ intrinsics! { | |
a.ashl(b) | |
} | |
+ pub extern "C" fn __ashrsi3(a: i32, b: u32) -> i32 { | |
+ a.ashr(b) | |
+ } | |
+ | |
#[maybe_use_optimized_c_shim] | |
#[arm_aeabi_alias = __aeabi_lasr] | |
pub extern "C" fn __ashrdi3(a: i64, b: u32) -> i64 { | |
@@ -94,6 +105,10 @@ intrinsics! { | |
a.ashr(b) | |
} | |
+ pub extern "C" fn __lshrsi3(a: u32, b: u32) -> u32 { | |
+ a.lshr(b) | |
+ } | |
+ | |
#[maybe_use_optimized_c_shim] | |
#[arm_aeabi_alias = __aeabi_llsr] | |
pub extern "C" fn __lshrdi3(a: u64, b: u32) -> u64 { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment