浏览代码

Merge pull request #10 from Amanieu/unused_builtins

Remove builtins that are not called by LLVM
Jorge Aparicio 8 年之前
父节点
当前提交
3723a269b1
共有 2 个文件被更改,包括 72 次插入83 次删除
  1. 72 69
      README.md
  2. 0 14
      src/arm.rs

+ 72 - 69
README.md

@@ -26,34 +26,16 @@ See [rust-lang/rust#35437][0].
 
 
 ## Progress
 ## Progress
 
 
-- [ ] absvdi2.c
-- [ ] absvsi2.c
-- [ ] absvti2.c
 - [ ] adddf3.c
 - [ ] adddf3.c
 - [ ] addsf3.c
 - [ ] addsf3.c
-- [ ] addvdi3.c
-- [ ] addvsi3.c
-- [ ] addvti3.c
 - [ ] arm/adddf3vfp.S
 - [ ] arm/adddf3vfp.S
 - [ ] arm/addsf3vfp.S
 - [ ] arm/addsf3vfp.S
-- [ ] arm/aeabi_cdcmp.S
-- [ ] arm/aeabi_cdcmpeq_check_nan.c
-- [ ] arm/aeabi_cfcmp.S
-- [ ] arm/aeabi_cfcmpeq_check_nan.c
 - [ ] arm/aeabi_dcmp.S
 - [ ] arm/aeabi_dcmp.S
-- [ ] arm/aeabi_div0.c
-- [ ] arm/aeabi_drsub.c
 - [ ] arm/aeabi_fcmp.S
 - [ ] arm/aeabi_fcmp.S
-- [ ] arm/aeabi_frsub.c
 - [ ] arm/aeabi_idivmod.S
 - [ ] arm/aeabi_idivmod.S
 - [ ] arm/aeabi_ldivmod.S
 - [ ] arm/aeabi_ldivmod.S
 - [ ] arm/aeabi_uidivmod.S
 - [ ] arm/aeabi_uidivmod.S
 - [ ] arm/aeabi_uldivmod.S
 - [ ] arm/aeabi_uldivmod.S
-- [ ] arm/bswapdi2.S
-- [ ] arm/bswapsi2.S
-- [ ] arm/clzdi2.S
-- [ ] arm/clzsi2.S
-- [ ] arm/comparesf2.S
 - [ ] arm/divdf3vfp.S
 - [ ] arm/divdf3vfp.S
 - [ ] arm/divmodsi4.S
 - [ ] arm/divmodsi4.S
 - [ ] arm/divsf3vfp.S
 - [ ] arm/divsf3vfp.S
@@ -84,15 +66,9 @@ See [rust-lang/rust#35437][0].
 - [ ] arm/negdf2vfp.S
 - [ ] arm/negdf2vfp.S
 - [ ] arm/negsf2vfp.S
 - [ ] arm/negsf2vfp.S
 - [ ] arm/nesf2vfp.S
 - [ ] arm/nesf2vfp.S
-- [ ] arm/restore_vfp_d8_d15_regs.S
-- [ ] arm/save_vfp_d8_d15_regs.S
 - [ ] arm/softfloat-alias.list
 - [ ] arm/softfloat-alias.list
 - [ ] arm/subdf3vfp.S
 - [ ] arm/subdf3vfp.S
 - [ ] arm/subsf3vfp.S
 - [ ] arm/subsf3vfp.S
-- [ ] arm/switch16.S
-- [ ] arm/switch32.S
-- [ ] arm/switch8.S
-- [ ] arm/switchu8.S
 - [ ] arm/truncdfsf2vfp.S
 - [ ] arm/truncdfsf2vfp.S
 - [ ] arm/udivmodsi4.S
 - [ ] arm/udivmodsi4.S
 - [ ] arm/udivsi3.S
 - [ ] arm/udivsi3.S
@@ -103,27 +79,13 @@ See [rust-lang/rust#35437][0].
 - [ ] ashlti3.c
 - [ ] ashlti3.c
 - [ ] ashrdi3.c
 - [ ] ashrdi3.c
 - [ ] ashrti3.c
 - [ ] ashrti3.c
-- [ ] clzdi2.c
-- [ ] clzsi2.c
-- [ ] clzti2.c
-- [ ] cmpdi2.c
-- [ ] cmpti2.c
-- [ ] comparedf2.c
-- [ ] comparesf2.c
-- [ ] ctzdi2.c
-- [ ] ctzsi2.c
-- [ ] ctzti2.c
 - [ ] divdf3.c
 - [ ] divdf3.c
 - [ ] divdi3.c
 - [ ] divdi3.c
-- [ ] divmoddi4.c
-- [ ] divmodsi4.c
 - [ ] divsf3.c
 - [ ] divsf3.c
 - [ ] divsi3.c
 - [ ] divsi3.c
 - [ ] divti3.c
 - [ ] divti3.c
 - [ ] extendhfsf2.c
 - [ ] extendhfsf2.c
 - [ ] extendsfdf2.c
 - [ ] extendsfdf2.c
-- [ ] ffsdi2.c
-- [ ] ffsti2.c
 - [ ] fixdfdi.c
 - [ ] fixdfdi.c
 - [ ] fixdfsi.c
 - [ ] fixdfsi.c
 - [ ] fixdfti.c
 - [ ] fixdfti.c
@@ -174,44 +136,14 @@ See [rust-lang/rust#35437][0].
 - [ ] muloti4.c
 - [ ] muloti4.c
 - [ ] mulsf3.c
 - [ ] mulsf3.c
 - [ ] multi3.c
 - [ ] multi3.c
-- [ ] mulvdi3.c
-- [ ] mulvsi3.c
-- [ ] mulvti3.c
-- [ ] negdf2.c
-- [ ] negdi2.c
-- [ ] negsf2.c
-- [ ] negti2.c
-- [ ] negvdi2.c
-- [ ] negvsi2.c
-- [ ] negvti2.c
-- [ ] paritydi2.c
-- [ ] paritysi2.c
-- [ ] parityti2.c
-- [ ] popcountdi2.c
-- [ ] popcountsi2.c
-- [ ] popcountti2.c
 - [ ] powidf2.c
 - [ ] powidf2.c
 - [ ] powisf2.c
 - [ ] powisf2.c
-- [ ] ppc/gcc_qadd.c
-- [ ] ppc/gcc_qdiv.c
-- [ ] ppc/gcc_qmul.c
-- [ ] ppc/gcc_qsub.c
-- [ ] ppc/restFP.S
-- [ ] ppc/saveFP.S
 - [ ] subdf3.c
 - [ ] subdf3.c
 - [ ] subsf3.c
 - [ ] subsf3.c
-- [ ] subvdi3.c
-- [ ] subvsi3.c
-- [ ] subvti3.c
 - [ ] truncdfhf2.c
 - [ ] truncdfhf2.c
 - [ ] truncdfsf2.c
 - [ ] truncdfsf2.c
 - [ ] truncsfhf2.c
 - [ ] truncsfhf2.c
-- [ ] ucmpdi2.c
-- [ ] ucmpti2.c
 - [ ] udivdi3.c
 - [ ] udivdi3.c
-- [ ] udivmoddi4.c
-- [ ] udivmodsi4.c
-- [ ] udivmodti4.c
 - [ ] udivsi3.c
 - [ ] udivsi3.c
 - [ ] udivti3.c
 - [ ] udivti3.c
 - [ ] umoddi3.c
 - [ ] umoddi3.c
@@ -221,7 +153,6 @@ See [rust-lang/rust#35437][0].
 - [ ] x86_64/chkstk2.S
 - [ ] x86_64/chkstk2.S
 - [ ] x86_64/floatundidf.S
 - [ ] x86_64/floatundidf.S
 - [ ] x86_64/floatundisf.S
 - [ ] x86_64/floatundisf.S
-- [x] arm/aeabi_memcmp.S
 - [x] arm/aeabi_memcpy.S
 - [x] arm/aeabi_memcpy.S
 - [x] arm/aeabi_memmove.S
 - [x] arm/aeabi_memmove.S
 - [x] arm/aeabi_memset.S
 - [x] arm/aeabi_memset.S
@@ -274,6 +205,10 @@ These builtins involve floating-point types ("`f128`", "`f80`" and complex numbe
 - ~~ppc/fixunstfdi.c~~
 - ~~ppc/fixunstfdi.c~~
 - ~~ppc/floatditf.c~~
 - ~~ppc/floatditf.c~~
 - ~~ppc/floatunditf.c~~
 - ~~ppc/floatunditf.c~~
+- ~~ppc/gcc_qadd.c~~
+- ~~ppc/gcc_qdiv.c~~
+- ~~ppc/gcc_qmul.c~~
+- ~~ppc/gcc_qsub.c~~
 - ~~ppc/multc3.c~~
 - ~~ppc/multc3.c~~
 - ~~subtf3.c~~
 - ~~subtf3.c~~
 - ~~trunctfdf2.c~~
 - ~~trunctfdf2.c~~
@@ -281,6 +216,74 @@ These builtins involve floating-point types ("`f128`", "`f80`" and complex numbe
 - ~~x86_64/floatdixf.c~~
 - ~~x86_64/floatdixf.c~~
 - ~~x86_64/floatundixf.S~~
 - ~~x86_64/floatundixf.S~~
 
 
+These builtins are never called by LLVM.
+
+- ~~absvdi2.c~~
+- ~~absvsi2.c~~
+- ~~absvti2.c~~
+- ~~addvdi3.c~~
+- ~~addvsi3.c~~
+- ~~addvti3.c~~
+- ~~arm/aeabi_cdcmp.S~~
+- ~~arm/aeabi_cdcmpeq_check_nan.c~~
+- ~~arm/aeabi_cfcmp.S~~
+- ~~arm/aeabi_cfcmpeq_check_nan.c~~
+- ~~arm/aeabi_div0.c~~
+- ~~arm/aeabi_drsub.c~~
+- ~~arm/aeabi_frsub.c~~
+- ~~arm/aeabi_memcmp.S~~
+- ~~arm/bswapdi2.S~~
+- ~~arm/bswapsi2.S~~
+- ~~arm/clzdi2.S~~
+- ~~arm/clzsi2.S~~
+- ~~arm/comparesf2.S~~
+- ~~arm/restore_vfp_d8_d15_regs.S~~
+- ~~arm/save_vfp_d8_d15_regs.S~~
+- ~~arm/switch16.S~~
+- ~~arm/switch32.S~~
+- ~~arm/switch8.S~~
+- ~~arm/switchu8.S~~
+- ~~clzdi2.c~~
+- ~~clzsi2.c~~
+- ~~clzti2.c~~
+- ~~cmpdi2.c~~
+- ~~cmpti2.c~~
+- ~~comparedf2.c~~
+- ~~comparesf2.c~~
+- ~~ctzdi2.c~~
+- ~~ctzsi2.c~~
+- ~~ctzti2.c~~
+- ~~divmoddi4.c~~
+- ~~divmodsi4.c~~
+- ~~ffsdi2.c~~
+- ~~ffsti2.c~~
+- ~~mulvdi3.c~~
+- ~~mulvsi3.c~~
+- ~~mulvti3.c~~
+- ~~negdf2.c~~
+- ~~negdi2.c~~
+- ~~negsf2.c~~
+- ~~negti2.c~~
+- ~~negvdi2.c~~
+- ~~negvsi2.c~~
+- ~~negvti2.c~~
+- ~~paritydi2.c~~
+- ~~paritysi2.c~~
+- ~~parityti2.c~~
+- ~~popcountdi2.c~~
+- ~~popcountsi2.c~~
+- ~~popcountti2.c~~
+- ~~ppc/restFP.S~~
+- ~~ppc/saveFP.S~~
+- ~~subvdi3.c~~
+- ~~subvsi3.c~~
+- ~~subvti3.c~~
+- ~~ucmpdi2.c~~
+- ~~ucmpti2.c~~
+- ~~udivmoddi4.c~~
+- ~~udivmodsi4.c~~
+- ~~udivmodti4.c~~
+
 Rust only exposes atomic types on platforms that support them, and therefore does not need to fall back to software implementations.
 Rust only exposes atomic types on platforms that support them, and therefore does not need to fall back to software implementations.
 
 
 - ~~arm/sync_fetch_and_add_4.S~~
 - ~~arm/sync_fetch_and_add_4.S~~

+ 0 - 14
src/arm.rs

@@ -1,5 +1,4 @@
 extern "C" {
 extern "C" {
-    fn memcmp(s1: *const u8, s2: *const u8, n: usize) -> i32;
     fn memcpy(dest: *mut u8, src: *const u8, n: usize) -> *mut u8;
     fn memcpy(dest: *mut u8, src: *const u8, n: usize) -> *mut u8;
     fn memmove(dest: *mut u8, src: *const u8, n: usize) -> *mut u8;
     fn memmove(dest: *mut u8, src: *const u8, n: usize) -> *mut u8;
     fn memset(dest: *mut u8, c: i32, n: usize) -> *mut u8;
     fn memset(dest: *mut u8, c: i32, n: usize) -> *mut u8;
@@ -7,19 +6,6 @@ extern "C" {
 
 
 // FIXME: The `*4` and `*8` variants should be defined as aliases.
 // FIXME: The `*4` and `*8` variants should be defined as aliases.
 
 
-#[no_mangle]
-pub unsafe extern "aapcs" fn __aeabi_memcmp(s1: *const u8, s2: *const u8, n: usize) -> i32 {
-    memcmp(s1, s2, n)
-}
-#[no_mangle]
-pub unsafe extern "aapcs" fn __aeabi_memcmp4(s1: *const u8, s2: *const u8, n: usize) -> i32 {
-    memcmp(s1, s2, n)
-}
-#[no_mangle]
-pub unsafe extern "aapcs" fn __aeabi_memcmp8(s1: *const u8, s2: *const u8, n: usize) -> i32 {
-    memcmp(s1, s2, n)
-}
-
 #[no_mangle]
 #[no_mangle]
 pub unsafe extern "aapcs" fn __aeabi_memcpy(dest: *mut u8, src: *const u8, n: usize) {
 pub unsafe extern "aapcs" fn __aeabi_memcpy(dest: *mut u8, src: *const u8, n: usize) {
     memcpy(dest, src, n);
     memcpy(dest, src, n);