Skip to content

Commit

Permalink
Merge ^/head r279893 through r279984.
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitryAndric committed Mar 14, 2015
2 parents d6cbc26 + 470fe38 commit 49820c9
Show file tree
Hide file tree
Showing 204 changed files with 1,926 additions and 13,803 deletions.
14 changes: 13 additions & 1 deletion Makefile.inc1
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,19 @@ LOCALBASE?= /usr/local
CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
.endif

# If we do not have a bootstrap binutils (because the in-tree one does not
# support the target architecture), provide a default cross-binutils prefix.
# This allows aarch64 builds, for example, to automatically use the
# aarch64-binutils port or package.
.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \
!defined(CROSS_BINUTILS_PREFIX)
CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/
.if !exists(${CROSS_BINUTILS_PREFIX})
.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX.
.endif
.endif

XCOMPILERS= CC CXX CPP
.for COMPILER in ${XCOMPILERS}
.if defined(CROSS_COMPILER_PREFIX)
Expand Down Expand Up @@ -1484,7 +1497,6 @@ cross-tools: .MAKE
${_binutils} \
${_elftctools} \
${_cc} \
usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
${_btxld} \
${_crunchide} \
${_kgzip} \
Expand Down
2 changes: 1 addition & 1 deletion contrib/bmake/meta.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ filemon_read(FILE *mfp, int fd)
if ((fp = fdopen(fd, "r")) == NULL)
err(1, "Could not read build monitor file '%d'", fd);

fprintf(mfp, "-- filemon acquired metadata --\n");
fprintf(mfp, "\n-- filemon acquired metadata --\n");

while (fgets(buf, sizeof(buf), fp)) {
fprintf(mfp, "%s", buf);
Expand Down
41 changes: 9 additions & 32 deletions contrib/compiler-rt/lib/builtins/fixdfdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,17 @@
* Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
* This file implements __fixdfdi for the compiler_rt library.
*
* ===----------------------------------------------------------------------===
*/

#include "int_lib.h"

/* Returns: convert a to a signed long long, rounding toward zero. */

/* Assumption: double is a IEEE 64 bit floating point type
* su_int is a 32 bit integral type
* value in double is representable in di_int (no range checking performed)
*/

/* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */

#define DOUBLE_PRECISION
#include "fp_lib.h"
ARM_EABI_FNALIAS(d2lz, fixdfdi)

typedef di_int fixint_t;
typedef du_int fixuint_t;
#include "fp_fixint_impl.inc"

COMPILER_RT_ABI di_int
__fixdfdi(double a)
{
double_bits fb;
fb.f = a;
int e = ((fb.u.s.high & 0x7FF00000) >> 20) - 1023;
if (e < 0)
return 0;
di_int s = (si_int)(fb.u.s.high & 0x80000000) >> 31;
dwords r;
r.s.high = (fb.u.s.high & 0x000FFFFF) | 0x00100000;
r.s.low = fb.u.s.low;
if (e > 52)
r.all <<= (e - 52);
else
r.all >>= (52 - e);
return (r.all ^ s) - s;
}
__fixdfdi(fp_t a) {
return __fixint(a);
}
56 changes: 14 additions & 42 deletions contrib/compiler-rt/lib/builtins/fixdfsi.c
Original file line number Diff line number Diff line change
@@ -1,50 +1,22 @@
//===-- lib/fixdfsi.c - Double-precision -> integer conversion ----*- C -*-===//
//
// 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 implements double-precision to integer conversion for the
// compiler-rt library. No range checking is performed; the behavior of this
// conversion is undefined for out of range values in the C standard.
//
//===----------------------------------------------------------------------===//
/* ===-- fixdfsi.c - Implement __fixdfsi -----------------------------------===
*
* 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.
*
* ===----------------------------------------------------------------------===
*/

#define DOUBLE_PRECISION
#include "fp_lib.h"

#include "int_lib.h"
typedef si_int fixint_t;
typedef su_int fixuint_t;
#include "fp_fixint_impl.inc"

ARM_EABI_FNALIAS(d2iz, fixdfsi)

COMPILER_RT_ABI int
COMPILER_RT_ABI si_int
__fixdfsi(fp_t a) {

// Break a into sign, exponent, significand
const rep_t aRep = toRep(a);
const rep_t aAbs = aRep & absMask;
const int sign = aRep & signBit ? -1 : 1;
const int exponent = (aAbs >> significandBits) - exponentBias;
const rep_t significand = (aAbs & significandMask) | implicitBit;

// If 0 < exponent < significandBits, right shift to get the result.
if ((unsigned int)exponent < significandBits) {
return sign * (significand >> (significandBits - exponent));
}

// If exponent is negative, the result is zero.
else if (exponent < 0) {
return 0;
}

// If significandBits < exponent, left shift to get the result. This shift
// may end up being larger than the type width, which incurs undefined
// behavior, but the conversion itself is undefined in that case, so
// whatever the compiler decides to do is fine.
else {
return sign * (significand << (exponent - significandBits));
}
return __fixint(a);
}
33 changes: 7 additions & 26 deletions contrib/compiler-rt/lib/builtins/fixdfti.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,21 @@
* Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
* This file implements __fixdfti for the compiler_rt library.
*
* ===----------------------------------------------------------------------===
*/

#include "int_lib.h"

#ifdef CRT_HAS_128BIT
#define DOUBLE_PRECISION
#include "fp_lib.h"

/* Returns: convert a to a signed long long, rounding toward zero. */

/* Assumption: double is a IEEE 64 bit floating point type
* su_int is a 32 bit integral type
* value in double is representable in ti_int (no range checking performed)
*/

/* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */
typedef ti_int fixint_t;
typedef tu_int fixuint_t;
#include "fp_fixint_impl.inc"

COMPILER_RT_ABI ti_int
__fixdfti(double a)
{
double_bits fb;
fb.f = a;
int e = ((fb.u.s.high & 0x7FF00000) >> 20) - 1023;
if (e < 0)
return 0;
ti_int s = (si_int)(fb.u.s.high & 0x80000000) >> 31;
ti_int r = 0x0010000000000000uLL | (0x000FFFFFFFFFFFFFuLL & fb.u.all);
if (e > 52)
r <<= (e - 52);
else
r >>= (52 - e);
return (r ^ s) - s;
__fixdfti(fp_t a) {
return __fixint(a);
}

#endif /* CRT_HAS_128BIT */
38 changes: 9 additions & 29 deletions contrib/compiler-rt/lib/builtins/fixsfdi.c
Original file line number Diff line number Diff line change
@@ -1,43 +1,23 @@
/* ===-- fixsfdi.c - Implement __fixsfdi -----------------------------------===
*
* The LLVM Compiler Infrastructure
* 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 implements __fixsfdi for the compiler_rt library.
*
* ===----------------------------------------------------------------------===
*/

#include "int_lib.h"

/* Returns: convert a to a signed long long, rounding toward zero. */

/* Assumption: float is a IEEE 32 bit floating point type
* su_int is a 32 bit integral type
* value in float is representable in di_int (no range checking performed)
*/

/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */
#define SINGLE_PRECISION
#include "fp_lib.h"

ARM_EABI_FNALIAS(f2lz, fixsfdi)

typedef di_int fixint_t;
typedef du_int fixuint_t;
#include "fp_fixint_impl.inc"

COMPILER_RT_ABI di_int
__fixsfdi(float a)
{
float_bits fb;
fb.f = a;
int e = ((fb.u & 0x7F800000) >> 23) - 127;
if (e < 0)
return 0;
di_int s = (si_int)(fb.u & 0x80000000) >> 31;
di_int r = (fb.u & 0x007FFFFF) | 0x00800000;
if (e > 23)
r <<= (e - 23);
else
r >>= (23 - e);
return (r ^ s) - s;
__fixsfdi(fp_t a) {
return __fixint(a);
}
53 changes: 14 additions & 39 deletions contrib/compiler-rt/lib/builtins/fixsfsi.c
Original file line number Diff line number Diff line change
@@ -1,47 +1,22 @@
//===-- lib/fixsfsi.c - Single-precision -> integer conversion ----*- C -*-===//
//
// 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 implements single-precision to integer conversion for the
// compiler-rt library. No range checking is performed; the behavior of this
// conversion is undefined for out of range values in the C standard.
//
//===----------------------------------------------------------------------===//
/* ===-- fixsfsi.c - Implement __fixsfsi -----------------------------------===
*
* 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.
*
* ===----------------------------------------------------------------------===
*/

#define SINGLE_PRECISION
#include "fp_lib.h"
typedef si_int fixint_t;
typedef su_int fixuint_t;
#include "fp_fixint_impl.inc"

ARM_EABI_FNALIAS(f2iz, fixsfsi)

COMPILER_RT_ABI int
COMPILER_RT_ABI si_int
__fixsfsi(fp_t a) {
// Break a into sign, exponent, significand
const rep_t aRep = toRep(a);
const rep_t aAbs = aRep & absMask;
const int sign = aRep & signBit ? -1 : 1;
const int exponent = (aAbs >> significandBits) - exponentBias;
const rep_t significand = (aAbs & significandMask) | implicitBit;

// If 0 < exponent < significandBits, right shift to get the result.
if ((unsigned int)exponent < significandBits) {
return sign * (significand >> (significandBits - exponent));
}

// If exponent is negative, the result is zero.
else if (exponent < 0) {
return 0;
}

// If significandBits < exponent, left shift to get the result. This shift
// may end up being larger than the type width, which incurs undefined
// behavior, but the conversion itself is undefined in that case, so
// whatever the compiler decides to do is fine.
else {
return sign * (significand << (exponent - significandBits));
}
return __fixint(a);
}
33 changes: 7 additions & 26 deletions contrib/compiler-rt/lib/builtins/fixsfti.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,21 @@
* Source Licenses. See LICENSE.TXT for details.
*
* ===----------------------------------------------------------------------===
*
* This file implements __fixsfti for the compiler_rt library.
*
* ===----------------------------------------------------------------------===
*/

#include "int_lib.h"

#ifdef CRT_HAS_128BIT
#define SINGLE_PRECISION
#include "fp_lib.h"

/* Returns: convert a to a signed long long, rounding toward zero. */

/* Assumption: float is a IEEE 32 bit floating point type
* su_int is a 32 bit integral type
* value in float is representable in ti_int (no range checking performed)
*/

/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */
typedef ti_int fixint_t;
typedef tu_int fixuint_t;
#include "fp_fixint_impl.inc"

COMPILER_RT_ABI ti_int
__fixsfti(float a)
{
float_bits fb;
fb.f = a;
int e = ((fb.u & 0x7F800000) >> 23) - 127;
if (e < 0)
return 0;
ti_int s = (si_int)(fb.u & 0x80000000) >> 31;
ti_int r = (fb.u & 0x007FFFFF) | 0x00800000;
if (e > 23)
r <<= (e - 23);
else
r >>= (23 - e);
return (r ^ s) - s;
__fixsfti(fp_t a) {
return __fixint(a);
}

#endif /* CRT_HAS_128BIT */
23 changes: 23 additions & 0 deletions contrib/compiler-rt/lib/builtins/fixtfdi.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* ===-- fixtfdi.c - Implement __fixtfdi -----------------------------------===
*
* 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.
*
* ===----------------------------------------------------------------------===
*/

#define QUAD_PRECISION
#include "fp_lib.h"

#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
typedef di_int fixint_t;
typedef du_int fixuint_t;
#include "fp_fixint_impl.inc"

COMPILER_RT_ABI di_int
__fixtfdi(fp_t a) {
return __fixint(a);
}
#endif
Loading

0 comments on commit 49820c9

Please sign in to comment.