Skip to content

Commit 3723a26

Browse files
author
Jorge Aparicio
authored
Merge pull request #10 from Amanieu/unused_builtins
Remove builtins that are not called by LLVM
2 parents 255cde5 + a147763 commit 3723a26

File tree

2 files changed

+72
-83
lines changed

2 files changed

+72
-83
lines changed

README.md

+72-69
Original file line numberDiff line numberDiff line change
@@ -26,34 +26,16 @@ See [rust-lang/rust#35437][0].
2626

2727
## Progress
2828

29-
- [ ] absvdi2.c
30-
- [ ] absvsi2.c
31-
- [ ] absvti2.c
3229
- [ ] adddf3.c
3330
- [ ] addsf3.c
34-
- [ ] addvdi3.c
35-
- [ ] addvsi3.c
36-
- [ ] addvti3.c
3731
- [ ] arm/adddf3vfp.S
3832
- [ ] arm/addsf3vfp.S
39-
- [ ] arm/aeabi_cdcmp.S
40-
- [ ] arm/aeabi_cdcmpeq_check_nan.c
41-
- [ ] arm/aeabi_cfcmp.S
42-
- [ ] arm/aeabi_cfcmpeq_check_nan.c
4333
- [ ] arm/aeabi_dcmp.S
44-
- [ ] arm/aeabi_div0.c
45-
- [ ] arm/aeabi_drsub.c
4634
- [ ] arm/aeabi_fcmp.S
47-
- [ ] arm/aeabi_frsub.c
4835
- [ ] arm/aeabi_idivmod.S
4936
- [ ] arm/aeabi_ldivmod.S
5037
- [ ] arm/aeabi_uidivmod.S
5138
- [ ] arm/aeabi_uldivmod.S
52-
- [ ] arm/bswapdi2.S
53-
- [ ] arm/bswapsi2.S
54-
- [ ] arm/clzdi2.S
55-
- [ ] arm/clzsi2.S
56-
- [ ] arm/comparesf2.S
5739
- [ ] arm/divdf3vfp.S
5840
- [ ] arm/divmodsi4.S
5941
- [ ] arm/divsf3vfp.S
@@ -84,15 +66,9 @@ See [rust-lang/rust#35437][0].
8466
- [ ] arm/negdf2vfp.S
8567
- [ ] arm/negsf2vfp.S
8668
- [ ] arm/nesf2vfp.S
87-
- [ ] arm/restore_vfp_d8_d15_regs.S
88-
- [ ] arm/save_vfp_d8_d15_regs.S
8969
- [ ] arm/softfloat-alias.list
9070
- [ ] arm/subdf3vfp.S
9171
- [ ] arm/subsf3vfp.S
92-
- [ ] arm/switch16.S
93-
- [ ] arm/switch32.S
94-
- [ ] arm/switch8.S
95-
- [ ] arm/switchu8.S
9672
- [ ] arm/truncdfsf2vfp.S
9773
- [ ] arm/udivmodsi4.S
9874
- [ ] arm/udivsi3.S
@@ -103,27 +79,13 @@ See [rust-lang/rust#35437][0].
10379
- [ ] ashlti3.c
10480
- [ ] ashrdi3.c
10581
- [ ] ashrti3.c
106-
- [ ] clzdi2.c
107-
- [ ] clzsi2.c
108-
- [ ] clzti2.c
109-
- [ ] cmpdi2.c
110-
- [ ] cmpti2.c
111-
- [ ] comparedf2.c
112-
- [ ] comparesf2.c
113-
- [ ] ctzdi2.c
114-
- [ ] ctzsi2.c
115-
- [ ] ctzti2.c
11682
- [ ] divdf3.c
11783
- [ ] divdi3.c
118-
- [ ] divmoddi4.c
119-
- [ ] divmodsi4.c
12084
- [ ] divsf3.c
12185
- [ ] divsi3.c
12286
- [ ] divti3.c
12387
- [ ] extendhfsf2.c
12488
- [ ] extendsfdf2.c
125-
- [ ] ffsdi2.c
126-
- [ ] ffsti2.c
12789
- [ ] fixdfdi.c
12890
- [ ] fixdfsi.c
12991
- [ ] fixdfti.c
@@ -174,44 +136,14 @@ See [rust-lang/rust#35437][0].
174136
- [ ] muloti4.c
175137
- [ ] mulsf3.c
176138
- [ ] multi3.c
177-
- [ ] mulvdi3.c
178-
- [ ] mulvsi3.c
179-
- [ ] mulvti3.c
180-
- [ ] negdf2.c
181-
- [ ] negdi2.c
182-
- [ ] negsf2.c
183-
- [ ] negti2.c
184-
- [ ] negvdi2.c
185-
- [ ] negvsi2.c
186-
- [ ] negvti2.c
187-
- [ ] paritydi2.c
188-
- [ ] paritysi2.c
189-
- [ ] parityti2.c
190-
- [ ] popcountdi2.c
191-
- [ ] popcountsi2.c
192-
- [ ] popcountti2.c
193139
- [ ] powidf2.c
194140
- [ ] powisf2.c
195-
- [ ] ppc/gcc_qadd.c
196-
- [ ] ppc/gcc_qdiv.c
197-
- [ ] ppc/gcc_qmul.c
198-
- [ ] ppc/gcc_qsub.c
199-
- [ ] ppc/restFP.S
200-
- [ ] ppc/saveFP.S
201141
- [ ] subdf3.c
202142
- [ ] subsf3.c
203-
- [ ] subvdi3.c
204-
- [ ] subvsi3.c
205-
- [ ] subvti3.c
206143
- [ ] truncdfhf2.c
207144
- [ ] truncdfsf2.c
208145
- [ ] truncsfhf2.c
209-
- [ ] ucmpdi2.c
210-
- [ ] ucmpti2.c
211146
- [ ] udivdi3.c
212-
- [ ] udivmoddi4.c
213-
- [ ] udivmodsi4.c
214-
- [ ] udivmodti4.c
215147
- [ ] udivsi3.c
216148
- [ ] udivti3.c
217149
- [ ] umoddi3.c
@@ -221,7 +153,6 @@ See [rust-lang/rust#35437][0].
221153
- [ ] x86_64/chkstk2.S
222154
- [ ] x86_64/floatundidf.S
223155
- [ ] x86_64/floatundisf.S
224-
- [x] arm/aeabi_memcmp.S
225156
- [x] arm/aeabi_memcpy.S
226157
- [x] arm/aeabi_memmove.S
227158
- [x] arm/aeabi_memset.S
@@ -274,13 +205,85 @@ These builtins involve floating-point types ("`f128`", "`f80`" and complex numbe
274205
- ~~ppc/fixunstfdi.c~~
275206
- ~~ppc/floatditf.c~~
276207
- ~~ppc/floatunditf.c~~
208+
- ~~ppc/gcc_qadd.c~~
209+
- ~~ppc/gcc_qdiv.c~~
210+
- ~~ppc/gcc_qmul.c~~
211+
- ~~ppc/gcc_qsub.c~~
277212
- ~~ppc/multc3.c~~
278213
- ~~subtf3.c~~
279214
- ~~trunctfdf2.c~~
280215
- ~~trunctfsf2.c~~
281216
- ~~x86_64/floatdixf.c~~
282217
- ~~x86_64/floatundixf.S~~
283218

219+
These builtins are never called by LLVM.
220+
221+
- ~~absvdi2.c~~
222+
- ~~absvsi2.c~~
223+
- ~~absvti2.c~~
224+
- ~~addvdi3.c~~
225+
- ~~addvsi3.c~~
226+
- ~~addvti3.c~~
227+
- ~~arm/aeabi_cdcmp.S~~
228+
- ~~arm/aeabi_cdcmpeq_check_nan.c~~
229+
- ~~arm/aeabi_cfcmp.S~~
230+
- ~~arm/aeabi_cfcmpeq_check_nan.c~~
231+
- ~~arm/aeabi_div0.c~~
232+
- ~~arm/aeabi_drsub.c~~
233+
- ~~arm/aeabi_frsub.c~~
234+
- ~~arm/aeabi_memcmp.S~~
235+
- ~~arm/bswapdi2.S~~
236+
- ~~arm/bswapsi2.S~~
237+
- ~~arm/clzdi2.S~~
238+
- ~~arm/clzsi2.S~~
239+
- ~~arm/comparesf2.S~~
240+
- ~~arm/restore_vfp_d8_d15_regs.S~~
241+
- ~~arm/save_vfp_d8_d15_regs.S~~
242+
- ~~arm/switch16.S~~
243+
- ~~arm/switch32.S~~
244+
- ~~arm/switch8.S~~
245+
- ~~arm/switchu8.S~~
246+
- ~~clzdi2.c~~
247+
- ~~clzsi2.c~~
248+
- ~~clzti2.c~~
249+
- ~~cmpdi2.c~~
250+
- ~~cmpti2.c~~
251+
- ~~comparedf2.c~~
252+
- ~~comparesf2.c~~
253+
- ~~ctzdi2.c~~
254+
- ~~ctzsi2.c~~
255+
- ~~ctzti2.c~~
256+
- ~~divmoddi4.c~~
257+
- ~~divmodsi4.c~~
258+
- ~~ffsdi2.c~~
259+
- ~~ffsti2.c~~
260+
- ~~mulvdi3.c~~
261+
- ~~mulvsi3.c~~
262+
- ~~mulvti3.c~~
263+
- ~~negdf2.c~~
264+
- ~~negdi2.c~~
265+
- ~~negsf2.c~~
266+
- ~~negti2.c~~
267+
- ~~negvdi2.c~~
268+
- ~~negvsi2.c~~
269+
- ~~negvti2.c~~
270+
- ~~paritydi2.c~~
271+
- ~~paritysi2.c~~
272+
- ~~parityti2.c~~
273+
- ~~popcountdi2.c~~
274+
- ~~popcountsi2.c~~
275+
- ~~popcountti2.c~~
276+
- ~~ppc/restFP.S~~
277+
- ~~ppc/saveFP.S~~
278+
- ~~subvdi3.c~~
279+
- ~~subvsi3.c~~
280+
- ~~subvti3.c~~
281+
- ~~ucmpdi2.c~~
282+
- ~~ucmpti2.c~~
283+
- ~~udivmoddi4.c~~
284+
- ~~udivmodsi4.c~~
285+
- ~~udivmodti4.c~~
286+
284287
Rust only exposes atomic types on platforms that support them, and therefore does not need to fall back to software implementations.
285288

286289
- ~~arm/sync_fetch_and_add_4.S~~

src/arm.rs

-14
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
11
extern "C" {
2-
fn memcmp(s1: *const u8, s2: *const u8, n: usize) -> i32;
32
fn memcpy(dest: *mut u8, src: *const u8, n: usize) -> *mut u8;
43
fn memmove(dest: *mut u8, src: *const u8, n: usize) -> *mut u8;
54
fn memset(dest: *mut u8, c: i32, n: usize) -> *mut u8;
65
}
76

87
// FIXME: The `*4` and `*8` variants should be defined as aliases.
98

10-
#[no_mangle]
11-
pub unsafe extern "aapcs" fn __aeabi_memcmp(s1: *const u8, s2: *const u8, n: usize) -> i32 {
12-
memcmp(s1, s2, n)
13-
}
14-
#[no_mangle]
15-
pub unsafe extern "aapcs" fn __aeabi_memcmp4(s1: *const u8, s2: *const u8, n: usize) -> i32 {
16-
memcmp(s1, s2, n)
17-
}
18-
#[no_mangle]
19-
pub unsafe extern "aapcs" fn __aeabi_memcmp8(s1: *const u8, s2: *const u8, n: usize) -> i32 {
20-
memcmp(s1, s2, n)
21-
}
22-
239
#[no_mangle]
2410
pub unsafe extern "aapcs" fn __aeabi_memcpy(dest: *mut u8, src: *const u8, n: usize) {
2511
memcpy(dest, src, n);

0 commit comments

Comments
 (0)