From owner-svn-src-all@FreeBSD.ORG Fri Jan 18 22:53:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 55902935; Fri, 18 Jan 2013 22:53:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 43231BFF; Fri, 18 Jan 2013 22:53:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0IMr1cZ075115; Fri, 18 Jan 2013 22:53:01 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0IMqxLT075099; Fri, 18 Jan 2013 22:52:59 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301182252.r0IMqxLT075099@svn.freebsd.org> From: Andrew Turner Date: Fri, 18 Jan 2013 22:52:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245628 - in head/contrib/compiler-rt: . lib lib/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2013 22:53:01 -0000 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 #if _BYTE_ORDER == _BIG_ENDIAN @@ -44,6 +44,19 @@ #endif /* *BSD */ +#if defined(__OpenBSD__) || defined(__Bitrig__) +#include + +#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 +