+2015-05-06 Sandra Loosemore <sandra@codesourcery.com>
+ Chris Jones <chrisj@nvidia.com>
+ Joshua Conner <jconner@nvidia.com>
+
+ * config/arm/unknown-elf.h (STARTFILE_SPEC): Add conditional
+ linking of crtfastmath.o.
+ * config/arm/linux-eabi.h (STARTFILE_SPEC): Likewise.
+
2015-05-06 Segher Boessenkool <segher@kernel.crashing.org>
* config/rs6000/rs6000.md (cstore<mode>4_signed_imm): New expander.
#undef ENDFILE_SPEC
#define ENDFILE_SPEC \
+ "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \
LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
#define UNKNOWN_ELF_STARTFILE_SPEC " crti%O%s crtbegin%O%s crt0%O%s"
#undef STARTFILE_SPEC
-#define STARTFILE_SPEC UNKNOWN_ELF_STARTFILE_SPEC
+#define STARTFILE_SPEC \
+ "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \
+ UNKNOWN_ELF_STARTFILE_SPEC
#define UNKNOWN_ELF_ENDFILE_SPEC "crtend%O%s crtn%O%s"
+2015-05-06 Sandra Loosemore <sandra@codesourcery.com>
+ Chris Jones <chrisj@nvidia.com>
+ Joshua Conner <jconner@nvidia.com>
+
+ * config.host (arm*-*-linux*): Add support for crtfastmath.o.
+ (arm*-*-uclinux*): Likewise.
+ (arm*-*-eabi* | arm*-*-rtems*): Likewise.
+ * config/arm/crtfastmath.c: New file.
+
2014-04-29 Bernd Schmidt <bernds@codesourcery.com>
* Makefile.in (real_host_noncanonical): New variable.
tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover"
;;
arm*-*-linux*) # ARM GNU/Linux with ELF
- tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix"
+ tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm"
tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc"
tm_file="$tm_file arm/bpabi-lib.h"
unwind_header=config/arm/unwind-arm.h
tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
+ extra_parts="$extra_parts crtfastmath.o"
;;
arm*-*-uclinux*) # ARM ucLinux
- tmake_file="${tmake_file} t-fixedpoint-gnu-prefix"
+ tmake_file="${tmake_file} t-fixedpoint-gnu-prefix t-crtfm"
tmake_file="$tmake_file arm/t-arm arm/t-elf t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
tmake_file="${tmake_file} arm/t-bpabi"
tm_file="$tm_file arm/bpabi-lib.h"
tm_file="$tm_file arm/bpabi-lib.h"
case ${host} in
arm*-*-eabi* | arm*-*-rtems*)
- tmake_file="${tmake_file} arm/t-bpabi"
+ tmake_file="${tmake_file} arm/t-bpabi t-crtfm"
extra_parts="crtbegin.o crtend.o crti.o crtn.o"
;;
arm*-*-symbianelf*)
--- /dev/null
+/*
+ * Copyright (C) 2014 Free Software Foundation, Inc.
+ *
+ * This file is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 3, or (at your option) any
+ * later version.
+ *
+ * This file is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * Under Section 7 of GPL version 3, you are granted additional
+ * permissions described in the GCC Runtime Library Exception, version
+ * 3.1, as published by the Free Software Foundation.
+ *
+ * You should have received a copy of the GNU General Public License and
+ * a copy of the GCC Runtime Library Exception along with this program;
+ * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+/* Enable flush-to-zero support for -ffast-math on VFP targets. */
+#ifndef __SOFTFP__
+
+#define FPSCR_FZ (1 << 24)
+
+static void __attribute__((constructor))
+__arm_set_fast_math (void)
+{
+ unsigned int fpscr_save;
+
+ /* Set the FZ (flush-to-zero) bit in FPSCR. */
+ __asm__("vmrs %0, fpscr" : "=r" (fpscr_save));
+ fpscr_save |= FPSCR_FZ;
+ __asm__("vmsr fpscr, %0" : : "r" (fpscr_save));
+}
+
+#endif /* __SOFTFP__ */