Skip to content

Commit

Permalink
Upgrade libcompiler_rt from revision 117047 to 132478.
Browse files Browse the repository at this point in the history
It seems there have only been a small amount to the compiler-rt source
code in the mean time. I'd rather have the code in sync as much as
possible by the time we release 9.0. Changes:

- The libcompiler_rt library is now dual licensed under both the
  University of Illinois "BSD-Like" license and the MIT license.

- Our local modifications for using .hidden instead of .private_extern
  have been upstreamed, meaning our changes to lib/assembly.h can now be
  reverted.

- A possible endless recursion in __modsi3() has been fixed.

- Support for ARM EABI has been added, but it has no effect on FreeBSD
  (yet).

- The functions __udivmodsi4 and __divmodsi4 have been added.

Requested by:	many, including bf@ and Pedro Giffuni
  • Loading branch information
ed authored and ed committed Jun 3, 2011
2 parents 779614a + ee2dbb0 commit df37ac9
Show file tree
Hide file tree
Showing 202 changed files with 1,351 additions and 536 deletions.
3 changes: 3 additions & 0 deletions contrib/compiler-rt/CREDITS.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ W: http://www.auroraux.org
D: CMake'ify Compiler-RT build system
D: Maintain Solaris & AuroraUX ports of Compiler-RT

N: Howard Hinnant
E: [email protected]
D: Architect and primary author of compiler-rt
53 changes: 33 additions & 20 deletions contrib/compiler-rt/LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
==============================================================================
LLVM Release License
compiler_rt License
==============================================================================

The compiler_rt library is dual licensed under both the University of Illinois
"BSD-Like" license and the MIT license. As a user of this code you may choose
to use it under either license. As a contributor, you agree to allow your code
to be used under both.

Full text of the relevant licenses is included below.

==============================================================================

University of Illinois/NCSA
Open Source License

Copyright (c) 2003-2009 University of Illinois at Urbana-Champaign.
Copyright (c) 2009-2010 by the contributors listed in CREDITS.TXT

All rights reserved.

Developed by:
Expand Down Expand Up @@ -43,21 +54,23 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
SOFTWARE.

==============================================================================
Copyrights and Licenses for Third Party Software Distributed with LLVM:
==============================================================================
The LLVM software contains code written by third parties. Such software will
have its own individual LICENSE.TXT file in the directory in which it appears.
This file will describe the copyrights, license, and restrictions which apply
to that code.

The disclaimer of warranty in the University of Illinois Open Source License
applies to all code in the LLVM Distribution, and nothing in any of the
other licenses gives permission to use the names of the LLVM Team or the
University of Illinois to endorse or promote products derived from this
Software.

The following pieces of software have additional or alternate copyrights,
licenses, and/or restrictions:

Program Directory
------- ---------

Copyright (c) 2009-2010 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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
8 changes: 6 additions & 2 deletions contrib/compiler-rt/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,12 @@ ti_int __modti3 (ti_int a, ti_int b); // a % b signed
su_int __umodsi3 (su_int a, su_int b); // a % b unsigned
du_int __umoddi3 (du_int a, du_int b); // a % b unsigned
tu_int __umodti3 (tu_int a, tu_int b); // a % b unsigned
du_int __udivmoddi4(du_int a, du_int b, du_int* rem); // a / b, *rem = a % b
tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem); // a / b, *rem = a % b
du_int __udivmoddi4(du_int a, du_int b, du_int* rem); // a / b, *rem = a % b unsigned
tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem); // a / b, *rem = a % b unsigned
su_int __udivmodsi4(su_int a, su_int b, su_int* rem); // a / b, *rem = a % b unsigned
si_int __divmodsi4(si_int a, si_int b, si_int* rem); // a / b, *rem = a % b signed



// Integral arithmetic with trapping overflow

Expand Down
23 changes: 23 additions & 0 deletions contrib/compiler-rt/lib/abi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* ===------ abi.h - configuration header for compiler-rt -----------------===
*
* The LLVM Compiler Infrastructure
*
* This file is dual licensed under the MIT and the University of Illinois Open
* Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
* This file is a configuration header for compiler-rt.
* This file is not part of the interface of this library.
*
* ===----------------------------------------------------------------------===
*/

#if __ARM_EABI__
# define ARM_EABI_FNALIAS(aeabi_name, name) \
void __aeabi_##aeabi_name() __attribute__((alias("__" #name)));
# define COMPILER_RT_ABI __attribute__((pcs("aapcs")))
#else
# define ARM_EABI_FNALIAS(aeabi_name, name)
# define COMPILER_RT_ABI
#endif
7 changes: 4 additions & 3 deletions contrib/compiler-rt/lib/absvdi2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
* This file is dual licensed under the MIT and the University of Illinois Open
* Source Licenses. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===
*
* This file implements __absvdi2 for the compiler_rt library.
*
*===----------------------------------------------------------------------===
*/
#include "abi.h"

#include "int_lib.h"
#include <stdlib.h>
Expand All @@ -19,7 +20,7 @@

/* Effects: aborts if abs(x) < 0 */

di_int
COMPILER_RT_ABI di_int
__absvdi2(di_int a)
{
const int N = (int)(sizeof(di_int) * CHAR_BIT);
Expand Down
9 changes: 5 additions & 4 deletions contrib/compiler-rt/lib/absvsi2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
* This file is dual licensed under the MIT and the University of Illinois Open
* Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
* This file implements __absvsi2 for the compiler_rt library.
*
* ===----------------------------------------------------------------------===
*/
*/
#include "abi.h"

#include "int_lib.h"
#include <stdlib.h>
Expand All @@ -19,7 +20,7 @@

/* Effects: aborts if abs(x) < 0 */

si_int
COMPILER_RT_ABI si_int
__absvsi2(si_int a)
{
const int N = (int)(sizeof(si_int) * CHAR_BIT);
Expand Down
4 changes: 2 additions & 2 deletions contrib/compiler-rt/lib/absvti2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
* This file is dual licensed under the MIT and the University of Illinois Open
* Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
Expand Down
22 changes: 11 additions & 11 deletions contrib/compiler-rt/lib/adddf3.c
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
//===-- lib/adddf3.c - Double-precision addition and subtraction --*- C -*-===//
//===-- lib/adddf3.c - Double-precision addition ------------------*- C -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements double-precision soft-float addition and subtraction
// with the IEEE-754 default rounding (to nearest, ties to even).
// This file implements double-precision soft-float addition with the IEEE-754
// default rounding (to nearest, ties to even).
//
//===----------------------------------------------------------------------===//

#include "abi.h"

#define DOUBLE_PRECISION
#include "fp_lib.h"

fp_t __adddf3(fp_t a, fp_t b) {
ARM_EABI_FNALIAS(dadd, adddf3);

COMPILER_RT_ABI fp_t
__adddf3(fp_t a, fp_t b) {

rep_t aRep = toRep(a);
rep_t bRep = toRep(b);
Expand Down Expand Up @@ -147,8 +152,3 @@ fp_t __adddf3(fp_t a, fp_t b) {
if (roundGuardSticky == 0x4) result += result & 1;
return fromRep(result);
}

// Subtraction; flip the sign bit of b and add.
fp_t __subdf3(fp_t a, fp_t b) {
return __adddf3(a, fromRep(toRep(b) ^ signBit));
}
29 changes: 9 additions & 20 deletions contrib/compiler-rt/lib/addsf3.c
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
//===-- lib/addsf3.c - Single-precision addition and subtraction --*- C -*-===//
//===-- lib/addsf3.c - Single-precision addition ------------------*- C -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements single-precision soft-float addition and subtraction
// with the IEEE-754 default rounding (to nearest, ties to even).
// This file implements single-precision soft-float addition with the IEEE-754
// default rounding (to nearest, ties to even).
//
//===----------------------------------------------------------------------===//

#include "abi.h"

#define SINGLE_PRECISION
#include "fp_lib.h"

ARM_EABI_FNALIAS(fadd, addsf3);

fp_t __addsf3(fp_t a, fp_t b) {

rep_t aRep = toRep(a);
Expand Down Expand Up @@ -147,18 +151,3 @@ fp_t __addsf3(fp_t a, fp_t b) {
if (roundGuardSticky == 0x4) result += result & 1;
return fromRep(result);
}

// Subtraction; flip the sign bit of b and add.
fp_t __subsf3(fp_t a, fp_t b) {
return __addsf3(a, fromRep(toRep(b) ^ signBit));
}










7 changes: 4 additions & 3 deletions contrib/compiler-rt/lib/addvdi3.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
* This file is dual licensed under the MIT and the University of Illinois Open
* Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
* This file implements __addvdi3 for the compiler_rt library.
*
* ===----------------------------------------------------------------------===
*/
#include "abi.h"

#include "int_lib.h"
#include <stdlib.h>
Expand All @@ -19,7 +20,7 @@

/* Effects: aborts if a + b overflows */

di_int
COMPILER_RT_ABI di_int
__addvdi3(di_int a, di_int b)
{
di_int s = a + b;
Expand Down
7 changes: 4 additions & 3 deletions contrib/compiler-rt/lib/addvsi3.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
* This file is dual licensed under the MIT and the University of Illinois Open
* Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
* This file implements __addvsi3 for the compiler_rt library.
*
* ===----------------------------------------------------------------------===
*/
#include "abi.h"

#include "int_lib.h"
#include <stdlib.h>
Expand All @@ -19,7 +20,7 @@

/* Effects: aborts if a + b overflows */

si_int
COMPILER_RT_ABI si_int
__addvsi3(si_int a, si_int b)
{
si_int s = a + b;
Expand Down
4 changes: 2 additions & 2 deletions contrib/compiler-rt/lib/addvti3.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
* This file is dual licensed under the MIT and the University of Illinois Open
* Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
Expand Down
Loading

0 comments on commit df37ac9

Please sign in to comment.