[haiku-commits] haiku: hrev52231 - in src/system/libroot/posix/glibc: stdlib include/arch/arm

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 15 Aug 2018 00:18:40 -0400 (EDT)

hrev52231 adds 2 changesets to branch 'master'
old head: 6d6e6526579e38962f87319ea1a3ee9397dd67aa
new head: 552fabf1ad689e65e88101e9f5a6c2335d1de63b
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=552fabf1ad68+%5E6d6e6526579e

----------------------------------------------------------------------------

581da829b5dc: libroot: ARM does not have regparm.
  
  Also fix the test for USE_REGPARMS in the same file. Gets the Clang
  build somewhat further.

552fabf1ad68: libroot: Merge some changes to longlong.h for ARM from upstream.
  
  Gets the ARM/Clang build all the way to the libroot linking stage.

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

2 files changed, 26 insertions(+), 11 deletions(-)
.../posix/glibc/include/arch/arm/config.h        |  4 +--
src/system/libroot/posix/glibc/stdlib/longlong.h | 33 ++++++++++++++------

############################################################################

Commit:      581da829b5dcc331c5e24a822c61b6f1fab428e5
URL:         https://git.haiku-os.org/haiku/commit/?id=581da829b5dc
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Wed Aug 15 04:10:33 2018 UTC

libroot: ARM does not have regparm.

Also fix the test for USE_REGPARMS in the same file. Gets the Clang
build somewhat further.

----------------------------------------------------------------------------

diff --git a/src/system/libroot/posix/glibc/include/arch/arm/config.h 
b/src/system/libroot/posix/glibc/include/arch/arm/config.h
index aed6e20f4a..8a0761b0eb 100644
--- a/src/system/libroot/posix/glibc/include/arch/arm/config.h
+++ b/src/system/libroot/posix/glibc/include/arch/arm/config.h
@@ -110,7 +110,7 @@
 
 /* Define if the regparm attribute shall be used for local functions
    (gcc on ix86 only).  */
-#define        USE_REGPARMS 1
+#define        USE_REGPARMS 0
 
 /* Defined on PowerPC if the GCC being used has a problem with clobbering
    certain registers (CR0, MQ, CTR, LR) in asm statements.  */
@@ -161,7 +161,7 @@
 
 /* Defined to some form of __attribute__ ((...)) if the compiler supports
    a different, more efficient calling convention.  */
-#if defined USE_REGPARMS && !defined PROF && !defined __BOUNDED_POINTERS__
+#if USE_REGPARMS && !defined PROF && !defined __BOUNDED_POINTERS__
 # define internal_function __attribute__ ((regparm (3), stdcall))
 #endif
 

############################################################################

Revision:    hrev52231
Commit:      552fabf1ad689e65e88101e9f5a6c2335d1de63b
URL:         https://git.haiku-os.org/haiku/commit/?id=552fabf1ad68
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Wed Aug 15 04:11:30 2018 UTC

libroot: Merge some changes to longlong.h for ARM from upstream.

Gets the ARM/Clang build all the way to the libroot linking stage.

----------------------------------------------------------------------------

diff --git a/src/system/libroot/posix/glibc/stdlib/longlong.h 
b/src/system/libroot/posix/glibc/stdlib/longlong.h
index cd1e30ed2e..65531af912 100644
--- a/src/system/libroot/posix/glibc/stdlib/longlong.h
+++ b/src/system/libroot/posix/glibc/stdlib/longlong.h
@@ -193,7 +193,8 @@ do {                                                        
                \
 UDItype __umulsidi3 (USItype, USItype);
 #endif
 
-#if defined (__arm__) && W_TYPE_SIZE == 32
+#if defined (__arm__) && (defined (__thumb2__) || !defined (__thumb__)) \
+ && W_TYPE_SIZE == 32
 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
   __asm__ ("adds       %1, %4, %5\n\tadc       %0, %2, %3"             \
           : "=r" ((USItype) (sh)),                                     \
@@ -201,7 +202,7 @@ UDItype __umulsidi3 (USItype, USItype);
           : "%r" ((USItype) (ah)),                                     \
             "rI" ((USItype) (bh)),                                     \
             "%r" ((USItype) (al)),                                     \
-            "rI" ((USItype) (bl)))
+            "rI" ((USItype) (bl)) __CLOBBER_CC)
 #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
   __asm__ ("subs       %1, %4, %5\n\tsbc       %0, %2, %3"             \
           : "=r" ((USItype) (sh)),                                     \
@@ -209,10 +210,13 @@ UDItype __umulsidi3 (USItype, USItype);
           : "r" ((USItype) (ah)),                                      \
             "rI" ((USItype) (bh)),                                     \
             "r" ((USItype) (al)),                                      \
-            "rI" ((USItype) (bl)))
-#define umul_ppmm(xh, xl, a, b) \
-{register USItype __t0, __t1, __t2;                                    \
-  __asm__ ("%@ Inlined umul_ppmm\n"                                    \
+            "rI" ((USItype) (bl)) __CLOBBER_CC)
+# if defined(__ARM_ARCH_2__) || defined(__ARM_ARCH_2A__) \
+     || defined(__ARM_ARCH_3__)
+#  define umul_ppmm(xh, xl, a, b)                                      \
+  do {                                                                 \
+    register USItype __t0, __t1, __t2;                                 \
+    __asm__ ("%@ Inlined umul_ppmm\n"                                  \
           "    mov     %2, %5, lsr #16\n"                              \
           "    mov     %0, %6, lsr #16\n"                              \
           "    bic     %3, %5, %2, lsl #16\n"                          \
@@ -229,9 +233,20 @@ UDItype __umulsidi3 (USItype, USItype);
             "=r" ((USItype) (xl)),                                     \
             "=&r" (__t0), "=&r" (__t1), "=r" (__t2)                    \
           : "r" ((USItype) (a)),                                       \
-            "r" ((USItype) (b)));}
-#define UMUL_TIME 20
-#define UDIV_TIME 100
+            "r" ((USItype) (b)) __CLOBBER_CC );                        \
+  } while (0)
+#  define UMUL_TIME 20
+# else
+#  define umul_ppmm(xh, xl, a, b)                                      \
+  do {                                                                 \
+    /* Generate umull, under compiler control.  */                     \
+    register UDItype __t0 = (UDItype)(USItype)(a) * (USItype)(b);      \
+    (xl) = (USItype)__t0;                                              \
+    (xh) = (USItype)(__t0 >> 32);                                      \
+  } while (0)
+#  define UMUL_TIME 3
+# endif
+# define UDIV_TIME 100
 #endif /* __arm__ */
 
 #if defined (__hppa) && W_TYPE_SIZE == 32


Other related posts:

  • » [haiku-commits] haiku: hrev52231 - in src/system/libroot/posix/glibc: stdlib include/arch/arm - waddlesplash