Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Mar 2015 13:08:01 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r279985 - in projects/clang360-import: . contrib/bmake contrib/compiler-rt/lib/builtins contrib/jemalloc/include/jemalloc contrib/libxo/libxo etc etc/autofs etc/defaults lib/libc/posix1...
Message-ID:  <201503141308.t2ED817a059230@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Sat Mar 14 13:08:00 2015
New Revision: 279985
URL: https://svnweb.freebsd.org/changeset/base/279985

Log:
  Merge ^/head r279893 through r279984.

Added:
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixtfdi.c
     - copied unchanged from r279984, head/contrib/compiler-rt/lib/builtins/fixtfdi.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixtfsi.c
     - copied unchanged from r279984, head/contrib/compiler-rt/lib/builtins/fixtfsi.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixtfti.c
     - copied unchanged from r279984, head/contrib/compiler-rt/lib/builtins/fixtfti.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunstfdi.c
     - copied unchanged from r279984, head/contrib/compiler-rt/lib/builtins/fixunstfdi.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunstfsi.c
     - copied unchanged from r279984, head/contrib/compiler-rt/lib/builtins/fixunstfsi.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunstfti.c
     - copied unchanged from r279984, head/contrib/compiler-rt/lib/builtins/fixunstfti.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fp_fixint_impl.inc
     - copied unchanged from r279984, head/contrib/compiler-rt/lib/builtins/fp_fixint_impl.inc
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fp_fixuint_impl.inc
     - copied unchanged from r279984, head/contrib/compiler-rt/lib/builtins/fp_fixuint_impl.inc
  projects/clang360-import/etc/autofs/special_noauto
     - copied unchanged from r279984, head/etc/autofs/special_noauto
  projects/clang360-import/sys/mips/conf/TL-WR1043NDv2
     - copied unchanged from r279984, head/sys/mips/conf/TL-WR1043NDv2
  projects/clang360-import/sys/mips/conf/TL-WR1043NDv2.hints
     - copied unchanged from r279984, head/sys/mips/conf/TL-WR1043NDv2.hints
Deleted:
  projects/clang360-import/sys/amd64/vmm/vmm_ipi.c
  projects/clang360-import/sys/amd64/vmm/vmm_ipi.h
  projects/clang360-import/sys/amd64/vmm/vmm_support.S
  projects/clang360-import/sys/gnu/dts/arm/alphascale-asm9260-devkit.dts
  projects/clang360-import/sys/gnu/dts/arm/alphascale-asm9260.dtsi
  projects/clang360-import/sys/gnu/dts/arm/axm5516-amarillo.dts
  projects/clang360-import/sys/gnu/dts/arm/axm55xx.dtsi
  projects/clang360-import/sys/gnu/dts/arm/exynos5250-snow.dts
  projects/clang360-import/sys/gnu/dts/arm/exynos5420-peach-pit.dts
  projects/clang360-import/sys/gnu/dts/arm/exynos5800-peach-pi.dts
  projects/clang360-import/sys/gnu/dts/arm/mmp2-brownstone.dts
  projects/clang360-import/sys/gnu/dts/arm/mmp2.dtsi
  projects/clang360-import/sys/gnu/dts/arm/pxa168-aspenite.dts
  projects/clang360-import/sys/gnu/dts/arm/pxa168.dtsi
  projects/clang360-import/sys/gnu/dts/arm/pxa910-dkb.dts
  projects/clang360-import/sys/gnu/dts/arm/pxa910.dtsi
  projects/clang360-import/sys/gnu/dts/arm/qcom-apq8064-cm-qs600.dts
  projects/clang360-import/sys/gnu/dts/arm/qcom-apq8064-ifc6410.dts
  projects/clang360-import/sys/gnu/dts/arm/qcom-apq8064-v2.0.dtsi
  projects/clang360-import/sys/gnu/dts/arm/qcom-apq8064.dtsi
  projects/clang360-import/sys/gnu/dts/arm/qcom-apq8074-dragonboard.dts
  projects/clang360-import/sys/gnu/dts/arm/qcom-apq8084-ifc6540.dts
  projects/clang360-import/sys/gnu/dts/arm/qcom-apq8084-mtp.dts
  projects/clang360-import/sys/gnu/dts/arm/qcom-apq8084.dtsi
  projects/clang360-import/sys/gnu/dts/arm/qcom-ipq8064-ap148.dts
  projects/clang360-import/sys/gnu/dts/arm/qcom-ipq8064-v1.0.dtsi
  projects/clang360-import/sys/gnu/dts/arm/qcom-ipq8064.dtsi
  projects/clang360-import/sys/gnu/dts/arm/qcom-msm8660-surf.dts
  projects/clang360-import/sys/gnu/dts/arm/qcom-msm8660.dtsi
  projects/clang360-import/sys/gnu/dts/arm/qcom-msm8960-cdp.dts
  projects/clang360-import/sys/gnu/dts/arm/qcom-msm8960.dtsi
  projects/clang360-import/sys/gnu/dts/arm/qcom-msm8974-sony-xperia-honami.dts
  projects/clang360-import/sys/gnu/dts/arm/qcom-msm8974.dtsi
  projects/clang360-import/sys/gnu/dts/arm/s3c6400.dtsi
  projects/clang360-import/sys/gnu/dts/arm/s3c6410-mini6410.dts
  projects/clang360-import/sys/gnu/dts/arm/s3c6410-smdk6410.dts
  projects/clang360-import/sys/gnu/dts/arm/s3c6410.dtsi
  projects/clang360-import/sys/gnu/dts/arm/s3c64xx-pinctrl.dtsi
  projects/clang360-import/sys/gnu/dts/arm/s3c64xx.dtsi
  projects/clang360-import/sys/gnu/dts/arm/socfpga.dtsi
  projects/clang360-import/sys/gnu/dts/arm/socfpga_arria10.dtsi
  projects/clang360-import/sys/gnu/dts/arm/socfpga_arria10_socdk.dts
  projects/clang360-import/sys/gnu/dts/arm/socfpga_arria5.dtsi
  projects/clang360-import/sys/gnu/dts/arm/socfpga_arria5_socdk.dts
  projects/clang360-import/sys/gnu/dts/arm/socfpga_cyclone5.dtsi
  projects/clang360-import/sys/gnu/dts/arm/socfpga_cyclone5_socdk.dts
  projects/clang360-import/sys/gnu/dts/arm/socfpga_cyclone5_sockit.dts
  projects/clang360-import/sys/gnu/dts/arm/socfpga_cyclone5_socrates.dts
  projects/clang360-import/sys/gnu/dts/arm/socfpga_vt.dts
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/alphascale,asm9260.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/lsi,axm5516-clks.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/marvell,mmp2.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/marvell,pxa168.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/marvell,pxa910.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/maxim,max77686.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/maxim,max77802.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-apq8084.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq806x.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8660.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8960.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8974.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-ipq806x.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-msm8960.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-apq8084.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8960.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8974.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/rockchip,rk808.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/clock/samsung,s3c64xx-clock.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/iio/
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/pinctrl/qcom,pmic-gpio.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/pinctrl/qcom,pmic-mpp.h
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/regulator/
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/reset/
  projects/clang360-import/sys/gnu/dts/include/dt-bindings/soc/
Modified:
  projects/clang360-import/Makefile.inc1
  projects/clang360-import/contrib/bmake/meta.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixdfdi.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixdfsi.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixdfti.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixsfdi.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixsfsi.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixsfti.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsdfdi.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsdfsi.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsdfti.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunssfdi.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunssfsi.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunssfti.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsxfdi.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsxfsi.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsxfti.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixxfdi.c
  projects/clang360-import/contrib/compiler-rt/lib/builtins/fixxfti.c
  projects/clang360-import/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h
  projects/clang360-import/contrib/libxo/libxo/xo.h
  projects/clang360-import/etc/auto_master
  projects/clang360-import/etc/autofs/Makefile
  projects/clang360-import/etc/defaults/periodic.conf
  projects/clang360-import/lib/libc/posix1e/acl_calc_mask.c
  projects/clang360-import/lib/libc/posix1e/acl_strip.c
  projects/clang360-import/lib/libcompiler_rt/Makefile
  projects/clang360-import/lib/libproc/proc_sym.c
  projects/clang360-import/lib/libstand/Makefile
  projects/clang360-import/lib/libstand/dosfs.c
  projects/clang360-import/sbin/geom/class/part/gpart.8
  projects/clang360-import/sbin/ifconfig/ifconfig.c
  projects/clang360-import/sbin/ipfw/ipfw.8
  projects/clang360-import/sbin/ipfw/ipfw2.c
  projects/clang360-import/sbin/ipfw/tables.c
  projects/clang360-import/share/doc/psd/title/Title
  projects/clang360-import/share/doc/smm/title/Title
  projects/clang360-import/share/doc/usd/title/Title
  projects/clang360-import/share/examples/bhyve/vmrun.sh
  projects/clang360-import/share/man/man5/periodic.conf.5
  projects/clang360-import/share/man/man9/mbuf.9
  projects/clang360-import/share/mk/bsd.mkopt.mk
  projects/clang360-import/share/mk/bsd.obj.mk
  projects/clang360-import/share/mk/sys.mk
  projects/clang360-import/sys/amd64/amd64/apic_vector.S
  projects/clang360-import/sys/amd64/include/smp.h
  projects/clang360-import/sys/amd64/vmm/intel/ept.c
  projects/clang360-import/sys/amd64/vmm/intel/vmx.c
  projects/clang360-import/sys/amd64/vmm/io/vlapic.c
  projects/clang360-import/sys/amd64/vmm/vmm.c
  projects/clang360-import/sys/amd64/vmm/vmm_lapic.c
  projects/clang360-import/sys/arm/include/in_cksum.h
  projects/clang360-import/sys/boot/amd64/Makefile.inc
  projects/clang360-import/sys/boot/amd64/efi/Makefile
  projects/clang360-import/sys/boot/amd64/efi/conf.c
  projects/clang360-import/sys/boot/amd64/efi/copy.c
  projects/clang360-import/sys/boot/efi/libefi/Makefile
  projects/clang360-import/sys/boot/efi/libefi/libefi.c
  projects/clang360-import/sys/boot/ficl/Makefile
  projects/clang360-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
  projects/clang360-import/sys/conf/kern.opts.mk
  projects/clang360-import/sys/dev/ahci/ahci.h
  projects/clang360-import/sys/dev/ata/ata-all.h
  projects/clang360-import/sys/dev/cxgbe/t4_main.c
  projects/clang360-import/sys/dev/drm2/drm_pci.c
  projects/clang360-import/sys/dev/etherswitch/arswitch/arswitch_8327.c
  projects/clang360-import/sys/dev/etherswitch/arswitch/arswitch_vlans.c
  projects/clang360-import/sys/dev/etherswitch/arswitch/arswitch_vlans.h
  projects/clang360-import/sys/dev/etherswitch/arswitch/arswitchvar.h
  projects/clang360-import/sys/dev/hwpmc/hwpmc_core.c
  projects/clang360-import/sys/dev/hwpmc/hwpmc_logging.c
  projects/clang360-import/sys/dev/mii/rgephy.c
  projects/clang360-import/sys/dev/mii/rgephyreg.h
  projects/clang360-import/sys/dev/mvs/mvs.h
  projects/clang360-import/sys/dev/siis/siis.h
  projects/clang360-import/sys/geom/mirror/g_mirror.c
  projects/clang360-import/sys/geom/part/g_part.c
  projects/clang360-import/sys/geom/part/g_part.h
  projects/clang360-import/sys/geom/part/g_part_gpt.c
  projects/clang360-import/sys/i386/isa/npx.c
  projects/clang360-import/sys/mips/conf/QCA955X_BASE
  projects/clang360-import/sys/modules/vmm/Makefile
  projects/clang360-import/sys/net/if.c
  projects/clang360-import/sys/netinet/ip_fw.h
  projects/clang360-import/sys/netpfil/ipfw/ip_fw2.c
  projects/clang360-import/sys/netpfil/ipfw/ip_fw_pfil.c
  projects/clang360-import/sys/netpfil/ipfw/ip_fw_private.h
  projects/clang360-import/sys/netpfil/ipfw/ip_fw_table_value.c
  projects/clang360-import/sys/netpfil/pf/pf.c
  projects/clang360-import/sys/powerpc/aim/mmu_oea64.c
  projects/clang360-import/sys/powerpc/include/slb.h
  projects/clang360-import/sys/powerpc/include/ucontext.h
  projects/clang360-import/sys/powerpc/powerpc/exec_machdep.c
  projects/clang360-import/sys/powerpc/pseries/mmu_phyp.c
  projects/clang360-import/sys/powerpc/pseries/phyp_llan.c
  projects/clang360-import/sys/sys/gpt.h
  projects/clang360-import/sys/x86/include/apicvar.h
  projects/clang360-import/sys/x86/x86/local_apic.c
  projects/clang360-import/sys/x86/xen/xen_apic.c
  projects/clang360-import/usr.bin/Makefile
  projects/clang360-import/usr.bin/xlint/Makefile.inc
  projects/clang360-import/usr.sbin/autofs/auto_master.5
  projects/clang360-import/usr.sbin/autofs/automount.c
  projects/clang360-import/usr.sbin/autofs/automountd.c
  projects/clang360-import/usr.sbin/autofs/common.c
  projects/clang360-import/usr.sbin/autofs/common.h
  projects/clang360-import/usr.sbin/bhyve/ahci.h
  projects/clang360-import/usr.sbin/bhyve/block_if.c
  projects/clang360-import/usr.sbin/bhyve/block_if.h
  projects/clang360-import/usr.sbin/bhyve/pci_ahci.c
  projects/clang360-import/usr.sbin/freebsd-update/freebsd-update.sh
Directory Properties:
  projects/clang360-import/   (props changed)
  projects/clang360-import/contrib/bmake/   (props changed)
  projects/clang360-import/contrib/compiler-rt/   (props changed)
  projects/clang360-import/etc/   (props changed)
  projects/clang360-import/lib/libc/   (props changed)
  projects/clang360-import/sbin/   (props changed)
  projects/clang360-import/sbin/ipfw/   (props changed)
  projects/clang360-import/share/   (props changed)
  projects/clang360-import/sys/   (props changed)
  projects/clang360-import/sys/amd64/vmm/   (props changed)
  projects/clang360-import/sys/boot/   (props changed)
  projects/clang360-import/sys/cddl/contrib/opensolaris/   (props changed)
  projects/clang360-import/sys/conf/   (props changed)
  projects/clang360-import/sys/gnu/dts/   (props changed)
  projects/clang360-import/sys/gnu/dts/arm/   (props changed)
  projects/clang360-import/sys/gnu/dts/include/   (props changed)
  projects/clang360-import/sys/modules/vmm/   (props changed)
  projects/clang360-import/usr.sbin/bhyve/   (props changed)

Modified: projects/clang360-import/Makefile.inc1
==============================================================================
--- projects/clang360-import/Makefile.inc1	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/Makefile.inc1	Sat Mar 14 13:08:00 2015	(r279985)
@@ -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)
@@ -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} \

Modified: projects/clang360-import/contrib/bmake/meta.c
==============================================================================
--- projects/clang360-import/contrib/bmake/meta.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/bmake/meta.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -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);

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixdfdi.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixdfdi.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixdfdi.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -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);
+}

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixdfsi.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixdfsi.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixdfsi.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -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);
 }

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixdfti.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixdfti.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixdfti.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -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 */

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixsfdi.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixsfdi.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixsfdi.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -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);
 }

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixsfsi.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixsfsi.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixsfsi.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -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);
 }

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixsfti.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixsfti.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixsfti.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -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 */

Copied: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixtfdi.c (from r279984, head/contrib/compiler-rt/lib/builtins/fixtfdi.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixtfdi.c	Sat Mar 14 13:08:00 2015	(r279985, copy of r279984, head/contrib/compiler-rt/lib/builtins/fixtfdi.c)
@@ -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

Copied: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixtfsi.c (from r279984, head/contrib/compiler-rt/lib/builtins/fixtfsi.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixtfsi.c	Sat Mar 14 13:08:00 2015	(r279985, copy of r279984, head/contrib/compiler-rt/lib/builtins/fixtfsi.c)
@@ -0,0 +1,23 @@
+/* ===-- fixtfsi.c - Implement __fixtfsi -----------------------------------===
+ *
+ *                     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 si_int fixint_t;
+typedef su_int fixuint_t;
+#include "fp_fixint_impl.inc"
+
+COMPILER_RT_ABI si_int
+__fixtfsi(fp_t a) {
+    return __fixint(a);
+}
+#endif

Copied: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixtfti.c (from r279984, head/contrib/compiler-rt/lib/builtins/fixtfti.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixtfti.c	Sat Mar 14 13:08:00 2015	(r279985, copy of r279984, head/contrib/compiler-rt/lib/builtins/fixtfti.c)
@@ -0,0 +1,23 @@
+/* ===-- fixtfti.c - Implement __fixtfti -----------------------------------===
+ *
+ *                     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 ti_int fixint_t;
+typedef tu_int fixuint_t;
+#include "fp_fixint_impl.inc"
+
+COMPILER_RT_ABI ti_int
+__fixtfti(fp_t a) {
+    return __fixint(a);
+}
+#endif

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsdfdi.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsdfdi.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsdfdi.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -6,42 +6,16 @@
  * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
- *
- * This file implements __fixunsdfdi for the compiler_rt library.
- *
- * ===----------------------------------------------------------------------===
- */
-
-#include "int_lib.h"
-
-/* Returns: convert a to a unsigned long long, rounding toward zero.
- *          Negative values all become zero.
- */
-
-/* Assumption: double is a IEEE 64 bit floating point type 
- *             du_int is a 64 bit integral type
- *             value in double is representable in du_int or is negative 
- *                 (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"
+typedef du_int fixuint_t;
+#include "fp_fixuint_impl.inc"
 
 ARM_EABI_FNALIAS(d2ulz, fixunsdfdi)
 
 COMPILER_RT_ABI du_int
-__fixunsdfdi(double a)
-{
-    double_bits fb;
-    fb.f = a;
-    int e = ((fb.u.s.high & 0x7FF00000) >> 20) - 1023;
-    if (e < 0 || (fb.u.s.high & 0x80000000))
-        return 0;
-    udwords 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;
+__fixunsdfdi(fp_t a) {
+    return __fixuint(a);
 }

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsdfsi.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsdfsi.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsdfsi.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -6,39 +6,16 @@
  * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
- *
- * This file implements __fixunsdfsi for the compiler_rt library.
- *
- * ===----------------------------------------------------------------------===
- */
-
-#include "int_lib.h"
-
-/* Returns: convert a to a unsigned int, rounding toward zero.
- *          Negative values all become 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 su_int or is negative 
- *                 (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"
+typedef su_int fixuint_t;
+#include "fp_fixuint_impl.inc"
 
 ARM_EABI_FNALIAS(d2uiz, fixunsdfsi)
 
 COMPILER_RT_ABI su_int
-__fixunsdfsi(double a)
-{
-    double_bits fb;
-    fb.f = a;
-    int e = ((fb.u.s.high & 0x7FF00000) >> 20) - 1023;
-    if (e < 0 || (fb.u.s.high & 0x80000000))
-        return 0;
-    return (
-                0x80000000u                      |
-                ((fb.u.s.high & 0x000FFFFF) << 11) |
-                (fb.u.s.low >> 21)
-           ) >> (31 - e);
+__fixunsdfsi(fp_t a) {
+    return __fixuint(a);
 }

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsdfti.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsdfti.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsdfti.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -6,42 +6,18 @@
  * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
- *
- * This file implements __fixunsdfti for the compiler_rt library.
- *
- * ===----------------------------------------------------------------------===
  */
 
 #include "int_lib.h"
 
 #ifdef CRT_HAS_128BIT
-
-/* Returns: convert a to a unsigned long long, rounding toward zero.
- *          Negative values all become zero.
- */
-
-/* Assumption: double is a IEEE 64 bit floating point type 
- *             tu_int is a 64 bit integral type
- *             value in double is representable in tu_int or is negative 
- *                 (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"
+typedef tu_int fixuint_t;
+#include "fp_fixuint_impl.inc"
 
 COMPILER_RT_ABI tu_int
-__fixunsdfti(double a)
-{
-    double_bits fb;
-    fb.f = a;
-    int e = ((fb.u.s.high & 0x7FF00000) >> 20) - 1023;
-    if (e < 0 || (fb.u.s.high & 0x80000000))
-        return 0;
-    tu_int r = 0x0010000000000000uLL | (fb.u.all & 0x000FFFFFFFFFFFFFuLL);
-    if (e > 52)
-        r <<= (e - 52);
-    else
-        r >>= (52 - e);
-    return r;
+__fixunsdftti(fp_t a) {
+    return __fixuint(a);
 }
-
 #endif /* CRT_HAS_128BIT */

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunssfdi.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunssfdi.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunssfdi.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -6,39 +6,16 @@
  * Source Licenses. See LICENSE.TXT for details.
  *
  * ===----------------------------------------------------------------------===
- *
- * This file implements __fixunssfdi for the compiler_rt library.
- *
- * ===----------------------------------------------------------------------===
- */
-
-#include "int_lib.h"
-/* Returns: convert a to a unsigned long long, rounding toward zero.
- *          Negative values all become zero.
- */
-
-/* Assumption: float is a IEEE 32 bit floating point type 
- *             du_int is a 64 bit integral type
- *             value in float is representable in du_int or is negative 
- *                 (no range checking performed)
  */
 
-/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */
+#define SINGLE_PRECISION
+#include "fp_lib.h"
+typedef du_int fixuint_t;
+#include "fp_fixuint_impl.inc"
 
 ARM_EABI_FNALIAS(f2ulz, fixunssfdi)
 
 COMPILER_RT_ABI du_int
-__fixunssfdi(float a)
-{
-    float_bits fb;
-    fb.f = a;
-    int e = ((fb.u & 0x7F800000) >> 23) - 127;
-    if (e < 0 || (fb.u & 0x80000000))
-        return 0;
-    du_int r = (fb.u & 0x007FFFFF) | 0x00800000;
-    if (e > 23)
-        r <<= (e - 23);
-    else
-        r >>= (23 - e);
-    return r;
+__fixunssfdi(fp_t a) {
+    return __fixuint(a);
 }

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunssfsi.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunssfsi.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunssfsi.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -12,34 +12,14 @@
  * ===----------------------------------------------------------------------===
  */
 
-#include "int_lib.h"
-
-/* Returns: convert a to a unsigned int, rounding toward zero.
- *          Negative values all become 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 su_int or is negative 
- *                 (no range checking performed)
- */
-
-/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */
+#define SINGLE_PRECISION
+#include "fp_lib.h"
+typedef su_int fixuint_t;
+#include "fp_fixuint_impl.inc"
 
 ARM_EABI_FNALIAS(f2uiz, fixunssfsi)
 
 COMPILER_RT_ABI su_int
-__fixunssfsi(float a)
-{
-    float_bits fb;
-    fb.f = a;
-    int e = ((fb.u & 0x7F800000) >> 23) - 127;
-    if (e < 0 || (fb.u & 0x80000000))
-        return 0;
-    su_int r = (fb.u & 0x007FFFFF) | 0x00800000;
-    if (e > 23)
-        r <<= (e - 23);
-    else
-        r >>= (23 - e);
-    return r;
+__fixunssfsi(fp_t a) {
+    return __fixuint(a);
 }

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunssfti.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunssfti.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunssfti.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -12,36 +12,12 @@
  * ===----------------------------------------------------------------------===
  */
 
-#include "int_lib.h"
-
-#ifdef CRT_HAS_128BIT
-
-/* Returns: convert a to a unsigned long long, rounding toward zero.
- *          Negative values all become zero.
- */
-
-/* Assumption: float is a IEEE 32 bit floating point type 
- *             tu_int is a 64 bit integral type
- *             value in float is representable in tu_int or is negative 
- *                 (no range checking performed)
- */
-
-/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */
+#if defined(CRT_HAS_128BIT)
+typedef tu_int fixuint_t;
+#include "fp_fixuint_impl.inc"
 
 COMPILER_RT_ABI tu_int
-__fixunssfti(float a)
-{
-    float_bits fb;
-    fb.f = a;
-    int e = ((fb.u & 0x7F800000) >> 23) - 127;
-    if (e < 0 || (fb.u & 0x80000000))
-        return 0;
-    tu_int r = (fb.u & 0x007FFFFF) | 0x00800000;
-    if (e > 23)
-        r <<= (e - 23);
-    else
-        r >>= (23 - e);
-    return r;
+__fixunssfti(fp_t a) {
+    return __fixuint(a);
 }
-
-#endif /* CRT_HAS_128BIT */
+#endif

Copied: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunstfdi.c (from r279984, head/contrib/compiler-rt/lib/builtins/fixunstfdi.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunstfdi.c	Sat Mar 14 13:08:00 2015	(r279985, copy of r279984, head/contrib/compiler-rt/lib/builtins/fixunstfdi.c)
@@ -0,0 +1,22 @@
+/* ===-- fixunstfdi.c - Implement __fixunstfdi -----------------------------===
+ *
+ *                     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 du_int fixuint_t;
+#include "fp_fixuint_impl.inc"
+
+COMPILER_RT_ABI du_int
+__fixunstfdi(fp_t a) {
+    return __fixuint(a);
+}
+#endif

Copied: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunstfsi.c (from r279984, head/contrib/compiler-rt/lib/builtins/fixunstfsi.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunstfsi.c	Sat Mar 14 13:08:00 2015	(r279985, copy of r279984, head/contrib/compiler-rt/lib/builtins/fixunstfsi.c)
@@ -0,0 +1,22 @@
+/* ===-- fixunstfsi.c - Implement __fixunstfsi -----------------------------===
+ *
+ *                     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 su_int fixuint_t;
+#include "fp_fixuint_impl.inc"
+
+COMPILER_RT_ABI su_int
+__fixunstfsi(fp_t a) {
+    return __fixuint(a);
+}
+#endif

Copied: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunstfti.c (from r279984, head/contrib/compiler-rt/lib/builtins/fixunstfti.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunstfti.c	Sat Mar 14 13:08:00 2015	(r279985, copy of r279984, head/contrib/compiler-rt/lib/builtins/fixunstfti.c)
@@ -0,0 +1,22 @@
+/* ===-- fixunstfsi.c - Implement __fixunstfsi -----------------------------===
+ *
+ *                     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 tu_int fixuint_t;
+#include "fp_fixuint_impl.inc"
+
+COMPILER_RT_ABI tu_int
+__fixunstfti(fp_t a) {
+    return __fixuint(a);
+}
+#endif

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsxfdi.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsxfdi.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsxfdi.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -38,6 +38,8 @@ __fixunsxfdi(long double a)
     int e = (fb.u.high.s.low & 0x00007FFF) - 16383;
     if (e < 0 || (fb.u.high.s.low & 0x00008000))
         return 0;
+    if ((unsigned)e > sizeof(du_int) * CHAR_BIT)
+        return ~(du_int)0;
     return fb.u.low.all >> (63 - e);
 }
 

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsxfsi.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsxfsi.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsxfsi.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -23,7 +23,6 @@
 /* Assumption: long double is an intel 80 bit floating point type padded with 6 bytes
  *             su_int is a 32 bit integral type
  *             value in long double is representable in su_int or is negative 
- *                 (no range checking performed)
  */
 
 /* gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee |
@@ -38,6 +37,8 @@ __fixunsxfsi(long double a)
     int e = (fb.u.high.s.low & 0x00007FFF) - 16383;
     if (e < 0 || (fb.u.high.s.low & 0x00008000))
         return 0;
+    if ((unsigned)e > sizeof(su_int) * CHAR_BIT)
+        return ~(su_int)0;
     return fb.u.low.s.high >> (31 - e);
 }
 

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsxfti.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsxfti.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixunsxfti.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -21,9 +21,8 @@
  */
 
 /* Assumption: long double is an intel 80 bit floating point type padded with 6 bytes
- *             tu_int is a 64 bit integral type
+ *             tu_int is a 128 bit integral type
  *             value in long double is representable in tu_int or is negative 
- *                 (no range checking performed)
  */
 
 /* gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee |
@@ -38,6 +37,8 @@ __fixunsxfti(long double a)
     int e = (fb.u.high.s.low & 0x00007FFF) - 16383;
     if (e < 0 || (fb.u.high.s.low & 0x00008000))
         return 0;
+    if ((unsigned)e > sizeof(tu_int) * CHAR_BIT)
+        return ~(tu_int)0;
     tu_int r = fb.u.low.all;
     if (e > 63)
         r <<= (e - 63);

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixxfdi.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixxfdi.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixxfdi.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -19,7 +19,7 @@
 /* Returns: convert a to a signed long long, rounding toward zero. */
 
 /* Assumption: long double is an intel 80 bit floating point type padded with 6 bytes
- *             su_int is a 32 bit integral type
+ *             di_int is a 64 bit integral type
  *             value in long double is representable in di_int (no range checking performed)
  */
 
@@ -30,11 +30,15 @@
 COMPILER_RT_ABI di_int
 __fixxfdi(long double a)
 {
+    const di_int di_max = (di_int)((~(du_int)0) / 2);
+    const di_int di_min = -di_max - 1;
     long_double_bits fb;
     fb.f = a;
     int e = (fb.u.high.s.low & 0x00007FFF) - 16383;
     if (e < 0)
         return 0;
+    if ((unsigned)e >= sizeof(di_int) * CHAR_BIT)
+        return a > 0 ? di_max : di_min;
     di_int s = -(si_int)((fb.u.high.s.low & 0x00008000) >> 15);
     di_int r = fb.u.low.all;
     r = (du_int)r >> (63 - e);

Modified: projects/clang360-import/contrib/compiler-rt/lib/builtins/fixxfti.c
==============================================================================
--- projects/clang360-import/contrib/compiler-rt/lib/builtins/fixxfti.c	Sat Mar 14 13:04:39 2015	(r279984)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fixxfti.c	Sat Mar 14 13:08:00 2015	(r279985)
@@ -19,8 +19,8 @@
 /* Returns: convert a to a signed long long, rounding toward zero. */
 
 /* Assumption: long double is an intel 80 bit floating point type padded with 6 bytes
- *             su_int is a 32 bit integral type
- *             value in long double is representable in ti_int (no range checking performed)
+ *             ti_int is a 128 bit integral type
+ *             value in long double is representable in ti_int
  */
 
 /* gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee |
@@ -30,6 +30,8 @@
 COMPILER_RT_ABI ti_int
 __fixxfti(long double a)
 {
+    const ti_int ti_max = (ti_int)((~(tu_int)0) / 2);
+    const ti_int ti_min = -ti_max - 1;
     long_double_bits fb;
     fb.f = a;
     int e = (fb.u.high.s.low & 0x00007FFF) - 16383;
@@ -37,6 +39,8 @@ __fixxfti(long double a)
         return 0;
     ti_int s = -(si_int)((fb.u.high.s.low & 0x00008000) >> 15);
     ti_int r = fb.u.low.all;
+    if ((unsigned)e >= sizeof(ti_int) * CHAR_BIT)
+        return a > 0 ? ti_max : ti_min;
     if (e > 63)
         r <<= (e - 63);
     else

Copied: projects/clang360-import/contrib/compiler-rt/lib/builtins/fp_fixint_impl.inc (from r279984, head/contrib/compiler-rt/lib/builtins/fp_fixint_impl.inc)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fp_fixint_impl.inc	Sat Mar 14 13:08:00 2015	(r279985, copy of r279984, head/contrib/compiler-rt/lib/builtins/fp_fixint_impl.inc)
@@ -0,0 +1,41 @@
+//===-- 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 float to integer conversion for the
+// compiler-rt library.
+//
+//===----------------------------------------------------------------------===//
+
+#include "fp_lib.h"
+
+static inline fixint_t __fixint(fp_t a) {
+    const fixint_t fixint_max = (fixint_t)((~(fixuint_t)0) / 2);
+    const fixint_t fixint_min = -fixint_max - 1;
+    // Break a into sign, exponent, significand
+    const rep_t aRep = toRep(a);
+    const rep_t aAbs = aRep & absMask;
+    const fixint_t sign = aRep & signBit ? -1 : 1;
+    const int exponent = (aAbs >> significandBits) - exponentBias;
+    const rep_t significand = (aAbs & significandMask) | implicitBit;
+
+    // If exponent is negative, the result is zero.
+    if (exponent < 0)
+        return 0;
+
+    // If the value is too large for the integer type, saturate.
+    if ((unsigned)exponent >= sizeof(fixint_t) * CHAR_BIT)
+        return sign == 1 ? fixint_max : fixint_min;
+
+    // If 0 <= exponent < significandBits, right shift to get the result.
+    // Otherwise, shift left.
+    if (exponent < significandBits)
+        return sign * (significand >> (significandBits - exponent));
+    else
+        return sign * ((fixint_t)significand << (exponent - significandBits));
+}

Copied: projects/clang360-import/contrib/compiler-rt/lib/builtins/fp_fixuint_impl.inc (from r279984, head/contrib/compiler-rt/lib/builtins/fp_fixuint_impl.inc)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang360-import/contrib/compiler-rt/lib/builtins/fp_fixuint_impl.inc	Sat Mar 14 13:08:00 2015	(r279985, copy of r279984, head/contrib/compiler-rt/lib/builtins/fp_fixuint_impl.inc)
@@ -0,0 +1,39 @@
+//===-- 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 float to unsigned integer conversion for the
+// compiler-rt library.
+//
+//===----------------------------------------------------------------------===//
+
+#include "fp_lib.h"
+
+static inline fixuint_t __fixuint(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 either the value or the exponent is negative, the result is zero.

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503141308.t2ED817a059230>