Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/compiler_rt/dist/lib/builtins PR port-arm/5...



details:   https://anonhg.NetBSD.org/src/rev/509a34e200d7
branches:  trunk
changeset: 983978:509a34e200d7
user:      rin <rin%NetBSD.org@localhost>
date:      Wed Jun 16 05:07:49 2021 +0000

description:
PR port-arm/55897

Cherry-pick upstream commit llvm-svn: 314851:

https://github.com/llvm/llvm-project/commit/0d586d06a756b126a7eb43a21ecc12bd243d7cd8#diff-549f1733063df365663fe375f336034e33e16d6bf2826cd4f966045aeb136007
----
[PATCH] [compiler-rt] Add back ARM EABI aliases where legal.

r303188 removed all the uses of aliases for EABI functions from
compiler-rt, because some of them had mismatched calling conventions.
Obviously, we can't use aliases for functions which don't have the same
calling convention, but that's only an issue for floating-point
functions with the hardfloat ABI.  In other cases, the stubs increase
size and reduce performance for no benefit.

This patch adds back the aliases, with appropriate checks to make sure
they're only used in cases where the calling convention matches.

llvm-svn: 314851

diffstat:

 sys/external/bsd/compiler_rt/dist/lib/builtins/adddf3.c      |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/addsf3.c      |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/ashldi3.c     |   5 +----
 sys/external/bsd/compiler_rt/dist/lib/builtins/ashrdi3.c     |   5 +----
 sys/external/bsd/compiler_rt/dist/lib/builtins/comparedf2.c  |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/comparesf2.c  |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/divdf3.c      |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/divsf3.c      |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/divsi3.c      |   5 +----
 sys/external/bsd/compiler_rt/dist/lib/builtins/extendhfsf2.c |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/extendsfdf2.c |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfdi.c     |  12 +++++-------
 sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfsi.c     |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfdi.c     |  12 +++++-------
 sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfsi.c     |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfdi.c  |  12 +++++-------
 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfsi.c  |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfdi.c  |  12 +++++-------
 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfsi.c  |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/floatdidf.c   |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/floatdisf.c   |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/floatsidf.c   |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/floatsisf.c   |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/floatundidf.c |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/floatundisf.c |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsidf.c |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsisf.c |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h     |   4 +++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/lshrdi3.c     |   5 +----
 sys/external/bsd/compiler_rt/dist/lib/builtins/muldf3.c      |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/muldi3.c      |   5 +----
 sys/external/bsd/compiler_rt/dist/lib/builtins/mulsf3.c      |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/negdf2.c      |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/negsf2.c      |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/subdf3.c      |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/subsf3.c      |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfhf2.c  |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfsf2.c  |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/truncsfhf2.c  |   5 ++++-
 sys/external/bsd/compiler_rt/dist/lib/builtins/udivsi3.c     |   5 +----
 40 files changed, 145 insertions(+), 82 deletions(-)

diffs (truncated from 646 to 300 lines):

diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/adddf3.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/adddf3.c   Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/adddf3.c   Wed Jun 16 05:07:49 2021 +0000
@@ -20,8 +20,11 @@
 }
 
 #if defined(__ARM_EABI__)
+#if defined(COMPILER_RT_ARMHF_TARGET)
 AEABI_RTABI double __aeabi_dadd(double a, double b) {
   return __adddf3(a, b);
 }
+#else
+AEABI_RTABI double __aeabi_dadd(double a, double b) COMPILER_RT_ALIAS(__adddf3);
 #endif
-
+#endif
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/addsf3.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/addsf3.c   Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/addsf3.c   Wed Jun 16 05:07:49 2021 +0000
@@ -20,8 +20,11 @@
 }
 
 #if defined(__ARM_EABI__)
+#if defined(COMPILER_RT_ARMHF_TARGET)
 AEABI_RTABI float __aeabi_fadd(float a, float b) {
   return __addsf3(a, b);
 }
+#else
+AEABI_RTABI float __aeabi_fadd(float a, float b) COMPILER_RT_ALIAS(__addsf3);
 #endif
-
+#endif
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/ashldi3.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/ashldi3.c  Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/ashldi3.c  Wed Jun 16 05:07:49 2021 +0000
@@ -41,8 +41,5 @@
 }
 
 #if defined(__ARM_EABI__)
-AEABI_RTABI di_int __aeabi_llsl(di_int a, si_int b) {
-  return __ashldi3(a, b);
-}
+AEABI_RTABI di_int __aeabi_llsl(di_int a, si_int b) COMPILER_RT_ALIAS(__ashldi3);
 #endif
-
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/ashrdi3.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/ashrdi3.c  Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/ashrdi3.c  Wed Jun 16 05:07:49 2021 +0000
@@ -42,8 +42,5 @@
 }
 
 #if defined(__ARM_EABI__)
-AEABI_RTABI di_int __aeabi_lasr(di_int a, si_int b) {
-  return __ashrdi3(a, b);
-}
+AEABI_RTABI di_int __aeabi_lasr(di_int a, si_int b) COMPILER_RT_ALIAS(__ashrdi3);
 #endif
-
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/comparedf2.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/comparedf2.c       Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/comparedf2.c       Wed Jun 16 05:07:49 2021 +0000
@@ -143,8 +143,11 @@
 }
 
 #if defined(__ARM_EABI__)
+#if defined(COMPILER_RT_ARMHF_TARGET)
 AEABI_RTABI int __aeabi_dcmpun(fp_t a, fp_t b) {
   return __unorddf2(a, b);
 }
+#else
+AEABI_RTABI int __aeabi_dcmpun(fp_t a, fp_t b) COMPILER_RT_ALIAS(__unorddf2);
 #endif
-
+#endif
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/comparesf2.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/comparesf2.c       Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/comparesf2.c       Wed Jun 16 05:07:49 2021 +0000
@@ -143,8 +143,11 @@
 }
 
 #if defined(__ARM_EABI__)
+#if defined(COMPILER_RT_ARMHF_TARGET)
 AEABI_RTABI int __aeabi_fcmpun(fp_t a, fp_t b) {
   return __unordsf2(a, b);
 }
+#else
+AEABI_RTABI int __aeabi_fcmpun(fp_t a, fp_t b) COMPILER_RT_ALIAS(__unordsf2);
 #endif
-
+#endif
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/divdf3.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/divdf3.c   Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/divdf3.c   Wed Jun 16 05:07:49 2021 +0000
@@ -183,8 +183,11 @@
 }
 
 #if defined(__ARM_EABI__)
+#if defined(COMPILER_RT_ARMHF_TARGET)
 AEABI_RTABI fp_t __aeabi_ddiv(fp_t a, fp_t b) {
   return __divdf3(a, b);
 }
+#else
+AEABI_RTABI fp_t __aeabi_ddiv(fp_t a, fp_t b) COMPILER_RT_ALIAS(__divdf3);
 #endif
-
+#endif
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/divsf3.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/divsf3.c   Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/divsf3.c   Wed Jun 16 05:07:49 2021 +0000
@@ -167,8 +167,11 @@
 }
 
 #if defined(__ARM_EABI__)
+#if defined(COMPILER_RT_ARMHF_TARGET)
 AEABI_RTABI fp_t __aeabi_fdiv(fp_t a, fp_t b) {
   return __divsf3(a, b);
 }
+#else
+AEABI_RTABI fp_t __aeabi_fdiv(fp_t a, fp_t b) COMPILER_RT_ALIAS(__divsf3);
 #endif
-
+#endif
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/divsi3.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/divsi3.c   Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/divsi3.c   Wed Jun 16 05:07:49 2021 +0000
@@ -35,8 +35,5 @@
 }
 
 #if defined(__ARM_EABI__)
-AEABI_RTABI si_int __aeabi_idiv(si_int a, si_int b) {
-  return __divsi3(a, b);
-}
+AEABI_RTABI si_int __aeabi_idiv(si_int a, si_int b) COMPILER_RT_ALIAS(__divsi3);
 #endif
-
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/extendhfsf2.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/extendhfsf2.c      Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/extendhfsf2.c      Wed Jun 16 05:07:49 2021 +0000
@@ -23,8 +23,11 @@
 }
 
 #if defined(__ARM_EABI__)
+#if defined(COMPILER_RT_ARMHF_TARGET)
 AEABI_RTABI float __aeabi_h2f(uint16_t a) {
   return __extendhfsf2(a);
 }
+#else
+AEABI_RTABI float __aeabi_h2f(uint16_t a) COMPILER_RT_ALIAS(__extendhfsf2);
 #endif
-
+#endif
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/extendsfdf2.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/extendsfdf2.c      Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/extendsfdf2.c      Wed Jun 16 05:07:49 2021 +0000
@@ -17,8 +17,11 @@
 }
 
 #if defined(__ARM_EABI__)
+#if defined(COMPILER_RT_ARMHF_TARGET)
 AEABI_RTABI double __aeabi_f2d(float a) {
   return __extendsfdf2(a);
 }
+#else
+AEABI_RTABI double __aeabi_f2d(float a) COMPILER_RT_ALIAS(__extendsfdf2);
 #endif
-
+#endif
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfdi.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfdi.c  Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfdi.c  Wed Jun 16 05:07:49 2021 +0000
@@ -45,13 +45,11 @@
 #endif
 
 #if defined(__ARM_EABI__)
-AEABI_RTABI di_int
-#if defined(__SOFT_FP__)
-__aeabi_d2lz(fp_t a) {
-#else
-__aeabi_d2lz(double a) {
-#endif
+#if defined(COMPILER_RT_ARMHF_TARGET)
+AEABI_RTABI di_int __aeabi_d2lz(fp_t a) {
   return __fixdfdi(a);
 }
+#else
+AEABI_RTABI di_int __aeabi_d2lz(fp_t a) COMPILER_RT_ALIAS(__fixdfdi);
 #endif
-
+#endif
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfsi.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfsi.c  Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfsi.c  Wed Jun 16 05:07:49 2021 +0000
@@ -20,8 +20,11 @@
 }
 
 #if defined(__ARM_EABI__)
+#if defined(COMPILER_RT_ARMHF_TARGET)
 AEABI_RTABI si_int __aeabi_d2iz(fp_t a) {
   return __fixdfsi(a);
 }
+#else
+AEABI_RTABI si_int __aeabi_d2iz(fp_t a) COMPILER_RT_ALIAS(__fixdfsi);
 #endif
-
+#endif
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfdi.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfdi.c  Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfdi.c  Wed Jun 16 05:07:49 2021 +0000
@@ -45,13 +45,11 @@
 #endif
 
 #if defined(__ARM_EABI__)
-AEABI_RTABI di_int
-#if defined(__SOFT_FP__)
-__aeabi_f2lz(fp_t a) {
-#else
-__aeabi_f2lz(float a) {
-#endif
+#if defined(COMPILER_RT_ARMHF_TARGET)
+AEABI_RTABI di_int __aeabi_f2lz(fp_t a) {
   return __fixsfdi(a);
 }
+#else
+AEABI_RTABI di_int __aeabi_f2lz(fp_t a) COMPILER_RT_ALIAS(__fixsfdi);
 #endif
-
+#endif
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfsi.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfsi.c  Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfsi.c  Wed Jun 16 05:07:49 2021 +0000
@@ -20,8 +20,11 @@
 }
 
 #if defined(__ARM_EABI__)
+#if defined(COMPILER_RT_ARMHF_TARGET)
 AEABI_RTABI si_int __aeabi_f2iz(fp_t a) {
   return __fixsfsi(a);
 }
+#else
+AEABI_RTABI si_int __aeabi_f2iz(fp_t a) COMPILER_RT_ALIAS(__fixsfsi);
 #endif
-
+#endif
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfdi.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfdi.c       Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfdi.c       Wed Jun 16 05:07:49 2021 +0000
@@ -42,13 +42,11 @@
 #endif
 
 #if defined(__ARM_EABI__)
-AEABI_RTABI du_int
-#if defined(__SOFT_FP__)
-__aeabi_d2ulz(fp_t a) {
-#else
-__aeabi_d2ulz(double a) {
-#endif
+#if defined(COMPILER_RT_ARMHF_TARGET)
+AEABI_RTABI du_int __aeabi_d2ulz(fp_t a) {
   return __fixunsdfdi(a);
 }
+#else
+AEABI_RTABI du_int __aeabi_d2ulz(fp_t a) COMPILER_RT_ALIAS(__fixunsdfdi);
 #endif
-
+#endif
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfsi.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfsi.c       Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfsi.c       Wed Jun 16 05:07:49 2021 +0000
@@ -19,8 +19,11 @@
 }
 
 #if defined(__ARM_EABI__)
+#if defined(COMPILER_RT_ARMHF_TARGET)
 AEABI_RTABI su_int __aeabi_d2uiz(fp_t a) {
   return __fixunsdfsi(a);
 }
+#else
+AEABI_RTABI su_int __aeabi_d2uiz(fp_t a) COMPILER_RT_ALIAS(__fixunsdfsi);
 #endif
-
+#endif
diff -r 86f77974cac6 -r 509a34e200d7 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfdi.c
--- a/sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfdi.c       Wed Jun 16 05:07:18 2021 +0000
+++ b/sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfdi.c       Wed Jun 16 05:07:49 2021 +0000
@@ -43,13 +43,11 @@
 #endif
 
 #if defined(__ARM_EABI__)
-AEABI_RTABI du_int
-#if defined(__SOFT_FP__)
-__aeabi_f2ulz(fp_t a) {
-#else
-__aeabi_f2ulz(float a) {
-#endif
+#if defined(COMPILER_RT_ARMHF_TARGET)
+AEABI_RTABI du_int __aeabi_f2ulz(fp_t a) {
   return __fixunssfdi(a);
 }
+#else
+AEABI_RTABI du_int __aeabi_f2ulz(fp_t a) COMPILER_RT_ALIAS(__fixunssfdi);



Home | Main Index | Thread Index | Old Index