svn commit: r245628 - in head/contrib/compiler-rt: . lib lib/arm
Andrew Turner
andrew at FreeBSD.org
Fri Jan 18 22:53:01 UTC 2013
Author: andrew
Date: Fri Jan 18 22:52:59 2013
New Revision: 245628
URL: http://svnweb.freebsd.org/changeset/base/245628
Log:
Import compiler-rt r172839.
This brings in __aeabi_lcmp and __aeabi_ulcmp. It also fixes the spelling
of __aeabi_f2lz. Both changes originated on the arm_eabi project branch.
Modified:
head/contrib/compiler-rt/LICENSE.TXT
head/contrib/compiler-rt/lib/arm/divsi3.S
head/contrib/compiler-rt/lib/arm/udivsi3.S
head/contrib/compiler-rt/lib/cmpdi2.c
head/contrib/compiler-rt/lib/fixsfdi.c
head/contrib/compiler-rt/lib/int_endianness.h
head/contrib/compiler-rt/lib/ucmpdi2.c
Directory Properties:
head/contrib/compiler-rt/ (props changed)
Modified: head/contrib/compiler-rt/LICENSE.TXT
==============================================================================
--- head/contrib/compiler-rt/LICENSE.TXT Fri Jan 18 22:50:29 2013 (r245627)
+++ head/contrib/compiler-rt/LICENSE.TXT Fri Jan 18 22:52:59 2013 (r245628)
@@ -14,7 +14,7 @@ Full text of the relevant licenses is in
University of Illinois/NCSA
Open Source License
-Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT
+Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT
All rights reserved.
@@ -55,7 +55,7 @@ SOFTWARE.
==============================================================================
-Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT
+Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Modified: head/contrib/compiler-rt/lib/arm/divsi3.S
==============================================================================
--- head/contrib/compiler-rt/lib/arm/divsi3.S Fri Jan 18 22:50:29 2013 (r245627)
+++ head/contrib/compiler-rt/lib/arm/divsi3.S Fri Jan 18 22:52:59 2013 (r245628)
@@ -25,7 +25,16 @@
// Ok, APCS and AAPCS agree on 32 bit args, so it's safe to use the same routine.
DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_idiv, __divsi3)
DEFINE_COMPILERRT_FUNCTION(__divsi3)
- ESTABLISH_FRAME
+#if __ARM_ARCH_7S__
+ tst r1,r1
+ beq LOCAL_LABEL(divzero)
+ sdiv r0, r0, r1
+ bx lr
+LOCAL_LABEL(divzero):
+ mov r0,#0
+ bx lr
+#else
+ESTABLISH_FRAME
// Set aside the sign of the quotient.
eor r4, r0, r1
// Take absolute value of a and b via abs(x) = (x^(x >> 31)) - (x >> 31).
@@ -39,3 +48,4 @@ DEFINE_COMPILERRT_FUNCTION(__divsi3)
eor r0, r0, r4, asr #31
sub r0, r0, r4, asr #31
CLEAR_FRAME_AND_RETURN
+#endif
Modified: head/contrib/compiler-rt/lib/arm/udivsi3.S
==============================================================================
--- head/contrib/compiler-rt/lib/arm/udivsi3.S Fri Jan 18 22:50:29 2013 (r245627)
+++ head/contrib/compiler-rt/lib/arm/udivsi3.S Fri Jan 18 22:52:59 2013 (r245628)
@@ -33,6 +33,15 @@
// Ok, APCS and AAPCS agree on 32 bit args, so it's safe to use the same routine.
DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_uidiv, __udivsi3)
DEFINE_COMPILERRT_FUNCTION(__udivsi3)
+#if __ARM_ARCH_7S__
+ tst r1,r1
+ beq LOCAL_LABEL(divzero)
+ udiv r0, r0, r1
+ bx lr
+ LOCAL_LABEL(divzero):
+ mov r0,#0
+ bx lr
+#else
// We use a simple digit by digit algorithm; before we get into the actual
// divide loop, we must calculate the left-shift amount necessary to align
// the MSB of the divisor with that of the dividend (If this shift is
@@ -78,3 +87,4 @@ LOCAL_LABEL(return):
// Move the quotient to r0 and return.
mov r0, q
CLEAR_FRAME_AND_RETURN
+#endif
Modified: head/contrib/compiler-rt/lib/cmpdi2.c
==============================================================================
--- head/contrib/compiler-rt/lib/cmpdi2.c Fri Jan 18 22:50:29 2013 (r245627)
+++ head/contrib/compiler-rt/lib/cmpdi2.c Fri Jan 18 22:52:59 2013 (r245628)
@@ -36,3 +36,16 @@ __cmpdi2(di_int a, di_int b)
return 2;
return 1;
}
+
+#ifdef __ARM_EABI__
+/* Returns: if (a < b) returns -1
+* if (a == b) returns 0
+* if (a > b) returns 1
+*/
+COMPILER_RT_ABI si_int
+__aeabi_lcmp(di_int a, di_int b)
+{
+ return __cmpdi2(a, b) - 1;
+}
+#endif
+
Modified: head/contrib/compiler-rt/lib/fixsfdi.c
==============================================================================
--- head/contrib/compiler-rt/lib/fixsfdi.c Fri Jan 18 22:50:29 2013 (r245627)
+++ head/contrib/compiler-rt/lib/fixsfdi.c Fri Jan 18 22:52:59 2013 (r245628)
@@ -23,7 +23,7 @@
/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */
-ARM_EABI_FNALIAS(d2lz, fixsfdi)
+ARM_EABI_FNALIAS(f2lz, fixsfdi)
COMPILER_RT_ABI di_int
__fixsfdi(float a)
Modified: head/contrib/compiler-rt/lib/int_endianness.h
==============================================================================
--- head/contrib/compiler-rt/lib/int_endianness.h Fri Jan 18 22:50:29 2013 (r245627)
+++ head/contrib/compiler-rt/lib/int_endianness.h Fri Jan 18 22:52:59 2013 (r245628)
@@ -31,7 +31,7 @@
/* .. */
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__minix)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__minix)
#include <sys/endian.h>
#if _BYTE_ORDER == _BIG_ENDIAN
@@ -44,6 +44,19 @@
#endif /* *BSD */
+#if defined(__OpenBSD__) || defined(__Bitrig__)
+#include <machine/endian.h>
+
+#if _BYTE_ORDER == _BIG_ENDIAN
+#define _YUGA_LITTLE_ENDIAN 0
+#define _YUGA_BIG_ENDIAN 1
+#elif _BYTE_ORDER == _LITTLE_ENDIAN
+#define _YUGA_LITTLE_ENDIAN 1
+#define _YUGA_BIG_ENDIAN 0
+#endif /* _BYTE_ORDER */
+
+#endif /* OpenBSD and Bitrig. */
+
/* .. */
/* Mac OSX has __BIG_ENDIAN__ or __LITTLE_ENDIAN__ automatically set by the compiler (at least with GCC) */
Modified: head/contrib/compiler-rt/lib/ucmpdi2.c
==============================================================================
--- head/contrib/compiler-rt/lib/ucmpdi2.c Fri Jan 18 22:50:29 2013 (r245627)
+++ head/contrib/compiler-rt/lib/ucmpdi2.c Fri Jan 18 22:52:59 2013 (r245628)
@@ -36,3 +36,16 @@ __ucmpdi2(du_int a, du_int b)
return 2;
return 1;
}
+
+#ifdef __ARM_EABI__
+/* Returns: if (a < b) returns -1
+* if (a == b) returns 0
+* if (a > b) returns 1
+*/
+COMPILER_RT_ABI si_int
+__aeabi_ulcmp(di_int a, di_int b)
+{
+ return __ucmpdi2(a, b) - 1;
+}
+#endif
+
More information about the svn-src-head
mailing list