Skip to content

Commit 745ad0f

Browse files
committed
Remove unused __rust_* shift intrinsics
They are rust specific and used by neither cg_llvm nor cg_clif
1 parent e6fd1b2 commit 745ad0f

File tree

2 files changed

+1
-40
lines changed

2 files changed

+1
-40
lines changed

src/int/shift.rs

-16
Original file line numberDiff line numberDiff line change
@@ -113,20 +113,4 @@ intrinsics! {
113113
pub extern "C" fn __lshrti3(a: u128, b: u32) -> u128 {
114114
a.lshr(b)
115115
}
116-
117-
pub extern "C" fn __rust_i128_shlo(a: i128, b: u128) -> (i128, bool) {
118-
(__ashlti3(a as _, b as _) as _, b >= 128)
119-
}
120-
121-
pub extern "C" fn __rust_u128_shlo(a: u128, b: u128) -> (u128, bool) {
122-
(__ashlti3(a, b as _), b >= 128)
123-
}
124-
125-
pub extern "C" fn __rust_i128_shro(a: i128, b: u128) -> (i128, bool) {
126-
(__ashrti3(a, b as _), b >= 128)
127-
}
128-
129-
pub extern "C" fn __rust_u128_shro(a: u128, b: u128) -> (u128, bool) {
130-
(__lshrti3(a, b as _), b >= 128)
131-
}
132116
}

testcrate/tests/shift.rs

+1-24
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,11 @@ macro_rules! shift {
1717
};
1818
}
1919

20-
macro_rules! overflowing_shift {
21-
($($i:ty, $fn_std:ident, $fn_builtins:ident);*;) => {
22-
$(
23-
fuzz_shift(|x: $i, s: u32| {
24-
let tmp0: $i = x.$fn_std(s);
25-
let (tmp1, o1): ($i, bool) = $fn_builtins(x, s.into());
26-
if tmp0 != tmp1 || o1 {
27-
panic!(
28-
"{}({}, {}): std: {}, builtins: {}",
29-
stringify!($fn_builtins), x, s, tmp0, tmp1
30-
);
31-
}
32-
});
33-
)*
34-
};
35-
}
36-
3720
#[test]
3821
fn shift() {
3922
use compiler_builtins::int::shift::{
4023
__ashldi3, __ashlsi3, __ashlti3, __ashrdi3, __ashrsi3, __ashrti3, __lshrdi3, __lshrsi3,
41-
__lshrti3, __rust_i128_shlo, __rust_i128_shro, __rust_u128_shlo, __rust_u128_shro,
24+
__lshrti3,
4225
};
4326
shift!(
4427
u32, wrapping_shl, __ashlsi3;
@@ -51,10 +34,4 @@ fn shift() {
5134
u64, wrapping_shr, __lshrdi3;
5235
u128, wrapping_shr, __lshrti3;
5336
);
54-
overflowing_shift!(
55-
u128, wrapping_shl, __rust_u128_shlo;
56-
i128, wrapping_shl, __rust_i128_shlo;
57-
u128, wrapping_shr, __rust_u128_shro;
58-
i128, wrapping_shr, __rust_i128_shro;
59-
);
6037
}

0 commit comments

Comments
 (0)